From 58cc99f790200657adacf5997e51bd1b1c035141 Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Sat, 4 Nov 2023 18:47:37 +0800 Subject: [PATCH 01/10] =?UTF-8?q?feat:=20vant=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=EF=BC=8C=E5=88=A0=E9=99=A4Tdesign?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- src/openeuler/.gitignore | 3 +- src/openeuler/.vscode/settings.json | 7 + src/openeuler/config/constants.js | 5 +- src/openeuler/jsconfig.json | 6 + .../@vant/weapp/action-sheet/index.js | 138 +- .../@vant/weapp/action-sheet/index.json | 16 +- .../@vant/weapp/action-sheet/index.wxml | 138 +- .../@vant/weapp/action-sheet/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/area/index.js | 498 +-- .../@vant/weapp/area/index.json | 12 +- .../@vant/weapp/area/index.wxml | 40 +- .../@vant/weapp/area/index.wxs | 16 +- .../@vant/weapp/button/index.js | 127 +- .../@vant/weapp/button/index.json | 14 +- .../@vant/weapp/button/index.wxml | 109 +- .../@vant/weapp/button/index.wxs | 78 +- .../@vant/weapp/button/index.wxss | 2 +- .../@vant/weapp/calendar/calendar.wxml | 133 +- .../weapp/calendar/components/header/index.js | 63 +- .../calendar/components/header/index.json | 6 +- .../calendar/components/header/index.wxml | 32 +- .../calendar/components/header/index.wxss | 2 +- .../weapp/calendar/components/month/index.js | 325 +- .../calendar/components/month/index.json | 6 +- .../calendar/components/month/index.wxml | 78 +- .../weapp/calendar/components/month/index.wxs | 138 +- .../calendar/components/month/index.wxss | 2 +- .../@vant/weapp/calendar/index.js | 704 +-- .../@vant/weapp/calendar/index.json | 20 +- .../@vant/weapp/calendar/index.wxml | 51 +- .../@vant/weapp/calendar/index.wxs | 74 +- .../@vant/weapp/calendar/index.wxss | 2 +- .../@vant/weapp/calendar/utils.js | 188 +- .../@vant/weapp/calendar/utils.wxs | 50 +- .../miniprogram_npm/@vant/weapp/card/index.js | 102 +- .../@vant/weapp/card/index.json | 12 +- .../@vant/weapp/card/index.wxml | 112 +- .../@vant/weapp/card/index.wxss | 2 +- .../@vant/weapp/cell-group/index.js | 25 +- .../@vant/weapp/cell-group/index.json | 6 +- .../@vant/weapp/cell-group/index.wxml | 20 +- .../@vant/weapp/cell-group/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/cell/index.js | 80 +- .../@vant/weapp/cell/index.json | 12 +- .../@vant/weapp/cell/index.wxml | 93 +- .../@vant/weapp/cell/index.wxs | 34 +- .../@vant/weapp/cell/index.wxss | 2 +- .../@vant/weapp/checkbox-group/index.js | 77 +- .../@vant/weapp/checkbox-group/index.json | 6 +- .../@vant/weapp/checkbox-group/index.wxml | 6 +- .../@vant/weapp/checkbox-group/index.wxss | 2 +- .../@vant/weapp/checkbox/index.js | 162 +- .../@vant/weapp/checkbox/index.json | 12 +- .../@vant/weapp/checkbox/index.wxml | 62 +- .../@vant/weapp/checkbox/index.wxs | 40 +- .../@vant/weapp/checkbox/index.wxss | 2 +- .../@vant/weapp/circle/canvas.js | 94 +- .../@vant/weapp/circle/index.js | 418 +- .../@vant/weapp/circle/index.json | 6 +- .../@vant/weapp/circle/index.wxml | 18 +- .../@vant/weapp/circle/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/col/index.js | 22 +- .../@vant/weapp/col/index.json | 6 +- .../@vant/weapp/col/index.wxml | 18 +- .../miniprogram_npm/@vant/weapp/col/index.wxs | 36 +- .../@vant/weapp/col/index.wxss | 2 +- .../@vant/weapp/collapse-item/animate.js | 120 +- .../@vant/weapp/collapse-item/index.js | 130 +- .../@vant/weapp/collapse-item/index.json | 12 +- .../@vant/weapp/collapse-item/index.wxml | 89 +- .../@vant/weapp/collapse-item/index.wxss | 2 +- .../@vant/weapp/collapse/index.js | 98 +- .../@vant/weapp/collapse/index.json | 6 +- .../@vant/weapp/collapse/index.wxml | 6 +- .../@vant/weapp/common/color.js | 20 +- .../@vant/weapp/common/component.js | 97 +- .../@vant/weapp/common/index.wxss | 2 +- .../@vant/weapp/common/relation.js | 144 +- .../@vant/weapp/common/style/clearfix.wxss | 2 +- .../@vant/weapp/common/style/ellipsis.wxss | 2 +- .../@vant/weapp/common/style/hairline.wxss | 2 +- .../@vant/weapp/common/style/theme.wxss | 0 .../@vant/weapp/common/utils.js | 220 +- .../@vant/weapp/common/validator.js | 85 +- .../@vant/weapp/common/version.js | 124 +- .../@vant/weapp/count-down/index.js | 207 +- .../@vant/weapp/count-down/index.json | 6 +- .../@vant/weapp/count-down/index.wxml | 8 +- .../@vant/weapp/count-down/index.wxss | 2 +- .../@vant/weapp/count-down/utils.js | 129 +- .../@vant/weapp/datetime-picker/index.js | 654 ++- .../@vant/weapp/datetime-picker/index.json | 12 +- .../@vant/weapp/datetime-picker/index.wxml | 32 +- .../@vant/weapp/definitions/index.js | 4 +- .../@vant/weapp/dialog/dialog.js | 196 +- .../@vant/weapp/dialog/index.js | 258 +- .../@vant/weapp/dialog/index.json | 18 +- .../@vant/weapp/dialog/index.wxml | 235 +- .../@vant/weapp/dialog/index.wxss | 2 +- .../@vant/weapp/divider/index.js | 28 +- .../@vant/weapp/divider/index.json | 8 +- .../@vant/weapp/divider/index.wxml | 18 +- .../@vant/weapp/divider/index.wxs | 36 +- .../@vant/weapp/divider/index.wxss | 2 +- .../@vant/weapp/dropdown-item/index.js | 253 +- .../@vant/weapp/dropdown-item/index.json | 16 +- .../@vant/weapp/dropdown-item/index.wxml | 98 +- .../@vant/weapp/dropdown-item/index.wxss | 2 +- .../@vant/weapp/dropdown-item/shared.js | 4 +- .../@vant/weapp/dropdown-menu/index.js | 248 +- .../@vant/weapp/dropdown-menu/index.json | 6 +- .../@vant/weapp/dropdown-menu/index.wxml | 46 +- .../@vant/weapp/dropdown-menu/index.wxs | 32 +- .../@vant/weapp/dropdown-menu/index.wxss | 2 +- .../@vant/weapp/empty/index.js | 24 +- .../@vant/weapp/empty/index.json | 8 +- .../@vant/weapp/empty/index.wxml | 44 +- .../@vant/weapp/empty/index.wxs | 29 +- .../@vant/weapp/empty/index.wxss | 2 +- .../@vant/weapp/field/index.js | 288 +- .../@vant/weapp/field/index.json | 14 +- .../@vant/weapp/field/index.wxml | 112 +- .../@vant/weapp/field/index.wxs | 36 +- .../@vant/weapp/field/index.wxss | 2 +- .../@vant/weapp/field/input.wxml | 56 +- .../@vant/weapp/field/props.js | 133 +- .../@vant/weapp/field/textarea.wxml | 59 +- .../@vant/weapp/goods-action-button/index.js | 82 +- .../weapp/goods-action-button/index.json | 12 +- .../weapp/goods-action-button/index.wxml | 63 +- .../weapp/goods-action-button/index.wxss | 2 +- .../@vant/weapp/goods-action-icon/index.js | 53 +- .../@vant/weapp/goods-action-icon/index.json | 14 +- .../@vant/weapp/goods-action-icon/index.wxml | 76 +- .../@vant/weapp/goods-action-icon/index.wxss | 2 +- .../@vant/weapp/goods-action/index.js | 34 +- .../@vant/weapp/goods-action/index.json | 6 +- .../@vant/weapp/goods-action/index.wxml | 10 +- .../@vant/weapp/goods-action/index.wxss | 2 +- .../@vant/weapp/grid-item/index.js | 112 +- .../@vant/weapp/grid-item/index.json | 12 +- .../@vant/weapp/grid-item/index.wxml | 54 +- .../@vant/weapp/grid-item/index.wxs | 64 +- .../@vant/weapp/grid-item/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/grid/index.js | 109 +- .../@vant/weapp/grid/index.json | 6 +- .../@vant/weapp/grid/index.wxml | 16 +- .../@vant/weapp/grid/index.wxs | 26 +- .../@vant/weapp/grid/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/icon/index.js | 45 +- .../@vant/weapp/icon/index.json | 12 +- .../@vant/weapp/icon/index.wxml | 40 +- .../@vant/weapp/icon/index.wxs | 82 +- .../@vant/weapp/icon/index.wxss | 2 +- .../@vant/weapp/image/index.js | 129 +- .../@vant/weapp/image/index.json | 14 +- .../@vant/weapp/image/index.wxml | 69 +- .../@vant/weapp/image/index.wxs | 64 +- .../@vant/weapp/image/index.wxss | 2 +- .../@vant/weapp/index-anchor/index.js | 56 +- .../@vant/weapp/index-anchor/index.json | 6 +- .../@vant/weapp/index-anchor/index.wxml | 28 +- .../@vant/weapp/index-anchor/index.wxss | 2 +- .../@vant/weapp/index-bar/index.js | 521 +-- .../@vant/weapp/index-bar/index.json | 6 +- .../@vant/weapp/index-bar/index.wxml | 44 +- .../@vant/weapp/index-bar/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/info/index.js | 20 +- .../@vant/weapp/info/index.json | 6 +- .../@vant/weapp/info/index.wxml | 14 +- .../@vant/weapp/info/index.wxss | 2 +- .../@vant/weapp/loading/index.js | 36 +- .../@vant/weapp/loading/index.json | 6 +- .../@vant/weapp/loading/index.wxml | 38 +- .../@vant/weapp/loading/index.wxs | 44 +- .../@vant/weapp/loading/index.wxss | 2 +- .../@vant/weapp/mixins/basic.js | 30 +- .../@vant/weapp/mixins/button.js | 72 +- .../@vant/weapp/mixins/link.js | 57 +- .../@vant/weapp/mixins/open-type.js | 29 - .../@vant/weapp/mixins/page-scroll.js | 87 +- .../@vant/weapp/mixins/touch.js | 80 +- .../@vant/weapp/mixins/transition.js | 279 +- .../@vant/weapp/nav-bar/index.js | 136 +- .../@vant/weapp/nav-bar/index.json | 12 +- .../@vant/weapp/nav-bar/index.wxml | 84 +- .../@vant/weapp/nav-bar/index.wxs | 26 +- .../@vant/weapp/nav-bar/index.wxss | 2 +- .../@vant/weapp/notice-bar/index.js | 257 +- .../@vant/weapp/notice-bar/index.json | 12 +- .../@vant/weapp/notice-bar/index.wxml | 77 +- .../@vant/weapp/notice-bar/index.wxs | 30 +- .../@vant/weapp/notice-bar/index.wxss | 2 +- .../@vant/weapp/notify/index.js | 138 +- .../@vant/weapp/notify/index.json | 12 +- .../@vant/weapp/notify/index.wxml | 42 +- .../@vant/weapp/notify/index.wxs | 44 +- .../@vant/weapp/notify/index.wxss | 2 +- .../@vant/weapp/notify/notify.js | 131 +- .../@vant/weapp/overlay/index.js | 56 +- .../@vant/weapp/overlay/index.json | 12 +- .../@vant/weapp/overlay/index.wxml | 17 +- .../@vant/weapp/overlay/index.wxss | 2 +- .../@vant/weapp/panel/index.js | 23 +- .../@vant/weapp/panel/index.json | 12 +- .../@vant/weapp/panel/index.wxml | 38 +- .../@vant/weapp/panel/index.wxss | 2 +- .../@vant/weapp/picker-column/index.js | 254 +- .../@vant/weapp/picker-column/index.json | 6 +- .../@vant/weapp/picker-column/index.wxml | 46 +- .../@vant/weapp/picker-column/index.wxs | 72 +- .../@vant/weapp/picker-column/index.wxss | 2 +- .../@vant/weapp/picker/index.js | 340 +- .../@vant/weapp/picker/index.json | 14 +- .../@vant/weapp/picker/index.wxml | 74 +- .../@vant/weapp/picker/index.wxs | 84 +- .../@vant/weapp/picker/index.wxss | 2 +- .../@vant/weapp/picker/shared.js | 48 +- .../@vant/weapp/picker/toolbar.wxml | 46 +- .../@vant/weapp/popup/index.js | 188 +- .../@vant/weapp/popup/index.json | 14 +- .../@vant/weapp/popup/index.wxml | 46 +- .../@vant/weapp/popup/index.wxs | 36 +- .../@vant/weapp/popup/index.wxss | 2 +- .../@vant/weapp/progress/index.js | 111 +- .../@vant/weapp/progress/index.json | 6 +- .../@vant/weapp/progress/index.wxml | 40 +- .../@vant/weapp/progress/index.wxs | 72 +- .../@vant/weapp/progress/index.wxss | 2 +- .../@vant/weapp/radio-group/index.js | 64 +- .../@vant/weapp/radio-group/index.json | 6 +- .../@vant/weapp/radio-group/index.wxml | 10 +- .../@vant/weapp/radio-group/index.wxss | 2 +- .../@vant/weapp/radio/index.js | 118 +- .../@vant/weapp/radio/index.json | 12 +- .../@vant/weapp/radio/index.wxml | 59 +- .../@vant/weapp/radio/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/rate/index.js | 204 +- .../@vant/weapp/rate/index.json | 12 +- .../@vant/weapp/rate/index.wxml | 69 +- .../@vant/weapp/rate/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/row/index.js | 52 +- .../@vant/weapp/row/index.json | 6 +- .../@vant/weapp/row/index.wxml | 10 +- .../miniprogram_npm/@vant/weapp/row/index.wxs | 36 +- .../@vant/weapp/row/index.wxss | 2 +- .../@vant/weapp/search/index.js | 181 +- .../@vant/weapp/search/index.json | 12 +- .../@vant/weapp/search/index.wxml | 104 +- .../@vant/weapp/search/index.wxss | 2 +- .../@vant/weapp/share-sheet/index.js | 114 +- .../@vant/weapp/share-sheet/index.json | 14 +- .../@vant/weapp/share-sheet/index.wxml | 92 +- .../@vant/weapp/share-sheet/index.wxs | 24 +- .../@vant/weapp/share-sheet/index.wxss | 2 +- .../@vant/weapp/share-sheet/options.js | 58 +- .../@vant/weapp/share-sheet/options.json | 6 +- .../@vant/weapp/share-sheet/options.wxml | 40 +- .../@vant/weapp/share-sheet/options.wxs | 28 +- .../@vant/weapp/share-sheet/options.wxss | 2 +- .../@vant/weapp/sidebar-item/index.js | 64 +- .../@vant/weapp/sidebar-item/index.json | 12 +- .../@vant/weapp/sidebar-item/index.wxml | 36 +- .../@vant/weapp/sidebar-item/index.wxss | 2 +- .../@vant/weapp/sidebar/index.js | 74 +- .../@vant/weapp/sidebar/index.json | 6 +- .../@vant/weapp/sidebar/index.wxml | 6 +- .../@vant/weapp/sidebar/index.wxss | 2 +- .../@vant/weapp/skeleton/index.js | 96 +- .../@vant/weapp/skeleton/index.json | 8 +- .../@vant/weapp/skeleton/index.wxml | 58 +- .../@vant/weapp/skeleton/index.wxss | 2 +- .../@vant/weapp/slider/index.js | 324 +- .../@vant/weapp/slider/index.json | 6 +- .../@vant/weapp/slider/index.wxml | 98 +- .../@vant/weapp/slider/index.wxs | 28 +- .../@vant/weapp/slider/index.wxss | 2 +- .../@vant/weapp/stepper/index.js | 421 +- .../@vant/weapp/stepper/index.json | 6 +- .../@vant/weapp/stepper/index.wxml | 85 +- .../@vant/weapp/stepper/index.wxs | 44 +- .../@vant/weapp/stepper/index.wxss | 2 +- .../@vant/weapp/steps/index.js | 70 +- .../@vant/weapp/steps/index.json | 12 +- .../@vant/weapp/steps/index.wxml | 108 +- .../@vant/weapp/steps/index.wxss | 2 +- .../@vant/weapp/sticky/index.js | 249 +- .../@vant/weapp/sticky/index.json | 6 +- .../@vant/weapp/sticky/index.wxml | 16 +- .../@vant/weapp/sticky/index.wxs | 50 +- .../@vant/weapp/sticky/index.wxss | 2 +- .../@vant/weapp/submit-bar/index.js | 119 +- .../@vant/weapp/submit-bar/index.json | 14 +- .../@vant/weapp/submit-bar/index.wxml | 88 +- .../@vant/weapp/submit-bar/index.wxss | 2 +- .../@vant/weapp/swipe-cell/index.js | 297 +- .../@vant/weapp/swipe-cell/index.json | 6 +- .../@vant/weapp/swipe-cell/index.wxml | 40 +- .../@vant/weapp/swipe-cell/index.wxss | 2 +- .../@vant/weapp/switch/index.js | 80 +- .../@vant/weapp/switch/index.json | 12 +- .../@vant/weapp/switch/index.wxml | 32 +- .../@vant/weapp/switch/index.wxs | 52 +- .../@vant/weapp/switch/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/tab/index.js | 116 +- .../@vant/weapp/tab/index.json | 6 +- .../@vant/weapp/tab/index.wxml | 16 +- .../@vant/weapp/tab/index.wxss | 2 +- .../@vant/weapp/tabbar-item/index.js | 128 +- .../@vant/weapp/tabbar-item/index.json | 14 +- .../@vant/weapp/tabbar-item/index.wxml | 56 +- .../@vant/weapp/tabbar-item/index.wxss | 2 +- .../@vant/weapp/tabbar/index.js | 138 +- .../@vant/weapp/tabbar/index.json | 6 +- .../@vant/weapp/tabbar/index.wxml | 20 +- .../@vant/weapp/tabbar/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/tabs/index.js | 632 +-- .../@vant/weapp/tabs/index.json | 14 +- .../@vant/weapp/tabs/index.wxml | 126 +- .../@vant/weapp/tabs/index.wxs | 165 +- .../@vant/weapp/tabs/index.wxss | 2 +- .../miniprogram_npm/@vant/weapp/tag/index.js | 46 +- .../@vant/weapp/tag/index.json | 12 +- .../@vant/weapp/tag/index.wxml | 30 +- .../miniprogram_npm/@vant/weapp/tag/index.wxs | 26 +- .../@vant/weapp/tag/index.wxss | 2 +- .../@vant/weapp/toast/index.js | 62 +- .../@vant/weapp/toast/index.json | 18 +- .../@vant/weapp/toast/index.wxml | 69 +- .../@vant/weapp/toast/index.wxss | 2 +- .../@vant/weapp/toast/toast.js | 175 +- .../@vant/weapp/transition/index.js | 30 +- .../@vant/weapp/transition/index.json | 6 +- .../@vant/weapp/transition/index.wxml | 20 +- .../@vant/weapp/transition/index.wxs | 34 +- .../@vant/weapp/transition/index.wxss | 2 +- .../@vant/weapp/tree-select/index.js | 143 +- .../@vant/weapp/tree-select/index.json | 16 +- .../@vant/weapp/tree-select/index.wxml | 82 +- .../@vant/weapp/tree-select/index.wxs | 24 +- .../@vant/weapp/tree-select/index.wxss | 2 +- .../@vant/weapp/uploader/index.js | 429 +- .../@vant/weapp/uploader/index.json | 14 +- .../@vant/weapp/uploader/index.wxml | 167 +- .../@vant/weapp/uploader/index.wxs | 31 +- .../@vant/weapp/uploader/index.wxss | 2 +- .../@vant/weapp/uploader/shared.js | 93 +- .../@vant/weapp/uploader/utils.js | 270 +- .../@vant/weapp/wxs/add-unit.wxs | 24 +- .../miniprogram_npm/@vant/weapp/wxs/array.wxs | 10 +- .../miniprogram_npm/@vant/weapp/wxs/bem.wxs | 78 +- .../@vant/weapp/wxs/memoize.wxs | 110 +- .../@vant/weapp/wxs/object.wxs | 26 +- .../miniprogram_npm/@vant/weapp/wxs/style.wxs | 74 +- .../miniprogram_npm/@vant/weapp/wxs/utils.wxs | 20 +- .../miniprogram_npm/eventemitter3/index.js | 695 +-- .../tdesign-miniprogram/CHANGELOG.md | 1323 ------ .../tdesign-miniprogram/LICENSE | 9 - .../tdesign-miniprogram/README.md | 74 - .../miniprogram_dist/.wechatide.ib.json | 3895 ----------------- .../miniprogram_dist/common/bus.d.ts | 6 - .../miniprogram_dist/common/bus.js | 16 - .../miniprogram_dist/common/common.d.ts | 35 - .../miniprogram_dist/common/common.js | 1 - .../miniprogram_dist/common/component.d.ts | 3 - .../miniprogram_dist/common/component.js | 5 - .../miniprogram_dist/common/config.d.ts | 5 - .../miniprogram_dist/common/config.js | 4 - .../miniprogram_dist/common/index.wxss | 27 - .../common/shared/calendar/index.d.ts | 19 - .../common/shared/calendar/index.js | 128 - .../common/shared/calendar/type.d.ts | 11 - .../common/shared/calendar/type.js | 1 - .../miniprogram_dist/common/shared/date.d.ts | 21 - .../miniprogram_dist/common/shared/date.js | 41 - .../miniprogram_dist/common/src/control.d.ts | 15 - .../miniprogram_dist/common/src/control.js | 40 - .../miniprogram_dist/common/src/flatTool.d.ts | 15 - .../miniprogram_dist/common/src/flatTool.js | 57 - .../miniprogram_dist/common/src/index.d.ts | 4 - .../miniprogram_dist/common/src/index.js | 4 - .../common/src/instantiationDecorator.d.ts | 3 - .../common/src/instantiationDecorator.js | 141 - .../common/src/superComponent.d.ts | 19 - .../common/src/superComponent.js | 5 - .../common/style/_variables.wxss | 0 .../miniprogram_dist/common/style/base.wxss | 0 .../miniprogram_dist/common/style/index.wxss | 27 - .../common/style/mixins/_clearfix.wxss | 0 .../common/style/mixins/_cursor.wxss | 0 .../common/style/mixins/_ellipsis.wxss | 0 .../common/style/mixins/_hairline.wxss | 0 .../common/style/mixins/_index.wxss | 0 .../common/style/theme/_index.wxss | 0 .../common/style/utilities/_animation.wxss | 8 - .../common/style/utilities/_float.wxss | 6 - .../common/style/utilities/_index.wxss | 27 - .../common/template/badge.wxml | 16 - .../common/template/button.wxml | 37 - .../common/template/icon.wxml | 15 - .../common/template/image.wxml | 17 - .../miniprogram_dist/common/utils.d.ts | 29 - .../miniprogram_dist/common/utils.js | 218 - .../miniprogram_dist/common/utils.wxs | 93 - .../miniprogram_dist/common/version.d.ts | 2 - .../miniprogram_dist/common/version.js | 40 - .../date-time-picker/README.en-US.md | 30 - .../date-time-picker/README.md | 68 - .../date-time-picker/date-time-picker.d.ts | 83 - .../date-time-picker/date-time-picker.js | 352 -- .../date-time-picker/date-time-picker.json | 7 - .../date-time-picker/date-time-picker.wxml | 27 - .../date-time-picker/date-time-picker.wxss | 31 - .../date-time-picker/locale/en.d.ts | 13 - .../date-time-picker/locale/en.js | 12 - .../date-time-picker/locale/zh.d.ts | 13 - .../date-time-picker/locale/zh.js | 12 - .../date-time-picker/props.d.ts | 3 - .../date-time-picker/props.js | 55 - .../date-time-picker/type.d.ts | 65 - .../miniprogram_dist/date-time-picker/type.js | 1 - .../miniprogram_dist/icon/README.md | 101 - .../miniprogram_dist/icon/icon.d.ts | 18 - .../miniprogram_dist/icon/icon.js | 51 - .../miniprogram_dist/icon/icon.json | 4 - .../miniprogram_dist/icon/icon.wxml | 15 - .../miniprogram_dist/icon/icon.wxss | 770 ---- .../miniprogram_dist/icon/props.d.ts | 3 - .../miniprogram_dist/icon/props.js | 20 - .../miniprogram_dist/icon/type.d.ts | 27 - .../miniprogram_dist/icon/type.js | 1 - .../miniprogram_npm/dayjs/index.js | 1 - .../miniprogram_dist/mixins/page-scroll.d.ts | 6 - .../miniprogram_dist/mixins/page-scroll.js | 37 - .../miniprogram_dist/mixins/touch.d.ts | 2 - .../miniprogram_dist/mixins/touch.js | 35 - .../miniprogram_dist/mixins/transition.d.ts | 1 - .../miniprogram_dist/mixins/transition.js | 123 - .../miniprogram_dist/overlay/README.md | 49 - .../miniprogram_dist/overlay/overlay.d.ts | 36 - .../miniprogram_dist/overlay/overlay.js | 65 - .../miniprogram_dist/overlay/overlay.json | 3 - .../miniprogram_dist/overlay/overlay.wxml | 25 - .../miniprogram_dist/overlay/overlay.wxss | 42 - .../picker-item/picker-item.d.ts | 27 - .../picker-item/picker-item.js | 142 - .../picker-item/picker-item.json | 4 - .../picker-item/picker-item.wxml | 12 - .../picker-item/picker-item.wxss | 51 - .../miniprogram_dist/picker-item/props.d.ts | 3 - .../miniprogram_dist/picker-item/props.js | 10 - .../miniprogram_dist/picker-item/type.d.ts | 18 - .../miniprogram_dist/picker-item/type.js | 1 - .../miniprogram_dist/picker/README.en-US.md | 34 - .../miniprogram_dist/picker/README.md | 72 - .../miniprogram_dist/picker/picker.d.ts | 30 - .../miniprogram_dist/picker/picker.js | 96 - .../miniprogram_dist/picker/picker.json | 6 - .../miniprogram_dist/picker/picker.wxml | 23 - .../miniprogram_dist/picker/picker.wxss | 106 - .../miniprogram_dist/picker/props.d.ts | 3 - .../miniprogram_dist/picker/props.js | 41 - .../miniprogram_dist/picker/type.d.ts | 53 - .../miniprogram_dist/picker/type.js | 1 - .../miniprogram_dist/popup/README.en-US.md | 25 - .../miniprogram_dist/popup/README.md | 57 - .../miniprogram_dist/popup/popup.d.ts | 20 - .../miniprogram_dist/popup/popup.js | 44 - .../miniprogram_dist/popup/popup.json | 7 - .../miniprogram_dist/popup/popup.wxml | 31 - .../miniprogram_dist/popup/popup.wxs | 8 - .../miniprogram_dist/popup/popup.wxss | 96 - .../miniprogram_dist/popup/props.d.ts | 3 - .../miniprogram_dist/popup/props.js | 51 - .../miniprogram_dist/popup/type.d.ts | 62 - .../miniprogram_dist/popup/type.js | 1 - .../tdesign-miniprogram/package.json | 127 - .../miniprogram_npm/widget-ui/index.js | 23 +- .../miniprogram_npm/wxml-to-canvas/index.js | 1556 +++---- .../miniprogram_npm/wxml-to-canvas/index.json | 6 +- .../miniprogram_npm/wxml-to-canvas/index.wxml | 2 +- .../miniprogram_npm/wxml-to-canvas/utils.js | 114 +- src/openeuler/package-events/events/poster.js | 18 - .../package-events/events/wxml-to-canvas.js | 8 +- .../package-events/publish/publish.js | 116 +- .../package-events/publish/publish.wxml | 4 +- .../package-meeting/meeting/meeting-list.js | 2 +- .../package-meeting/reserve/reserve.js | 56 +- .../package-meeting/reserve/reserve.json | 5 +- .../package-meeting/reserve/reserve.wxml | 95 +- .../package-meeting/sig/sig-list.json | 5 +- src/openeuler/package-my/my/help.js | 3 +- src/openeuler/package-my/my/privecy-seting.js | 4 +- .../package-my/my/privecy-seting.less | 17 +- .../package-my/my/privecy-seting.wxml | 89 +- .../package-my/my/privecy-seting.wxss | 14 + src/openeuler/package-my/my/qrcode.js | 4 +- src/openeuler/package.json | 20 +- src/openeuler/pages/auth/auth.js | 261 +- src/openeuler/pages/index/index.js | 2 +- src/openeuler/pages/meeting/meeting.js | 4 +- src/openeuler/pages/meeting/meeting.wxml | 6 +- src/openeuler/project.private.config.json | 14 + src/openeuler/typings/wx.d.ts | 2705 ++++++++++++ src/openeuler/utils/app-ajax.js | 28 +- src/openeuler/utils/app-session.js | 2 +- src/openeuler/utils/app-user.js | 5 +- src/openeuler/utils/page-mixin.js | 18 - src/openeuler/utils/url-config.js | 6 + src/openeuler/utils/utils.js | 70 - 511 files changed, 15397 insertions(+), 22566 deletions(-) create mode 100644 src/openeuler/.vscode/settings.json create mode 100644 src/openeuler/jsconfig.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/style/theme.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/mixins/open-type.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/CHANGELOG.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/LICENSE delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/README.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/.wechatide.ib.json delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/bus.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/bus.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/common.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/common.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/component.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/component.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/config.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/config.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/shared/calendar/index.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/shared/calendar/index.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/shared/calendar/type.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/shared/calendar/type.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/shared/date.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/shared/date.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/control.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/control.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/flatTool.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/flatTool.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/index.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/index.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/instantiationDecorator.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/instantiationDecorator.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/superComponent.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/src/superComponent.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/_variables.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/base.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/mixins/_clearfix.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/mixins/_cursor.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/mixins/_ellipsis.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/mixins/_hairline.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/mixins/_index.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/theme/_index.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/utilities/_animation.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/utilities/_float.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/style/utilities/_index.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/template/badge.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/template/button.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/template/icon.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/template/image.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/utils.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/utils.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/utils.wxs delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/version.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/common/version.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/README.en-US.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/README.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/date-time-picker.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/date-time-picker.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/date-time-picker.json delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/date-time-picker.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/date-time-picker.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/locale/en.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/locale/en.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/locale/zh.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/locale/zh.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/props.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/props.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/type.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/date-time-picker/type.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/README.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/icon.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/icon.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/icon.json delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/icon.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/icon.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/props.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/props.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/type.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/icon/type.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/miniprogram_npm/dayjs/index.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/mixins/page-scroll.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/mixins/page-scroll.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/mixins/touch.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/mixins/touch.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/mixins/transition.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/mixins/transition.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/overlay/README.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/overlay/overlay.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/overlay/overlay.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/overlay/overlay.json delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/overlay/overlay.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/overlay/overlay.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/picker-item.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/picker-item.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/picker-item.json delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/picker-item.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/picker-item.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/props.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/props.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/type.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker-item/type.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/README.en-US.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/README.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/picker.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/picker.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/picker.json delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/picker.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/picker.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/props.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/props.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/type.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/picker/type.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/README.en-US.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/README.md delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/popup.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/popup.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/popup.json delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/popup.wxml delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/popup.wxs delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/popup.wxss delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/props.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/props.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/type.d.ts delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/miniprogram_dist/popup/type.js delete mode 100644 src/openeuler/miniprogram_npm/tdesign-miniprogram/package.json create mode 100644 src/openeuler/typings/wx.d.ts create mode 100644 src/openeuler/utils/url-config.js diff --git a/.gitignore b/.gitignore index 2944723..5b3cade 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ dist dist-ssr *.local project.config.json -*.less \ No newline at end of file +*.less +/miniprogram_npm \ No newline at end of file diff --git a/src/openeuler/.gitignore b/src/openeuler/.gitignore index cac5570..f0a5fd4 100644 --- a/src/openeuler/.gitignore +++ b/src/openeuler/.gitignore @@ -1,2 +1,3 @@ /node_modules -/package-lock.json \ No newline at end of file +/package-lock.json +/miniprogram_npm \ No newline at end of file diff --git a/src/openeuler/.vscode/settings.json b/src/openeuler/.vscode/settings.json new file mode 100644 index 0000000..2f64467 --- /dev/null +++ b/src/openeuler/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "files.associations": { + "*.wxml": "html", + "*.vue": "vue", + "*.wxss": "css" + } +} \ No newline at end of file diff --git a/src/openeuler/config/constants.js b/src/openeuler/config/constants.js index a803688..bc969b1 100644 --- a/src/openeuler/config/constants.js +++ b/src/openeuler/config/constants.js @@ -5,8 +5,9 @@ let _ = require('../utils/underscore-extend.js'); // 服务连接配置 let serviceConfig = { - SERVICE_URL: 'https://api.openeuler.org/meetings', // 正式环境 - // SERVICE_URL: 'https://meetingserver-openeuler.test.osinfra.cn', // 测试环境 + // SERVICE_URL: 'https://api.openeuler.org/meetings', // 正式环境 + SERVICE_URL: 'https://meetingserver-openeuler.test.osinfra.cn', // 测试环境 + // SERVICE_URL: 'https://meetings-beta.openeuler.org', // 测试环境 }; // 存储配置 diff --git a/src/openeuler/jsconfig.json b/src/openeuler/jsconfig.json new file mode 100644 index 0000000..47fe424 --- /dev/null +++ b/src/openeuler/jsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "target": "es2015", + "module": "commonjs" + } +} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js index 946264e..a39818a 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js @@ -1,64 +1,74 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var button_1 = require('../mixins/button'); -var open_type_1 = require('../mixins/open-type'); -component_1.VantComponent({ - mixins: [button_1.button, open_type_1.openType], - props: { - show: Boolean, - title: String, - cancelText: String, - description: String, - round: { - type: Boolean, - value: true, - }, - zIndex: { - type: Number, - value: 100, - }, - actions: { - type: Array, - value: [], - }, - overlay: { - type: Boolean, - value: true, - }, - closeOnClickOverlay: { - type: Boolean, - value: true, - }, - closeOnClickAction: { - type: Boolean, - value: true, - }, - safeAreaInsetBottom: { - type: Boolean, - value: true, - }, - }, - methods: { - onSelect: function (event) { - var index = event.currentTarget.dataset.index; - var item = this.data.actions[index]; - if (item && !item.disabled && !item.loading) { - this.$emit('select', item); - if (this.data.closeOnClickAction) { - this.onClose(); - } - } - }, - onCancel: function () { - this.$emit('cancel'); - }, - onClose: function () { - this.$emit('close'); - }, - onClickOverlay: function () { - this.$emit('click-overlay'); - this.onClose(); - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +(0, component_1.VantComponent)({ + classes: ['list-class'], + mixins: [button_1.button], + props: { + show: Boolean, + title: String, + cancelText: String, + description: String, + round: { + type: Boolean, + value: true, + }, + zIndex: { + type: Number, + value: 100, + }, + actions: { + type: Array, + value: [], + }, + overlay: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + closeOnClickAction: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + }, + methods: { + onSelect: function (event) { + var _this = this; + var index = event.currentTarget.dataset.index; + var _a = this.data, actions = _a.actions, closeOnClickAction = _a.closeOnClickAction, canIUseGetUserProfile = _a.canIUseGetUserProfile; + var item = actions[index]; + if (item) { + this.$emit('select', item); + if (closeOnClickAction) { + this.onClose(); + } + if (item.openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: item.getUserProfileDesc || ' ', + complete: function (userProfile) { + _this.$emit('getuserinfo', userProfile); + }, + }); + } + } + }, + onCancel: function () { + this.$emit('cancel'); + }, + onClose: function () { + this.$emit('close'); + }, + onClickOverlay: function () { + this.$emit('click-overlay'); + this.onClose(); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json index b3548bd..19bf989 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json @@ -1,8 +1,8 @@ -{ - "component": true, - "usingComponents": { - "van-icon": "../icon/index", - "van-popup": "../popup/index", - "van-loading": "../loading/index" - } -} +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-popup": "../popup/index", + "van-loading": "../loading/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml index ba802e8..d59a45d 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml @@ -1,69 +1,69 @@ - - - - - {{ title }} - - - - {{ description }} - - - - - - - - - - {{ cancelText }} - - - + + + + + {{ title }} + + + + {{ description }} + + + + + + + + + + {{ cancelText }} + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss index 9b247d5..eedd361 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;max-height:var(--action-sheet-max-height,90%)!important;color:#323233;color:var(--action-sheet-item-text-color,#323233)}.van-action-sheet__cancel,.van-action-sheet__item{padding:14px 16px;text-align:center;font-size:16px;font-size:var(--action-sheet-item-font-size,16px);line-height:22px;line-height:var(--action-sheet-item-line-height,22px);background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-action-sheet__cancel:after,.van-action-sheet__item:after{border-width:0}.van-action-sheet__cancel{color:#646566;color:var(--action-sheet-cancel-text-color,#646566)}.van-action-sheet__gap{display:block;height:8px;height:var(--action-sheet-cancel-padding-top,8px);background-color:#f7f8fa;background-color:var(--action-sheet-cancel-padding-color,#f7f8fa)}.van-action-sheet__item--disabled{color:#c8c9cc;color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{margin-top:8px;margin-top:var(--padding-xs,8px);font-size:12px;font-size:var(--action-sheet-subname-font-size,12px);color:#969799;color:var(--action-sheet-subname-color,#969799);line-height:20px;line-height:var(--action-sheet-subname-line-height,20px)}.van-action-sheet__header{text-align:center;font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--action-sheet-header-font-size,16px);line-height:48px;line-height:var(--action-sheet-header-height,48px)}.van-action-sheet__description{text-align:center;padding:20px 16px;padding:20px var(--padding-md,16px);color:#969799;color:var(--action-sheet-description-color,#969799);font-size:14px;font-size:var(--action-sheet-description-font-size,14px);line-height:20px;line-height:var(--action-sheet-description-line-height,20px)}.van-action-sheet__close{position:absolute!important;top:0;right:0;line-height:inherit!important;padding:0 16px;padding:var(--action-sheet-close-icon-padding,0 16px);font-size:22px!important;font-size:var(--action-sheet-close-icon-size,22px)!important;color:#c8c9cc;color:var(--action-sheet-close-icon-color,#c8c9cc)}.van-action-sheet__loading{display:-webkit-flex!important;display:flex!important} \ No newline at end of file +@import '../common/index.wxss';.van-action-sheet{color:var(--action-sheet-item-text-color,#323233);max-height:var(--action-sheet-max-height,90%)!important}.van-action-sheet__cancel,.van-action-sheet__item{background-color:var(--action-sheet-item-background,#fff);font-size:var(--action-sheet-item-font-size,16px);line-height:var(--action-sheet-item-line-height,22px);padding:14px 16px;text-align:center}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5}.van-action-sheet__cancel:after,.van-action-sheet__item:after{border-width:0}.van-action-sheet__cancel{color:var(--action-sheet-cancel-text-color,#646566)}.van-action-sheet__gap{background-color:var(--action-sheet-cancel-padding-color,#f7f8fa);display:block;height:var(--action-sheet-cancel-padding-top,8px)}.van-action-sheet__item--disabled{color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{color:var(--action-sheet-subname-color,#969799);font-size:var(--action-sheet-subname-font-size,12px);line-height:var(--action-sheet-subname-line-height,20px);margin-top:var(--padding-xs,8px)}.van-action-sheet__header{font-size:var(--action-sheet-header-font-size,16px);font-weight:var(--font-weight-bold,500);line-height:var(--action-sheet-header-height,48px);text-align:center}.van-action-sheet__description{color:var(--action-sheet-description-color,#969799);font-size:var(--action-sheet-description-font-size,14px);line-height:var(--action-sheet-description-line-height,20px);padding:20px var(--padding-md,16px);text-align:center}.van-action-sheet__close{color:var(--action-sheet-close-icon-color,#c8c9cc);font-size:var(--action-sheet-close-icon-size,22px)!important;line-height:inherit!important;padding:var(--action-sheet-close-icon-padding,0 16px);position:absolute!important;right:0;top:0}.van-action-sheet__loading{display:flex!important} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js index a194dde..73de66d 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js @@ -1,263 +1,235 @@ -'use strict'; -var __assign = - (this && this.__assign) || - function () { - __assign = - Object.assign || - function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var shared_1 = require('../picker/shared'); -var utils_1 = require('../common/utils'); -var EMPTY_CODE = '000000'; -component_1.VantComponent({ - classes: ['active-class', 'toolbar-class', 'column-class'], - props: __assign(__assign({}, shared_1.pickerProps), { - value: { - type: String, - observer: function (value) { - this.code = value; - this.setValues(); - }, - }, - areaList: { - type: Object, - value: {}, - observer: 'setValues', - }, - columnsNum: { - type: null, - value: 3, - }, - columnsPlaceholder: { - type: Array, - observer: function (val) { - this.setData({ - typeToColumnsPlaceholder: { - province: val[0] || '', - city: val[1] || '', - county: val[2] || '', - }, - }); - }, - }, - }), - data: { - columns: [{ values: [] }, { values: [] }, { values: [] }], - typeToColumnsPlaceholder: {}, - }, - mounted: function () { - var _this = this; - utils_1.requestAnimationFrame(function () { - _this.setValues(); - }); - }, - methods: { - getPicker: function () { - if (this.picker == null) { - this.picker = this.selectComponent('.van-area__picker'); - } - return this.picker; - }, - onCancel: function (event) { - this.emit('cancel', event.detail); - }, - onConfirm: function (event) { - var index = event.detail.index; - var value = event.detail.value; - value = this.parseValues(value); - this.emit('confirm', { value: value, index: index }); - }, - emit: function (type, detail) { - detail.values = detail.value; - delete detail.value; - this.$emit(type, detail); - }, - parseValues: function (values) { - var columnsPlaceholder = this.data.columnsPlaceholder; - return values.map(function (value, index) { - if ( - value && - (!value.code || value.name === columnsPlaceholder[index]) - ) { - return __assign(__assign({}, value), { code: '', name: '' }); - } - return value; - }); - }, - onChange: function (event) { - var _this = this; - var _a = event.detail, - index = _a.index, - picker = _a.picker, - value = _a.value; - this.code = value[index].code; - this.setValues().then(function () { - _this.$emit('change', { - picker: picker, - values: _this.parseValues(picker.getValues()), - index: index, - }); - }); - }, - getConfig: function (type) { - var areaList = this.data.areaList; - return (areaList && areaList[type + '_list']) || {}; - }, - getList: function (type, code) { - if (type !== 'province' && !code) { - return []; - } - var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder; - var list = this.getConfig(type); - var result = Object.keys(list).map(function (code) { - return { - code: code, - name: list[code], - }; - }); - if (code != null) { - // oversea code - if (code[0] === '9' && type === 'city') { - code = '9'; - } - result = result.filter(function (item) { - return item.code.indexOf(code) === 0; - }); - } - if (typeToColumnsPlaceholder[type] && result.length) { - // set columns placeholder - var codeFill = - type === 'province' - ? '' - : type === 'city' - ? EMPTY_CODE.slice(2, 4) - : EMPTY_CODE.slice(4, 6); - result.unshift({ - code: '' + code + codeFill, - name: typeToColumnsPlaceholder[type], - }); - } - return result; - }, - getIndex: function (type, code) { - var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; - var list = this.getList(type, code.slice(0, compareNum - 2)); - // oversea code - if (code[0] === '9' && type === 'province') { - compareNum = 1; - } - code = code.slice(0, compareNum); - for (var i = 0; i < list.length; i++) { - if (list[i].code.slice(0, compareNum) === code) { - return i; - } - } - return 0; - }, - setValues: function () { - var picker = this.getPicker(); - if (!picker) { - return; - } - var code = this.code || this.getDefaultCode(); - var provinceList = this.getList('province'); - var cityList = this.getList('city', code.slice(0, 2)); - var stack = []; - var indexes = []; - var columnsNum = this.data.columnsNum; - if (columnsNum >= 1) { - stack.push(picker.setColumnValues(0, provinceList, false)); - indexes.push(this.getIndex('province', code)); - } - if (columnsNum >= 2) { - stack.push(picker.setColumnValues(1, cityList, false)); - indexes.push(this.getIndex('city', code)); - if (cityList.length && code.slice(2, 4) === '00') { - code = cityList[0].code; - } - } - if (columnsNum === 3) { - stack.push( - picker.setColumnValues( - 2, - this.getList('county', code.slice(0, 4)), - false - ) - ); - indexes.push(this.getIndex('county', code)); - } - return Promise.all(stack) - .catch(function () {}) - .then(function () { - return picker.setIndexes(indexes); - }) - .catch(function () {}); - }, - getDefaultCode: function () { - var columnsPlaceholder = this.data.columnsPlaceholder; - if (columnsPlaceholder.length) { - return EMPTY_CODE; - } - var countyCodes = Object.keys(this.getConfig('county')); - if (countyCodes[0]) { - return countyCodes[0]; - } - var cityCodes = Object.keys(this.getConfig('city')); - if (cityCodes[0]) { - return cityCodes[0]; - } - return ''; - }, - getValues: function () { - var picker = this.getPicker(); - if (!picker) { - return []; - } - return this.parseValues( - picker.getValues().filter(function (value) { - return !!value; - }) - ); - }, - getDetail: function () { - var values = this.getValues(); - var area = { - code: '', - country: '', - province: '', - city: '', - county: '', - }; - if (!values.length) { - return area; - } - var names = values.map(function (item) { - return item.name; - }); - area.code = values[values.length - 1].code; - if (area.code[0] === '9') { - area.country = names[1] || ''; - area.province = names[2] || ''; - } else { - area.province = names[0] || ''; - area.city = names[1] || ''; - area.county = names[2] || ''; - } - return area; - }, - reset: function (code) { - this.code = code || ''; - return this.setValues(); - }, - }, -}); +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var shared_1 = require("../picker/shared"); +var utils_1 = require("../common/utils"); +var EMPTY_CODE = '000000'; +(0, component_1.VantComponent)({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { showToolbar: { + type: Boolean, + value: true, + }, value: { + type: String, + observer: function (value) { + this.code = value; + this.setValues(); + }, + }, areaList: { + type: Object, + value: {}, + observer: 'setValues', + }, columnsNum: { + type: null, + value: 3, + }, columnsPlaceholder: { + type: Array, + observer: function (val) { + this.setData({ + typeToColumnsPlaceholder: { + province: val[0] || '', + city: val[1] || '', + county: val[2] || '', + }, + }); + }, + } }), + data: { + columns: [{ values: [] }, { values: [] }, { values: [] }], + typeToColumnsPlaceholder: {}, + }, + mounted: function () { + var _this = this; + (0, utils_1.requestAnimationFrame)(function () { + _this.setValues(); + }); + }, + methods: { + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-area__picker'); + } + return this.picker; + }, + onCancel: function (event) { + this.emit('cancel', event.detail); + }, + onConfirm: function (event) { + var index = event.detail.index; + var value = event.detail.value; + value = this.parseValues(value); + this.emit('confirm', { value: value, index: index }); + }, + emit: function (type, detail) { + detail.values = detail.value; + delete detail.value; + this.$emit(type, detail); + }, + parseValues: function (values) { + var columnsPlaceholder = this.data.columnsPlaceholder; + return values.map(function (value, index) { + if (value && + (!value.code || value.name === columnsPlaceholder[index])) { + return __assign(__assign({}, value), { code: '', name: '' }); + } + return value; + }); + }, + onChange: function (event) { + var _this = this; + var _a; + var _b = event.detail, index = _b.index, picker = _b.picker, value = _b.value; + this.code = value[index].code; + (_a = this.setValues()) === null || _a === void 0 ? void 0 : _a.then(function () { + _this.$emit('change', { + picker: picker, + values: _this.parseValues(picker.getValues()), + index: index, + }); + }); + }, + getConfig: function (type) { + var areaList = this.data.areaList; + return (areaList && areaList["".concat(type, "_list")]) || {}; + }, + getList: function (type, code) { + if (type !== 'province' && !code) { + return []; + } + var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder; + var list = this.getConfig(type); + var result = Object.keys(list).map(function (code) { return ({ + code: code, + name: list[code], + }); }); + if (code != null) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + result = result.filter(function (item) { return item.code.indexOf(code) === 0; }); + } + if (typeToColumnsPlaceholder[type] && result.length) { + // set columns placeholder + var codeFill = type === 'province' + ? '' + : type === 'city' + ? EMPTY_CODE.slice(2, 4) + : EMPTY_CODE.slice(4, 6); + result.unshift({ + code: "".concat(code).concat(codeFill), + name: typeToColumnsPlaceholder[type], + }); + } + return result; + }, + getIndex: function (type, code) { + var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; + var list = this.getList(type, code.slice(0, compareNum - 2)); + // oversea code + if (code[0] === '9' && type === 'province') { + compareNum = 1; + } + code = code.slice(0, compareNum); + for (var i = 0; i < list.length; i++) { + if (list[i].code.slice(0, compareNum) === code) { + return i; + } + } + return 0; + }, + setValues: function () { + var picker = this.getPicker(); + if (!picker) { + return; + } + var code = this.code || this.getDefaultCode(); + var provinceList = this.getList('province'); + var cityList = this.getList('city', code.slice(0, 2)); + var stack = []; + var indexes = []; + var columnsNum = this.data.columnsNum; + if (columnsNum >= 1) { + stack.push(picker.setColumnValues(0, provinceList, false)); + indexes.push(this.getIndex('province', code)); + } + if (columnsNum >= 2) { + stack.push(picker.setColumnValues(1, cityList, false)); + indexes.push(this.getIndex('city', code)); + if (cityList.length && code.slice(2, 4) === '00') { + code = cityList[0].code; + } + } + if (columnsNum === 3) { + stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4)), false)); + indexes.push(this.getIndex('county', code)); + } + return Promise.all(stack) + .catch(function () { }) + .then(function () { return picker.setIndexes(indexes); }) + .catch(function () { }); + }, + getDefaultCode: function () { + var columnsPlaceholder = this.data.columnsPlaceholder; + if (columnsPlaceholder.length) { + return EMPTY_CODE; + } + var countyCodes = Object.keys(this.getConfig('county')); + if (countyCodes[0]) { + return countyCodes[0]; + } + var cityCodes = Object.keys(this.getConfig('city')); + if (cityCodes[0]) { + return cityCodes[0]; + } + return ''; + }, + getValues: function () { + var picker = this.getPicker(); + if (!picker) { + return []; + } + return this.parseValues(picker.getValues().filter(function (value) { return !!value; })); + }, + getDetail: function () { + var values = this.getValues(); + var area = { + code: '', + country: '', + province: '', + city: '', + county: '', + }; + if (!values.length) { + return area; + } + var names = values.map(function (item) { return item.name; }); + area.code = values[values.length - 1].code; + if (area.code[0] === '9') { + area.country = names[1] || ''; + area.province = names[2] || ''; + } + else { + area.province = names[0] || ''; + area.city = names[1] || ''; + area.county = names[2] || ''; + } + return area; + }, + reset: function (code) { + this.code = code || ''; + return this.setValues(); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json index 9176008..a778e91 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json @@ -1,6 +1,6 @@ -{ - "component": true, - "usingComponents": { - "van-picker": "../picker/index" - } -} +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml index 9ee9bd9..3a437b7 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml @@ -1,20 +1,20 @@ - - - + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs index bd1072c..07723c1 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs @@ -1,8 +1,8 @@ -/* eslint-disable */ -function displayColumns(columns, columnsNum) { - return columns.slice(0, +columnsNum); -} - -module.exports = { - displayColumns: displayColumns, -}; +/* eslint-disable */ +function displayColumns(columns, columnsNum) { + return columns.slice(0, +columnsNum); +} + +module.exports = { + displayColumns: displayColumns, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js index 7466dfe..984135c 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js @@ -1,60 +1,67 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var button_1 = require('../mixins/button'); -var open_type_1 = require('../mixins/open-type'); -var version_1 = require('../common/version'); -var mixins = [button_1.button, open_type_1.openType]; -if (version_1.canIUseFormFieldButton()) { - mixins.push('wx://form-field-button'); -} -component_1.VantComponent({ - mixins: mixins, - classes: ['hover-class', 'loading-class'], - data: { - baseStyle: '', - }, - props: { - formType: String, - icon: String, - classPrefix: { - type: String, - value: 'van-icon', - }, - plain: Boolean, - block: Boolean, - round: Boolean, - square: Boolean, - loading: Boolean, - hairline: Boolean, - disabled: Boolean, - loadingText: String, - customStyle: String, - loadingType: { - type: String, - value: 'circular', - }, - type: { - type: String, - value: 'default', - }, - dataset: null, - size: { - type: String, - value: 'normal', - }, - loadingSize: { - type: String, - value: '20px', - }, - color: String, - }, - methods: { - onClick: function () { - if (!this.data.loading) { - this.$emit('click'); - } - }, - noop: function () {}, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +var version_1 = require("../common/version"); +var mixins = [button_1.button]; +if ((0, version_1.canIUseFormFieldButton)()) { + mixins.push('wx://form-field-button'); +} +(0, component_1.VantComponent)({ + mixins: mixins, + classes: ['hover-class', 'loading-class'], + data: { + baseStyle: '', + }, + props: { + formType: String, + icon: String, + classPrefix: { + type: String, + value: 'van-icon', + }, + plain: Boolean, + block: Boolean, + round: Boolean, + square: Boolean, + loading: Boolean, + hairline: Boolean, + disabled: Boolean, + loadingText: String, + customStyle: String, + loadingType: { + type: String, + value: 'circular', + }, + type: { + type: String, + value: 'default', + }, + dataset: null, + size: { + type: String, + value: 'normal', + }, + loadingSize: { + type: String, + value: '20px', + }, + color: String, + }, + methods: { + onClick: function (event) { + var _this = this; + this.$emit('click', event); + var _a = this.data, canIUseGetUserProfile = _a.canIUseGetUserProfile, openType = _a.openType, getUserProfileDesc = _a.getUserProfileDesc, lang = _a.lang; + if (openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: getUserProfileDesc || ' ', + lang: lang || 'en', + complete: function (userProfile) { + _this.$emit('getuserinfo', userProfile); + }, + }); + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json index 8e23ad6..e00a588 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json @@ -1,7 +1,7 @@ -{ - "component": true, - "usingComponents": { - "van-icon": "../icon/index", - "van-loading": "../loading/index" - } -} +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-loading": "../loading/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml index a0059c7..e7f60f1 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml @@ -1,53 +1,56 @@ - - - - + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs index f5b7ab2..8b649fe 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs @@ -1,39 +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, -}; +/* eslint-disable */ +var style = require('../wxs/style.wxs'); + +function rootStyle(data) { + if (!data.color) { + return data.customStyle; + } + + var properties = { + color: data.plain ? data.color : '#fff', + background: data.plain ? null : data.color, + }; + + // hide border when color is linear-gradient + if (data.color.indexOf('gradient') !== -1) { + properties.border = 0; + } else { + properties['border-color'] = data.color; + } + + return style([properties, data.customStyle]); +} + +function loadingColor(data) { + if (data.plain) { + return data.color ? data.color : '#c9c9c9'; + } + + if (data.type === 'default') { + return '#c9c9c9'; + } + + return '#fff'; +} + +module.exports = { + rootStyle: rootStyle, + loadingColor: loadingColor, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss index 5a591fb..bd8bb5a 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-button{position:relative;display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:0;text-align:center;vertical-align:middle;-webkit-appearance:none;-webkit-text-size-adjust:100%;height:44px;height:var(--button-default-height,44px);line-height:20px;line-height:var(--button-line-height,20px);font-size:16px;font-size:var(--button-default-font-size,16px);transition:opacity .2s;transition:opacity var(--animation-duration-fast,.2s);border-radius:2px;border-radius:var(--button-border-radius,2px)}.van-button:before{position:absolute;top:50%;left:50%;width:100%;height:100%;border:inherit;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0;content:" ";background-color:#000;background-color:var(--black,#000);border-color:#000;border-color:var(--black,#000)}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{color:#323233;color:var(--button-default-color,#323233);background:#fff;background:var(--button-default-background-color,#fff);border:1px solid #ebedf0;border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0)}.van-button--primary{color:#fff;color:var(--button-primary-color,#fff);background:#07c160;background:var(--button-primary-background-color,#07c160);border:1px solid #07c160;border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160)}.van-button--info{color:#fff;color:var(--button-info-color,#fff);background:#1989fa;background:var(--button-info-background-color,#1989fa);border:1px solid #1989fa;border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa)}.van-button--danger{color:#fff;color:var(--button-danger-color,#fff);background:#ee0a24;background:var(--button-danger-background-color,#ee0a24);border:1px solid #ee0a24;border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24)}.van-button--warning{color:#fff;color:var(--button-warning-color,#fff);background:#ff976a;background:var(--button-warning-background-color,#ff976a);border:1px solid #ff976a;border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a)}.van-button--plain{background:#fff;background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:#07c160;color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:#1989fa;color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:#ee0a24;color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:#ff976a;color:var(--button-warning-background-color,#ff976a)}.van-button--large{width:100%;height:50px;height:var(--button-large-height,50px)}.van-button--normal{padding:0 15px;font-size:14px;font-size:var(--button-normal-font-size,14px)}.van-button--small{min-width:60px;min-width:var(--button-small-min-width,60px);height:30px;height:var(--button-small-height,30px);padding:0 8px;padding:0 var(--padding-xs,8px);font-size:12px;font-size:var(--button-small-font-size,12px)}.van-button--mini{display:inline-block;min-width:50px;min-width:var(--button-mini-min-width,50px);height:22px;height:var(--button-mini-height,22px);font-size:10px;font-size:var(--button-mini-font-size,10px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:-webkit-flex;display:flex;width:100%}.van-button--round{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{opacity:.5;opacity:var(--button-disabled-opacity,.5)}.van-button__text{display:inline}.van-button__icon+.van-button__text:not(:empty),.van-button__loading-text{margin-left:4px}.van-button__icon{min-width:1em;line-height:inherit!important;vertical-align:top}.van-button--hairline{padding-top:1px;border-width:0}.van-button--hairline:after{border-color:inherit;border-width:1px;border-radius:4px;border-radius:calc(var(--button-border-radius, 2px)*2)}.van-button--hairline.van-button--round:after{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--hairline.van-button--square:after{border-radius:0} \ No newline at end of file +@import '../common/index.wxss';.van-button{-webkit-text-size-adjust:100%;align-items:center;-webkit-appearance:none;border-radius:var(--button-border-radius,2px);box-sizing:border-box;display:inline-flex;font-size:var(--button-default-font-size,16px);height:var(--button-default-height,44px);justify-content:center;line-height:var(--button-line-height,20px);padding:0;position:relative;text-align:center;transition:opacity .2s;vertical-align:middle}.van-button:before{background-color:#000;border:inherit;border-color:#000;border-radius:inherit;content:" ";height:100%;left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{background:var(--button-default-background-color,#fff);border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0);color:var(--button-default-color,#323233)}.van-button--primary{background:var(--button-primary-background-color,#07c160);border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160);color:var(--button-primary-color,#fff)}.van-button--info{background:var(--button-info-background-color,#1989fa);border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa);color:var(--button-info-color,#fff)}.van-button--danger{background:var(--button-danger-background-color,#ee0a24);border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24);color:var(--button-danger-color,#fff)}.van-button--warning{background:var(--button-warning-background-color,#ff976a);border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a);color:var(--button-warning-color,#fff)}.van-button--plain{background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:var(--button-warning-background-color,#ff976a)}.van-button--large{height:var(--button-large-height,50px);width:100%}.van-button--normal{font-size:var(--button-normal-font-size,14px);padding:0 15px}.van-button--small{font-size:var(--button-small-font-size,12px);height:var(--button-small-height,30px);min-width:var(--button-small-min-width,60px);padding:0 var(--padding-xs,8px)}.van-button--mini{display:inline-block;font-size:var(--button-mini-font-size,10px);height:var(--button-mini-height,22px);min-width:var(--button-mini-min-width,50px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:flex;width:100%}.van-button--round{border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{opacity:var(--button-disabled-opacity,.5)}.van-button__text{display:inline}.van-button__icon+.van-button__text:not(:empty),.van-button__loading-text{margin-left:4px}.van-button__icon{line-height:inherit!important;min-width:1em;vertical-align:top}.van-button--hairline{border-width:0;padding-top:1px}.van-button--hairline:after{border-color:inherit;border-radius:calc(var(--button-border-radius, 2px)*2);border-width:1px}.van-button--hairline.van-button--round:after{border-radius:var(--button-round-border-radius,999px)}.van-button--hairline.van-button--square:after{border-radius:0} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml index b59ffe9..2ba6f30 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml @@ -1,65 +1,68 @@ - -
- -
- - - - - - - - - - - - {{ - computed.getButtonDisabled(type, currentDate) - ? confirmDisabledText - : confirmText - }} - - -
+ +
+ +
+ + + + + + + + + + + + {{ + computed.getButtonDisabled(type, currentDate, minRange) + ? confirmDisabledText + : confirmText + }} + + +
diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js index f4d70c2..544b3a4 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js @@ -1,18 +1,45 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../../../common/component'); -component_1.VantComponent({ - props: { - title: { - type: String, - value: '日期选择', - }, - subtitle: String, - showTitle: Boolean, - showSubtitle: Boolean, - }, - data: { - weekdays: ['日', '一', '二', '三', '四', '五', '六'], - }, - methods: {}, -}); +"use strict"; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../../../common/component"); +(0, component_1.VantComponent)({ + props: { + title: { + type: String, + value: '日期选择', + }, + subtitle: String, + showTitle: Boolean, + showSubtitle: Boolean, + firstDayOfWeek: { + type: Number, + observer: 'initWeekDay', + }, + }, + data: { + weekdays: [], + }, + created: function () { + this.initWeekDay(); + }, + methods: { + initWeekDay: function () { + var defaultWeeks = ['日', '一', '二', '三', '四', '五', '六']; + var firstDayOfWeek = this.data.firstDayOfWeek || 0; + this.setData({ + weekdays: __spreadArray(__spreadArray([], defaultWeeks.slice(firstDayOfWeek, 7), true), defaultWeeks.slice(0, firstDayOfWeek), true), + }); + }, + onClickSubtitle: function (event) { + this.$emit('click-subtitle', event); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml index 08e62a6..7e56c83 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml @@ -1,16 +1,16 @@ - - - - {{ title }} - - - - {{ subtitle }} - - - - - {{ item }} - - - + + + + {{ title }} + + + + {{ subtitle }} + + + + + {{ item }} + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss index 4075e48..272537e 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss @@ -1 +1 @@ -@import '../../../common/index.wxss';.van-calendar__header{-webkit-flex-shrink:0;flex-shrink:0;box-shadow:0 2px 10px rgba(125,126,128,.16);box-shadow:var(--calendar-header-box-shadow,0 2px 10px rgba(125,126,128,.16))}.van-calendar__header-subtitle,.van-calendar__header-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:-webkit-flex;display:flex}.van-calendar__weekday{-webkit-flex:1;flex:1;text-align:center;font-size:12px;font-size:var(--calendar-weekdays-font-size,12px);line-height:30px;line-height:var(--calendar-weekdays-height,30px)} \ No newline at end of file +@import '../../../common/index.wxss';.van-calendar__header{box-shadow:var(--calendar-header-box-shadow,0 2px 10px hsla(220,1%,50%,.16));flex-shrink:0}.van-calendar__header-subtitle,.van-calendar__header-title{font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:flex}.van-calendar__weekday{flex:1;font-size:var(--calendar-weekdays-font-size,12px);line-height:var(--calendar-weekdays-height,30px);text-align:center} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js index 470b31b..4d137f5 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js @@ -1,167 +1,158 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../../../common/component'); -var utils_1 = require('../../utils'); -component_1.VantComponent({ - props: { - date: { - type: null, - observer: 'setDays', - }, - type: { - type: String, - observer: 'setDays', - }, - color: String, - minDate: { - type: null, - observer: 'setDays', - }, - maxDate: { - type: null, - observer: 'setDays', - }, - showMark: Boolean, - rowHeight: null, - formatter: { - type: null, - observer: 'setDays', - }, - currentDate: { - type: null, - observer: 'setDays', - }, - allowSameDay: Boolean, - showSubtitle: Boolean, - showMonthTitle: Boolean, - }, - data: { - visible: true, - days: [], - }, - methods: { - onClick: function (event) { - var index = event.currentTarget.dataset.index; - var item = this.data.days[index]; - if (item.type !== 'disabled') { - this.$emit('click', item); - } - }, - setDays: function () { - var days = []; - var startDate = new Date(this.data.date); - var year = startDate.getFullYear(); - var month = startDate.getMonth(); - var totalDay = utils_1.getMonthEndDay( - startDate.getFullYear(), - startDate.getMonth() + 1 - ); - for (var day = 1; day <= totalDay; day++) { - var date = new Date(year, month, day); - var type = this.getDayType(date); - var config = { - date: date, - type: type, - text: day, - bottomInfo: this.getBottomInfo(type), - }; - if (this.data.formatter) { - config = this.data.formatter(config); - } - days.push(config); - } - this.setData({ days: days }); - }, - getMultipleDayType: function (day) { - var currentDate = this.data.currentDate; - if (!Array.isArray(currentDate)) { - return ''; - } - var isSelected = function (date) { - return currentDate.some(function (item) { - return utils_1.compareDay(item, date) === 0; - }); - }; - if (isSelected(day)) { - var prevDay = utils_1.getPrevDay(day); - var nextDay = utils_1.getNextDay(day); - var prevSelected = isSelected(prevDay); - var nextSelected = isSelected(nextDay); - if (prevSelected && nextSelected) { - return 'multiple-middle'; - } - if (prevSelected) { - return 'end'; - } - return nextSelected ? 'start' : 'multiple-selected'; - } - return ''; - }, - getRangeDayType: function (day) { - var _a = this.data, - currentDate = _a.currentDate, - allowSameDay = _a.allowSameDay; - if (!Array.isArray(currentDate)) { - return; - } - var startDay = currentDate[0], - endDay = currentDate[1]; - if (!startDay) { - return; - } - var compareToStart = utils_1.compareDay(day, startDay); - if (!endDay) { - return compareToStart === 0 ? 'start' : ''; - } - var compareToEnd = utils_1.compareDay(day, endDay); - if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) { - return 'start-end'; - } - if (compareToStart === 0) { - return 'start'; - } - if (compareToEnd === 0) { - return 'end'; - } - if (compareToStart > 0 && compareToEnd < 0) { - return 'middle'; - } - }, - getDayType: function (day) { - var _a = this.data, - type = _a.type, - minDate = _a.minDate, - maxDate = _a.maxDate, - currentDate = _a.currentDate; - if ( - utils_1.compareDay(day, minDate) < 0 || - utils_1.compareDay(day, maxDate) > 0 - ) { - return 'disabled'; - } - if (type === 'single') { - return utils_1.compareDay(day, currentDate) === 0 ? 'selected' : ''; - } - if (type === 'multiple') { - return this.getMultipleDayType(day); - } - /* istanbul ignore else */ - if (type === 'range') { - return this.getRangeDayType(day); - } - }, - getBottomInfo: function (type) { - if (this.data.type === 'range') { - if (type === 'start') { - return '开始'; - } - if (type === 'end') { - return '结束'; - } - if (type === 'start-end') { - return '开始/结束'; - } - } - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../../../common/component"); +var utils_1 = require("../../utils"); +(0, component_1.VantComponent)({ + props: { + date: { + type: null, + observer: 'setDays', + }, + type: { + type: String, + observer: 'setDays', + }, + color: String, + minDate: { + type: null, + observer: 'setDays', + }, + maxDate: { + type: null, + observer: 'setDays', + }, + showMark: Boolean, + rowHeight: null, + formatter: { + type: null, + observer: 'setDays', + }, + currentDate: { + type: null, + observer: 'setDays', + }, + firstDayOfWeek: { + type: Number, + observer: 'setDays', + }, + allowSameDay: Boolean, + showSubtitle: Boolean, + showMonthTitle: Boolean, + }, + data: { + visible: true, + days: [], + }, + methods: { + onClick: function (event) { + var index = event.currentTarget.dataset.index; + var item = this.data.days[index]; + if (item.type !== 'disabled') { + this.$emit('click', item); + } + }, + setDays: function () { + var days = []; + var startDate = new Date(this.data.date); + var year = startDate.getFullYear(); + var month = startDate.getMonth(); + var totalDay = (0, utils_1.getMonthEndDay)(startDate.getFullYear(), startDate.getMonth() + 1); + for (var day = 1; day <= totalDay; day++) { + var date = new Date(year, month, day); + var type = this.getDayType(date); + var config = { + date: date, + type: type, + text: day, + bottomInfo: this.getBottomInfo(type), + }; + if (this.data.formatter) { + config = this.data.formatter(config); + } + days.push(config); + } + this.setData({ days: days }); + }, + getMultipleDayType: function (day) { + var currentDate = this.data.currentDate; + if (!Array.isArray(currentDate)) { + return ''; + } + var isSelected = function (date) { + return currentDate.some(function (item) { return (0, utils_1.compareDay)(item, date) === 0; }); + }; + if (isSelected(day)) { + var prevDay = (0, utils_1.getPrevDay)(day); + var nextDay = (0, utils_1.getNextDay)(day); + var prevSelected = isSelected(prevDay); + var nextSelected = isSelected(nextDay); + if (prevSelected && nextSelected) { + return 'multiple-middle'; + } + if (prevSelected) { + return 'end'; + } + return nextSelected ? 'start' : 'multiple-selected'; + } + return ''; + }, + getRangeDayType: function (day) { + var _a = this.data, currentDate = _a.currentDate, allowSameDay = _a.allowSameDay; + if (!Array.isArray(currentDate)) { + return ''; + } + var startDay = currentDate[0], endDay = currentDate[1]; + if (!startDay) { + return ''; + } + var compareToStart = (0, utils_1.compareDay)(day, startDay); + if (!endDay) { + return compareToStart === 0 ? 'start' : ''; + } + var compareToEnd = (0, utils_1.compareDay)(day, endDay); + if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) { + return 'start-end'; + } + if (compareToStart === 0) { + return 'start'; + } + if (compareToEnd === 0) { + return 'end'; + } + if (compareToStart > 0 && compareToEnd < 0) { + return 'middle'; + } + return ''; + }, + getDayType: function (day) { + var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, currentDate = _a.currentDate; + if ((0, utils_1.compareDay)(day, minDate) < 0 || (0, utils_1.compareDay)(day, maxDate) > 0) { + return 'disabled'; + } + if (type === 'single') { + return (0, utils_1.compareDay)(day, currentDate) === 0 ? 'selected' : ''; + } + if (type === 'multiple') { + return this.getMultipleDayType(day); + } + /* istanbul ignore else */ + if (type === 'range') { + return this.getRangeDayType(day); + } + return ''; + }, + getBottomInfo: function (type) { + if (this.data.type === 'range') { + if (type === 'start') { + return '开始'; + } + if (type === 'end') { + return '结束'; + } + if (type === 'start-end') { + return '开始/结束'; + } + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml index b4b431a..0c73b2f 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml @@ -1,39 +1,39 @@ - - - - - - {{ computed.formatMonthTitle(date) }} - - - - - {{ computed.getMark(date) }} - - - - - {{ item.topInfo }} - {{ item.text }} - - {{ item.bottomInfo }} - - - - - {{ item.topInfo }} - {{ item.text }} - - {{ item.bottomInfo }} - - - - - + + + + + + {{ computed.formatMonthTitle(date) }} + + + + + {{ computed.getMark(date) }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs index 00c909d..55e45a5 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs @@ -1,67 +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) { - var style = []; - var offset = getDate(date).getDay(); - - if (index === 0) { - style.push(['margin-left', (100 * offset) / 7 + '%']); - } - - if (rowHeight !== ROW_HEIGHT) { - style.push(['height', rowHeight + 'px']); - } - - if (color) { - if ( - type === 'start' || - type === 'end' || - type === 'multiple-selected' || - type === 'multiple-middle' - ) { - style.push(['background', color]); - } else if (type === 'middle') { - style.push(['color', color]); - } - } - - return style - .map(function(item) { - return item.join(':'); - }) - .join(';'); -} - -function formatMonthTitle(date) { - date = getDate(date); - return date.getFullYear() + '年' + (date.getMonth() + 1) + '月'; -} - -function getMonthStyle(visible, date, rowHeight) { - if (!visible) { - date = getDate(date); - - var totalDay = utils.getMonthEndDay( - date.getFullYear(), - date.getMonth() + 1 - ); - var offset = getDate(date).getDay(); - var padding = Math.ceil((totalDay + offset) / 7) * rowHeight; - - return 'padding-bottom:' + padding + 'px'; - } -} - -module.exports = { - getMark: getMark, - getDayStyle: getDayStyle, - formatMonthTitle: formatMonthTitle, - getMonthStyle: getMonthStyle -}; +/* eslint-disable */ +var utils = require('../../utils.wxs'); + +function getMark(date) { + return getDate(date).getMonth() + 1; +} + +var ROW_HEIGHT = 64; + +function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) { + var style = []; + var current = getDate(date).getDay() || 7; + var offset = current < firstDayOfWeek ? (7 - firstDayOfWeek + current) : + current === 7 && firstDayOfWeek === 0 ? 0 : + (current - firstDayOfWeek); + + if (index === 0) { + style.push(['margin-left', (100 * offset) / 7 + '%']); + } + + if (rowHeight !== ROW_HEIGHT) { + style.push(['height', rowHeight + 'px']); + } + + if (color) { + if ( + type === 'start' || + type === 'end' || + type === 'start-end' || + type === 'multiple-selected' || + type === 'multiple-middle' + ) { + style.push(['background', color]); + } else if (type === 'middle') { + style.push(['color', color]); + } + } + + return style + .map(function(item) { + return item.join(':'); + }) + .join(';'); +} + +function formatMonthTitle(date) { + date = getDate(date); + return date.getFullYear() + '年' + (date.getMonth() + 1) + '月'; +} + +function getMonthStyle(visible, date, rowHeight) { + if (!visible) { + date = getDate(date); + + var totalDay = utils.getMonthEndDay( + date.getFullYear(), + date.getMonth() + 1 + ); + var offset = getDate(date).getDay(); + var padding = Math.ceil((totalDay + offset) / 7) * rowHeight; + + return 'padding-bottom:' + padding + 'px'; + } +} + +module.exports = { + getMark: getMark, + getDayStyle: getDayStyle, + formatMonthTitle: formatMonthTitle, + getMonthStyle: getMonthStyle +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss index 17c12f4..9aee73d 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss @@ -1 +1 @@ -@import '../../../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__month-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:14px;font-size:var(--calendar-month-title-font-size,14px);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__days{position:relative;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{position:absolute;top:50%;left:50%;z-index:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);pointer-events:none;color:rgba(242,243,245,.8);color:var(--calendar-month-mark-color,rgba(242,243,245,.8));font-size:160px;font-size:var(--calendar-month-mark-font-size,160px)}.van-calendar__day,.van-calendar__selected-day{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;text-align:center}.van-calendar__day{position:relative;width:14.285%;height:64px;height:var(--calendar-day-height,64px);font-size:16px;font-size:var(--calendar-day-font-size,16px)}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{color:#fff;color:var(--calendar-range-edge-color,#fff);background-color:#ee0a24;background-color:var(--calendar-range-edge-background-color,#ee0a24)}.van-calendar__day--start{border-radius:4px 0 0 4px;border-radius:var(--border-radius-md,4px) 0 0 var(--border-radius-md,4px)}.van-calendar__day--end{border-radius:0 4px 4px 0;border-radius:0 var(--border-radius-md,4px) var(--border-radius-md,4px) 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px;border-radius:var(--border-radius-md,4px)}.van-calendar__day--middle{color:#ee0a24;color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{position:absolute;top:0;right:0;bottom:0;left:0;background-color:currentColor;content:"";opacity:.1;opacity:var(--calendar-range-middle-background-opacity,.1)}.van-calendar__day--disabled{cursor:default;color:#c8c9cc;color:var(--calendar-day-disabled-color,#c8c9cc)}.van-calendar__bottom-info,.van-calendar__top-info{position:absolute;right:0;left:0;font-size:10px;font-size:var(--calendar-info-font-size,10px);line-height:14px;line-height:var(--calendar-info-line-height,14px)}@media (max-width:350px){.van-calendar__bottom-info,.van-calendar__top-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{width:54px;width:var(--calendar-selected-day-size,54px);height:54px;height:var(--calendar-selected-day-size,54px);color:#fff;color:var(--calendar-selected-day-color,#fff);background-color:#ee0a24;background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;border-radius:var(--border-radius-md,4px)} \ No newline at end of file +@import '../../../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:100%}.van-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.van-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{color:var(--calendar-month-mark-color,rgba(242,243,245,.8));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.van-calendar__day,.van-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.van-calendar__day{font-size:var(--calendar-day-font-size,16px);height:var(--calendar-day-height,64px);position:relative;width:14.285%}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#ee0a24);color:var(--calendar-range-edge-color,#fff)}.van-calendar__day--start{border-radius:4px 0 0 4px}.van-calendar__day--end{border-radius:0 4px 4px 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px}.van-calendar__day--middle{color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{background-color:currentColor;bottom:0;content:"";left:0;opacity:var(--calendar-range-middle-background-opacity,.1);position:absolute;right:0;top:0}.van-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.van-calendar__bottom-info,.van-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.van-calendar__bottom-info,.van-calendar__top-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,54px);width:var(--calendar-selected-day-size,54px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js index f64f318..eea8751 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js @@ -1,325 +1,379 @@ -'use strict'; -var __spreadArrays = - (this && this.__spreadArrays) || - function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod }; - }; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var utils_1 = require('./utils'); -var toast_1 = __importDefault(require('../toast/toast')); -var utils_2 = require('../common/utils'); -component_1.VantComponent({ - props: { - title: { - type: String, - value: '日期选择', - }, - color: String, - show: { - type: Boolean, - observer: function (val) { - if (val) { - this.initRect(); - this.scrollIntoView(); - } - }, - }, - formatter: null, - confirmText: { - type: String, - value: '确定', - }, - rangePrompt: String, - defaultDate: { - type: null, - observer: function (val) { - this.setData({ currentDate: val }); - this.scrollIntoView(); - }, - }, - allowSameDay: Boolean, - confirmDisabledText: String, - type: { - type: String, - value: 'single', - observer: 'reset', - }, - minDate: { - type: null, - value: Date.now(), - }, - maxDate: { - type: null, - value: new Date( - new Date().getFullYear(), - new Date().getMonth() + 6, - new Date().getDate() - ).getTime(), - }, - position: { - type: String, - value: 'bottom', - }, - rowHeight: { - type: null, - value: utils_1.ROW_HEIGHT, - }, - round: { - type: Boolean, - value: true, - }, - poppable: { - type: Boolean, - value: true, - }, - showMark: { - type: Boolean, - value: true, - }, - showTitle: { - type: Boolean, - value: true, - }, - showConfirm: { - type: Boolean, - value: true, - }, - showSubtitle: { - type: Boolean, - value: true, - }, - safeAreaInsetBottom: { - type: Boolean, - value: true, - }, - closeOnClickOverlay: { - type: Boolean, - value: true, - }, - maxRange: { - type: null, - value: null, - }, - }, - data: { - subtitle: '', - currentDate: null, - scrollIntoView: '', - }, - created: function () { - this.setData({ - currentDate: this.getInitialDate(), - }); - }, - mounted: function () { - if (this.data.show || !this.data.poppable) { - this.initRect(); - this.scrollIntoView(); - } - }, - methods: { - reset: function () { - this.setData({ currentDate: this.getInitialDate() }); - this.scrollIntoView(); - }, - initRect: function () { - var _this = this; - if (this.contentObserver != null) { - this.contentObserver.disconnect(); - } - var contentObserver = this.createIntersectionObserver({ - thresholds: [0, 0.1, 0.9, 1], - observeAll: true, - }); - this.contentObserver = contentObserver; - contentObserver.relativeTo('.van-calendar__body'); - contentObserver.observe('.month', function (res) { - if (res.boundingClientRect.top <= res.relativeRect.top) { - // @ts-ignore - _this.setData({ - subtitle: utils_1.formatMonthTitle(res.dataset.date), - }); - } - }); - }, - getInitialDate: function () { - var _a = this.data, - type = _a.type, - defaultDate = _a.defaultDate, - minDate = _a.minDate; - if (type === 'range') { - var _b = defaultDate || [], - startDay = _b[0], - endDay = _b[1]; - return [ - startDay || minDate, - endDay || utils_1.getNextDay(new Date(minDate)).getTime(), - ]; - } - if (type === 'multiple') { - return defaultDate || [minDate]; - } - return defaultDate || minDate; - }, - scrollIntoView: function () { - var _this = this; - utils_2.requestAnimationFrame(function () { - var _a = _this.data, - currentDate = _a.currentDate, - type = _a.type, - show = _a.show, - poppable = _a.poppable, - minDate = _a.minDate, - maxDate = _a.maxDate; - // @ts-ignore - var targetDate = type === 'single' ? currentDate : currentDate[0]; - var displayed = show || !poppable; - if (!targetDate || !displayed) { - return; - } - var months = utils_1.getMonths(minDate, maxDate); - months.some(function (month, index) { - if (utils_1.compareMonth(month, targetDate) === 0) { - _this.setData({ scrollIntoView: 'month' + index }); - return true; - } - return false; - }); - }); - }, - onOpen: function () { - this.$emit('open'); - }, - onOpened: function () { - this.$emit('opened'); - }, - onClose: function () { - this.$emit('close'); - }, - onClosed: function () { - this.$emit('closed'); - }, - onClickDay: function (event) { - var date = event.detail.date; - var _a = this.data, - type = _a.type, - currentDate = _a.currentDate, - allowSameDay = _a.allowSameDay; - if (type === 'range') { - // @ts-ignore - var startDay = currentDate[0], - endDay = currentDate[1]; - if (startDay && !endDay) { - var compareToStart = utils_1.compareDay(date, startDay); - if (compareToStart === 1) { - this.select([startDay, date], true); - } else if (compareToStart === -1) { - this.select([date, null]); - } else if (allowSameDay) { - this.select([date, date]); - } - } else { - this.select([date, null]); - } - } else if (type === 'multiple') { - var selectedIndex_1; - // @ts-ignore - var selected = currentDate.some(function (dateItem, index) { - var equal = utils_1.compareDay(dateItem, date) === 0; - if (equal) { - selectedIndex_1 = index; - } - return equal; - }); - if (selected) { - // @ts-ignore - var cancelDate = currentDate.splice(selectedIndex_1, 1); - this.setData({ currentDate: currentDate }); - this.unselect(cancelDate); - } else { - // @ts-ignore - this.select(__spreadArrays(currentDate, [date])); - } - } else { - this.select(date, true); - } - }, - unselect: function (dateArray) { - var date = dateArray[0]; - if (date) { - this.$emit('unselect', utils_1.copyDates(date)); - } - }, - select: function (date, complete) { - if (complete && this.data.type === 'range') { - var valid = this.checkRange(date); - if (!valid) { - // auto selected to max range if showConfirm - if (this.data.showConfirm) { - this.emit([ - date[0], - utils_1.getDayByOffset(date[0], this.data.maxRange - 1), - ]); - } else { - this.emit(date); - } - return; - } - } - this.emit(date); - if (complete && !this.data.showConfirm) { - this.onConfirm(); - } - }, - emit: function (date) { - var getTime = function (date) { - return date instanceof Date ? date.getTime() : date; - }; - this.setData({ - currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), - }); - this.$emit('select', utils_1.copyDates(date)); - }, - checkRange: function (date) { - var _a = this.data, - maxRange = _a.maxRange, - rangePrompt = _a.rangePrompt; - if (maxRange && utils_1.calcDateNum(date) > maxRange) { - toast_1.default({ - context: this, - message: - rangePrompt || - '\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ' + - maxRange + - ' \u5929', - }); - return false; - } - return true; - }, - onConfirm: function () { - var _this = this; - if ( - this.data.type === 'range' && - !this.checkRange(this.data.currentDate) - ) { - return; - } - wx.nextTick(function () { - // @ts-ignore - _this.$emit('confirm', utils_1.copyDates(_this.data.currentDate)); - }); - }, - }, -}); +"use strict"; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var utils_1 = require("./utils"); +var toast_1 = __importDefault(require("../toast/toast")); +var utils_2 = require("../common/utils"); +var initialMinDate = (0, utils_1.getToday)().getTime(); +var initialMaxDate = (function () { + var now = (0, utils_1.getToday)(); + return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime(); +})(); +var getTime = function (date) { + return date instanceof Date ? date.getTime() : date; +}; +(0, component_1.VantComponent)({ + props: { + title: { + type: String, + value: '日期选择', + }, + color: String, + show: { + type: Boolean, + observer: function (val) { + if (val) { + this.initRect(); + this.scrollIntoView(); + } + }, + }, + formatter: null, + confirmText: { + type: String, + value: '确定', + }, + confirmDisabledText: { + type: String, + value: '确定', + }, + rangePrompt: String, + showRangePrompt: { + type: Boolean, + value: true, + }, + defaultDate: { + type: null, + value: (0, utils_1.getToday)().getTime(), + observer: function (val) { + this.setData({ currentDate: val }); + this.scrollIntoView(); + }, + }, + allowSameDay: Boolean, + type: { + type: String, + value: 'single', + observer: 'reset', + }, + minDate: { + type: Number, + value: initialMinDate, + }, + maxDate: { + type: Number, + value: initialMaxDate, + }, + position: { + type: String, + value: 'bottom', + }, + rowHeight: { + type: null, + value: utils_1.ROW_HEIGHT, + }, + round: { + type: Boolean, + value: true, + }, + poppable: { + type: Boolean, + value: true, + }, + showMark: { + type: Boolean, + value: true, + }, + showTitle: { + type: Boolean, + value: true, + }, + showConfirm: { + type: Boolean, + value: true, + }, + showSubtitle: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + maxRange: { + type: null, + value: null, + }, + minRange: { + type: Number, + value: 1, + }, + firstDayOfWeek: { + type: Number, + value: 0, + }, + readonly: Boolean, + }, + data: { + subtitle: '', + currentDate: null, + scrollIntoView: '', + }, + watch: { + minDate: function () { + this.initRect(); + }, + maxDate: function () { + this.initRect(); + }, + }, + created: function () { + this.setData({ + currentDate: this.getInitialDate(this.data.defaultDate), + }); + }, + mounted: function () { + if (this.data.show || !this.data.poppable) { + this.initRect(); + this.scrollIntoView(); + } + }, + methods: { + reset: function () { + this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) }); + this.scrollIntoView(); + }, + initRect: function () { + var _this = this; + if (this.contentObserver != null) { + this.contentObserver.disconnect(); + } + var contentObserver = this.createIntersectionObserver({ + thresholds: [0, 0.1, 0.9, 1], + observeAll: true, + }); + this.contentObserver = contentObserver; + contentObserver.relativeTo('.van-calendar__body'); + contentObserver.observe('.month', function (res) { + if (res.boundingClientRect.top <= res.relativeRect.top) { + // @ts-ignore + _this.setData({ subtitle: (0, utils_1.formatMonthTitle)(res.dataset.date) }); + } + }); + }, + limitDateRange: function (date, minDate, maxDate) { + if (minDate === void 0) { minDate = null; } + if (maxDate === void 0) { maxDate = null; } + minDate = minDate || this.data.minDate; + maxDate = maxDate || this.data.maxDate; + if ((0, utils_1.compareDay)(date, minDate) === -1) { + return minDate; + } + if ((0, utils_1.compareDay)(date, maxDate) === 1) { + return maxDate; + } + return date; + }, + getInitialDate: function (defaultDate) { + var _this = this; + if (defaultDate === void 0) { defaultDate = null; } + var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, allowSameDay = _a.allowSameDay; + if (!defaultDate) + return []; + var now = (0, utils_1.getToday)().getTime(); + if (type === 'range') { + if (!Array.isArray(defaultDate)) { + defaultDate = []; + } + var _b = defaultDate || [], startDay = _b[0], endDay = _b[1]; + var startDate = getTime(startDay || now); + var start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : (0, utils_1.getPrevDay)(new Date(maxDate)).getTime()); + var date = getTime(endDay || now); + var end = this.limitDateRange(date, allowSameDay ? date : (0, utils_1.getNextDay)(new Date(minDate)).getTime()); + return [start, end]; + } + if (type === 'multiple') { + if (Array.isArray(defaultDate)) { + return defaultDate.map(function (date) { return _this.limitDateRange(date); }); + } + return [this.limitDateRange(now)]; + } + if (!defaultDate || Array.isArray(defaultDate)) { + defaultDate = now; + } + return this.limitDateRange(defaultDate); + }, + scrollIntoView: function () { + var _this = this; + (0, utils_2.requestAnimationFrame)(function () { + var _a = _this.data, currentDate = _a.currentDate, type = _a.type, show = _a.show, poppable = _a.poppable, minDate = _a.minDate, maxDate = _a.maxDate; + if (!currentDate) + return; + // @ts-ignore + var targetDate = type === 'single' ? currentDate : currentDate[0]; + var displayed = show || !poppable; + if (!targetDate || !displayed) { + return; + } + var months = (0, utils_1.getMonths)(minDate, maxDate); + months.some(function (month, index) { + if ((0, utils_1.compareMonth)(month, targetDate) === 0) { + _this.setData({ scrollIntoView: "month".concat(index) }); + return true; + } + return false; + }); + }); + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + }, + onClickDay: function (event) { + if (this.data.readonly) { + return; + } + var date = event.detail.date; + var _a = this.data, type = _a.type, currentDate = _a.currentDate, allowSameDay = _a.allowSameDay; + if (type === 'range') { + // @ts-ignore + var startDay_1 = currentDate[0], endDay = currentDate[1]; + if (startDay_1 && !endDay) { + var compareToStart = (0, utils_1.compareDay)(date, startDay_1); + if (compareToStart === 1) { + var days_1 = this.selectComponent('.month').data.days; + days_1.some(function (day, index) { + var isDisabled = day.type === 'disabled' && + getTime(startDay_1) < getTime(day.date) && + getTime(day.date) < getTime(date); + if (isDisabled) { + (date = days_1[index - 1].date); + } + return isDisabled; + }); + this.select([startDay_1, date], true); + } + else if (compareToStart === -1) { + this.select([date, null]); + } + else if (allowSameDay) { + this.select([date, date], true); + } + } + else { + this.select([date, null]); + } + } + else if (type === 'multiple') { + var selectedIndex_1; + // @ts-ignore + var selected = currentDate.some(function (dateItem, index) { + var equal = (0, utils_1.compareDay)(dateItem, date) === 0; + if (equal) { + selectedIndex_1 = index; + } + return equal; + }); + if (selected) { + // @ts-ignore + var cancelDate = currentDate.splice(selectedIndex_1, 1); + this.setData({ currentDate: currentDate }); + this.unselect(cancelDate); + } + else { + // @ts-ignore + this.select(__spreadArray(__spreadArray([], currentDate, true), [date], false)); + } + } + else { + this.select(date, true); + } + }, + unselect: function (dateArray) { + var date = dateArray[0]; + if (date) { + this.$emit('unselect', (0, utils_1.copyDates)(date)); + } + }, + select: function (date, complete) { + if (complete && this.data.type === 'range') { + var valid = this.checkRange(date); + if (!valid) { + // auto selected to max range if showConfirm + if (this.data.showConfirm) { + this.emit([ + date[0], + (0, utils_1.getDayByOffset)(date[0], this.data.maxRange - 1), + ]); + } + else { + this.emit(date); + } + return; + } + } + this.emit(date); + if (complete && !this.data.showConfirm) { + this.onConfirm(); + } + }, + emit: function (date) { + this.setData({ + currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), + }); + this.$emit('select', (0, utils_1.copyDates)(date)); + }, + checkRange: function (date) { + var _a = this.data, maxRange = _a.maxRange, rangePrompt = _a.rangePrompt, showRangePrompt = _a.showRangePrompt; + if (maxRange && (0, utils_1.calcDateNum)(date) > maxRange) { + if (showRangePrompt) { + (0, toast_1.default)({ + context: this, + message: rangePrompt || "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ".concat(maxRange, " \u5929"), + }); + } + this.$emit('over-range'); + return false; + } + return true; + }, + onConfirm: function () { + var _this = this; + if (this.data.type === 'range' && + !this.checkRange(this.data.currentDate)) { + return; + } + wx.nextTick(function () { + // @ts-ignore + _this.$emit('confirm', (0, utils_1.copyDates)(_this.data.currentDate)); + }); + }, + onClickSubtitle: function (event) { + this.$emit('click-subtitle', event); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json index fbb2d4e..397d5ae 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json @@ -1,10 +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" - } -} +{ + "component": true, + "usingComponents": { + "header": "./components/header/index", + "month": "./components/month/index", + "van-button": "../button/index", + "van-popup": "../popup/index", + "van-toast": "../toast/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml index 9a194ce..9667eef 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml @@ -1,25 +1,26 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs index f464713..0a56646 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs @@ -1,37 +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 -}; +/* eslint-disable */ +var utils = require('./utils.wxs'); + +function getMonths(minDate, maxDate) { + var months = []; + var cursor = getDate(minDate); + + cursor.setDate(1); + + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1); + + return months; +} + +function getButtonDisabled(type, currentDate, minRange) { + if (currentDate == null) { + return true; + } + + if (type === 'range') { + return !currentDate[0] || !currentDate[1]; + } + + if (type === 'multiple') { + return currentDate.length < minRange; + } + + return !currentDate; +} + +module.exports = { + getMonths: getMonths, + getButtonDisabled: getButtonDisabled +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss index 9d78e0f..a1f1cf0 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;height:var(--calendar-height,100%);background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:80%;height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__footer{-webkit-flex-shrink:0;flex-shrink:0;padding:0 16px;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:36px!important;height:var(--calendar-confirm-button-height,36px)!important;margin:7px 0!important;margin:var(--calendar-confirm-button-margin,7px 0)!important;line-height:34px!important;line-height:var(--calendar-confirm-button-line-height,34px)!important} \ No newline at end of file +@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js index 39b9916..c9e5df7 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js @@ -1,91 +1,97 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0; -exports.ROW_HEIGHT = 64; -function formatMonthTitle(date) { - if (!(date instanceof Date)) { - date = new Date(date); - } - return date.getFullYear() + '\u5E74' + (date.getMonth() + 1) + '\u6708'; -} -exports.formatMonthTitle = formatMonthTitle; -function compareMonth(date1, date2) { - if (!(date1 instanceof Date)) { - date1 = new Date(date1); - } - if (!(date2 instanceof Date)) { - date2 = new Date(date2); - } - var year1 = date1.getFullYear(); - var year2 = date2.getFullYear(); - var month1 = date1.getMonth(); - var month2 = date2.getMonth(); - if (year1 === year2) { - return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; - } - return year1 > year2 ? 1 : -1; -} -exports.compareMonth = compareMonth; -function compareDay(day1, day2) { - if (!(day1 instanceof Date)) { - day1 = new Date(day1); - } - if (!(day2 instanceof Date)) { - day2 = new Date(day2); - } - var compareMonthResult = compareMonth(day1, day2); - if (compareMonthResult === 0) { - var date1 = day1.getDate(); - var date2 = day2.getDate(); - return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; - } - return compareMonthResult; -} -exports.compareDay = compareDay; -function getDayByOffset(date, offset) { - date = new Date(date); - date.setDate(date.getDate() + offset); - return date; -} -exports.getDayByOffset = getDayByOffset; -function getPrevDay(date) { - return getDayByOffset(date, -1); -} -exports.getPrevDay = getPrevDay; -function getNextDay(date) { - return getDayByOffset(date, 1); -} -exports.getNextDay = getNextDay; -function calcDateNum(date) { - var day1 = new Date(date[0]).getTime(); - var day2 = new Date(date[1]).getTime(); - return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; -} -exports.calcDateNum = calcDateNum; -function copyDates(dates) { - if (Array.isArray(dates)) { - return dates.map(function (date) { - if (date === null) { - return date; - } - return new Date(date); - }); - } - return new Date(dates); -} -exports.copyDates = copyDates; -function getMonthEndDay(year, month) { - return 32 - new Date(year, month - 1, 32).getDate(); -} -exports.getMonthEndDay = getMonthEndDay; -function getMonths(minDate, maxDate) { - var months = []; - var cursor = new Date(minDate); - cursor.setDate(1); - do { - months.push(cursor.getTime()); - cursor.setMonth(cursor.getMonth() + 1); - } while (compareMonth(cursor, maxDate) !== 1); - return months; -} -exports.getMonths = getMonths; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getToday = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0; +exports.ROW_HEIGHT = 64; +function formatMonthTitle(date) { + if (!(date instanceof Date)) { + date = new Date(date); + } + return "".concat(date.getFullYear(), "\u5E74").concat(date.getMonth() + 1, "\u6708"); +} +exports.formatMonthTitle = formatMonthTitle; +function compareMonth(date1, date2) { + if (!(date1 instanceof Date)) { + date1 = new Date(date1); + } + if (!(date2 instanceof Date)) { + date2 = new Date(date2); + } + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + return year1 > year2 ? 1 : -1; +} +exports.compareMonth = compareMonth; +function compareDay(day1, day2) { + if (!(day1 instanceof Date)) { + day1 = new Date(day1); + } + if (!(day2 instanceof Date)) { + day2 = new Date(day2); + } + var compareMonthResult = compareMonth(day1, day2); + if (compareMonthResult === 0) { + var date1 = day1.getDate(); + var date2 = day2.getDate(); + return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; + } + return compareMonthResult; +} +exports.compareDay = compareDay; +function getDayByOffset(date, offset) { + date = new Date(date); + date.setDate(date.getDate() + offset); + return date; +} +exports.getDayByOffset = getDayByOffset; +function getPrevDay(date) { + return getDayByOffset(date, -1); +} +exports.getPrevDay = getPrevDay; +function getNextDay(date) { + return getDayByOffset(date, 1); +} +exports.getNextDay = getNextDay; +function getToday() { + var today = new Date(); + today.setHours(0, 0, 0, 0); + return today; +} +exports.getToday = getToday; +function calcDateNum(date) { + var day1 = new Date(date[0]).getTime(); + var day2 = new Date(date[1]).getTime(); + return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; +} +exports.calcDateNum = calcDateNum; +function copyDates(dates) { + if (Array.isArray(dates)) { + return dates.map(function (date) { + if (date === null) { + return date; + } + return new Date(date); + }); + } + return new Date(dates); +} +exports.copyDates = copyDates; +function getMonthEndDay(year, month) { + return 32 - new Date(year, month - 1, 32).getDate(); +} +exports.getMonthEndDay = getMonthEndDay; +function getMonths(minDate, maxDate) { + var months = []; + var cursor = new Date(minDate); + cursor.setDate(1); + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (compareMonth(cursor, maxDate) !== 1); + return months; +} +exports.getMonths = getMonths; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs index 2efe4a6..e57f6b3 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs @@ -1,25 +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 -}; +/* eslint-disable */ +function getMonthEndDay(year, month) { + return 32 - getDate(year, month - 1, 32).getDate(); +} + +function compareMonth(date1, date2) { + date1 = getDate(date1); + date2 = getDate(date2); + + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + + return year1 > year2 ? 1 : -1; +} + +module.exports = { + getMonthEndDay: getMonthEndDay, + compareMonth: compareMonth +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js index fa32fb9..2815655 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js @@ -1,51 +1,51 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var link_1 = require('../mixins/link'); -var component_1 = require('../common/component'); -component_1.VantComponent({ - classes: [ - 'num-class', - 'desc-class', - 'thumb-class', - 'title-class', - 'price-class', - 'origin-price-class', - ], - mixins: [link_1.link], - props: { - tag: String, - num: String, - desc: String, - thumb: String, - title: String, - price: { - type: String, - observer: 'updatePrice', - }, - centered: Boolean, - lazyLoad: Boolean, - thumbLink: String, - originPrice: String, - thumbMode: { - type: String, - value: 'aspectFit', - }, - currency: { - type: String, - value: '¥', - }, - }, - methods: { - updatePrice: function () { - var price = this.data.price; - var priceArr = price.toString().split('.'); - this.setData({ - integerStr: priceArr[0], - decimalStr: priceArr[1] ? '.' + priceArr[1] : '', - }); - }, - onClickThumb: function () { - this.jumpLink('thumbLink'); - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var link_1 = require("../mixins/link"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + classes: [ + 'num-class', + 'desc-class', + 'thumb-class', + 'title-class', + 'price-class', + 'origin-price-class', + ], + mixins: [link_1.link], + props: { + tag: String, + num: String, + desc: String, + thumb: String, + title: String, + price: { + type: String, + observer: 'updatePrice', + }, + centered: Boolean, + lazyLoad: Boolean, + thumbLink: String, + originPrice: String, + thumbMode: { + type: String, + value: 'aspectFit', + }, + currency: { + type: String, + value: '¥', + }, + }, + methods: { + updatePrice: function () { + var price = this.data.price; + var priceArr = price.toString().split('.'); + this.setData({ + integerStr: priceArr[0], + decimalStr: priceArr[1] ? ".".concat(priceArr[1]) : '', + }); + }, + onClickThumb: function () { + this.jumpLink('thumbLink'); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json index 2b603f2..e917407 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json @@ -1,6 +1,6 @@ -{ - "component": true, - "usingComponents": { - "van-tag": "../tag/index" - } -} +{ + "component": true, + "usingComponents": { + "van-tag": "../tag/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml index c00776f..62173e4 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml @@ -1,56 +1,56 @@ - - - - - - - - - {{ tag }} - - - - - - - {{ title }} - - - {{ desc }} - - - - - - - - - {{ currency }} - {{ integerStr }} - {{ decimalStr }} - - - {{ currency }} {{ originPrice }} - - x {{ num }} - - - - - - - - - - + + + + + + + + + {{ tag }} + + + + + + + {{ title }} + + + {{ desc }} + + + + + + + + + {{ currency }} + {{ integerStr }} + {{ decimalStr }} + + + {{ currency }} {{ originPrice }} + + x {{ num }} + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss index a21a599..0f4d7c5 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-card{position:relative;box-sizing:border-box;padding:8px 16px;padding:var(--card-padding,8px 16px);font-size:12px;font-size:var(--card-font-size,12px);color:#323233;color:var(--card-text-color,#323233);background-color:#fafafa;background-color:var(--card-background-color,#fafafa)}.van-card__header{display:-webkit-flex;display:flex}.van-card__header--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{position:relative;-webkit-flex:none;flex:none;width:88px;width:var(--card-thumb-size,88px);height:88px;height:var(--card-thumb-size,88px);margin-right:8px;margin-right:var(--padding-xs,8px)}.van-card__thumb:empty{display:none}.van-card__img{width:100%;height:100%;border-radius:8px;border-radius:var(--border-radius-lg,8px)}.van-card__content{position:relative;display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;justify-content:space-between;min-width:0;min-height:88px;min-height:var(--card-thumb-size,88px)}.van-card__content--center{-webkit-justify-content:center;justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{font-weight:700;line-height:16px;line-height:var(--card-title-line-height,16px)}.van-card__desc{line-height:20px;line-height:var(--card-desc-line-height,20px);color:#646566;color:var(--card-desc-color,#646566)}.van-card__bottom{line-height:20px}.van-card__price{display:inline-block;font-weight:700;color:#ee0a24;color:var(--card-price-color,#ee0a24);font-size:12px;font-size:var(--card-price-font-size,12px)}.van-card__price-integer{font-size:16px;font-size:var(--card-price-integer-font-size,16px)}.van-card__price-decimal,.van-card__price-integer{font-family:Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif;font-family:var(--card-price-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif)}.van-card__origin-price{display:inline-block;margin-left:5px;text-decoration:line-through;font-size:10px;font-size:var(--card-origin-price-font-size,10px);color:#646566;color:var(--card-origin-price-color,#646566)}.van-card__num{float:right}.van-card__tag{position:absolute!important;top:2px;left:0}.van-card__footer{-webkit-flex:none;flex:none;width:100%;text-align:right} \ No newline at end of file +@import '../common/index.wxss';.van-card{background-color:var(--card-background-color,#fafafa);box-sizing:border-box;color:var(--card-text-color,#323233);font-size:var(--card-font-size,12px);padding:var(--card-padding,8px 16px);position:relative}.van-card__header{display:flex}.van-card__header--center{align-items:center;justify-content:center}.van-card__thumb{flex:none;height:var(--card-thumb-size,88px);margin-right:var(--padding-xs,8px);position:relative;width:var(--card-thumb-size,88px)}.van-card__thumb:empty{display:none}.van-card__img{border-radius:8px;height:100%;width:100%}.van-card__content{display:flex;flex:1;flex-direction:column;justify-content:space-between;min-height:var(--card-thumb-size,88px);min-width:0;position:relative}.van-card__content--center{justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{font-weight:700;line-height:var(--card-title-line-height,16px)}.van-card__desc{color:var(--card-desc-color,#646566);line-height:var(--card-desc-line-height,20px)}.van-card__bottom{line-height:20px}.van-card__price{color:var(--card-price-color,#ee0a24);display:inline-block;font-size:var(--card-price-font-size,12px);font-weight:700}.van-card__price-integer{font-size:var(--card-price-integer-font-size,16px)}.van-card__price-decimal,.van-card__price-integer{font-family:var(--card-price-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif)}.van-card__origin-price{color:var(--card-origin-price-color,#646566);display:inline-block;font-size:var(--card-origin-price-font-size,10px);margin-left:5px;text-decoration:line-through}.van-card__num{float:right}.van-card__tag{left:0;position:absolute!important;top:2px}.van-card__footer{flex:none;text-align:right;width:100%} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js index 45b8ab6..34a93a6 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js @@ -1,12 +1,13 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -component_1.VantComponent({ - props: { - title: String, - border: { - type: Boolean, - value: true, - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + title: String, + border: { + type: Boolean, + value: true, + }, + inset: Boolean, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml index 88351a4..311e064 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml @@ -1,9 +1,11 @@ - - {{ title }} - - - - + + + + {{ title }} + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss index edbccd5..08b252f 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-cell-group__title{padding:16px 16px 8px;padding:var(--cell-group-title-padding,16px 16px 8px);font-size:14px;font-size:var(--cell-group-title-font-size,14px);line-height:16px;line-height:var(--cell-group-title-line-height,16px);color:#969799;color:var(--cell-group-title-color,#969799)} \ No newline at end of file +@import '../common/index.wxss';.van-cell-group--inset{border-radius:var(--cell-group-inset-border-radius,8px);margin:var(--cell-group-inset-padding,0 16px);overflow:hidden}.van-cell-group__title{color:var(--cell-group-title-color,#969799);font-size:var(--cell-group-title-font-size,14px);line-height:var(--cell-group-title-line-height,16px);padding:var(--cell-group-title-padding,16px 16px 8px)}.van-cell-group__title--inset{padding:var(--cell-group-inset-title-padding,16px 16px 8px 32px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js index 75691a1..80f3039 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js @@ -1,40 +1,40 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var link_1 = require('../mixins/link'); -var component_1 = require('../common/component'); -component_1.VantComponent({ - classes: [ - 'title-class', - 'label-class', - 'value-class', - 'right-icon-class', - 'hover-class', - ], - mixins: [link_1.link], - props: { - title: null, - value: null, - icon: String, - size: String, - label: String, - center: Boolean, - isLink: Boolean, - required: Boolean, - clickable: Boolean, - titleWidth: String, - customStyle: String, - arrowDirection: String, - useLabelSlot: Boolean, - border: { - type: Boolean, - value: true, - }, - titleStyle: String, - }, - methods: { - onClick: function (event) { - this.$emit('click', event.detail); - this.jumpLink(); - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var link_1 = require("../mixins/link"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + classes: [ + 'title-class', + 'label-class', + 'value-class', + 'right-icon-class', + 'hover-class', + ], + mixins: [link_1.link], + props: { + title: null, + value: null, + icon: String, + size: String, + label: String, + center: Boolean, + isLink: Boolean, + required: Boolean, + clickable: Boolean, + titleWidth: String, + customStyle: String, + arrowDirection: String, + useLabelSlot: Boolean, + border: { + type: Boolean, + value: true, + }, + titleStyle: String, + }, + methods: { + onClick: function (event) { + this.$emit('click', event.detail); + this.jumpLink(); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json index 8abfe20..0a336c0 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json @@ -1,6 +1,6 @@ -{ - "component": true, - "usingComponents": { - "van-icon": "../icon/index" - } -} +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml index dac1fbf..8387c3c 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml @@ -1,46 +1,47 @@ - - - - - - - - - {{ title }} - - - - - {{ label }} - - - - - {{ value }} - - - - - - - - + + + + + + + + + + {{ title }} + + + + + {{ label }} + + + + + {{ value }} + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs index 8bceeae..e3500c4 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs @@ -1,17 +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, -}; +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function titleStyle(data) { + return style([ + { + 'max-width': addUnit(data.titleWidth), + 'min-width': addUnit(data.titleWidth), + }, + data.titleStyle, + ]); +} + +module.exports = { + titleStyle: titleStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss index 605570d..1802f8e 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:4px;margin-right:var(--padding-base,4px)}.van-cell__right-icon-wrap{margin-left:4px;margin-left:var(--padding-base,4px);color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)} \ No newline at end of file +@import '../common/index.wxss';.van-cell{background-color:var(--cell-background-color,#fff);box-sizing:border-box;color:var(--cell-text-color,#323233);display:flex;font-size:var(--cell-font-size,14px);line-height:var(--cell-line-height,24px);padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);position:relative;width:100%}.van-cell:after{border-bottom:1px solid #ebedf0;bottom:0;box-sizing:border-box;content:" ";left:16px;pointer-events:none;position:absolute;right:16px;transform:scaleY(.5);transform-origin:center}.van-cell--borderless:after{display:none}.van-cell-group{background-color:var(--cell-background-color,#fff)}.van-cell__label{color:var(--cell-label-color,#969799);font-size:var(--cell-label-font-size,12px);line-height:var(--cell-label-line-height,18px);margin-top:var(--cell-label-margin-top,3px)}.van-cell__value{color:var(--cell-value-color,#969799);overflow:hidden;text-align:right;vertical-align:middle}.van-cell__title,.van-cell__value{flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{align-items:center;display:flex;font-size:var(--cell-icon-size,16px);height:var(--cell-line-height,24px)}.van-cell__left-icon-wrap{margin-right:var(--padding-base,4px)}.van-cell__right-icon-wrap{color:var(--cell-right-icon-color,#969799);margin-left:var(--padding-base,4px)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{color:var(--cell-required-color,#ee0a24);content:"*";font-size:var(--cell-font-size,14px);left:var(--padding-xs,8px);position:absolute}.van-cell--center{align-items:center}.van-cell--large{padding-bottom:var(--cell-large-vertical-padding,12px);padding-top:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:var(--cell-large-label-font-size,14px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js index 9836f09..80c93a1 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js @@ -1,38 +1,39 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var relation_1 = require('../common/relation'); -var component_1 = require('../common/component'); -component_1.VantComponent({ - field: true, - relation: relation_1.useChildren('checkbox', function (target) { - this.updateChild(target); - }), - props: { - max: Number, - value: { - type: Array, - observer: 'updateChildren', - }, - disabled: { - type: Boolean, - observer: 'updateChildren', - }, - }, - methods: { - updateChildren: function () { - var _this = this; - this.children.forEach(function (child) { - return _this.updateChild(child); - }); - }, - updateChild: function (child) { - var _a = this.data, - value = _a.value, - disabled = _a.disabled; - child.setData({ - value: value.indexOf(child.data.name) !== -1, - parentDisabled: disabled, - }); - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + field: true, + relation: (0, relation_1.useChildren)('checkbox', function (target) { + this.updateChild(target); + }), + props: { + max: Number, + value: { + type: Array, + observer: 'updateChildren', + }, + disabled: { + type: Boolean, + observer: 'updateChildren', + }, + direction: { + type: String, + value: 'vertical', + }, + }, + methods: { + updateChildren: function () { + var _this = this; + this.children.forEach(function (child) { return _this.updateChild(child); }); + }, + updateChild: function (child) { + var _a = this.data, value = _a.value, disabled = _a.disabled, direction = _a.direction; + child.setData({ + value: value.indexOf(child.data.name) !== -1, + parentDisabled: disabled, + direction: direction, + }); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml index a8f3249..638bf9d 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml @@ -1 +1,5 @@ - + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss index 99694d6..c5666d7 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss'; \ No newline at end of file +@import '../common/index.wxss';.van-checkbox-group--horizontal{display:flex;flex-wrap:wrap} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js index 93fc39a..6247365 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js @@ -1,83 +1,79 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var relation_1 = require('../common/relation'); -var component_1 = require('../common/component'); -function emit(target, value) { - target.$emit('input', value); - target.$emit('change', value); -} -component_1.VantComponent({ - field: true, - relation: relation_1.useParent('checkbox-group'), - classes: ['icon-class', 'label-class'], - props: { - value: Boolean, - disabled: Boolean, - useIconSlot: Boolean, - checkedColor: String, - labelPosition: { - type: String, - value: 'right', - }, - labelDisabled: Boolean, - shape: { - type: String, - value: 'round', - }, - iconSize: { - type: null, - value: 20, - }, - }, - data: { - parentDisabled: false, - }, - methods: { - emitChange: function (value) { - if (this.parent) { - this.setParentValue(this.parent, value); - } else { - emit(this, value); - } - }, - toggle: function () { - var _a = this.data, - parentDisabled = _a.parentDisabled, - disabled = _a.disabled, - value = _a.value; - if (!disabled && !parentDisabled) { - this.emitChange(!value); - } - }, - onClickLabel: function () { - var _a = this.data, - labelDisabled = _a.labelDisabled, - parentDisabled = _a.parentDisabled, - disabled = _a.disabled, - value = _a.value; - if (!disabled && !labelDisabled && !parentDisabled) { - this.emitChange(!value); - } - }, - setParentValue: function (parent, value) { - var parentValue = parent.data.value.slice(); - var name = this.data.name; - var max = parent.data.max; - if (value) { - if (max && parentValue.length >= max) { - return; - } - if (parentValue.indexOf(name) === -1) { - parentValue.push(name); - emit(parent, parentValue); - } - } else { - var index = parentValue.indexOf(name); - if (index !== -1) { - parentValue.splice(index, 1); - emit(parent, parentValue); - } - } - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +function emit(target, value) { + target.$emit('input', value); + target.$emit('change', value); +} +(0, component_1.VantComponent)({ + field: true, + relation: (0, relation_1.useParent)('checkbox-group'), + classes: ['icon-class', 'label-class'], + props: { + value: Boolean, + disabled: Boolean, + useIconSlot: Boolean, + checkedColor: String, + labelPosition: { + type: String, + value: 'right', + }, + labelDisabled: Boolean, + shape: { + type: String, + value: 'round', + }, + iconSize: { + type: null, + value: 20, + }, + }, + data: { + parentDisabled: false, + direction: 'vertical', + }, + methods: { + emitChange: function (value) { + if (this.parent) { + this.setParentValue(this.parent, value); + } + else { + emit(this, value); + } + }, + toggle: function () { + var _a = this.data, parentDisabled = _a.parentDisabled, disabled = _a.disabled, value = _a.value; + if (!disabled && !parentDisabled) { + this.emitChange(!value); + } + }, + onClickLabel: function () { + var _a = this.data, labelDisabled = _a.labelDisabled, parentDisabled = _a.parentDisabled, disabled = _a.disabled, value = _a.value; + if (!disabled && !labelDisabled && !parentDisabled) { + this.emitChange(!value); + } + }, + setParentValue: function (parent, value) { + var parentValue = parent.data.value.slice(); + var name = this.data.name; + var max = parent.data.max; + if (value) { + if (max && parentValue.length >= max) { + return; + } + if (parentValue.indexOf(name) === -1) { + parentValue.push(name); + emit(parent, parentValue); + } + } + else { + var index = parentValue.indexOf(name); + if (index !== -1) { + parentValue.splice(index, 1); + emit(parent, parentValue); + } + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json index 8abfe20..0a336c0 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json @@ -1,6 +1,6 @@ -{ - "component": true, - "usingComponents": { - "van-icon": "../icon/index" - } -} +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml index 4b3e8d3..39a7bb0 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml @@ -1,31 +1,31 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs index 6ae3d25..eb9c772 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs @@ -1,20 +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, -}; +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) { + var styles = { + 'font-size': addUnit(iconSize), + }; + + if (checkedColor && value && !disabled && !parentDisabled) { + styles['border-color'] = checkedColor; + styles['background-color'] = checkedColor; + } + + return style(styles); +} + +module.exports = { + iconStyle: iconStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss index afaf37b..da2272a 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0} \ No newline at end of file +@import '../common/index.wxss';.van-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox--horizontal{margin-right:12px}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{flex:none}.van-checkbox__icon{align-items:center;border:1px solid var(--checkbox-border-color,#c8c9cc);box-sizing:border-box;color:transparent;display:flex;font-size:var(--checkbox-size,20px);height:1em;justify-content:center;text-align:center;transition-duration:var(--checkbox-transition-duration,.2s);transition-property:color,border-color,background-color;width:1em}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:var(--checkbox-checked-icon-color,#1989fa);color:#fff}.van-checkbox__icon--disabled{background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;color:var(--checkbox-label-color,#323233);padding-left:var(--checkbox-label-margin,10px)}.van-checkbox__label--left{float:left;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js b/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js index 932a42a..d81df74 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js @@ -1,47 +1,47 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.adaptor = void 0; -function adaptor(ctx) { - // @ts-ignore - return Object.assign(ctx, { - setStrokeStyle: function (val) { - ctx.strokeStyle = val; - }, - setLineWidth: function (val) { - ctx.lineWidth = val; - }, - setLineCap: function (val) { - ctx.lineCap = val; - }, - setFillStyle: function (val) { - ctx.fillStyle = val; - }, - setFontSize: function (val) { - ctx.font = String(val); - }, - setGlobalAlpha: function (val) { - ctx.globalAlpha = val; - }, - setLineJoin: function (val) { - ctx.lineJoin = val; - }, - setTextAlign: function (val) { - ctx.textAlign = val; - }, - setMiterLimit: function (val) { - ctx.miterLimit = val; - }, - setShadow: function (offsetX, offsetY, blur, color) { - ctx.shadowOffsetX = offsetX; - ctx.shadowOffsetY = offsetY; - ctx.shadowBlur = blur; - ctx.shadowColor = color; - }, - setTextBaseline: function (val) { - ctx.textBaseline = val; - }, - createCircularGradient: function () {}, - draw: function () {}, - }); -} -exports.adaptor = adaptor; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.adaptor = void 0; +function adaptor(ctx) { + // @ts-ignore + return Object.assign(ctx, { + setStrokeStyle: function (val) { + ctx.strokeStyle = val; + }, + setLineWidth: function (val) { + ctx.lineWidth = val; + }, + setLineCap: function (val) { + ctx.lineCap = val; + }, + setFillStyle: function (val) { + ctx.fillStyle = val; + }, + setFontSize: function (val) { + ctx.font = String(val); + }, + setGlobalAlpha: function (val) { + ctx.globalAlpha = val; + }, + setLineJoin: function (val) { + ctx.lineJoin = val; + }, + setTextAlign: function (val) { + ctx.textAlign = val; + }, + setMiterLimit: function (val) { + ctx.miterLimit = val; + }, + setShadow: function (offsetX, offsetY, blur, color) { + ctx.shadowOffsetX = offsetX; + ctx.shadowOffsetY = offsetY; + ctx.shadowBlur = blur; + ctx.shadowColor = color; + }, + setTextBaseline: function (val) { + ctx.textBaseline = val; + }, + createCircularGradient: function () { }, + draw: function () { }, + }); +} +exports.adaptor = adaptor; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js index c3313ba..e131e4b 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js @@ -1,211 +1,207 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var color_1 = require('../common/color'); -var component_1 = require('../common/component'); -var utils_1 = require('../common/utils'); -var validator_1 = require('../common/validator'); -var version_1 = require('../common/version'); -var canvas_1 = require('./canvas'); -function format(rate) { - return Math.min(Math.max(rate, 0), 100); -} -var PERIMETER = 2 * Math.PI; -var BEGIN_ANGLE = -Math.PI / 2; -var STEP = 1; -component_1.VantComponent({ - props: { - text: String, - lineCap: { - type: String, - value: 'round', - }, - value: { - type: Number, - value: 0, - observer: 'reRender', - }, - speed: { - type: Number, - value: 50, - }, - size: { - type: Number, - value: 100, - observer: function () { - this.drawCircle(this.currentValue); - }, - }, - fill: String, - layerColor: { - type: String, - value: color_1.WHITE, - }, - color: { - type: null, - value: color_1.BLUE, - observer: function () { - var _this = this; - this.setHoverColor().then(function () { - _this.drawCircle(_this.currentValue); - }); - }, - }, - type: { - type: String, - value: '', - }, - strokeWidth: { - type: Number, - value: 4, - }, - clockwise: { - type: Boolean, - value: true, - }, - }, - data: { - hoverColor: color_1.BLUE, - }, - methods: { - getContext: function () { - var _this = this; - var _a = this.data, - type = _a.type, - size = _a.size; - if (type === '' || !version_1.canIUseCanvas2d()) { - var ctx = wx.createCanvasContext('van-circle', this); - return Promise.resolve(ctx); - } - var dpr = utils_1.getSystemInfoSync().pixelRatio; - return new Promise(function (resolve) { - wx.createSelectorQuery() - .in(_this) - .select('#van-circle') - .node() - .exec(function (res) { - var canvas = res[0].node; - var ctx = canvas.getContext(type); - if (!_this.inited) { - _this.inited = true; - canvas.width = size * dpr; - canvas.height = size * dpr; - ctx.scale(dpr, dpr); - } - resolve(canvas_1.adaptor(ctx)); - }); - }); - }, - setHoverColor: function () { - var _this = this; - var _a = this.data, - color = _a.color, - size = _a.size; - if (validator_1.isObj(color)) { - return this.getContext().then(function (context) { - var LinearColor = context.createLinearGradient(size, 0, 0, 0); - Object.keys(color) - .sort(function (a, b) { - return parseFloat(a) - parseFloat(b); - }) - .map(function (key) { - return LinearColor.addColorStop( - parseFloat(key) / 100, - color[key] - ); - }); - _this.hoverColor = LinearColor; - }); - } - this.hoverColor = color; - return Promise.resolve(); - }, - presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) { - var _a = this.data, - strokeWidth = _a.strokeWidth, - lineCap = _a.lineCap, - clockwise = _a.clockwise, - size = _a.size; - var position = size / 2; - var radius = position - strokeWidth / 2; - context.setStrokeStyle(strokeStyle); - context.setLineWidth(strokeWidth); - context.setLineCap(lineCap); - context.beginPath(); - context.arc(position, position, radius, beginAngle, endAngle, !clockwise); - context.stroke(); - if (fill) { - context.setFillStyle(fill); - context.fill(); - } - }, - renderLayerCircle: function (context) { - var _a = this.data, - layerColor = _a.layerColor, - fill = _a.fill; - this.presetCanvas(context, layerColor, 0, PERIMETER, fill); - }, - renderHoverCircle: function (context, formatValue) { - var clockwise = this.data.clockwise; - // 结束角度 - var progress = PERIMETER * (formatValue / 100); - var endAngle = clockwise - ? BEGIN_ANGLE + progress - : 3 * Math.PI - (BEGIN_ANGLE + progress); - this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle); - }, - drawCircle: function (currentValue) { - var _this = this; - var size = this.data.size; - this.getContext().then(function (context) { - context.clearRect(0, 0, size, size); - _this.renderLayerCircle(context); - var formatValue = format(currentValue); - if (formatValue !== 0) { - _this.renderHoverCircle(context, formatValue); - } - context.draw(); - }); - }, - reRender: function () { - var _this = this; - // tofector 动画暂时没有想到好的解决方案 - var _a = this.data, - value = _a.value, - speed = _a.speed; - if (speed <= 0 || speed > 1000) { - this.drawCircle(value); - return; - } - this.clearInterval(); - this.currentValue = this.currentValue || 0; - this.interval = setInterval(function () { - if (_this.currentValue !== value) { - if (_this.currentValue < value) { - _this.currentValue += STEP; - } else { - _this.currentValue -= STEP; - } - _this.drawCircle(_this.currentValue); - } else { - _this.clearInterval(); - } - }, 1000 / speed); - }, - clearInterval: function () { - if (this.interval) { - clearInterval(this.interval); - this.interval = null; - } - }, - }, - mounted: function () { - var _this = this; - this.currentValue = this.data.value; - this.setHoverColor().then(function () { - _this.drawCircle(_this.currentValue); - }); - }, - destroyed: function () { - this.clearInterval(); - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var color_1 = require("../common/color"); +var component_1 = require("../common/component"); +var utils_1 = require("../common/utils"); +var validator_1 = require("../common/validator"); +var version_1 = require("../common/version"); +var canvas_1 = require("./canvas"); +function format(rate) { + return Math.min(Math.max(rate, 0), 100); +} +var PERIMETER = 2 * Math.PI; +var BEGIN_ANGLE = -Math.PI / 2; +var STEP = 1; +(0, component_1.VantComponent)({ + props: { + text: String, + lineCap: { + type: String, + value: 'round', + }, + value: { + type: Number, + value: 0, + observer: 'reRender', + }, + speed: { + type: Number, + value: 50, + }, + size: { + type: Number, + value: 100, + observer: function () { + this.drawCircle(this.currentValue); + }, + }, + fill: String, + layerColor: { + type: String, + value: color_1.WHITE, + }, + color: { + type: null, + value: color_1.BLUE, + observer: function () { + var _this = this; + this.setHoverColor().then(function () { + _this.drawCircle(_this.currentValue); + }); + }, + }, + type: { + type: String, + value: '', + }, + strokeWidth: { + type: Number, + value: 4, + }, + clockwise: { + type: Boolean, + value: true, + }, + }, + data: { + hoverColor: color_1.BLUE, + }, + methods: { + getContext: function () { + var _this = this; + var _a = this.data, type = _a.type, size = _a.size; + if (type === '' || !(0, version_1.canIUseCanvas2d)()) { + var ctx = wx.createCanvasContext('van-circle', this); + return Promise.resolve(ctx); + } + var dpr = (0, utils_1.getSystemInfoSync)().pixelRatio; + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(_this) + .select('#van-circle') + .node() + .exec(function (res) { + var canvas = res[0].node; + var ctx = canvas.getContext(type); + if (!_this.inited) { + _this.inited = true; + canvas.width = size * dpr; + canvas.height = size * dpr; + ctx.scale(dpr, dpr); + } + resolve((0, canvas_1.adaptor)(ctx)); + }); + }); + }, + setHoverColor: function () { + var _this = this; + var _a = this.data, color = _a.color, size = _a.size; + if ((0, validator_1.isObj)(color)) { + return this.getContext().then(function (context) { + if (!context) + return; + var LinearColor = context.createLinearGradient(size, 0, 0, 0); + Object.keys(color) + .sort(function (a, b) { return parseFloat(a) - parseFloat(b); }) + .map(function (key) { + return LinearColor.addColorStop(parseFloat(key) / 100, color[key]); + }); + _this.hoverColor = LinearColor; + }); + } + this.hoverColor = color; + return Promise.resolve(); + }, + presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) { + var _a = this.data, strokeWidth = _a.strokeWidth, lineCap = _a.lineCap, clockwise = _a.clockwise, size = _a.size; + var position = size / 2; + var radius = position - strokeWidth / 2; + context.setStrokeStyle(strokeStyle); + context.setLineWidth(strokeWidth); + context.setLineCap(lineCap); + context.beginPath(); + context.arc(position, position, radius, beginAngle, endAngle, !clockwise); + context.stroke(); + if (fill) { + context.setFillStyle(fill); + context.fill(); + } + }, + renderLayerCircle: function (context) { + var _a = this.data, layerColor = _a.layerColor, fill = _a.fill; + this.presetCanvas(context, layerColor, 0, PERIMETER, fill); + }, + renderHoverCircle: function (context, formatValue) { + var clockwise = this.data.clockwise; + // 结束角度 + var progress = PERIMETER * (formatValue / 100); + var endAngle = clockwise + ? BEGIN_ANGLE + progress + : 3 * Math.PI - (BEGIN_ANGLE + progress); + this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle); + }, + drawCircle: function (currentValue) { + var _this = this; + var size = this.data.size; + this.getContext().then(function (context) { + if (!context) + return; + context.clearRect(0, 0, size, size); + _this.renderLayerCircle(context); + var formatValue = format(currentValue); + if (formatValue !== 0) { + _this.renderHoverCircle(context, formatValue); + } + context.draw(); + }); + }, + reRender: function () { + var _this = this; + // tofector 动画暂时没有想到好的解决方案 + var _a = this.data, value = _a.value, speed = _a.speed; + if (speed <= 0 || speed > 1000) { + this.drawCircle(value); + return; + } + this.clearMockInterval(); + this.currentValue = this.currentValue || 0; + var run = function () { + _this.interval = setTimeout(function () { + if (_this.currentValue !== value) { + if (Math.abs(_this.currentValue - value) < STEP) { + _this.currentValue = value; + } + else if (_this.currentValue < value) { + _this.currentValue += STEP; + } + else { + _this.currentValue -= STEP; + } + _this.drawCircle(_this.currentValue); + run(); + } + else { + _this.clearMockInterval(); + } + }, 1000 / speed); + }; + run(); + }, + clearMockInterval: function () { + if (this.interval) { + clearTimeout(this.interval); + this.interval = null; + } + }, + }, + mounted: function () { + var _this = this; + this.currentValue = this.data.value; + this.setHoverColor().then(function () { + _this.drawCircle(_this.currentValue); + }); + }, + destroyed: function () { + this.clearMockInterval(); + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml index 010ae1a..52bc59f 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml @@ -1,9 +1,9 @@ - - - - - - - - {{ text }} - + + + + + + + + {{ text }} + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss index 3ab63df..2200751 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-circle{position:relative;display:inline-block;text-align:center}.van-circle__text{position:absolute;top:50%;left:0;width:100%;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:#323233;color:var(--circle-text-color,#323233)} \ No newline at end of file +@import '../common/index.wxss';.van-circle{display:inline-block;position:relative;text-align:center}.van-circle__text{color:var(--circle-text-color,#323233);left:0;position:absolute;top:50%;transform:translateY(-50%);width:100%} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js index 47d89c7..63c56eb 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js @@ -1,11 +1,11 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var relation_1 = require('../common/relation'); -var component_1 = require('../common/component'); -component_1.VantComponent({ - relation: relation_1.useParent('row'), - props: { - span: Number, - offset: Number, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + relation: (0, relation_1.useParent)('row'), + props: { + span: Number, + offset: Number, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml index aa603b9..975348b 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml @@ -1,9 +1,9 @@ - - - - - - + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs index 2e65493..507c1cb 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs @@ -1,18 +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, -}; +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function rootStyle(data) { + if (!data.gutter) { + return ''; + } + + return style({ + 'padding-right': addUnit(data.gutter / 2), + 'padding-left': addUnit(data.gutter / 2), + }); +} + +module.exports = { + rootStyle: rootStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss index 44c896a..2fa265e 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} \ No newline at end of file +@import '../common/index.wxss';.van-col{box-sizing:border-box;float:left}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js index 255025c..5734087 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js @@ -1,77 +1,43 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.setContentAnimate = void 0; -var version_1 = require('../common/version'); -var utils_1 = require('../common/utils'); -function useAnimate(context, expanded, mounted, height) { - var selector = '.van-collapse-item__wrapper'; - if (expanded) { - context.animate( - selector, - [ - { height: 0, ease: 'ease-in-out', offset: 0 }, - { height: height + 'px', ease: 'ease-in-out', offset: 1 }, - { height: 'auto', ease: 'ease-in-out', offset: 1 }, - ], - mounted ? 300 : 0, - function () { - context.clearAnimation(selector); - } - ); - return; - } - context.animate( - selector, - [ - { height: height + 'px', ease: 'ease-in-out', offset: 0 }, - { height: 0, ease: 'ease-in-out', offset: 1 }, - ], - 300, - function () { - context.clearAnimation(selector); - } - ); -} -function useAnimation(context, expanded, mounted, height) { - var animation = wx.createAnimation({ - duration: 0, - timingFunction: 'ease-in-out', - }); - if (expanded) { - if (height === 0) { - animation.height('auto').top(1).step(); - } else { - animation - .height(height) - .top(1) - .step({ - duration: mounted ? 300 : 1, - }) - .height('auto') - .step(); - } - context.setData({ - animation: animation.export(), - }); - return; - } - animation.height(height).top(0).step({ duration: 1 }).height(0).step({ - duration: 300, - }); - context.setData({ - animation: animation.export(), - }); -} -function setContentAnimate(context, expanded, mounted) { - utils_1 - .getRect(context, '.van-collapse-item__content') - .then(function (rect) { - return rect.height; - }) - .then(function (height) { - version_1.canIUseAnimate() - ? useAnimate(context, expanded, mounted, height) - : useAnimation(context, expanded, mounted, height); - }); -} -exports.setContentAnimate = setContentAnimate; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setContentAnimate = void 0; +var utils_1 = require("../common/utils"); +function useAnimation(context, expanded, mounted, height) { + var animation = wx.createAnimation({ + duration: 0, + timingFunction: 'ease-in-out', + }); + if (expanded) { + if (height === 0) { + animation.height('auto').top(1).step(); + } + else { + animation + .height(height) + .top(1) + .step({ + duration: mounted ? 300 : 1, + }) + .height('auto') + .step(); + } + context.setData({ + animation: animation.export(), + }); + return; + } + animation.height(height).top(0).step({ duration: 1 }).height(0).step({ + duration: 300, + }); + context.setData({ + animation: animation.export(), + }); +} +function setContentAnimate(context, expanded, mounted) { + (0, utils_1.getRect)(context, '.van-collapse-item__content') + .then(function (rect) { return rect.height; }) + .then(function (height) { + useAnimation(context, expanded, mounted, height); + }); +} +exports.setContentAnimate = setContentAnimate; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js index 288ab82..982490e 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js @@ -1,68 +1,62 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var relation_1 = require('../common/relation'); -var animate_1 = require('./animate'); -component_1.VantComponent({ - classes: ['title-class', 'content-class'], - relation: relation_1.useParent('collapse'), - props: { - name: null, - title: null, - value: null, - icon: String, - label: String, - disabled: Boolean, - clickable: Boolean, - border: { - type: Boolean, - value: true, - }, - isLink: { - type: Boolean, - value: true, - }, - }, - data: { - expanded: false, - }, - mounted: function () { - this.updateExpanded(); - this.mounted = true; - }, - methods: { - updateExpanded: function () { - if (!this.parent) { - return; - } - var _a = this.parent.data, - value = _a.value, - accordion = _a.accordion; - var _b = this.parent.children, - children = _b === void 0 ? [] : _b; - var name = this.data.name; - var index = children.indexOf(this); - var currentName = name == null ? index : name; - var expanded = accordion - ? value === currentName - : (value || []).some(function (name) { - return name === currentName; - }); - if (expanded !== this.data.expanded) { - animate_1.setContentAnimate(this, expanded, this.mounted); - } - this.setData({ index: index, expanded: expanded }); - }, - onClick: function () { - if (this.data.disabled) { - return; - } - var _a = this.data, - name = _a.name, - expanded = _a.expanded; - var index = this.parent.children.indexOf(this); - var currentName = name == null ? index : name; - this.parent.switch(currentName, !expanded); - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var relation_1 = require("../common/relation"); +var animate_1 = require("./animate"); +(0, component_1.VantComponent)({ + classes: ['title-class', 'content-class'], + relation: (0, relation_1.useParent)('collapse'), + props: { + size: String, + name: null, + title: null, + value: null, + icon: String, + label: String, + disabled: Boolean, + clickable: Boolean, + border: { + type: Boolean, + value: true, + }, + isLink: { + type: Boolean, + value: true, + }, + }, + data: { + expanded: false, + }, + mounted: function () { + this.updateExpanded(); + this.mounted = true; + }, + methods: { + updateExpanded: function () { + if (!this.parent) { + return; + } + var _a = this.parent.data, value = _a.value, accordion = _a.accordion; + var _b = this.parent.children, children = _b === void 0 ? [] : _b; + var name = this.data.name; + var index = children.indexOf(this); + var currentName = name == null ? index : name; + var expanded = accordion + ? value === currentName + : (value || []).some(function (name) { return name === currentName; }); + if (expanded !== this.data.expanded) { + (0, animate_1.setContentAnimate)(this, expanded, this.mounted); + } + this.setData({ index: index, expanded: expanded }); + }, + onClick: function () { + if (this.data.disabled) { + return; + } + var _a = this.data, name = _a.name, expanded = _a.expanded; + var index = this.parent.children.indexOf(this); + var currentName = name == null ? index : name; + this.parent.switch(currentName, !expanded); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json index 7069216..0e5425c 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json @@ -1,6 +1,6 @@ -{ - "component": true, - "usingComponents": { - "van-cell": "../cell/index" - } -} +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml index 94705ff..f11d0d4 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml @@ -1,44 +1,45 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss index 0bb936c..4a65b5a 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)} \ No newline at end of file +@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{transform:rotate(90deg);transition:transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{background-color:var(--collapse-item-content-background-color,#fff);color:var(--collapse-item-content-text-color,#969799);font-size:var(--collapse-item-content-font-size,13px);line-height:var(--collapse-item-content-line-height,1.5);padding:var(--collapse-item-content-padding,15px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js index 3d90fb3..943d542 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js @@ -1,50 +1,48 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var relation_1 = require('../common/relation'); -component_1.VantComponent({ - relation: relation_1.useChildren('collapse-item'), - props: { - value: { - type: null, - observer: 'updateExpanded', - }, - accordion: { - type: Boolean, - observer: 'updateExpanded', - }, - border: { - type: Boolean, - value: true, - }, - }, - methods: { - updateExpanded: function () { - this.children.forEach(function (child) { - child.updateExpanded(); - }); - }, - switch: function (name, expanded) { - var _a = this.data, - accordion = _a.accordion, - value = _a.value; - var changeItem = name; - if (!accordion) { - name = expanded - ? (value || []).concat(name) - : (value || []).filter(function (activeName) { - return activeName !== name; - }); - } else { - name = expanded ? name : ''; - } - if (expanded) { - this.$emit('open', changeItem); - } else { - this.$emit('close', changeItem); - } - this.$emit('change', name); - this.$emit('input', name); - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var relation_1 = require("../common/relation"); +(0, component_1.VantComponent)({ + relation: (0, relation_1.useChildren)('collapse-item'), + props: { + value: { + type: null, + observer: 'updateExpanded', + }, + accordion: { + type: Boolean, + observer: 'updateExpanded', + }, + border: { + type: Boolean, + value: true, + }, + }, + methods: { + updateExpanded: function () { + this.children.forEach(function (child) { + child.updateExpanded(); + }); + }, + switch: function (name, expanded) { + var _a = this.data, accordion = _a.accordion, value = _a.value; + var changeItem = name; + if (!accordion) { + name = expanded + ? (value || []).concat(name) + : (value || []).filter(function (activeName) { return activeName !== name; }); + } + else { + name = expanded ? name : ''; + } + if (expanded) { + this.$emit('open', changeItem); + } + else { + this.$emit('close', changeItem); + } + this.$emit('change', name); + this.$emit('input', name); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml index f689405..fd4e171 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml @@ -1,3 +1,3 @@ - - - + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js index 11be12a..008a45a 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js @@ -1,10 +1,10 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.GRAY_DARK = exports.GRAY = exports.ORANGE = exports.GREEN = exports.WHITE = exports.BLUE = exports.RED = void 0; -exports.RED = '#ee0a24'; -exports.BLUE = '#1989fa'; -exports.WHITE = '#fff'; -exports.GREEN = '#07c160'; -exports.ORANGE = '#ff976a'; -exports.GRAY = '#323233'; -exports.GRAY_DARK = '#969799'; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GRAY_DARK = exports.GRAY = exports.ORANGE = exports.GREEN = exports.WHITE = exports.BLUE = exports.RED = void 0; +exports.RED = '#ee0a24'; +exports.BLUE = '#1989fa'; +exports.WHITE = '#fff'; +exports.GREEN = '#07c160'; +exports.ORANGE = '#ff976a'; +exports.GRAY = '#323233'; +exports.GRAY_DARK = '#969799'; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js index 6401bad..66da00e 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js @@ -1,48 +1,49 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.VantComponent = void 0; -var basic_1 = require('../mixins/basic'); -function mapKeys(source, target, map) { - Object.keys(map).forEach(function (key) { - if (source[key]) { - target[map[key]] = source[key]; - } - }); -} -function VantComponent(vantOptions) { - var options = {}; - mapKeys(vantOptions, options, { - data: 'data', - props: 'properties', - mixins: 'behaviors', - methods: 'methods', - beforeCreate: 'created', - created: 'attached', - mounted: 'ready', - destroyed: 'detached', - classes: 'externalClasses', - }); - // add default externalClasses - options.externalClasses = options.externalClasses || []; - options.externalClasses.push('custom-class'); - // add default behaviors - options.behaviors = options.behaviors || []; - options.behaviors.push(basic_1.basic); - // add relations - var relation = vantOptions.relation; - if (relation) { - options.relations = relation.relations; - options.behaviors.push(relation.mixin); - } - // map field to form-field behavior - if (vantOptions.field) { - options.behaviors.push('wx://form-field'); - } - // add default options - options.options = { - multipleSlots: true, - addGlobalClass: true, - }; - Component(options); -} -exports.VantComponent = VantComponent; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VantComponent = void 0; +var basic_1 = require("../mixins/basic"); +function mapKeys(source, target, map) { + Object.keys(map).forEach(function (key) { + if (source[key]) { + target[map[key]] = source[key]; + } + }); +} +function VantComponent(vantOptions) { + var options = {}; + mapKeys(vantOptions, options, { + data: 'data', + props: 'properties', + watch: 'observers', + mixins: 'behaviors', + methods: 'methods', + beforeCreate: 'created', + created: 'attached', + mounted: 'ready', + destroyed: 'detached', + classes: 'externalClasses', + }); + // add default externalClasses + options.externalClasses = options.externalClasses || []; + options.externalClasses.push('custom-class'); + // add default behaviors + options.behaviors = options.behaviors || []; + options.behaviors.push(basic_1.basic); + // add relations + var relation = vantOptions.relation; + if (relation) { + options.relations = relation.relations; + options.behaviors.push(relation.mixin); + } + // map field to form-field behavior + if (vantOptions.field) { + options.behaviors.push('wx://form-field'); + } + // add default options + options.options = { + multipleSlots: true, + addGlobalClass: true, + }; + Component(options); +} +exports.VantComponent = VantComponent; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss index 976825d..a73bb7a 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss @@ -1 +1 @@ -.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file +.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{clear:both;content:"";display:table}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js index a7372bc..008256c 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js @@ -1,79 +1,65 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.useChildren = exports.useParent = void 0; -function useParent(name, onEffect) { - var _a; - var path = '../' + name + '/index'; - return { - relations: - ((_a = {}), - (_a[path] = { - type: 'ancestor', - linked: function () { - onEffect && onEffect.call(this); - }, - linkChanged: function () { - onEffect && onEffect.call(this); - }, - unlinked: function () { - onEffect && onEffect.call(this); - }, - }), - _a), - mixin: Behavior({ - created: function () { - var _this = this; - Object.defineProperty(this, 'parent', { - get: function () { - return _this.getRelationNodes(path)[0]; - }, - }); - Object.defineProperty(this, 'index', { - // @ts-ignore - get: function () { - var _a, _b; - return (_b = - (_a = _this.parent) === null || _a === void 0 - ? void 0 - : _a.children) === null || _b === void 0 - ? void 0 - : _b.indexOf(_this); - }, - }); - }, - }), - }; -} -exports.useParent = useParent; -function useChildren(name, onEffect) { - var _a; - var path = '../' + name + '/index'; - return { - relations: - ((_a = {}), - (_a[path] = { - type: 'descendant', - linked: function (target) { - onEffect && onEffect.call(this, target); - }, - linkChanged: function (target) { - onEffect && onEffect.call(this, target); - }, - unlinked: function (target) { - onEffect && onEffect.call(this, target); - }, - }), - _a), - mixin: Behavior({ - created: function () { - var _this = this; - Object.defineProperty(this, 'children', { - get: function () { - return _this.getRelationNodes(path) || []; - }, - }); - }, - }), - }; -} -exports.useChildren = useChildren; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useChildren = exports.useParent = void 0; +function useParent(name, onEffect) { + var _a; + var path = "../".concat(name, "/index"); + return { + relations: (_a = {}, + _a[path] = { + type: 'ancestor', + linked: function () { + onEffect && onEffect.call(this); + }, + linkChanged: function () { + onEffect && onEffect.call(this); + }, + unlinked: function () { + onEffect && onEffect.call(this); + }, + }, + _a), + mixin: Behavior({ + created: function () { + var _this = this; + Object.defineProperty(this, 'parent', { + get: function () { return _this.getRelationNodes(path)[0]; }, + }); + Object.defineProperty(this, 'index', { + // @ts-ignore + get: function () { var _a, _b; return (_b = (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.indexOf(_this); }, + }); + }, + }), + }; +} +exports.useParent = useParent; +function useChildren(name, onEffect) { + var _a; + var path = "../".concat(name, "/index"); + return { + relations: (_a = {}, + _a[path] = { + type: 'descendant', + linked: function (target) { + onEffect && onEffect.call(this, target); + }, + linkChanged: function (target) { + onEffect && onEffect.call(this, target); + }, + unlinked: function (target) { + onEffect && onEffect.call(this, target); + }, + }, + _a), + mixin: Behavior({ + created: function () { + var _this = this; + Object.defineProperty(this, 'children', { + get: function () { return _this.getRelationNodes(path) || []; }, + }); + }, + }), + }; +} +exports.useChildren = useChildren; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss index a0ca838..442246f 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss @@ -1 +1 @@ -.van-clearfix:after{display:table;clear:both;content:""} \ No newline at end of file +.van-clearfix:after{clear:both;content:"";display:table} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss index 1e9dbc9..ee701df 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss @@ -1 +1 @@ -.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3} \ No newline at end of file +.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss index 49b9e65..f7c6260 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss @@ -1 +1 @@ -.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file +.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/theme.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/theme.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js index 6f44506..80fb803 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js @@ -1,113 +1,107 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.getCurrentPage = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.getSystemInfoSync = exports.nextTick = exports.range = void 0; -var validator_1 = require('./validator'); -var version_1 = require('./version'); -function range(num, min, max) { - return Math.min(Math.max(num, min), max); -} -exports.range = range; -function nextTick(cb) { - if (version_1.canIUseNextTick()) { - wx.nextTick(cb); - } else { - setTimeout(function () { - cb(); - }, 1000 / 30); - } -} -exports.nextTick = nextTick; -var systemInfo; -function getSystemInfoSync() { - if (systemInfo == null) { - systemInfo = wx.getSystemInfoSync(); - } - return systemInfo; -} -exports.getSystemInfoSync = getSystemInfoSync; -function addUnit(value) { - if (!validator_1.isDef(value)) { - return undefined; - } - value = String(value); - return validator_1.isNumber(value) ? value + 'px' : value; -} -exports.addUnit = addUnit; -function requestAnimationFrame(cb) { - var systemInfo = getSystemInfoSync(); - if (systemInfo.platform === 'devtools') { - return setTimeout(function () { - cb(); - }, 1000 / 30); - } - return wx - .createSelectorQuery() - .selectViewport() - .boundingClientRect() - .exec(function () { - cb(); - }); -} -exports.requestAnimationFrame = requestAnimationFrame; -function pickExclude(obj, keys) { - if (!validator_1.isPlainObject(obj)) { - return {}; - } - return Object.keys(obj).reduce(function (prev, key) { - if (!keys.includes(key)) { - prev[key] = obj[key]; - } - return prev; - }, {}); -} -exports.pickExclude = pickExclude; -function getRect(context, selector) { - return new Promise(function (resolve) { - wx.createSelectorQuery() - .in(context) - .select(selector) - .boundingClientRect() - .exec(function (rect) { - if (rect === void 0) { - rect = []; - } - return resolve(rect[0]); - }); - }); -} -exports.getRect = getRect; -function getAllRect(context, selector) { - return new Promise(function (resolve) { - wx.createSelectorQuery() - .in(context) - .selectAll(selector) - .boundingClientRect() - .exec(function (rect) { - if (rect === void 0) { - rect = []; - } - return resolve(rect[0]); - }); - }); -} -exports.getAllRect = getAllRect; -function groupSetData(context, cb) { - if (version_1.canIUseGroupSetData()) { - context.groupSetData(cb); - } else { - cb(); - } -} -exports.groupSetData = groupSetData; -function toPromise(promiseLike) { - if (validator_1.isPromise(promiseLike)) { - return promiseLike; - } - return Promise.resolve(promiseLike); -} -exports.toPromise = toPromise; -function getCurrentPage() { - var pages = getCurrentPages(); - return pages[pages.length - 1]; -} -exports.getCurrentPage = getCurrentPage; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0; +var validator_1 = require("./validator"); +var version_1 = require("./version"); +var validator_2 = require("./validator"); +Object.defineProperty(exports, "isDef", { enumerable: true, get: function () { return validator_2.isDef; } }); +var version_2 = require("./version"); +Object.defineProperty(exports, "getSystemInfoSync", { enumerable: true, get: function () { return version_2.getSystemInfoSync; } }); +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +exports.range = range; +function nextTick(cb) { + if ((0, version_1.canIUseNextTick)()) { + wx.nextTick(cb); + } + else { + setTimeout(function () { + cb(); + }, 1000 / 30); + } +} +exports.nextTick = nextTick; +function addUnit(value) { + if (!(0, validator_1.isDef)(value)) { + return undefined; + } + value = String(value); + return (0, validator_1.isNumber)(value) ? "".concat(value, "px") : value; +} +exports.addUnit = addUnit; +function requestAnimationFrame(cb) { + return setTimeout(function () { + cb(); + }, 1000 / 30); +} +exports.requestAnimationFrame = requestAnimationFrame; +function pickExclude(obj, keys) { + if (!(0, validator_1.isPlainObject)(obj)) { + return {}; + } + return Object.keys(obj).reduce(function (prev, key) { + if (!keys.includes(key)) { + prev[key] = obj[key]; + } + return prev; + }, {}); +} +exports.pickExclude = pickExclude; +function getRect(context, selector) { + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(context) + .select(selector) + .boundingClientRect() + .exec(function (rect) { + if (rect === void 0) { rect = []; } + return resolve(rect[0]); + }); + }); +} +exports.getRect = getRect; +function getAllRect(context, selector) { + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(context) + .selectAll(selector) + .boundingClientRect() + .exec(function (rect) { + if (rect === void 0) { rect = []; } + return resolve(rect[0]); + }); + }); +} +exports.getAllRect = getAllRect; +function groupSetData(context, cb) { + if ((0, version_1.canIUseGroupSetData)()) { + context.groupSetData(cb); + } + else { + cb(); + } +} +exports.groupSetData = groupSetData; +function toPromise(promiseLike) { + if ((0, validator_1.isPromise)(promiseLike)) { + return promiseLike; + } + return Promise.resolve(promiseLike); +} +exports.toPromise = toPromise; +// 浮点数精度处理 +function addNumber(num1, num2) { + var cardinal = Math.pow(10, 10); + return Math.round((num1 + num2) * cardinal) / cardinal; +} +exports.addNumber = addNumber; +// 限制value在[min, max]之间 +var clamp = function (num, min, max) { return Math.min(Math.max(num, min), max); }; +exports.clamp = clamp; +function getCurrentPage() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +exports.getCurrentPage = getCurrentPage; +exports.isPC = ['mac', 'windows'].includes((0, version_1.getSystemInfoSync)().platform); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js index e61af2c..169e796 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js @@ -1,42 +1,43 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.isVideoUrl = exports.isImageUrl = exports.isBoolean = exports.isNumber = exports.isObj = exports.isDef = exports.isPromise = exports.isPlainObject = exports.isFunction = void 0; -function isFunction(val) { - return typeof val === 'function'; -} -exports.isFunction = isFunction; -function isPlainObject(val) { - return val !== null && typeof val === 'object' && !Array.isArray(val); -} -exports.isPlainObject = isPlainObject; -function isPromise(val) { - return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch); -} -exports.isPromise = isPromise; -function isDef(value) { - return value !== undefined && value !== null; -} -exports.isDef = isDef; -function isObj(x) { - var type = typeof x; - return x !== null && (type === 'object' || type === 'function'); -} -exports.isObj = isObj; -function isNumber(value) { - return /^\d+(\.\d+)?$/.test(value); -} -exports.isNumber = isNumber; -function isBoolean(value) { - return typeof value === 'boolean'; -} -exports.isBoolean = isBoolean; -var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; -var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i; -function isImageUrl(url) { - return IMAGE_REGEXP.test(url); -} -exports.isImageUrl = isImageUrl; -function isVideoUrl(url) { - return VIDEO_REGEXP.test(url); -} -exports.isVideoUrl = isVideoUrl; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isVideoUrl = exports.isImageUrl = exports.isBoolean = exports.isNumber = exports.isObj = exports.isDef = exports.isPromise = exports.isPlainObject = exports.isFunction = void 0; +// eslint-disable-next-line @typescript-eslint/ban-types +function isFunction(val) { + return typeof val === 'function'; +} +exports.isFunction = isFunction; +function isPlainObject(val) { + return val !== null && typeof val === 'object' && !Array.isArray(val); +} +exports.isPlainObject = isPlainObject; +function isPromise(val) { + return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch); +} +exports.isPromise = isPromise; +function isDef(value) { + return value !== undefined && value !== null; +} +exports.isDef = isDef; +function isObj(x) { + var type = typeof x; + return x !== null && (type === 'object' || type === 'function'); +} +exports.isObj = isObj; +function isNumber(value) { + return /^\d+(\.\d+)?$/.test(value); +} +exports.isNumber = isNumber; +function isBoolean(value) { + return typeof value === 'boolean'; +} +exports.isBoolean = isBoolean; +var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; +var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i; +function isImageUrl(url) { + return IMAGE_REGEXP.test(url); +} +exports.isImageUrl = isImageUrl; +function isVideoUrl(url) { + return VIDEO_REGEXP.test(url); +} +exports.isVideoUrl = isVideoUrl; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js index 3a5d837..5937008 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js @@ -1,54 +1,70 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.canIUseCanvas2d = exports.canIUseNextTick = exports.canIUseGroupSetData = exports.canIUseAnimate = exports.canIUseFormFieldButton = exports.canIUseModel = void 0; -var utils_1 = require('./utils'); -function compareVersion(v1, v2) { - v1 = v1.split('.'); - v2 = v2.split('.'); - var len = Math.max(v1.length, v2.length); - while (v1.length < len) { - v1.push('0'); - } - while (v2.length < len) { - v2.push('0'); - } - for (var i = 0; i < len; i++) { - var num1 = parseInt(v1[i], 10); - var num2 = parseInt(v2[i], 10); - if (num1 > num2) { - return 1; - } - if (num1 < num2) { - return -1; - } - } - return 0; -} -function gte(version) { - var system = utils_1.getSystemInfoSync(); - return compareVersion(system.SDKVersion, version) >= 0; -} -function canIUseModel() { - return gte('2.9.3'); -} -exports.canIUseModel = canIUseModel; -function canIUseFormFieldButton() { - return gte('2.10.3'); -} -exports.canIUseFormFieldButton = canIUseFormFieldButton; -function canIUseAnimate() { - return gte('2.9.0'); -} -exports.canIUseAnimate = canIUseAnimate; -function canIUseGroupSetData() { - return gte('2.4.0'); -} -exports.canIUseGroupSetData = canIUseGroupSetData; -function canIUseNextTick() { - return wx.canIUse('nextTick'); -} -exports.canIUseNextTick = canIUseNextTick; -function canIUseCanvas2d() { - return gte('2.9.0'); -} -exports.canIUseCanvas2d = canIUseCanvas2d; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.canIUseGetUserProfile = exports.canIUseCanvas2d = exports.canIUseNextTick = exports.canIUseGroupSetData = exports.canIUseAnimate = exports.canIUseFormFieldButton = exports.canIUseModel = exports.getSystemInfoSync = void 0; +var systemInfo; +function getSystemInfoSync() { + if (systemInfo == null) { + systemInfo = wx.getSystemInfoSync(); + } + return systemInfo; +} +exports.getSystemInfoSync = getSystemInfoSync; +function compareVersion(v1, v2) { + v1 = v1.split('.'); + v2 = v2.split('.'); + var len = Math.max(v1.length, v2.length); + while (v1.length < len) { + v1.push('0'); + } + while (v2.length < len) { + v2.push('0'); + } + for (var i = 0; i < len; i++) { + var num1 = parseInt(v1[i], 10); + var num2 = parseInt(v2[i], 10); + if (num1 > num2) { + return 1; + } + if (num1 < num2) { + return -1; + } + } + return 0; +} +function gte(version) { + var system = getSystemInfoSync(); + return compareVersion(system.SDKVersion, version) >= 0; +} +function canIUseModel() { + return gte('2.9.3'); +} +exports.canIUseModel = canIUseModel; +function canIUseFormFieldButton() { + return gte('2.10.3'); +} +exports.canIUseFormFieldButton = canIUseFormFieldButton; +function canIUseAnimate() { + return gte('2.9.0'); +} +exports.canIUseAnimate = canIUseAnimate; +function canIUseGroupSetData() { + return gte('2.4.0'); +} +exports.canIUseGroupSetData = canIUseGroupSetData; +function canIUseNextTick() { + try { + return wx.canIUse('nextTick'); + } + catch (e) { + return gte('2.7.1'); + } +} +exports.canIUseNextTick = canIUseNextTick; +function canIUseCanvas2d() { + return gte('2.9.0'); +} +exports.canIUseCanvas2d = canIUseCanvas2d; +function canIUseGetUserProfile() { + return !!wx.getUserProfile; +} +exports.canIUseGetUserProfile = canIUseGetUserProfile; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js index f88ea09..afc780b 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js @@ -1,103 +1,104 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var utils_1 = require('./utils'); -function simpleTick(fn) { - return setTimeout(fn, 30); -} -component_1.VantComponent({ - props: { - useSlot: Boolean, - millisecond: Boolean, - time: { - type: Number, - observer: 'reset', - }, - format: { - type: String, - value: 'HH:mm:ss', - }, - autoStart: { - type: Boolean, - value: true, - }, - }, - data: { - timeData: utils_1.parseTimeData(0), - formattedTime: '0', - }, - destroyed: function () { - clearTimeout(this.tid); - this.tid = null; - }, - methods: { - // 开始 - start: function () { - if (this.counting) { - return; - } - this.counting = true; - this.endTime = Date.now() + this.remain; - this.tick(); - }, - // 暂停 - pause: function () { - this.counting = false; - clearTimeout(this.tid); - }, - // 重置 - reset: function () { - this.pause(); - this.remain = this.data.time; - this.setRemain(this.remain); - if (this.data.autoStart) { - this.start(); - } - }, - tick: function () { - if (this.data.millisecond) { - this.microTick(); - } else { - this.macroTick(); - } - }, - microTick: function () { - var _this = this; - this.tid = simpleTick(function () { - _this.setRemain(_this.getRemain()); - if (_this.remain !== 0) { - _this.microTick(); - } - }); - }, - macroTick: function () { - var _this = this; - this.tid = simpleTick(function () { - var remain = _this.getRemain(); - if (!utils_1.isSameSecond(remain, _this.remain) || remain === 0) { - _this.setRemain(remain); - } - if (_this.remain !== 0) { - _this.macroTick(); - } - }); - }, - getRemain: function () { - return Math.max(this.endTime - Date.now(), 0); - }, - setRemain: function (remain) { - this.remain = remain; - var timeData = utils_1.parseTimeData(remain); - if (this.data.useSlot) { - this.$emit('change', timeData); - } - this.setData({ - formattedTime: utils_1.parseFormat(this.data.format, timeData), - }); - if (remain === 0) { - this.pause(); - this.$emit('finish'); - } - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var utils_1 = require("./utils"); +function simpleTick(fn) { + return setTimeout(fn, 30); +} +(0, component_1.VantComponent)({ + props: { + useSlot: Boolean, + millisecond: Boolean, + time: { + type: Number, + observer: 'reset', + }, + format: { + type: String, + value: 'HH:mm:ss', + }, + autoStart: { + type: Boolean, + value: true, + }, + }, + data: { + timeData: (0, utils_1.parseTimeData)(0), + formattedTime: '0', + }, + destroyed: function () { + clearTimeout(this.tid); + this.tid = null; + }, + methods: { + // 开始 + start: function () { + if (this.counting) { + return; + } + this.counting = true; + this.endTime = Date.now() + this.remain; + this.tick(); + }, + // 暂停 + pause: function () { + this.counting = false; + clearTimeout(this.tid); + }, + // 重置 + reset: function () { + this.pause(); + this.remain = this.data.time; + this.setRemain(this.remain); + if (this.data.autoStart) { + this.start(); + } + }, + tick: function () { + if (this.data.millisecond) { + this.microTick(); + } + else { + this.macroTick(); + } + }, + microTick: function () { + var _this = this; + this.tid = simpleTick(function () { + _this.setRemain(_this.getRemain()); + if (_this.remain !== 0) { + _this.microTick(); + } + }); + }, + macroTick: function () { + var _this = this; + this.tid = simpleTick(function () { + var remain = _this.getRemain(); + if (!(0, utils_1.isSameSecond)(remain, _this.remain) || remain === 0) { + _this.setRemain(remain); + } + if (_this.remain !== 0) { + _this.macroTick(); + } + }); + }, + getRemain: function () { + return Math.max(this.endTime - Date.now(), 0); + }, + setRemain: function (remain) { + this.remain = remain; + var timeData = (0, utils_1.parseTimeData)(remain); + if (this.data.useSlot) { + this.$emit('change', timeData); + } + this.setData({ + formattedTime: (0, utils_1.parseFormat)(this.data.format, timeData), + }); + if (remain === 0) { + this.pause(); + this.$emit('finish'); + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml index 49c4db2..e206e16 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml @@ -1,4 +1,4 @@ - - - {{ formattedTime }} - + + + {{ formattedTime }} + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss index bc33f5d..8b957f7 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-count-down{color:#323233;color:var(--count-down-text-color,#323233);font-size:14px;font-size:var(--count-down-font-size,14px);line-height:20px;line-height:var(--count-down-line-height,20px)} \ No newline at end of file +@import '../common/index.wxss';.van-count-down{color:var(--count-down-text-color,#323233);font-size:var(--count-down-font-size,14px);line-height:var(--count-down-line-height,20px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js index ef6f982..a7cfa5f 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js @@ -1,65 +1,64 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.isSameSecond = exports.parseFormat = exports.parseTimeData = void 0; -function padZero(num, targetLength) { - if (targetLength === void 0) { - targetLength = 2; - } - var str = num + ''; - while (str.length < targetLength) { - str = '0' + str; - } - return str; -} -var SECOND = 1000; -var MINUTE = 60 * SECOND; -var HOUR = 60 * MINUTE; -var DAY = 24 * HOUR; -function parseTimeData(time) { - var days = Math.floor(time / DAY); - var hours = Math.floor((time % DAY) / HOUR); - var minutes = Math.floor((time % HOUR) / MINUTE); - var seconds = Math.floor((time % MINUTE) / SECOND); - var milliseconds = Math.floor(time % SECOND); - return { - days: days, - hours: hours, - minutes: minutes, - seconds: seconds, - milliseconds: milliseconds, - }; -} -exports.parseTimeData = parseTimeData; -function parseFormat(format, timeData) { - var days = timeData.days; - var hours = timeData.hours, - minutes = timeData.minutes, - seconds = timeData.seconds, - milliseconds = timeData.milliseconds; - if (format.indexOf('DD') === -1) { - hours += days * 24; - } else { - format = format.replace('DD', padZero(days)); - } - if (format.indexOf('HH') === -1) { - minutes += hours * 60; - } else { - format = format.replace('HH', padZero(hours)); - } - if (format.indexOf('mm') === -1) { - seconds += minutes * 60; - } else { - format = format.replace('mm', padZero(minutes)); - } - if (format.indexOf('ss') === -1) { - milliseconds += seconds * 1000; - } else { - format = format.replace('ss', padZero(seconds)); - } - return format.replace('SSS', padZero(milliseconds, 3)); -} -exports.parseFormat = parseFormat; -function isSameSecond(time1, time2) { - return Math.floor(time1 / 1000) === Math.floor(time2 / 1000); -} -exports.isSameSecond = isSameSecond; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSameSecond = exports.parseFormat = exports.parseTimeData = void 0; +function padZero(num, targetLength) { + if (targetLength === void 0) { targetLength = 2; } + var str = num + ''; + while (str.length < targetLength) { + str = '0' + str; + } + return str; +} +var SECOND = 1000; +var MINUTE = 60 * SECOND; +var HOUR = 60 * MINUTE; +var DAY = 24 * HOUR; +function parseTimeData(time) { + var days = Math.floor(time / DAY); + var hours = Math.floor((time % DAY) / HOUR); + var minutes = Math.floor((time % HOUR) / MINUTE); + var seconds = Math.floor((time % MINUTE) / SECOND); + var milliseconds = Math.floor(time % SECOND); + return { + days: days, + hours: hours, + minutes: minutes, + seconds: seconds, + milliseconds: milliseconds, + }; +} +exports.parseTimeData = parseTimeData; +function parseFormat(format, timeData) { + var days = timeData.days; + var hours = timeData.hours, minutes = timeData.minutes, seconds = timeData.seconds, milliseconds = timeData.milliseconds; + if (format.indexOf('DD') === -1) { + hours += days * 24; + } + else { + format = format.replace('DD', padZero(days)); + } + if (format.indexOf('HH') === -1) { + minutes += hours * 60; + } + else { + format = format.replace('HH', padZero(hours)); + } + if (format.indexOf('mm') === -1) { + seconds += minutes * 60; + } + else { + format = format.replace('mm', padZero(minutes)); + } + if (format.indexOf('ss') === -1) { + milliseconds += seconds * 1000; + } + else { + format = format.replace('ss', padZero(seconds)); + } + return format.replace('SSS', padZero(milliseconds, 3)); +} +exports.parseFormat = parseFormat; +function isSameSecond(time1, time2) { + return Math.floor(time1 / 1000) === Math.floor(time2 / 1000); +} +exports.isSameSecond = isSameSecond; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js index 6e119f2..e30afef 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js @@ -1,381 +1,329 @@ -'use strict'; -var __assign = - (this && this.__assign) || - function () { - __assign = - Object.assign || - function (t) { +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; } return t; - }; + }; return __assign.apply(this, arguments); - }; -var __spreadArrays = - (this && this.__spreadArrays) || - function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var validator_1 = require('../common/validator'); -var shared_1 = require('../picker/shared'); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var validator_1 = require("../common/validator"); +var shared_1 = require("../picker/shared"); var currentYear = new Date().getFullYear(); function isValidDate(date) { - return validator_1.isDef(date) && !isNaN(new Date(date).getTime()); + return (0, validator_1.isDef)(date) && !isNaN(new Date(date).getTime()); } function range(num, min, max) { - return Math.min(Math.max(num, min), max); + return Math.min(Math.max(num, min), max); } function padZero(val) { - return ('00' + val).slice(-2); + return "00".concat(val).slice(-2); } function times(n, iteratee) { - var index = -1; - var result = Array(n < 0 ? 0 : n); - while (++index < n) { - result[index] = iteratee(index); - } - return result; + var index = -1; + var result = Array(n < 0 ? 0 : n); + while (++index < n) { + result[index] = iteratee(index); + } + return result; } function getTrueValue(formattedValue) { - if (formattedValue === undefined) { - formattedValue = '1'; - } - while (isNaN(parseInt(formattedValue, 10))) { - formattedValue = formattedValue.slice(1); - } - return parseInt(formattedValue, 10); + 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(); + return 32 - new Date(year, month - 1, 32).getDate(); } -var defaultFormatter = function (type, value) { - return value; -}; -component_1.VantComponent({ - classes: ['active-class', 'toolbar-class', 'column-class'], - props: __assign(__assign({}, shared_1.pickerProps), { - value: { - type: null, - observer: 'updateValue', - }, - filter: null, - type: { - type: String, - value: 'datetime', - observer: 'updateValue', - }, - showToolbar: { - type: Boolean, - value: true, - }, - formatter: { - type: null, - value: defaultFormatter, - }, - minDate: { - type: Number, - value: new Date(currentYear - 10, 0, 1).getTime(), - observer: 'updateValue', - }, - maxDate: { - type: Number, - value: new Date(currentYear + 10, 11, 31).getTime(), - observer: 'updateValue', - }, - minHour: { - type: Number, - value: 0, - observer: 'updateValue', - }, - maxHour: { - type: Number, - value: 23, - observer: 'updateValue', - }, - minMinute: { - type: Number, - value: 0, - observer: 'updateValue', +var defaultFormatter = function (type, value) { return value; }; +(0, component_1.VantComponent)({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { value: { + type: null, + observer: 'updateValue', + }, filter: null, type: { + type: String, + value: 'datetime', + observer: 'updateValue', + }, showToolbar: { + type: Boolean, + value: true, + }, formatter: { + type: null, + value: defaultFormatter, + }, minDate: { + type: Number, + value: new Date(currentYear - 10, 0, 1).getTime(), + observer: 'updateValue', + }, maxDate: { + type: Number, + value: new Date(currentYear + 10, 11, 31).getTime(), + observer: 'updateValue', + }, minHour: { + type: Number, + value: 0, + observer: 'updateValue', + }, maxHour: { + type: Number, + value: 23, + observer: 'updateValue', + }, minMinute: { + type: Number, + value: 0, + observer: 'updateValue', + }, maxMinute: { + type: Number, + value: 59, + observer: 'updateValue', + } }), + data: { + innerValue: Date.now(), + columns: [], }, - maxMinute: { - type: Number, - value: 59, - observer: 'updateValue', - }, - }), - data: { - innerValue: Date.now(), - columns: [], - }, - methods: { - updateValue: function () { - var _this = this; - var data = this.data; - var val = this.correctValue(data.value); - var isEqual = val === data.innerValue; - if (!isEqual) { - this.updateColumnValue(val).then(function () { - _this.$emit('input', val); - }); - } else { - this.updateColumns(); - } - }, - getPicker: function () { - if (this.picker == null) { - this.picker = this.selectComponent('.van-datetime-picker'); - var picker_1 = this.picker; - var setColumnValues_1 = picker_1.setColumnValues; - picker_1.setColumnValues = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return setColumnValues_1.apply( - picker_1, - __spreadArrays(args, [false]) - ); - }; - } - return this.picker; - }, - updateColumns: function () { - var _a = this.data.formatter, - formatter = _a === void 0 ? defaultFormatter : _a; - var results = this.getOriginColumns().map(function (column) { - return { - values: column.values.map(function (value) { - return formatter(column.type, value); - }), - }; - }); - return this.set({ columns: results }); - }, - getOriginColumns: function () { - var filter = this.data.filter; - var results = this.getRanges().map(function (_a) { - var type = _a.type, - range = _a.range; - var values = times(range[1] - range[0] + 1, function (index) { - var value = range[0] + index; - value = type === 'year' ? '' + value : padZero(value); - return value; - }); - if (filter) { - values = filter(type, values); - } - return { type: type, values: values }; - }); - return results; - }, - getRanges: function () { - var data = this.data; - if (data.type === 'time') { - return [ - { - type: 'hour', - range: [data.minHour, data.maxHour], - }, - { - type: 'minute', - range: [data.minMinute, data.maxMinute], - }, - ]; - } - var _a = this.getBoundary('max', data.innerValue), - maxYear = _a.maxYear, - maxDate = _a.maxDate, - maxMonth = _a.maxMonth, - maxHour = _a.maxHour, - maxMinute = _a.maxMinute; - var _b = this.getBoundary('min', data.innerValue), - minYear = _b.minYear, - minDate = _b.minDate, - minMonth = _b.minMonth, - minHour = _b.minHour, - minMinute = _b.minMinute; - var result = [ - { - type: 'year', - range: [minYear, maxYear], + methods: { + updateValue: function () { + var _this = this; + var data = this.data; + var val = this.correctValue(data.value); + var isEqual = val === data.innerValue; + this.updateColumnValue(val).then(function () { + if (!isEqual) { + _this.$emit('input', val); + } + }); }, - { - type: 'month', - range: [minMonth, maxMonth], + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-datetime-picker'); + var picker_1 = this.picker; + var setColumnValues_1 = picker_1.setColumnValues; + picker_1.setColumnValues = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return setColumnValues_1.apply(picker_1, __spreadArray(__spreadArray([], args, true), [false], false)); + }; + } + return this.picker; }, - { - type: 'day', - range: [minDate, maxDate], + updateColumns: function () { + var _a = this.data.formatter, formatter = _a === void 0 ? defaultFormatter : _a; + var results = this.getOriginColumns().map(function (column) { return ({ + values: column.values.map(function (value) { return formatter(column.type, value); }), + }); }); + return this.set({ columns: results }); }, - { - type: 'hour', - range: [minHour, maxHour], + getOriginColumns: function () { + var filter = this.data.filter; + var results = this.getRanges().map(function (_a) { + var type = _a.type, range = _a.range; + var values = times(range[1] - range[0] + 1, function (index) { + var value = range[0] + index; + return type === 'year' ? "".concat(value) : padZero(value); + }); + if (filter) { + values = filter(type, values); + } + return { type: type, values: values }; + }); + return results; }, - { - type: 'minute', - range: [minMinute, maxMinute], + getRanges: function () { + var data = this.data; + if (data.type === 'time') { + return [ + { + type: 'hour', + range: [data.minHour, data.maxHour], + }, + { + type: 'minute', + range: [data.minMinute, data.maxMinute], + }, + ]; + } + var _a = this.getBoundary('max', data.innerValue), maxYear = _a.maxYear, maxDate = _a.maxDate, maxMonth = _a.maxMonth, maxHour = _a.maxHour, maxMinute = _a.maxMinute; + var _b = this.getBoundary('min', data.innerValue), minYear = _b.minYear, minDate = _b.minDate, minMonth = _b.minMonth, minHour = _b.minHour, minMinute = _b.minMinute; + var result = [ + { + type: 'year', + range: [minYear, maxYear], + }, + { + type: 'month', + range: [minMonth, maxMonth], + }, + { + type: 'day', + range: [minDate, maxDate], + }, + { + type: 'hour', + range: [minHour, maxHour], + }, + { + type: 'minute', + range: [minMinute, maxMinute], + }, + ]; + if (data.type === 'date') + result.splice(3, 2); + if (data.type === 'year-month') + result.splice(2, 3); + return result; }, - ]; - if (data.type === 'date') result.splice(3, 2); - if (data.type === 'year-month') result.splice(2, 3); - return result; - }, - correctValue: function (value) { - var data = this.data; - // validate value - var isDateType = data.type !== 'time'; - if (isDateType && !isValidDate(value)) { - value = data.minDate; - } else if (!isDateType && !value) { - var minHour = data.minHour; - value = padZero(minHour) + ':00'; - } - // time type - if (!isDateType) { - var _a = value.split(':'), - hour = _a[0], - minute = _a[1]; - hour = padZero(range(hour, data.minHour, data.maxHour)); - minute = padZero(range(minute, data.minMinute, data.maxMinute)); - return hour + ':' + minute; - } - // date type - value = Math.max(value, data.minDate); - value = Math.min(value, data.maxDate); - return value; - }, - getBoundary: function (type, innerValue) { - var _a; - var value = new Date(innerValue); - var boundary = new Date(this.data[type + 'Date']); - var year = boundary.getFullYear(); - var month = 1; - var date = 1; - var hour = 0; - var minute = 0; - if (type === 'max') { - month = 12; - date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1); - hour = 23; - minute = 59; - } - if (value.getFullYear() === year) { - month = boundary.getMonth() + 1; - if (value.getMonth() + 1 === month) { - date = boundary.getDate(); - if (value.getDate() === date) { - hour = boundary.getHours(); - if (value.getHours() === hour) { - minute = boundary.getMinutes(); + correctValue: function (value) { + var data = this.data; + // validate value + var isDateType = data.type !== 'time'; + if (isDateType && !isValidDate(value)) { + value = data.minDate; } - } - } - } - return ( - (_a = {}), - (_a[type + 'Year'] = year), - (_a[type + 'Month'] = month), - (_a[type + 'Date'] = date), - (_a[type + 'Hour'] = hour), - (_a[type + 'Minute'] = minute), - _a - ); - }, - onCancel: function () { - this.$emit('cancel'); - }, - onConfirm: function () { - this.$emit('confirm', this.data.innerValue); - }, - onChange: function () { - var _this = this; - var data = this.data; - var value; - var picker = this.getPicker(); - var originColumns = this.getOriginColumns(); - if (data.type === 'time') { - var indexes = picker.getIndexes(); - value = - +originColumns[0].values[indexes[0]] + - ':' + - +originColumns[1].values[indexes[1]]; - } else { - var indexes = picker.getIndexes(); - var values = indexes.map(function (value, index) { - return originColumns[index].values[value]; - }); - var year = getTrueValue(values[0]); - var month = getTrueValue(values[1]); - var maxDate = getMonthEndDay(year, month); - var date = getTrueValue(values[2]); - if (data.type === 'year-month') { - date = 1; - } - date = date > maxDate ? maxDate : date; - var hour = 0; - var minute = 0; - if (data.type === 'datetime') { - hour = getTrueValue(values[3]); - minute = getTrueValue(values[4]); - } - value = new Date(year, month - 1, date, hour, minute); - } - value = this.correctValue(value); - this.updateColumnValue(value).then(function () { - _this.$emit('input', value); - _this.$emit('change', picker); - }); + else if (!isDateType && !value) { + var minHour = data.minHour; + value = "".concat(padZero(minHour), ":00"); + } + // time type + if (!isDateType) { + var _a = value.split(':'), hour = _a[0], minute = _a[1]; + hour = padZero(range(hour, data.minHour, data.maxHour)); + minute = padZero(range(minute, data.minMinute, data.maxMinute)); + return "".concat(hour, ":").concat(minute); + } + // date type + value = Math.max(value, data.minDate); + value = Math.min(value, data.maxDate); + return value; + }, + getBoundary: function (type, innerValue) { + var _a; + var value = new Date(innerValue); + var boundary = new Date(this.data["".concat(type, "Date")]); + var year = boundary.getFullYear(); + var month = 1; + var date = 1; + var hour = 0; + var minute = 0; + if (type === 'max') { + month = 12; + date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1); + hour = 23; + minute = 59; + } + if (value.getFullYear() === year) { + month = boundary.getMonth() + 1; + if (value.getMonth() + 1 === month) { + date = boundary.getDate(); + if (value.getDate() === date) { + hour = boundary.getHours(); + if (value.getHours() === hour) { + minute = boundary.getMinutes(); + } + } + } + } + return _a = {}, + _a["".concat(type, "Year")] = year, + _a["".concat(type, "Month")] = month, + _a["".concat(type, "Date")] = date, + _a["".concat(type, "Hour")] = hour, + _a["".concat(type, "Minute")] = minute, + _a; + }, + onCancel: function () { + this.$emit('cancel'); + }, + onConfirm: function () { + this.$emit('confirm', this.data.innerValue); + }, + onChange: function () { + var _this = this; + var data = this.data; + var value; + var picker = this.getPicker(); + var originColumns = this.getOriginColumns(); + if (data.type === 'time') { + var indexes = picker.getIndexes(); + value = "".concat(+originColumns[0].values[indexes[0]], ":").concat(+originColumns[1] + .values[indexes[1]]); + } + else { + var indexes = picker.getIndexes(); + var values = indexes.map(function (value, index) { return originColumns[index].values[value]; }); + var year = getTrueValue(values[0]); + var month = getTrueValue(values[1]); + var maxDate = getMonthEndDay(year, month); + var date = getTrueValue(values[2]); + if (data.type === 'year-month') { + date = 1; + } + date = date > maxDate ? maxDate : date; + var hour = 0; + var minute = 0; + if (data.type === 'datetime') { + hour = getTrueValue(values[3]); + minute = getTrueValue(values[4]); + } + value = new Date(year, month - 1, date, hour, minute); + } + value = this.correctValue(value); + this.updateColumnValue(value).then(function () { + _this.$emit('input', value); + _this.$emit('change', picker); + }); + }, + updateColumnValue: function (value) { + var _this = this; + var values = []; + var type = this.data.type; + var formatter = this.data.formatter || defaultFormatter; + var picker = this.getPicker(); + if (type === 'time') { + var pair = value.split(':'); + values = [formatter('hour', pair[0]), formatter('minute', pair[1])]; + } + else { + var date = new Date(value); + values = [ + formatter('year', "".concat(date.getFullYear())), + formatter('month', padZero(date.getMonth() + 1)), + ]; + if (type === 'date') { + values.push(formatter('day', padZero(date.getDate()))); + } + if (type === 'datetime') { + values.push(formatter('day', padZero(date.getDate())), formatter('hour', padZero(date.getHours())), formatter('minute', padZero(date.getMinutes()))); + } + } + return this.set({ innerValue: value }) + .then(function () { return _this.updateColumns(); }) + .then(function () { return picker.setValues(values); }); + }, }, - updateColumnValue: function (value) { - var _this = this; - var values = []; - var type = this.data.type; - var formatter = this.data.formatter || defaultFormatter; - var picker = this.getPicker(); - if (type === 'time') { - var pair = value.split(':'); - values = [formatter('hour', pair[0]), formatter('minute', pair[1])]; - } else { - var date = new Date(value); - values = [ - formatter('year', '' + date.getFullYear()), - formatter('month', padZero(date.getMonth() + 1)), - ]; - if (type === 'date') { - values.push(formatter('day', padZero(date.getDate()))); - } - if (type === 'datetime') { - values.push( - formatter('day', padZero(date.getDate())), - formatter('hour', padZero(date.getHours())), - formatter('minute', padZero(date.getMinutes())) - ); - } - } - return this.set({ innerValue: value }) - .then(function () { - return _this.updateColumns(); - }) - .then(function () { - return picker.setValues(values); + created: function () { + var _this = this; + var innerValue = this.correctValue(this.data.value); + this.updateColumnValue(innerValue).then(function () { + _this.$emit('input', innerValue); }); }, - }, - created: function () { - var _this = this; - var innerValue = this.correctValue(this.data.value); - this.updateColumnValue(innerValue).then(function () { - _this.$emit('input', innerValue); - }); - }, }); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json index 9176008..a778e91 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json @@ -1,6 +1,6 @@ -{ - "component": true, - "usingComponents": { - "van-picker": "../picker/index" - } -} +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml index 33659f2..ade2202 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml @@ -1,16 +1,16 @@ - + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js index ce03781..c8ad2e5 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js @@ -1,2 +1,2 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js index 64c5f5f..400f4f1 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js @@ -1,104 +1,92 @@ -'use strict'; -var __assign = - (this && this.__assign) || - function () { - __assign = - Object.assign || - function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; -Object.defineProperty(exports, '__esModule', { value: true }); -var queue = []; -var defaultOptions = { - show: false, - title: '', - width: null, - theme: 'default', - message: '', - zIndex: 100, - overlay: true, - selector: '#van-dialog', - className: '', - asyncClose: false, - beforeClose: null, - transition: 'scale', - customStyle: '', - messageAlign: '', - overlayStyle: '', - confirmButtonText: '确认', - cancelButtonText: '取消', - showConfirmButton: true, - showCancelButton: false, - closeOnClickOverlay: false, - confirmButtonOpenType: '', -}; -var currentOptions = __assign({}, defaultOptions); -function getContext() { - var pages = getCurrentPages(); - return pages[pages.length - 1]; -} -var Dialog = function (options) { - options = __assign(__assign({}, currentOptions), options); - return new Promise(function (resolve, reject) { - var context = options.context || getContext(); - var dialog = context.selectComponent(options.selector); - delete options.context; - delete options.selector; - if (dialog) { - dialog.setData( - __assign( - { - callback: function (action, instance) { - action === 'confirm' ? resolve(instance) : reject(instance); - }, - }, - options - ) - ); - wx.nextTick(function () { - dialog.setData({ show: true }); - }); - queue.push(dialog); - } else { - console.warn( - '未找到 van-dialog 节点,请确认 selector 及 context 是否正确' - ); - } - }); -}; -Dialog.alert = function (options) { - return Dialog(options); -}; -Dialog.confirm = function (options) { - return Dialog(__assign({ showCancelButton: true }, options)); -}; -Dialog.close = function () { - queue.forEach(function (dialog) { - dialog.close(); - }); - queue = []; -}; -Dialog.stopLoading = function () { - queue.forEach(function (dialog) { - dialog.stopLoading(); - }); -}; -Dialog.currentOptions = currentOptions; -Dialog.defaultOptions = defaultOptions; -Dialog.setDefaultOptions = function (options) { - currentOptions = __assign(__assign({}, currentOptions), options); - Dialog.currentOptions = currentOptions; -}; -Dialog.resetDefaultOptions = function () { - currentOptions = __assign({}, defaultOptions); - Dialog.currentOptions = currentOptions; -}; -Dialog.resetDefaultOptions(); -exports.default = Dialog; +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var queue = []; +var defaultOptions = { + show: false, + title: '', + width: null, + theme: 'default', + message: '', + zIndex: 100, + overlay: true, + selector: '#van-dialog', + className: '', + asyncClose: false, + beforeClose: null, + transition: 'scale', + customStyle: '', + messageAlign: '', + overlayStyle: '', + confirmButtonText: '确认', + cancelButtonText: '取消', + showConfirmButton: true, + showCancelButton: false, + closeOnClickOverlay: false, + confirmButtonOpenType: '', +}; +var currentOptions = __assign({}, defaultOptions); +function getContext() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +var Dialog = function (options) { + options = __assign(__assign({}, currentOptions), options); + return new Promise(function (resolve, reject) { + var context = (typeof options.context === 'function' + ? options.context() + : options.context) || getContext(); + var dialog = context.selectComponent(options.selector); + delete options.context; + delete options.selector; + if (dialog) { + dialog.setData(__assign({ callback: function (action, instance) { + action === 'confirm' ? resolve(instance) : reject(instance); + } }, options)); + wx.nextTick(function () { + dialog.setData({ show: true }); + }); + queue.push(dialog); + } + else { + console.warn('未找到 van-dialog 节点,请确认 selector 及 context 是否正确'); + } + }); +}; +Dialog.alert = function (options) { return Dialog(options); }; +Dialog.confirm = function (options) { + return Dialog(__assign({ showCancelButton: true }, options)); +}; +Dialog.close = function () { + queue.forEach(function (dialog) { + dialog.close(); + }); + queue = []; +}; +Dialog.stopLoading = function () { + queue.forEach(function (dialog) { + dialog.stopLoading(); + }); +}; +Dialog.currentOptions = currentOptions; +Dialog.defaultOptions = defaultOptions; +Dialog.setDefaultOptions = function (options) { + currentOptions = __assign(__assign({}, currentOptions), options); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions = function () { + currentOptions = __assign({}, defaultOptions); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions(); +exports.default = Dialog; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js index 3f26daa..f10f50f 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js @@ -1,127 +1,131 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var button_1 = require('../mixins/button'); -var open_type_1 = require('../mixins/open-type'); -var color_1 = require('../common/color'); -var utils_1 = require('../common/utils'); -component_1.VantComponent({ - mixins: [button_1.button, open_type_1.openType], - props: { - show: { - type: Boolean, - observer: function (show) { - !show && this.stopLoading(); - }, - }, - title: String, - message: String, - theme: { - type: String, - value: 'default', - }, - useSlot: Boolean, - className: String, - customStyle: String, - asyncClose: Boolean, - messageAlign: String, - beforeClose: null, - overlayStyle: String, - useTitleSlot: Boolean, - showCancelButton: Boolean, - closeOnClickOverlay: Boolean, - confirmButtonOpenType: String, - width: null, - zIndex: { - type: Number, - value: 2000, - }, - confirmButtonText: { - type: String, - value: '确认', - }, - cancelButtonText: { - type: String, - value: '取消', - }, - confirmButtonColor: { - type: String, - value: color_1.RED, - }, - cancelButtonColor: { - type: String, - value: color_1.GRAY, - }, - showConfirmButton: { - type: Boolean, - value: true, - }, - overlay: { - type: Boolean, - value: true, - }, - transition: { - type: String, - value: 'scale', - }, - }, - data: { - loading: { - confirm: false, - cancel: false, - }, - callback: function () {}, - }, - methods: { - onConfirm: function () { - this.handleAction('confirm'); - }, - onCancel: function () { - this.handleAction('cancel'); - }, - onClickOverlay: function () { - this.close('overlay'); - }, - close: function (action) { - var _this = this; - this.setData({ show: false }); - wx.nextTick(function () { - _this.$emit('close', action); - var callback = _this.data.callback; - if (callback) { - callback(action, _this); - } - }); - }, - stopLoading: function () { - this.setData({ - loading: { - confirm: false, - cancel: false, - }, - }); - }, - handleAction: function (action) { - var _a; - var _this = this; - this.$emit(action, { dialog: this }); - var _b = this.data, - asyncClose = _b.asyncClose, - beforeClose = _b.beforeClose; - if (!asyncClose && !beforeClose) { - this.close(action); - return; - } - this.setData(((_a = {}), (_a['loading.' + action] = true), _a)); - if (beforeClose) { - utils_1.toPromise(beforeClose(action)).then(function (value) { - if (value) { - _this.close(action); - } else { - _this.stopLoading(); - } - }); - } - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +var color_1 = require("../common/color"); +var utils_1 = require("../common/utils"); +(0, component_1.VantComponent)({ + mixins: [button_1.button], + classes: ['cancle-button-class', 'confirm-button-class'], + props: { + show: { + type: Boolean, + observer: function (show) { + !show && this.stopLoading(); + }, + }, + title: String, + message: String, + theme: { + type: String, + value: 'default', + }, + confirmButtonId: String, + className: String, + customStyle: String, + asyncClose: Boolean, + messageAlign: String, + beforeClose: null, + overlayStyle: String, + useSlot: Boolean, + useTitleSlot: Boolean, + useConfirmButtonSlot: Boolean, + useCancelButtonSlot: Boolean, + showCancelButton: Boolean, + closeOnClickOverlay: Boolean, + confirmButtonOpenType: String, + width: null, + zIndex: { + type: Number, + value: 2000, + }, + confirmButtonText: { + type: String, + value: '确认', + }, + cancelButtonText: { + type: String, + value: '取消', + }, + confirmButtonColor: { + type: String, + value: color_1.RED, + }, + cancelButtonColor: { + type: String, + value: color_1.GRAY, + }, + showConfirmButton: { + type: Boolean, + value: true, + }, + overlay: { + type: Boolean, + value: true, + }, + transition: { + type: String, + value: 'scale', + }, + }, + data: { + loading: { + confirm: false, + cancel: false, + }, + callback: (function () { }), + }, + methods: { + onConfirm: function () { + this.handleAction('confirm'); + }, + onCancel: function () { + this.handleAction('cancel'); + }, + onClickOverlay: function () { + this.close('overlay'); + }, + close: function (action) { + var _this = this; + this.setData({ show: false }); + wx.nextTick(function () { + _this.$emit('close', action); + var callback = _this.data.callback; + if (callback) { + callback(action, _this); + } + }); + }, + stopLoading: function () { + this.setData({ + loading: { + confirm: false, + cancel: false, + }, + }); + }, + handleAction: function (action) { + var _a; + var _this = this; + this.$emit(action, { dialog: this }); + var _b = this.data, asyncClose = _b.asyncClose, beforeClose = _b.beforeClose; + if (!asyncClose && !beforeClose) { + this.close(action); + return; + } + this.setData((_a = {}, + _a["loading.".concat(action)] = true, + _a)); + if (beforeClose) { + (0, utils_1.toPromise)(beforeClose(action)).then(function (value) { + if (value) { + _this.close(action); + } + else { + _this.stopLoading(); + } + }); + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json index d45a906..43417fc 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json @@ -1,9 +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" - } -} +{ + "component": true, + "usingComponents": { + "van-popup": "../popup/index", + "van-button": "../button/index", + "van-goods-action": "../goods-action/index", + "van-goods-action-button": "../goods-action-button/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml index 886d471..8e0bb22 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml @@ -1,113 +1,122 @@ - - - - - - {{ title }} - - - - - {{ message }} - - - - - {{ cancelButtonText }} - - - {{ confirmButtonText }} - - - - - - {{ cancelButtonText }} - - - {{ confirmButtonText }} - - - + + + + + + {{ title }} + + + + + {{ message }} + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + + + + + + + {{ cancelButtonText }} + + + + + + + + {{ confirmButtonText }} + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss index c6bac95..507a789 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-dialog{top:45%!important;overflow:hidden;width:320px;width:var(--dialog-width,320px);font-size:16px;font-size:var(--dialog-font-size,16px);border-radius:16px;border-radius:var(--dialog-border-radius,16px);background-color:#fff;background-color:var(--dialog-background-color,#fff)}@media (max-width:321px){.van-dialog{width:90%;width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{text-align:center;padding-top:24px;padding-top:var(--dialog-header-padding-top,24px);font-weight:500;font-weight:var(--dialog-header-font-weight,500);line-height:24px;line-height:var(--dialog-header-line-height,24px)}.van-dialog__header--isolated{padding:24px 0;padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{overflow-y:auto;text-align:center;-webkit-overflow-scrolling:touch;font-size:14px;font-size:var(--dialog-message-font-size,14px);line-height:20px;line-height:var(--dialog-message-line-height,20px);max-height:60vh;max-height:var(--dialog-message-max-height,60vh);padding:24px;padding:var(--dialog-message-padding,24px)}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{padding-top:8px;padding-top:var(--dialog-has-title-message-padding-top,8px);color:#646566;color:var(--dialog-has-title-message-text-color,#646566)}.van-dialog__message--round-button{padding-bottom:16px;color:#323233}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__footer{display:-webkit-flex;display:flex}.van-dialog__footer--round-button{position:relative!important;padding:8px 24px 16px!important}.van-dialog__button{-webkit-flex:1;flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{-webkit-transform:translate3d(-50%,-50%,0) scale(.9);transform:translate3d(-50%,-50%,0) scale(.9);opacity:0} \ No newline at end of file +@import '../common/index.wxss';.van-dialog{background-color:var(--dialog-background-color,#fff);border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,320px)}@media (max-width:321px){.van-dialog{width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{font-weight:var(--dialog-header-font-weight,500);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.van-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{-webkit-overflow-scrolling:touch;font-size:var(--dialog-message-font-size,14px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,#646566);padding-top:var(--dialog-has-title-message-padding-top,8px)}.van-dialog__message--round-button{color:#323233;padding-bottom:16px}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex}.van-dialog__footer--round-button{padding:8px 24px 16px!important;position:relative!important}.van-dialog__button{flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js index d039925..5c63844 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js @@ -1,14 +1,14 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -component_1.VantComponent({ - props: { - dashed: Boolean, - hairline: Boolean, - contentPosition: String, - fontSize: String, - borderColor: String, - textColor: String, - customStyle: String, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + dashed: Boolean, + hairline: Boolean, + contentPosition: String, + fontSize: String, + borderColor: String, + textColor: String, + customStyle: String, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json index f719411..a89ef4d 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json @@ -1,4 +1,4 @@ -{ - "component": true, - "usingComponents": {} -} +{ + "component": true, + "usingComponents": {} +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml index 45e267e..f6a5a45 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml @@ -1,9 +1,9 @@ - - - - - - + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs index 6ecf3c4..215b14f 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs @@ -1,18 +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, -}; +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function rootStyle(data) { + return style([ + { + 'border-color': data.borderColor, + color: data.textColor, + 'font-size': addUnit(data.fontSize), + }, + data.customStyle, + ]); +} + +module.exports = { + rootStyle: rootStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss index c055e3a..e91dc44 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-divider{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;margin:16px 0;margin:var(--divider-margin,16px 0);color:#969799;color:var(--divider-text-color,#969799);font-size:14px;font-size:var(--divider-font-size,14px);line-height:24px;line-height:var(--divider-line-height,24px);border:0 solid #ebedf0;border-color:var(--divider-border-color,#ebedf0)}.van-divider:after,.van-divider:before{display:block;-webkit-flex:1;flex:1;box-sizing:border-box;height:1px;border-color:inherit;border-style:inherit;border-width:1px 0 0}.van-divider:before{content:""}.van-divider--hairline:after,.van-divider--hairline:before{-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-divider--dashed{border-style:dashed}.van-divider--center:before,.van-divider--left:before,.van-divider--right:before{margin-right:16px;margin-right:var(--divider-content-padding,16px)}.van-divider--center:after,.van-divider--left:after,.van-divider--right:after{content:"";margin-left:16px;margin-left:var(--divider-content-padding,16px)}.van-divider--left:before{max-width:10%;max-width:var(--divider-content-left-width,10%)}.van-divider--right:after{max-width:10%;max-width:var(--divider-content-right-width,10%)} \ No newline at end of file +@import '../common/index.wxss';.van-divider{align-items:center;border:0 solid var(--divider-border-color,#ebedf0);color:var(--divider-text-color,#969799);display:flex;font-size:var(--divider-font-size,14px);line-height:var(--divider-line-height,24px);margin:var(--divider-margin,16px 0)}.van-divider:after,.van-divider:before{border-color:inherit;border-style:inherit;border-width:1px 0 0;box-sizing:border-box;display:block;flex:1;height:1px}.van-divider:before{content:""}.van-divider--hairline:after,.van-divider--hairline:before{transform:scaleY(.5)}.van-divider--dashed{border-style:dashed}.van-divider--center:before,.van-divider--left:before,.van-divider--right:before{margin-right:var(--divider-content-padding,16px)}.van-divider--center:after,.van-divider--left:after,.van-divider--right:after{content:"";margin-left:var(--divider-content-padding,16px)}.van-divider--left:before{max-width:var(--divider-content-left-width,10%)}.van-divider--right:after{max-width:var(--divider-content-right-width,10%)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js index b97d1d9..826c26a 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js @@ -1,117 +1,136 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var relation_1 = require('../common/relation'); -var component_1 = require('../common/component'); -component_1.VantComponent({ - field: true, - relation: relation_1.useParent('dropdown-menu', function () { - this.updateDataFromParent(); - }), - props: { - value: { - type: null, - observer: 'rerender', - }, - title: { - type: String, - observer: 'rerender', - }, - disabled: Boolean, - titleClass: { - type: String, - observer: 'rerender', - }, - options: { - type: Array, - value: [], - observer: 'rerender', - }, - popupStyle: String, - }, - data: { - transition: true, - showPopup: false, - showWrapper: false, - displayTitle: '', - }, - methods: { - rerender: function () { - var _this = this; - wx.nextTick(function () { - var _a; - (_a = _this.parent) === null || _a === void 0 - ? void 0 - : _a.updateItemListData(); - }); - }, - updateDataFromParent: function () { - if (this.parent) { - var _a = this.parent.data, - overlay = _a.overlay, - duration = _a.duration, - activeColor = _a.activeColor, - closeOnClickOverlay = _a.closeOnClickOverlay, - direction = _a.direction; - this.setData({ - overlay: overlay, - duration: duration, - activeColor: activeColor, - closeOnClickOverlay: closeOnClickOverlay, - direction: direction, - }); - } - }, - onOpen: function () { - this.$emit('open'); - }, - onOpened: function () { - this.$emit('opened'); - }, - onClose: function () { - this.$emit('close'); - }, - onClosed: function () { - this.$emit('closed'); - this.setData({ showWrapper: false }); - }, - onOptionTap: function (event) { - var option = event.currentTarget.dataset.option; - var value = option.value; - var shouldEmitChange = this.data.value !== value; - this.setData({ showPopup: false, value: value }); - this.$emit('close'); - this.rerender(); - if (shouldEmitChange) { - this.$emit('change', value); - } - }, - toggle: function (show, options) { - var _this = this; - var _a; - if (options === void 0) { - options = {}; - } - var showPopup = this.data.showPopup; - if (typeof show !== 'boolean') { - show = !showPopup; - } - if (show === showPopup) { - return; - } - this.setData({ - transition: !options.immediate, - showPopup: show, - }); - if (show) { - (_a = this.parent) === null || _a === void 0 - ? void 0 - : _a.getChildWrapperStyle().then(function (wrapperStyle) { - _this.setData({ wrapperStyle: wrapperStyle, showWrapper: true }); - _this.rerender(); - }); - } else { - this.rerender(); - } - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + classes: ['item-title-class'], + field: true, + relation: (0, relation_1.useParent)('dropdown-menu', function () { + this.updateDataFromParent(); + }), + props: { + value: { + type: null, + observer: 'rerender', + }, + title: { + type: String, + observer: 'rerender', + }, + disabled: Boolean, + titleClass: { + type: String, + observer: 'rerender', + }, + options: { + type: Array, + value: [], + observer: 'rerender', + }, + popupStyle: String, + useBeforeToggle: { + type: Boolean, + value: false, + }, + rootPortal: { + type: Boolean, + value: false, + }, + }, + data: { + transition: true, + showPopup: false, + showWrapper: false, + displayTitle: '', + safeAreaTabBar: false, + }, + methods: { + rerender: function () { + var _this = this; + wx.nextTick(function () { + var _a; + (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.updateItemListData(); + }); + }, + updateDataFromParent: function () { + if (this.parent) { + var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction, safeAreaTabBar = _a.safeAreaTabBar; + this.setData({ + overlay: overlay, + duration: duration, + activeColor: activeColor, + closeOnClickOverlay: closeOnClickOverlay, + direction: direction, + safeAreaTabBar: safeAreaTabBar, + }); + } + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + this.setData({ showWrapper: false }); + }, + onOptionTap: function (event) { + var option = event.currentTarget.dataset.option; + var value = option.value; + var shouldEmitChange = this.data.value !== value; + this.setData({ showPopup: false, value: value }); + this.$emit('close'); + this.rerender(); + if (shouldEmitChange) { + this.$emit('change', value); + } + }, + toggle: function (show, options) { + var _this = this; + if (options === void 0) { options = {}; } + var showPopup = this.data.showPopup; + if (typeof show !== 'boolean') { + show = !showPopup; + } + if (show === showPopup) { + return; + } + this.onBeforeToggle(show).then(function (status) { + var _a; + if (!status) { + return; + } + _this.setData({ + transition: !options.immediate, + showPopup: show, + }); + if (show) { + (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.getChildWrapperStyle().then(function (wrapperStyle) { + _this.setData({ wrapperStyle: wrapperStyle, showWrapper: true }); + _this.rerender(); + }); + } + else { + _this.rerender(); + } + }); + }, + onBeforeToggle: function (status) { + var _this = this; + var useBeforeToggle = this.data.useBeforeToggle; + if (!useBeforeToggle) { + return Promise.resolve(true); + } + return new Promise(function (resolve) { + _this.$emit('before-toggle', { + status: status, + callback: function (value) { return resolve(value); }, + }); + }); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json index b30d74b..88d5409 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json @@ -1,8 +1,8 @@ -{ - "component": true, - "usingComponents": { - "van-popup": "../popup/index", - "van-cell": "../cell/index", - "van-icon": "../icon/index" - } -} +{ + "component": true, + "usingComponents": { + "van-popup": "../popup/index", + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml index f097276..63904f4 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml @@ -1,48 +1,50 @@ - - - - - - - {{ item.text }} - - - - - - - + + + + + + + {{ item.text }} + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss index 7cab3f2..80505e9 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-dropdown-item{position:fixed;right:0;left:0;overflow:hidden}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:#ee0a24;color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit} \ No newline at end of file +@import '../common/index.wxss';.van-dropdown-item{left:0;overflow:hidden;position:fixed;right:0}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js index b02af38..c8ad2e5 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js @@ -1,2 +1,2 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js index 98c9eb5..aed2921 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js @@ -1,126 +1,122 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -var relation_1 = require('../common/relation'); -var utils_1 = require('../common/utils'); -var ARRAY = []; -component_1.VantComponent({ - field: true, - relation: relation_1.useChildren('dropdown-item', function () { - this.updateItemListData(); - }), - props: { - activeColor: { - type: String, - observer: 'updateChildrenData', - }, - overlay: { - type: Boolean, - value: true, - observer: 'updateChildrenData', - }, - zIndex: { - type: Number, - value: 10, - }, - duration: { - type: Number, - value: 200, - observer: 'updateChildrenData', - }, - direction: { - type: String, - value: 'down', - observer: 'updateChildrenData', - }, - closeOnClickOverlay: { - type: Boolean, - value: true, - observer: 'updateChildrenData', - }, - closeOnClickOutside: { - type: Boolean, - value: true, - }, - }, - data: { - itemListData: [], - }, - beforeCreate: function () { - var windowHeight = utils_1.getSystemInfoSync().windowHeight; - this.windowHeight = windowHeight; - ARRAY.push(this); - }, - destroyed: function () { - var _this = this; - ARRAY = ARRAY.filter(function (item) { - return item !== _this; - }); - }, - methods: { - updateItemListData: function () { - this.setData({ - itemListData: this.children.map(function (child) { - return child.data; - }), - }); - }, - updateChildrenData: function () { - this.children.forEach(function (child) { - child.updateDataFromParent(); - }); - }, - toggleItem: function (active) { - this.children.forEach(function (item, index) { - var showPopup = item.data.showPopup; - if (index === active) { - item.toggle(); - } else if (showPopup) { - item.toggle(false, { immediate: true }); - } - }); - }, - close: function () { - this.children.forEach(function (child) { - child.toggle(false, { immediate: true }); - }); - }, - getChildWrapperStyle: function () { - var _this = this; - var _a = this.data, - zIndex = _a.zIndex, - direction = _a.direction; - return utils_1.getRect(this, '.van-dropdown-menu').then(function (rect) { - var _a = rect.top, - top = _a === void 0 ? 0 : _a, - _b = rect.bottom, - bottom = _b === void 0 ? 0 : _b; - var offset = direction === 'down' ? bottom : _this.windowHeight - top; - var wrapperStyle = 'z-index: ' + zIndex + ';'; - if (direction === 'down') { - wrapperStyle += 'top: ' + utils_1.addUnit(offset) + ';'; - } else { - wrapperStyle += 'bottom: ' + utils_1.addUnit(offset) + ';'; - } - return wrapperStyle; - }); - }, - onTitleTap: function (event) { - var _this = this; - var index = event.currentTarget.dataset.index; - var child = this.children[index]; - if (!child.data.disabled) { - ARRAY.forEach(function (menuItem) { - if ( - menuItem && - menuItem.data.closeOnClickOutside && - menuItem !== _this - ) { - menuItem.close(); - } - }); - this.toggleItem(index); - } - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var relation_1 = require("../common/relation"); +var utils_1 = require("../common/utils"); +var ARRAY = []; +(0, component_1.VantComponent)({ + field: true, + classes: ['title-class'], + relation: (0, relation_1.useChildren)('dropdown-item', function () { + this.updateItemListData(); + }), + props: { + activeColor: { + type: String, + observer: 'updateChildrenData', + }, + overlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + zIndex: { + type: Number, + value: 10, + }, + duration: { + type: Number, + value: 200, + observer: 'updateChildrenData', + }, + direction: { + type: String, + value: 'down', + observer: 'updateChildrenData', + }, + safeAreaTabBar: { + type: Boolean, + value: false, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + closeOnClickOutside: { + type: Boolean, + value: true, + }, + }, + data: { + itemListData: [], + }, + beforeCreate: function () { + var windowHeight = (0, utils_1.getSystemInfoSync)().windowHeight; + this.windowHeight = windowHeight; + ARRAY.push(this); + }, + destroyed: function () { + var _this = this; + ARRAY = ARRAY.filter(function (item) { return item !== _this; }); + }, + methods: { + updateItemListData: function () { + this.setData({ + itemListData: this.children.map(function (child) { return child.data; }), + }); + }, + updateChildrenData: function () { + this.children.forEach(function (child) { + child.updateDataFromParent(); + }); + }, + toggleItem: function (active) { + this.children.forEach(function (item, index) { + var showPopup = item.data.showPopup; + if (index === active) { + item.toggle(); + } + else if (showPopup) { + item.toggle(false, { immediate: true }); + } + }); + }, + close: function () { + this.children.forEach(function (child) { + child.toggle(false, { immediate: true }); + }); + }, + getChildWrapperStyle: function () { + var _this = this; + var _a = this.data, zIndex = _a.zIndex, direction = _a.direction; + return (0, utils_1.getRect)(this, '.van-dropdown-menu').then(function (rect) { + var _a = rect.top, top = _a === void 0 ? 0 : _a, _b = rect.bottom, bottom = _b === void 0 ? 0 : _b; + var offset = direction === 'down' ? bottom : _this.windowHeight - top; + var wrapperStyle = "z-index: ".concat(zIndex, ";"); + if (direction === 'down') { + wrapperStyle += "top: ".concat((0, utils_1.addUnit)(offset), ";"); + } + else { + wrapperStyle += "bottom: ".concat((0, utils_1.addUnit)(offset), ";"); + } + return wrapperStyle; + }); + }, + onTitleTap: function (event) { + var _this = this; + var index = event.currentTarget.dataset.index; + var child = this.children[index]; + if (!child.data.disabled) { + ARRAY.forEach(function (menuItem) { + if (menuItem && + menuItem.data.closeOnClickOutside && + menuItem !== _this) { + menuItem.close(); + } + }); + this.toggleItem(index); + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json index efdc3c8..467ce29 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json @@ -1,3 +1,3 @@ -{ - "component": true -} +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml index 2d3451f..ec165a9 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml @@ -1,23 +1,23 @@ - - - - - - - - {{ computed.displayTitle(item) }} - - - - - - + + + + + + + + {{ computed.displayTitle(item) }} + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs index ffa262f..6538854 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs @@ -1,16 +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 -}; +/* eslint-disable */ +function displayTitle(item) { + if (item.title) { + return item.title; + } + + var match = item.options.filter(function(option) { + return option.value === item.value; + }); + var displayTitle = match.length ? match[0].text : ''; + return displayTitle; +} + +module.exports = { + displayTitle: displayTitle +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss index ec6caff..dba000e 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-dropdown-menu{display:-webkit-flex;display:flex;box-shadow:0 2px 12px rgba(100,101,102,.12);-webkit-user-select:none;user-select:none;height:50px;height:var(--dropdown-menu-height,50px);background-color:#fff;background-color:var(--dropdown-menu-background-color,#fff)}.van-dropdown-menu__item{display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:#969799;color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:0 8px;padding:var(--dropdown-menu-title-padding,0 8px);color:#323233;color:var(--dropdown-menu-title-text-color,#323233);font-size:15px;font-size:var(--dropdown-menu-title-font-size,15px);line-height:18px;line-height:var(--dropdown-menu-title-line-height,18px)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:#ee0a24;color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;-webkit-transform:rotate(135deg);transform:rotate(135deg)} \ No newline at end of file +@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:11px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js index fa0bac9..755e638 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js @@ -1,12 +1,12 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -var component_1 = require('../common/component'); -component_1.VantComponent({ - props: { - description: String, - image: { - type: String, - value: 'default', - }, - }, -}); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + description: String, + image: { + type: String, + value: 'default', + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json index 011372e..a89ef4d 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json @@ -1,4 +1,4 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file +{ + "component": true, + "usingComponents": {} +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml index 75f6788..9c7b719 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - {{ description }} - - - - - - + + + + + + + + + + + + + + + + {{ description }} + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs index b7089d6..cf92ece 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs @@ -1,14 +1,15 @@ -/* eslint-disable */ -var PRESETS = ['error', 'search', 'default', 'network']; - -function imageUrl(image) { - if (PRESETS.indexOf(image) !== -1) { - return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png'; - } - - return image; -} - -module.exports = { - imageUrl: imageUrl, -}; +/* eslint-disable */ +var PRESETS = ['error', 'search', 'default', 'network']; + +function imageUrl(image) { + if (PRESETS.indexOf(image) !== -1) { + return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png'; + } + + return image; +} + +module.exports = { + imageUrl: imageUrl, +}; + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss index aeb9d4b..0fb74fe 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px} \ No newline at end of file +@import '../common/index.wxss';.van-empty{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding:32px 0}.van-empty__image{height:160px;width:160px}.van-empty__image:empty{display:none}.van-empty__image__img{height:100%;width:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{color:#969799;font-size:14px;line-height:20px;margin-top:16px;padding:0 60px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js index b2ea182..c20d266 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js @@ -1,151 +1,137 @@ -'use strict'; -var __assign = - (this && this.__assign) || - function () { - __assign = - Object.assign || - function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; -Object.defineProperty(exports, '__esModule', { value: true }); -var utils_1 = require('../common/utils'); -var component_1 = require('../common/component'); -var props_1 = require('./props'); -component_1.VantComponent({ - field: true, - classes: ['input-class', 'right-icon-class', 'label-class'], - props: __assign( - __assign( - __assign(__assign({}, props_1.commonProps), props_1.inputProps), - props_1.textareaProps - ), - { - size: String, - icon: String, - label: String, - error: Boolean, - center: Boolean, - isLink: Boolean, - leftIcon: String, - rightIcon: String, - autosize: null, - required: Boolean, - iconClass: String, - clickable: Boolean, - inputAlign: String, - customStyle: String, - errorMessage: String, - arrowDirection: String, - showWordLimit: Boolean, - errorMessageAlign: String, - readonly: { - type: Boolean, - observer: 'setShowClear', - }, - clearable: { - type: Boolean, - observer: 'setShowClear', - }, - border: { - type: Boolean, - value: true, - }, - titleWidth: { - type: String, - value: '6.2em', - }, - } - ), - data: { - focused: false, - innerValue: '', - showClear: false, - }, - created: function () { - this.value = this.data.value; - this.setData({ innerValue: this.value }); - }, - methods: { - onInput: function (event) { - var _a = (event.detail || {}).value, - value = _a === void 0 ? '' : _a; - this.value = value; - this.setShowClear(); - this.emitChange(); - }, - onFocus: function (event) { - this.focused = true; - this.setShowClear(); - this.$emit('focus', event.detail); - }, - onBlur: function (event) { - this.focused = false; - this.setShowClear(); - this.$emit('blur', event.detail); - }, - onClickIcon: function () { - this.$emit('click-icon'); - }, - onClickInput: function (event) { - this.$emit('click-input', event.detail); - }, - onClear: function () { - var _this = this; - this.setData({ innerValue: '' }); - this.value = ''; - this.setShowClear(); - utils_1.nextTick(function () { - _this.emitChange(); - _this.$emit('clear', ''); - }); - }, - onConfirm: function (event) { - var _a = (event.detail || {}).value, - value = _a === void 0 ? '' : _a; - this.value = value; - this.setShowClear(); - this.$emit('confirm', value); - }, - setValue: function (value) { - this.value = value; - this.setShowClear(); - if (value === '') { - this.setData({ innerValue: '' }); - } - this.emitChange(); - }, - onLineChange: function (event) { - this.$emit('linechange', event.detail); - }, - onKeyboardHeightChange: function (event) { - this.$emit('keyboardheightchange', event.detail); - }, - emitChange: function () { - var _this = this; - this.setData({ value: this.value }); - utils_1.nextTick(function () { - _this.$emit('input', _this.value); - _this.$emit('change', _this.value); - }); - }, - setShowClear: function () { - var _a = this.data, - clearable = _a.clearable, - readonly = _a.readonly; - var _b = this, - focused = _b.focused, - value = _b.value; - this.setData({ - showClear: !!clearable && !!focused && !!value && !readonly, - }); - }, - noop: function () {}, - }, -}); +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var utils_1 = require("../common/utils"); +var component_1 = require("../common/component"); +var props_1 = require("./props"); +(0, component_1.VantComponent)({ + field: true, + classes: ['input-class', 'right-icon-class', 'label-class'], + props: __assign(__assign(__assign(__assign({}, props_1.commonProps), props_1.inputProps), props_1.textareaProps), { size: String, icon: String, label: String, error: Boolean, center: Boolean, isLink: Boolean, leftIcon: String, rightIcon: String, autosize: null, required: Boolean, iconClass: String, clickable: Boolean, inputAlign: String, customStyle: String, errorMessage: String, arrowDirection: String, showWordLimit: Boolean, errorMessageAlign: String, readonly: { + type: Boolean, + observer: 'setShowClear', + }, clearable: { + type: Boolean, + observer: 'setShowClear', + }, clearTrigger: { + type: String, + value: 'focus', + }, border: { + type: Boolean, + value: true, + }, titleWidth: { + type: String, + value: '6.2em', + }, clearIcon: { + type: String, + value: 'clear', + }, extraEventParams: { + type: Boolean, + value: false, + } }), + data: { + focused: false, + innerValue: '', + showClear: false, + }, + created: function () { + this.value = this.data.value; + this.setData({ innerValue: this.value }); + }, + methods: { + formatValue: function (value) { + var maxlength = this.data.maxlength; + if (maxlength !== -1 && value.length > maxlength) { + return value.slice(0, maxlength); + } + return value; + }, + onInput: function (event) { + var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; + var formatValue = this.formatValue(value); + this.value = formatValue; + this.setShowClear(); + return this.emitChange(__assign(__assign({}, event.detail), { value: formatValue })); + }, + onFocus: function (event) { + this.focused = true; + this.setShowClear(); + this.$emit('focus', event.detail); + }, + onBlur: function (event) { + this.focused = false; + this.setShowClear(); + this.$emit('blur', event.detail); + }, + onClickIcon: function () { + this.$emit('click-icon'); + }, + onClickInput: function (event) { + this.$emit('click-input', event.detail); + }, + onClear: function () { + var _this = this; + this.setData({ innerValue: '' }); + this.value = ''; + this.setShowClear(); + (0, utils_1.nextTick)(function () { + _this.emitChange({ value: '' }); + _this.$emit('clear', ''); + }); + }, + onConfirm: function (event) { + var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; + this.value = value; + this.setShowClear(); + this.$emit('confirm', value); + }, + setValue: function (value) { + this.value = value; + this.setShowClear(); + if (value === '') { + this.setData({ innerValue: '' }); + } + this.emitChange({ value: value }); + }, + onLineChange: function (event) { + this.$emit('linechange', event.detail); + }, + onKeyboardHeightChange: function (event) { + this.$emit('keyboardheightchange', event.detail); + }, + emitChange: function (detail) { + var extraEventParams = this.data.extraEventParams; + this.setData({ value: detail.value }); + var result; + var data = extraEventParams + ? __assign(__assign({}, detail), { callback: function (data) { + result = data; + } }) : detail.value; + this.$emit('input', data); + this.$emit('change', data); + return result; + }, + setShowClear: function () { + var _a = this.data, clearable = _a.clearable, readonly = _a.readonly, clearTrigger = _a.clearTrigger; + var _b = this, focused = _b.focused, value = _b.value; + var showClear = false; + if (clearable && !readonly) { + var hasValue = !!value; + var trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused); + showClear = hasValue && trigger; + } + this.setData({ showClear: showClear }); + }, + noop: function () { }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json index 2c5d25e..5906c50 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json @@ -1,7 +1,7 @@ -{ - "component": true, - "usingComponents": { - "van-cell": "../cell/index", - "van-icon": "../icon/index" - } -} +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml index d40e850..6018993 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml @@ -1,56 +1,56 @@ - - - - - - - {{ label }} - - - - - - - - - - - - - - - - - - - - - {{ value.length >= maxlength ? maxlength : value.length }}/{{ maxlength }} - - - {{ errorMessage }} - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs index 6b90dd2..78575b9 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs @@ -1,18 +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, -}; +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function inputStyle(autosize) { + if (autosize && autosize.constructor === 'Object') { + return style({ + 'min-height': addUnit(autosize.minHeight), + 'max-height': addUnit(autosize.maxHeight), + }); + } + + return ''; +} + +module.exports = { + inputStyle: inputStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss index 171f613..5f7d306 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:#646566;color:var(--field-label-color,#646566)}.van-field__label--disabled{color:#c8c9cc;color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{box-sizing:border-box;padding:3.6px 0;line-height:1.2em;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__control:empty+.van-field__control{display:block}.van-field__control{position:relative;display:none;box-sizing:border-box;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px);min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__control:empty{display:none}.van-field__control--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;opacity:1;color:#c8c9cc;color:var(--field-input-disabled-text-color,#c8c9cc)}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#c8c9cc;color:var(--field-placeholder-text-color,#c8c9cc)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file +@import '../common/index.wxss';.van-field{--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:var(--field-label-color,#646566)}.van-field__label--disabled{color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{align-items:center;display:flex}.van-field__body--textarea{box-sizing:border-box;line-height:1.2em;min-height:var(--cell-line-height,24px);padding:3.6px 0}.van-field__control:empty+.van-field__control{display:block}.van-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,#323233);display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:left;width:100%}.van-field__control:empty{display:none}.van-field__control--textarea{height:var(--field-text-area-min-height,18px);min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;color:var(--field-input-disabled-text-color,#c8c9cc);opacity:1}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__placeholder{color:var(--field-placeholder-text-color,#c8c9cc);left:0;pointer-events:none;position:absolute;right:0;top:0}.van-field__placeholder--error{color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{flex-shrink:0}.van-field__clear-root{color:var(--field-clear-icon-color,#c8c9cc);font-size:var(--field-clear-icon-size,16px)}.van-field__icon-container{color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{color:var(--field-error-message-color,#ee0a24);display:block;font-size:var(--field-error-message-text-font-size,12px);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{color:var(--field-word-limit-color,#646566);font-size:var(--field-word-limit-font-size,12px);line-height:var(--field-word-limit-line-height,16px);margin-top:var(--padding-base,4px);text-align:right}.van-field__word-num{display:inline}.van-field__word-num--full{color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml index 06680df..e39a5ee 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml @@ -1,27 +1,29 @@ - + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js b/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js index 6de6d6c..3cb8dca 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js @@ -1,66 +1,67 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.textareaProps = exports.inputProps = exports.commonProps = void 0; -exports.commonProps = { - value: { - type: String, - observer: function (value) { - if (value !== this.value) { - this.setData({ innerValue: value }); - this.value = value; - } - }, - }, - placeholder: String, - placeholderStyle: String, - placeholderClass: String, - disabled: Boolean, - maxlength: { - type: Number, - value: -1, - }, - cursorSpacing: { - type: Number, - value: 50, - }, - autoFocus: Boolean, - focus: Boolean, - cursor: { - type: Number, - value: -1, - }, - selectionStart: { - type: Number, - value: -1, - }, - selectionEnd: { - type: Number, - value: -1, - }, - adjustPosition: { - type: Boolean, - value: true, - }, - holdKeyboard: Boolean, -}; -exports.inputProps = { - type: { - type: String, - value: 'text', - }, - password: Boolean, - confirmType: String, - confirmHold: Boolean, -}; -exports.textareaProps = { - autoHeight: Boolean, - fixed: Boolean, - showConfirmBar: { - type: Boolean, - value: true, - }, - disableDefaultPadding: { - type: Boolean, - value: true, - }, -}; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.textareaProps = exports.inputProps = exports.commonProps = void 0; +exports.commonProps = { + value: { + type: String, + observer: function (value) { + if (value !== this.value) { + this.setData({ innerValue: value }); + this.value = value; + } + }, + }, + placeholder: String, + placeholderStyle: String, + placeholderClass: String, + disabled: Boolean, + maxlength: { + type: Number, + value: -1, + }, + cursorSpacing: { + type: Number, + value: 50, + }, + autoFocus: Boolean, + focus: Boolean, + cursor: { + type: Number, + value: -1, + }, + selectionStart: { + type: Number, + value: -1, + }, + selectionEnd: { + type: Number, + value: -1, + }, + adjustPosition: { + type: Boolean, + value: true, + }, + holdKeyboard: Boolean, +}; +exports.inputProps = { + type: { + type: String, + value: 'text', + }, + password: Boolean, + confirmType: String, + confirmHold: Boolean, + alwaysEmbed: Boolean, +}; +exports.textareaProps = { + autoHeight: Boolean, + fixed: Boolean, + showConfirmBar: { + type: Boolean, + value: true, + }, + disableDefaultPadding: { + type: Boolean, + value: true, + }, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml index cceecb4..d42c184 100644 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml @@ -1,29 +1,30 @@ - @@ -100,7 +110,7 @@ - 多个邮箱地址用分号;隔开 + 多个邮箱地址用分号;隔开。长度最长为1000,每个邮箱长度最长为50,限制20个邮箱 @@ -111,7 +121,8 @@ - + 已阅读并同意隐私声明 @@ -137,38 +148,41 @@ - - - - - - - + + + 选择预定会议日期 + + + + - - - - - - - - - - + + + + + 选择会议开始时间 + + + + - - - - - - - - - + + + + + 选择会议结束时间 + + + + - - - + + + 当前您不属于任何SIG组,请先在SIG管理中关联SIG组 @@ -183,7 +197,8 @@ - + {{item}} diff --git a/src/openeuler/package-meeting/sig/sig-list.json b/src/openeuler/package-meeting/sig/sig-list.json index f8acfea..64e2a52 100644 --- a/src/openeuler/package-meeting/sig/sig-list.json +++ b/src/openeuler/package-meeting/sig/sig-list.json @@ -1,7 +1,4 @@ { - "usingComponents": { - "van-cell": "@vant/weapp/cell/index", - "van-cell-group": "@vant/weapp/cell-group/index" - }, + "usingComponents": {}, "navigationBarTitleText": "SIG组管理" } \ No newline at end of file diff --git a/src/openeuler/package-my/my/help.js b/src/openeuler/package-my/my/help.js index 526e427..c373aa8 100644 --- a/src/openeuler/package-my/my/help.js +++ b/src/openeuler/package-my/my/help.js @@ -1,5 +1,6 @@ // pages/my/help.js -const resourceUrl = 'https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/help'; +const { OBS_URL } = require('./../../utils/url-config'); +const resourceUrl = `${OBS_URL}/help`; Page({ /** diff --git a/src/openeuler/package-my/my/privecy-seting.js b/src/openeuler/package-my/my/privecy-seting.js index 2a8e5e5..8233959 100644 --- a/src/openeuler/package-my/my/privecy-seting.js +++ b/src/openeuler/package-my/my/privecy-seting.js @@ -41,11 +41,13 @@ Page({ isLogoffDiaShown: false, content: '', deleteText: '', + gitee: '' }, onLoad: function () { this.setData({ avatarUrl: sessionUtil.getUserInfoByKey('avatarUrl'), nickName: sessionUtil.getUserInfoByKey('nickName'), + gitee: sessionUtil.getUserInfoByKey('gitee'), }); }, shownDialog: function (e) { @@ -94,4 +96,4 @@ Page({ isPrivecyDiaShown: false, }); }, -}); +}); \ No newline at end of file diff --git a/src/openeuler/package-my/my/privecy-seting.less b/src/openeuler/package-my/my/privecy-seting.less index 13fd111..8685c45 100644 --- a/src/openeuler/package-my/my/privecy-seting.less +++ b/src/openeuler/package-my/my/privecy-seting.less @@ -16,12 +16,13 @@ display: flex; align-items: center; image { - margin-right: 8rpx; + margin-right: 8rpx; } } image { width: 34rpx; height: 34rpx; + border-radius: 50%; } } @@ -30,6 +31,20 @@ display: flex; align-items: center; } + .name-box { + display: flex; + align-items: flex-start; + flex-direction: column; + font-size: 26rpx; + .gitee { + font-size: 36rpx; + } + .nickname { + margin-top: 20rpx; + font-size: 26rpx; + color: #6d7278; + } + } image { margin-right: 40rpx; width: 135rpx; diff --git a/src/openeuler/package-my/my/privecy-seting.wxml b/src/openeuler/package-my/my/privecy-seting.wxml index eba0154..4a71b0d 100644 --- a/src/openeuler/package-my/my/privecy-seting.wxml +++ b/src/openeuler/package-my/my/privecy-seting.wxml @@ -1,50 +1,51 @@ - @@ -52,7 +53,8 @@ 当前暂无任何会议哦 - + {{curMid}} {{curJoinUrl}} @@ -63,7 +65,8 @@ - + 请确认删除当前会议 @@ -72,7 +75,8 @@ - + diff --git a/src/openeuler/config/services-config.js b/src/openeuler/config/services-config.js index 5d75397..883b216 100644 --- a/src/openeuler/config/services-config.js +++ b/src/openeuler/config/services-config.js @@ -5,9 +5,15 @@ let commonServiceConfig = { // 登录接口 LOGIN: '/login/', - // 登录接口 + // 刷新 token + REFRESH: '/refresh/', + + // SIG列表接口 SIG_LIST: '/groups/', + // 有会议的sig列表 + MEETING_SIG_LIST: '/meetings_group/', + // 获取sig组已添加成员列表 SIG_MEMBER_LIST: '/users_include/{id}/', diff --git a/src/openeuler/miniprogram_npm/eventemitter3/index.js b/src/openeuler/miniprogram_npm/eventemitter3/index.js deleted file mode 100644 index 5f4e7a9..0000000 --- a/src/openeuler/miniprogram_npm/eventemitter3/index.js +++ /dev/null @@ -1,349 +0,0 @@ -module.exports = (function() { -var __MODS__ = {}; -var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; -var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; -var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; -var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; -__DEFINE__(1698905245833, function(require, module, exports) { - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; - -/** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private - */ -function Events() {} - -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} - -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; -}; - -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if ('undefined' !== typeof module) { - module.exports = EventEmitter; -} - -}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) -return __REQUIRE__(1698905245833); -})() -//miniprogram-npm-outsideDeps=[] -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/eventemitter3/index.js.map b/src/openeuler/miniprogram_npm/eventemitter3/index.js.map deleted file mode 100644 index 4f2cb7b..0000000 --- a/src/openeuler/miniprogram_npm/eventemitter3/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n"]} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/widget-ui/index.js b/src/openeuler/miniprogram_npm/widget-ui/index.js deleted file mode 100644 index 0959773..0000000 --- a/src/openeuler/miniprogram_npm/widget-ui/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = (function() { -var __MODS__ = {}; -var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; -var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; -var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; -var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; -__DEFINE__(1698905245834, function(require, module, exports) { -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var r in o)("object"==typeof exports?exports:t)[r]=o[r]}}(this,(function(){return function(t){var e={};function o(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(r,i,function(e){return t[e]}.bind(null,i));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=0)}([function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(o(1)),l=o(2),n=0,a=function(){function t(e){var o=this;void 0===e&&(e={}),this.parent=null,this.id=t.uuid(),this.style={},this.computedStyle={},this.lastComputedStyle={},this.children={},this.layoutBox={left:0,top:0,width:0,height:0},e=Object.assign(l.getDefaultStyle(),e),this.computedStyle=Object.assign(l.getDefaultStyle(),e),this.lastComputedStyle=Object.assign(l.getDefaultStyle(),e),Object.keys(e).forEach((function(t){Object.defineProperty(o.style,t,{configurable:!0,enumerable:!0,get:function(){return e[t]},set:function(r){r!==e[t]&&void 0!==r&&(o.lastComputedStyle=o.computedStyle[t],e[t]=r,o.computedStyle[t]=r,l.scalableStyles.includes(t)&&o.style.scale&&(o.computedStyle[t]=r*o.style.scale),"scale"===t&&l.scalableStyles.forEach((function(t){e[t]&&(o.computedStyle[t]=e[t]*r)})),"hidden"===t&&(r?l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=0})):l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=o.lastComputedStyle[t]}))))}})})),this.style.scale&&l.scalableStyles.forEach((function(t){if(o.style[t]){var e=o.style[t]*o.style.scale;o.computedStyle[t]=e}})),e.hidden&&l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=0}))}return t.uuid=function(){return n++},t.prototype.getAbsolutePosition=function(t){if(!t)return this.getAbsolutePosition(this);if(!t.parent)return{left:0,top:0};var e=this.getAbsolutePosition(t.parent),o=e.left,r=e.top;return{left:o+t.layoutBox.left,top:r+t.layoutBox.top}},t.prototype.add=function(t){t.parent=this,this.children[t.id]=t},t.prototype.remove=function(t){var e=this;t?this.children[t.id]&&(t.remove(),delete this.children[t.id]):Object.keys(this.children).forEach((function(t){e.children[t].remove(),delete e.children[t]}))},t.prototype.getNodeTree=function(){var t=this;return{id:this.id,style:this.computedStyle,children:Object.keys(this.children).map((function(e){return t.children[e].getNodeTree()}))}},t.prototype.applyLayout=function(t){var e=this;["left","top","width","height"].forEach((function(o){t.layout&&"number"==typeof t.layout[o]&&(e.layoutBox[o]=t.layout[o],!e.parent||"left"!==o&&"top"!==o||(e.layoutBox[o]+=e.parent.layoutBox[o]))})),t.children.forEach((function(t){e.children[t.id].applyLayout(t)}))},t.prototype.layout=function(){var t=this.getNodeTree();i.default(t),this.applyLayout(t)},t}();e.default=a},function(t,e,o){o.r(e);var r=function(){var t,e="inherit",o="ltr",r="rtl",i="row",l="row-reverse",n="column",a="column-reverse",u="flex-start",d="center",s="flex-end",y="space-between",c="space-around",f="flex-start",h="center",p="flex-end",g="stretch",v="relative",m="absolute",b={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},x={row:"right","row-reverse":"left",column:"bottom","column-reverse":"top"},w={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},S={row:"width","row-reverse":"width",column:"height","column-reverse":"height"};function W(t){return void 0===t}function L(t){return t===i||t===l}function k(t,e){if(void 0!==t.style.marginStart&&L(e))return t.style.marginStart;var o=null;switch(e){case"row":o=t.style.marginLeft;break;case"row-reverse":o=t.style.marginRight;break;case"column":o=t.style.marginTop;break;case"column-reverse":o=t.style.marginBottom}return void 0!==o?o:void 0!==t.style.margin?t.style.margin:0}function j(t,e){if(void 0!==t.style.marginEnd&&L(e))return t.style.marginEnd;var o=null;switch(e){case"row":o=t.style.marginRight;break;case"row-reverse":o=t.style.marginLeft;break;case"column":o=t.style.marginBottom;break;case"column-reverse":o=t.style.marginTop}return null!=o?o:void 0!==t.style.margin?t.style.margin:0}function B(t,e){if(void 0!==t.style.borderStartWidth&&t.style.borderStartWidth>=0&&L(e))return t.style.borderStartWidth;var o=null;switch(e){case"row":o=t.style.borderLeftWidth;break;case"row-reverse":o=t.style.borderRightWidth;break;case"column":o=t.style.borderTopWidth;break;case"column-reverse":o=t.style.borderBottomWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function E(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&L(e))return t.style.borderEndWidth;var o=null;switch(e){case"row":o=t.style.borderRightWidth;break;case"row-reverse":o=t.style.borderLeftWidth;break;case"column":o=t.style.borderBottomWidth;break;case"column-reverse":o=t.style.borderTopWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function C(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&L(e))return t.style.paddingStart;var o=null;switch(e){case"row":o=t.style.paddingLeft;break;case"row-reverse":o=t.style.paddingRight;break;case"column":o=t.style.paddingTop;break;case"column-reverse":o=t.style.paddingBottom}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+B(t,e)}function T(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&L(e))return t.style.paddingEnd;var o=null;switch(e){case"row":o=t.style.paddingRight;break;case"row-reverse":o=t.style.paddingLeft;break;case"column":o=t.style.paddingBottom;break;case"column-reverse":o=t.style.paddingTop}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+E(t,e)}function O(t,e){return B(t,e)+E(t,e)}function _(t,e){return k(t,e)+j(t,e)}function R(t,e){return C(t,e)+T(t,e)}function A(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:"stretch"}function P(t,e){if(e===r){if(t===i)return l;if(t===l)return i}return t}function D(t,e){return function(t){return t===n||t===a}(t)?P(i,e):n}function H(t){return t.style.position?t.style.position:"relative"}function M(t){return H(t)===v&&t.style.flex>0}function I(t,e){return t.layout[S[e]]+_(t,e)}function N(t,e){return void 0!==t.style[S[e]]&&t.style[S[e]]>=0}function F(t,e){return void 0!==t.style[e]}function q(t,e){return void 0!==t.style[e]?t.style[e]:0}function z(t,e,o){var r={row:t.style.minWidth,"row-reverse":t.style.minWidth,column:t.style.minHeight,"column-reverse":t.style.minHeight}[e],i={row:t.style.maxWidth,"row-reverse":t.style.maxWidth,column:t.style.maxHeight,"column-reverse":t.style.maxHeight}[e],l=o;return void 0!==i&&i>=0&&l>i&&(l=i),void 0!==r&&r>=0&&le?t:e}function G(t,e){void 0===t.layout[S[e]]&&N(t,e)&&(t.layout[S[e]]=U(z(t,e,t.style[S[e]]),R(t,e)))}function J(t,e,o){e.layout[x[o]]=t.layout[S[o]]-e.layout[S[o]]-e.layout[w[o]]}function K(t,e){return void 0!==t.style[b[e]]?q(t,b[e]):-q(t,x[e])}function Q(r,E,Q){var X=function(t,r){var i;return(i=t.style.direction?t.style.direction:e)===e&&(i=void 0===r?o:r),i}(r,Q),Y=P(function(t){return t.style.flexDirection?t.style.flexDirection:n}(r),X),Z=D(Y,X),$=P(i,X);G(r,Y),G(r,Z),r.layout.direction=X,r.layout[b[Y]]+=k(r,Y)+K(r,Y),r.layout[x[Y]]+=j(r,Y)+K(r,Y),r.layout[b[Z]]+=k(r,Z)+K(r,Z),r.layout[x[Z]]+=j(r,Z)+K(r,Z);var tt=r.children.length,et=R(r,$);if(function(t){return void 0!==t.style.measure}(r)){var ot=!W(r.layout[S[$]]),rt=t;rt=N(r,$)?r.style.width:ot?r.layout[S[$]]:E-_(r,$),rt-=et;var it=!N(r,$)&&!ot,lt=!N(r,n)&&W(r.layout[S[n]]);if(it||lt){var nt=r.style.measure(rt);it&&(r.layout.width=nt.width+et),lt&&(r.layout.height=nt.height+R(r,n))}if(0===tt)return}var at,ut,dt,st,yt=function(t){return"wrap"===t.style.flexWrap}(r),ct=function(t){return t.style.justifyContent?t.style.justifyContent:"flex-start"}(r),ft=C(r,Y),ht=C(r,Z),pt=R(r,Y),gt=R(r,Z),vt=!W(r.layout[S[Y]]),mt=!W(r.layout[S[Z]]),bt=L(Y),xt=null,wt=null,St=t;vt&&(St=r.layout[S[Y]]-pt);for(var Wt=0,Lt=0,kt=0,jt=0,Bt=0,Et=0;LtSt&&at!==Wt){Rt--,kt=1;break}At&&(H(dt)!==v||M(dt))&&(At=!1,Pt=at),Dt&&(H(dt)!==v||Xt!==g&&Xt!==f||W(dt.layout[S[Z]]))&&(Dt=!1,Ht=at),At&&(dt.layout[w[Y]]+=Nt,vt&&J(r,dt,Y),Nt+=I(dt,Y),Ft=U(Ft,z(dt,Z,I(dt,Z)))),Dt&&(dt.layout[w[Z]]+=jt+ht,mt&&J(r,dt,Z)),kt=0,Tt+=qt,Lt=at+1}var zt=0,Ut=0,Gt=0;if(Gt=vt?St-Tt:U(Tt,0)-Tt,0!==Ot){var Jt,Kt,Qt=Gt/_t;for(It=Mt;null!==It;)(Jt=Qt*It.style.flex+R(It,Y))!==(Kt=z(It,Y,Jt))&&(Gt-=Kt,_t-=It.style.flex),It=It.nextFlexChild;for((Qt=Gt/_t)<0&&(Qt=0),It=Mt;null!==It;)It.layout[S[Y]]=z(It,Y,Qt*It.style.flex+R(It,Y)),Ct=t,N(r,$)?Ct=r.layout[S[$]]-et:bt||(Ct=E-_(r,$)-et),V(It,Ct,X),dt=It,It=It.nextFlexChild,dt.nextFlexChild=null}else ct!==u&&(ct===d?zt=Gt/2:ct===s?zt=Gt:ct===y?(Gt=U(Gt,0),Ut=Ot+Rt-1!=0?Gt/(Ot+Rt-1):0):ct===c&&(zt=(Ut=Gt/(Ot+Rt))/2));for(Nt+=zt,at=Pt;at1&&mt){var $t=r.layout[S[Z]]-gt,te=$t-jt,ee=0,oe=ht,re=function(t){return t.style.alignContent?t.style.alignContent:"flex-start"}(r);re===p?oe+=te:re===h?oe+=te/2:re===g&&$t>jt&&(ee=te/Et);var ie=0;for(at=0;at=0&&L(e))return t.style.borderStartWidth;var o=null;switch(e){case\"row\":o=t.style.borderLeftWidth;break;case\"row-reverse\":o=t.style.borderRightWidth;break;case\"column\":o=t.style.borderTopWidth;break;case\"column-reverse\":o=t.style.borderBottomWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function E(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&L(e))return t.style.borderEndWidth;var o=null;switch(e){case\"row\":o=t.style.borderRightWidth;break;case\"row-reverse\":o=t.style.borderLeftWidth;break;case\"column\":o=t.style.borderBottomWidth;break;case\"column-reverse\":o=t.style.borderTopWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function C(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&L(e))return t.style.paddingStart;var o=null;switch(e){case\"row\":o=t.style.paddingLeft;break;case\"row-reverse\":o=t.style.paddingRight;break;case\"column\":o=t.style.paddingTop;break;case\"column-reverse\":o=t.style.paddingBottom}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+B(t,e)}function T(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&L(e))return t.style.paddingEnd;var o=null;switch(e){case\"row\":o=t.style.paddingRight;break;case\"row-reverse\":o=t.style.paddingLeft;break;case\"column\":o=t.style.paddingBottom;break;case\"column-reverse\":o=t.style.paddingTop}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+E(t,e)}function O(t,e){return B(t,e)+E(t,e)}function _(t,e){return k(t,e)+j(t,e)}function R(t,e){return C(t,e)+T(t,e)}function A(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:\"stretch\"}function P(t,e){if(e===r){if(t===i)return l;if(t===l)return i}return t}function D(t,e){return function(t){return t===n||t===a}(t)?P(i,e):n}function H(t){return t.style.position?t.style.position:\"relative\"}function M(t){return H(t)===v&&t.style.flex>0}function I(t,e){return t.layout[S[e]]+_(t,e)}function N(t,e){return void 0!==t.style[S[e]]&&t.style[S[e]]>=0}function F(t,e){return void 0!==t.style[e]}function q(t,e){return void 0!==t.style[e]?t.style[e]:0}function z(t,e,o){var r={row:t.style.minWidth,\"row-reverse\":t.style.minWidth,column:t.style.minHeight,\"column-reverse\":t.style.minHeight}[e],i={row:t.style.maxWidth,\"row-reverse\":t.style.maxWidth,column:t.style.maxHeight,\"column-reverse\":t.style.maxHeight}[e],l=o;return void 0!==i&&i>=0&&l>i&&(l=i),void 0!==r&&r>=0&&le?t:e}function G(t,e){void 0===t.layout[S[e]]&&N(t,e)&&(t.layout[S[e]]=U(z(t,e,t.style[S[e]]),R(t,e)))}function J(t,e,o){e.layout[x[o]]=t.layout[S[o]]-e.layout[S[o]]-e.layout[w[o]]}function K(t,e){return void 0!==t.style[b[e]]?q(t,b[e]):-q(t,x[e])}function Q(r,E,Q){var X=function(t,r){var i;return(i=t.style.direction?t.style.direction:e)===e&&(i=void 0===r?o:r),i}(r,Q),Y=P(function(t){return t.style.flexDirection?t.style.flexDirection:n}(r),X),Z=D(Y,X),$=P(i,X);G(r,Y),G(r,Z),r.layout.direction=X,r.layout[b[Y]]+=k(r,Y)+K(r,Y),r.layout[x[Y]]+=j(r,Y)+K(r,Y),r.layout[b[Z]]+=k(r,Z)+K(r,Z),r.layout[x[Z]]+=j(r,Z)+K(r,Z);var tt=r.children.length,et=R(r,$);if(function(t){return void 0!==t.style.measure}(r)){var ot=!W(r.layout[S[$]]),rt=t;rt=N(r,$)?r.style.width:ot?r.layout[S[$]]:E-_(r,$),rt-=et;var it=!N(r,$)&&!ot,lt=!N(r,n)&&W(r.layout[S[n]]);if(it||lt){var nt=r.style.measure(rt);it&&(r.layout.width=nt.width+et),lt&&(r.layout.height=nt.height+R(r,n))}if(0===tt)return}var at,ut,dt,st,yt=function(t){return\"wrap\"===t.style.flexWrap}(r),ct=function(t){return t.style.justifyContent?t.style.justifyContent:\"flex-start\"}(r),ft=C(r,Y),ht=C(r,Z),pt=R(r,Y),gt=R(r,Z),vt=!W(r.layout[S[Y]]),mt=!W(r.layout[S[Z]]),bt=L(Y),xt=null,wt=null,St=t;vt&&(St=r.layout[S[Y]]-pt);for(var Wt=0,Lt=0,kt=0,jt=0,Bt=0,Et=0;LtSt&&at!==Wt){Rt--,kt=1;break}At&&(H(dt)!==v||M(dt))&&(At=!1,Pt=at),Dt&&(H(dt)!==v||Xt!==g&&Xt!==f||W(dt.layout[S[Z]]))&&(Dt=!1,Ht=at),At&&(dt.layout[w[Y]]+=Nt,vt&&J(r,dt,Y),Nt+=I(dt,Y),Ft=U(Ft,z(dt,Z,I(dt,Z)))),Dt&&(dt.layout[w[Z]]+=jt+ht,mt&&J(r,dt,Z)),kt=0,Tt+=qt,Lt=at+1}var zt=0,Ut=0,Gt=0;if(Gt=vt?St-Tt:U(Tt,0)-Tt,0!==Ot){var Jt,Kt,Qt=Gt/_t;for(It=Mt;null!==It;)(Jt=Qt*It.style.flex+R(It,Y))!==(Kt=z(It,Y,Jt))&&(Gt-=Kt,_t-=It.style.flex),It=It.nextFlexChild;for((Qt=Gt/_t)<0&&(Qt=0),It=Mt;null!==It;)It.layout[S[Y]]=z(It,Y,Qt*It.style.flex+R(It,Y)),Ct=t,N(r,$)?Ct=r.layout[S[$]]-et:bt||(Ct=E-_(r,$)-et),V(It,Ct,X),dt=It,It=It.nextFlexChild,dt.nextFlexChild=null}else ct!==u&&(ct===d?zt=Gt/2:ct===s?zt=Gt:ct===y?(Gt=U(Gt,0),Ut=Ot+Rt-1!=0?Gt/(Ot+Rt-1):0):ct===c&&(zt=(Ut=Gt/(Ot+Rt))/2));for(Nt+=zt,at=Pt;at1&&mt){var $t=r.layout[S[Z]]-gt,te=$t-jt,ee=0,oe=ht,re=function(t){return t.style.alignContent?t.style.alignContent:\"flex-start\"}(r);re===p?oe+=te:re===h?oe+=te/2:re===g&&$t>jt&&(ee=te/Et);var ie=0;for(at=0;at { - let result = null - - if (/^#/.test(color) && (color.length === 7 || color.length === 9)) { - return color - // eslint-disable-next-line no-cond-assign - } else if ((result = /^(rgb|rgba)\((.+)\)/.exec(color)) !== null) { - return '#' + result[2].split(',').map((part, index) => { - part = part.trim() - part = index === 3 ? Math.floor(parseFloat(part) * 255) : parseInt(part, 10) - part = part.toString(16) - if (part.length === 1) { - part = '0' + part - } - return part - }).join('') - } else { - return '#00000000' - } -} - -const splitLineToCamelCase = (str) => str.split('-').map((part, index) => { - if (index === 0) { - return part - } - return part[0].toUpperCase() + part.slice(1) -}).join('') - -const 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 - } else if (num1 < num2) { - return -1 - } - } - - return 0 -} - -module.exports = { - hex, - splitLineToCamelCase, - compareVersion -} - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - -const xmlParse = __webpack_require__(2) -const {Widget} = __webpack_require__(3) -const {Draw} = __webpack_require__(5) -const {compareVersion} = __webpack_require__(0) - -const canvasId = 'weui-canvas' - -Component({ - properties: { - width: { - type: Number, - value: 400 - }, - height: { - type: Number, - value: 300 - } - }, - data: { - use2dCanvas: false, // 2.9.2 后可用canvas 2d 接口 - }, - lifetimes: { - attached() { - const {SDKVersion, pixelRatio: dpr} = wx.getSystemInfoSync() - const use2dCanvas = compareVersion(SDKVersion, '2.9.2') >= 0 - this.dpr = dpr - this.setData({use2dCanvas}, () => { - if (use2dCanvas) { - const query = this.createSelectorQuery() - query.select(`#${canvasId}`) - .fields({node: true, size: true}) - .exec(res => { - const canvas = res[0].node - const ctx = canvas.getContext('2d') - canvas.width = res[0].width * dpr - canvas.height = res[0].height * dpr - ctx.scale(dpr, dpr) - this.ctx = ctx - this.canvas = canvas - }) - } else { - this.ctx = wx.createCanvasContext(canvasId, this) - } - }) - } - }, - methods: { - async renderToCanvas(args) { - const {wxml, style} = args - const ctx = this.ctx - const canvas = this.canvas - const use2dCanvas = this.data.use2dCanvas - - if (use2dCanvas && !canvas) { - return Promise.reject(new Error('renderToCanvas: fail canvas has not been created')) - } - - ctx.clearRect(0, 0, this.data.width, this.data.height) - const {root: xom} = xmlParse(wxml) - - const widget = new Widget(xom, style) - const container = widget.init() - this.boundary = { - top: container.layoutBox.top, - left: container.layoutBox.left, - width: container.computedStyle.width, - height: container.computedStyle.height, - } - const draw = new Draw(ctx, canvas, use2dCanvas) - await draw.drawNode(container) - - if (!use2dCanvas) { - await this.canvasDraw(ctx) - } - return Promise.resolve(container) - }, - - canvasDraw(ctx, reserve) { - return new Promise(resolve => { - ctx.draw(reserve, () => { - resolve() - }) - }) - }, - - canvasToTempFilePath(args = {}) { - const use2dCanvas = this.data.use2dCanvas - - return new Promise((resolve, reject) => { - const { - top, left, width, height - } = this.boundary - - const copyArgs = { - x: left, - y: top, - width, - height, - destWidth: width * this.dpr, - destHeight: height * this.dpr, - canvasId, - fileType: args.fileType || 'png', - quality: args.quality || 1, - success: resolve, - fail: reject - } - - if (use2dCanvas) { - delete copyArgs.canvasId - copyArgs.canvas = this.canvas - } - wx.canvasToTempFilePath(copyArgs, this) - }) - } - } -}) - - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - - -/** - * Module dependencies. - */ - - -/** - * Expose `parse`. - */ - - -/** - * Parse the given string of `xml`. - * - * @param {String} xml - * @return {Object} - * @api public - */ - -function parse(xml) { - xml = xml.trim() - - // strip comments - xml = xml.replace(//g, '') - - return document() - - /** - * XML document. - */ - - function document() { - return { - declaration: declaration(), - root: tag() - } - } - - /** - * Declaration. - */ - - function declaration() { - const m = match(/^<\?xml\s*/) - if (!m) return - - // tag - const node = { - attributes: {} - } - - // attributes - while (!(eos() || is('?>'))) { - const attr = attribute() - if (!attr) return node - node.attributes[attr.name] = attr.value - } - - match(/\?>\s*/) - - return node - } - - /** - * Tag. - */ - - function tag() { - const m = match(/^<([\w-:.]+)\s*/) - if (!m) return - - // name - const node = { - name: m[1], - attributes: {}, - children: [] - } - - // attributes - while (!(eos() || is('>') || is('?>') || is('/>'))) { - const attr = attribute() - if (!attr) return node - node.attributes[attr.name] = attr.value - } - - // self closing tag - if (match(/^\s*\/>\s*/)) { - return node - } - - match(/\??>\s*/) - - // content - node.content = content() - - // children - let child - while (child = tag()) { - node.children.push(child) - } - - // closing - match(/^<\/[\w-:.]+>\s*/) - - return node - } - - /** - * Text content. - */ - - function content() { - const m = match(/^([^<]*)/) - if (m) return m[1] - return '' - } - - /** - * Attribute. - */ - - function attribute() { - const m = match(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/) - if (!m) return - return {name: m[1], value: strip(m[2])} - } - - /** - * Strip quotes from `val`. - */ - - function strip(val) { - return val.replace(/^['"]|['"]$/g, '') - } - - /** - * Match `re` and advance the string. - */ - - function match(re) { - const m = xml.match(re) - if (!m) return - xml = xml.slice(m[0].length) - return m - } - - /** - * End-of-source. - */ - - function eos() { - return xml.length == 0 - } - - /** - * Check for `prefix`. - */ - - function is(prefix) { - return xml.indexOf(prefix) == 0 - } -} - -module.exports = parse - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -const Block = __webpack_require__(4) -const {splitLineToCamelCase} = __webpack_require__(0) - -class Element extends Block { - constructor(prop) { - super(prop.style) - this.name = prop.name - this.attributes = prop.attributes - } -} - - -class Widget { - constructor(xom, style) { - this.xom = xom - this.style = style - - this.inheritProps = ['fontSize', 'lineHeight', 'textAlign', 'verticalAlign', 'color'] - } - - init() { - this.container = this.create(this.xom) - this.container.layout() - - this.inheritStyle(this.container) - return this.container - } - - // 继承父节点的样式 - inheritStyle(node) { - const parent = node.parent || null - const children = node.children || {} - const computedStyle = node.computedStyle - - if (parent) { - this.inheritProps.forEach(prop => { - computedStyle[prop] = computedStyle[prop] || parent.computedStyle[prop] - }) - } - - Object.values(children).forEach(child => { - this.inheritStyle(child) - }) - } - - create(node) { - let classNames = (node.attributes.class || '').split(' ') - classNames = classNames.map(item => splitLineToCamelCase(item.trim())) - const style = {} - classNames.forEach(item => { - Object.assign(style, this.style[item] || {}) - }) - - const args = {name: node.name, style} - - const attrs = Object.keys(node.attributes) - const attributes = {} - for (const attr of attrs) { - const value = node.attributes[attr] - const CamelAttr = splitLineToCamelCase(attr) - - if (value === '' || value === 'true') { - attributes[CamelAttr] = true - } else if (value === 'false') { - attributes[CamelAttr] = false - } else { - attributes[CamelAttr] = value - } - } - attributes.text = node.content - args.attributes = attributes - const element = new Element(args) - node.children.forEach(childNode => { - const childElement = this.create(childNode) - element.add(childElement) - }) - return element - } -} - -module.exports = {Widget} - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = require("widget-ui"); - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -class Draw { - constructor(context, canvas, use2dCanvas = false) { - this.ctx = context - this.canvas = canvas || null - this.use2dCanvas = use2dCanvas - } - - roundRect(x, y, w, h, r, fill = true, stroke = false) { - if (r < 0) return - const ctx = this.ctx - - ctx.beginPath() - ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 3 / 2) - ctx.arc(x + w - r, y + r, r, Math.PI * 3 / 2, 0) - ctx.arc(x + w - r, y + h - r, r, 0, Math.PI / 2) - ctx.arc(x + r, y + h - r, r, Math.PI / 2, Math.PI) - ctx.lineTo(x, y + r) - if (stroke) ctx.stroke() - if (fill) ctx.fill() - } - - drawView(box, style) { - const ctx = this.ctx - const { - left: x, top: y, width: w, height: h - } = box - const { - borderRadius = 0, - borderWidth = 0, - borderColor, - color = '#000', - backgroundColor = 'transparent', - } = style - ctx.save() - // 外环 - if (borderWidth > 0) { - ctx.fillStyle = borderColor || color - this.roundRect(x, y, w, h, borderRadius) - } - - // 内环 - ctx.fillStyle = backgroundColor - const innerWidth = w - 2 * borderWidth - const innerHeight = h - 2 * borderWidth - const innerRadius = borderRadius - borderWidth >= 0 ? borderRadius - borderWidth : 0 - this.roundRect(x + borderWidth, y + borderWidth, innerWidth, innerHeight, innerRadius) - ctx.restore() - } - - async drawImage(img, box, style) { - await new Promise((resolve, reject) => { - const ctx = this.ctx - const canvas = this.canvas - - const { - borderRadius = 0 - } = style - const { - left: x, top: y, width: w, height: h - } = box - ctx.save() - this.roundRect(x, y, w, h, borderRadius, false, false) - ctx.clip() - - const _drawImage = (img) => { - if (this.use2dCanvas) { - const Image = canvas.createImage() - Image.onload = () => { - ctx.drawImage(Image, x, y, w, h) - ctx.restore() - resolve() - } - Image.onerror = () => { reject(new Error(`createImage fail: ${img}`)) } - Image.src = img - } else { - ctx.drawImage(img, x, y, w, h) - ctx.restore() - resolve() - } - } - - const isTempFile = /^wxfile:\/\//.test(img) - const isNetworkFile = /^https?:\/\//.test(img) - - if (isTempFile) { - _drawImage(img) - } else if (isNetworkFile) { - wx.downloadFile({ - url: img, - success(res) { - if (res.statusCode === 200) { - _drawImage(res.tempFilePath) - } else { - reject(new Error(`downloadFile:fail ${img}`)) - } - }, - fail() { - reject(new Error(`downloadFile:fail ${img}`)) - } - }) - } else { - reject(new Error(`image format error: ${img}`)) - } - }) - } - - // eslint-disable-next-line complexity - drawText(text, box, style) { - const ctx = this.ctx - let { - left: x, top: y, width: w, height: h - } = box - let { - color = '#000', - lineHeight = '1.4em', - fontSize = 14, - textAlign = 'left', - verticalAlign = 'top', - backgroundColor = 'transparent' - } = style - - if (typeof lineHeight === 'string') { // 2em - lineHeight = Math.ceil(parseFloat(lineHeight.replace('em')) * fontSize) - } - if (!text || (lineHeight > h)) return - - ctx.save() - ctx.textBaseline = 'top' - ctx.font = `${fontSize}px sans-serif` - ctx.textAlign = textAlign - - // 背景色 - ctx.fillStyle = backgroundColor - this.roundRect(x, y, w, h, 0) - - // 文字颜色 - ctx.fillStyle = color - - // 水平布局 - switch (textAlign) { - case 'left': - break - case 'center': - x += 0.5 * w - break - case 'right': - x += w - break - default: break - } - - const textWidth = ctx.measureText(text).width - const actualHeight = Math.ceil(textWidth / w) * lineHeight - let paddingTop = Math.ceil((h - actualHeight) / 2) - if (paddingTop < 0) paddingTop = 0 - - // 垂直布局 - switch (verticalAlign) { - case 'top': - break - case 'middle': - y += paddingTop - break - case 'bottom': - y += 2 * paddingTop - break - default: break - } - - const inlinePaddingTop = Math.ceil((lineHeight - fontSize) / 2) - - // 不超过一行 - if (textWidth <= w) { - ctx.fillText(text, x, y + inlinePaddingTop) - return - } - - // 多行文本 - const chars = text.split('') - const _y = y - - // 逐行绘制 - let line = '' - for (const ch of chars) { - const testLine = line + ch - const testWidth = ctx.measureText(testLine).width - - if (testWidth > w) { - ctx.fillText(line, x, y + inlinePaddingTop) - y += lineHeight - line = ch - if ((y + lineHeight) > (_y + h)) break - } else { - line = testLine - } - } - - // 避免溢出 - if ((y + lineHeight) <= (_y + h)) { - ctx.fillText(line, x, y + inlinePaddingTop) - } - ctx.restore() - } - - async drawNode(element) { - const {layoutBox, computedStyle, name} = element - const {src, text} = element.attributes - if (name === 'view') { - this.drawView(layoutBox, computedStyle) - } else if (name === 'image') { - await this.drawImage(src, layoutBox, computedStyle) - } else if (name === 'text') { - this.drawText(text, layoutBox, computedStyle) - } - const childs = Object.values(element.children) - for (const child of childs) { - await this.drawNode(child) - } - } -} - - -module.exports = { - Draw -} - - -/***/ }) -/******/ ]); -}); \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/wxml-to-canvas/index.json b/src/openeuler/miniprogram_npm/wxml-to-canvas/index.json deleted file mode 100644 index e8cfaaf..0000000 --- a/src/openeuler/miniprogram_npm/wxml-to-canvas/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/wxml-to-canvas/index.wxml b/src/openeuler/miniprogram_npm/wxml-to-canvas/index.wxml deleted file mode 100644 index a0010ad..0000000 --- a/src/openeuler/miniprogram_npm/wxml-to-canvas/index.wxml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/wxml-to-canvas/index.wxss b/src/openeuler/miniprogram_npm/wxml-to-canvas/index.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/src/openeuler/miniprogram_npm/wxml-to-canvas/utils.js b/src/openeuler/miniprogram_npm/wxml-to-canvas/utils.js deleted file mode 100644 index c3cf7d7..0000000 --- a/src/openeuler/miniprogram_npm/wxml-to-canvas/utils.js +++ /dev/null @@ -1,57 +0,0 @@ -const hex = (color) => { - let result = null - - if (/^#/.test(color) && (color.length === 7 || color.length === 9)) { - return color - // eslint-disable-next-line no-cond-assign - } else if ((result = /^(rgb|rgba)\((.+)\)/.exec(color)) !== null) { - return '#' + result[2].split(',').map((part, index) => { - part = part.trim() - part = index === 3 ? Math.floor(parseFloat(part) * 255) : parseInt(part, 10) - part = part.toString(16) - if (part.length === 1) { - part = '0' + part - } - return part - }).join('') - } else { - return '#00000000' - } -} - -const splitLineToCamelCase = (str) => str.split('-').map((part, index) => { - if (index === 0) { - return part - } - return part[0].toUpperCase() + part.slice(1) -}).join('') - -const 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 - } else if (num1 < num2) { - return -1 - } - } - - return 0 -} - -module.exports = { - hex, - splitLineToCamelCase, - compareVersion -} diff --git a/src/openeuler/package-events/events/event-list.js b/src/openeuler/package-events/events/event-list.js index 27f5738..4b7d280 100644 --- a/src/openeuler/package-events/events/event-list.js +++ b/src/openeuler/package-events/events/event-list.js @@ -4,12 +4,13 @@ const sessionUtil = require('../../utils/app-session.js'); let that = null; let remoteMethods = { - getList: function (_callback) { + getList: function (params, _callback) { appAjax.postJson({ autoShowWait: true, type: 'GET', service: 'ALL_EVENTS_LIST', data: { + ...params, activity: that.data.activity, activity_type: that.data.curFilterType, search: that.data.curKeyword, @@ -112,6 +113,11 @@ Page({ name: '线上', }, ], + pageParams: { + page: 1, + size: 50, + }, + total: 0, list: [], actionShow: false, actions: [], @@ -132,15 +138,12 @@ Page({ */ onLoad: function () { that = this; - remoteMethods.getList((res) => { + this.initData(); + remoteMethods.getCount((res) => { that.setData({ - list: res, + 'pageParams.page': 1, level: sessionUtil.getUserInfoByKey('eventLevel') || 1, user: sessionUtil.getUserInfoByKey('userId'), - }); - }); - remoteMethods.getCount((res) => { - that.setData({ allNum: res.all_activities_count, signUpNum: res.registering_activities_count, goingNum: res.going_activities_count, @@ -148,11 +151,33 @@ Page({ }); }); }, - + initData() { + let renderData = []; + remoteMethods.getList(this.data.pageParams, (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } + this.setData({ + list: renderData, + total: data.total, + }); + }); + }, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, + }); + this.initData(); + }, /** * 生命周期函数--监听页面显示 */ - onShow: function () {}, search: function (e) { this.setData({ curKeyword: e.detail.value, diff --git a/src/openeuler/package-events/events/event-list.wxml b/src/openeuler/package-events/events/event-list.wxml index ebdcba4..95ddd9b 100644 --- a/src/openeuler/package-events/events/event-list.wxml +++ b/src/openeuler/package-events/events/event-list.wxml @@ -2,7 +2,7 @@ - + {{curfilterTypeName}} @@ -46,7 +46,7 @@ - {{item.address||item.join_url}} + {{item.address||item.join_url || ''}} @@ -56,7 +56,8 @@ - - - - @@ -83,18 +87,22 @@ - + - + 暂无活动! - + 请确认下架当前活动 @@ -103,7 +111,8 @@ - + 活动一经发布,暂不支持自行下架删除。如有需要,请联系 @@ -115,7 +124,8 @@ - + 您暂时没有预定会议的权限,请联系 diff --git a/src/openeuler/package-events/events/poster.js b/src/openeuler/package-events/events/poster.js index 0ea153e..3dfd2d3 100644 --- a/src/openeuler/package-events/events/poster.js +++ b/src/openeuler/package-events/events/poster.js @@ -1,6 +1,4 @@ -// package-events/events/poster.js const appAjax = require('./../../utils/app-ajax'); -const { wxml, style } = require('./wxml-to-canvas.js'); let that = null; let remoteMethods = { @@ -37,7 +35,6 @@ Page({ */ onLoad: function (options) { that = this; - this.widget = this.selectComponent('.widget'); this.setData({ id: options.id || '', isDraft: options.isDraft, @@ -62,52 +59,14 @@ Page({ }); } }, + onShow() { + wx.showToast({ + title: '如有需要请截图保存海报~', + icon: 'none', + duration: 4000, + }); + }, back() { wx.navigateBack(); }, - saveToAlbum() { - wx.showLoading({ - title: '保存中', - mask: true, - }); - const p1 = this.widget.renderToCanvas({ - wxml: wxml({ - title: that.data.info.title, - date: that.data.info.date, - address: that.data.info.detail_address, - poster: that.data.info.poster, - qrcode: that.data.info.wx_code, - liveAddress: that.data.info.join_url, - }), - style: style(), - }); - p1.then(() => { - const p2 = this.widget.canvasToTempFilePath(); - p2.then((res) => { - wx.getSetting({ - success() { - wx.saveImageToPhotosAlbum({ - filePath: res.tempFilePath, - success: function () { - wx.showToast({ - title: '保存成功', - icon: 'success', - duration: 2000, - }); - }, - fail: function () { - wx.showModal({ - title: '保存失败~', - content: '请尝试点击右上角 “...” => “设置” 同意添加到相册后再保存~', - }); - }, - complete() { - wx.hideLoading(); - }, - }); - }, - }); - }); - }); - }, }); diff --git a/src/openeuler/package-events/events/poster.wxml b/src/openeuler/package-events/events/poster.wxml index 3926b9b..66c8330 100644 --- a/src/openeuler/package-events/events/poster.wxml +++ b/src/openeuler/package-events/events/poster.wxml @@ -11,11 +11,4 @@ 长按识别二维码,进入活动! - - - - - - - \ No newline at end of file diff --git a/src/openeuler/package-events/events/poster.wxss b/src/openeuler/package-events/events/poster.wxss index 8cf9f7b..a1971ec 100644 --- a/src/openeuler/package-events/events/poster.wxss +++ b/src/openeuler/package-events/events/poster.wxss @@ -4,7 +4,7 @@ page { } .container { - padding: 30rpx 50rpx 129rpx 50rpx !important; + padding: 30rpx 50rpx 0 50rpx !important; } .container .post-wrapper { @@ -100,7 +100,7 @@ page { } .container .btn-wrapper button { - width: 330rpx; + width: 100%; height: 90rpx; text-align: center; line-height: 90rpx; diff --git a/src/openeuler/package-events/events/sign.js b/src/openeuler/package-events/events/sign.js deleted file mode 100644 index 85ac7bb..0000000 --- a/src/openeuler/package-events/events/sign.js +++ /dev/null @@ -1,45 +0,0 @@ -// package-events/events/sign.js -const appAjax = require('./../../utils/app-ajax'); - -let that = null; -let remoteMethods = { - getDraftDetail: function (_callback) { - let service = 'EVENT_DETAIL'; - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service, - otherParams: { - id: that.data.id, - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, -}; - -Page({ - /** - * 页面的初始数据 - */ - data: { - id: '', - info: {}, - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - that = this; - this.setData({ - id: options.id || '', - }); - remoteMethods.getDraftDetail((res) => { - this.setData({ - info: res, - }); - }); - }, -}); diff --git a/src/openeuler/package-events/events/sign.json b/src/openeuler/package-events/events/sign.json deleted file mode 100644 index 2449904..0000000 --- a/src/openeuler/package-events/events/sign.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "活动签到" -} \ No newline at end of file diff --git a/src/openeuler/package-events/events/sign.wxml b/src/openeuler/package-events/events/sign.wxml deleted file mode 100644 index 1e13bed..0000000 --- a/src/openeuler/package-events/events/sign.wxml +++ /dev/null @@ -1,9 +0,0 @@ - - - - {{info.title}} - - 扫一扫二维码签到吧! - - - diff --git a/src/openeuler/package-events/events/sign.wxss b/src/openeuler/package-events/events/sign.wxss deleted file mode 100644 index 93df72a..0000000 --- a/src/openeuler/package-events/events/sign.wxss +++ /dev/null @@ -1,64 +0,0 @@ -/* package-events/events/sign.wxss */ -page { - background-color: #f5f7fa !important; -} - -.container { - padding: 0 !important; -} - -.container .post-wrapper { - width: 750rpx; - height: 1312rpx; - background-size: 100% 100% !important; - display: flex; - flex-direction: column; - align-items: center; - overflow: hidden; -} - -.bg1 { - background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/poster/bg1.png) no-repeat; -} - -.bg2 { - background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/poster/bg2.png) no-repeat; -} - -.bg3 { - background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/poster/bg3.png) no-repeat; -} - -.bg4 { - background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/poster/bg4.png) no-repeat; -} - -.container .post-wrapper .title { - color: #fff; - font-size: 40rpx; - line-height: 48rpx; - margin-top: 173rpx; - text-align: center; -} - -.container .post-wrapper .qrcode { - width: 519rpx; - height: 519rpx; - margin-top: 139rpx; - border-radius: 50%; - background-color: #fff; -} - -.container .post-wrapper .qrcode-text { - font-size: 28rpx; - line-height: 40rpx; - color: #333; - text-align: center; - margin-top: 22rpx; -} - -.container .post-wrapper .logo { - margin-top: 158rpx; - width: 171rpx; - height: 148rpx; -} \ No newline at end of file diff --git a/src/openeuler/package-events/events/wxml-to-canvas.js b/src/openeuler/package-events/events/wxml-to-canvas.js deleted file mode 100644 index 7e83504..0000000 --- a/src/openeuler/package-events/events/wxml-to-canvas.js +++ /dev/null @@ -1,91 +0,0 @@ -const { OBS_URL } = require('./../../utils/url-config'); - -const wxml = (data) => { - return ` - - - - ${data.title} - - 时间:${data.date} - ${data.address ? '地点:' + data.address : '直播地址:' + data.liveAddress} - - 长按识别二维码,进入活动! - - - `; -}; - -const style = () => { - return { - container: { - width: 325, - height: 656, - flexDirection: 'column', - alignItems: 'center', - }, - absolute: { - width: 325, - height: 656, - flexDirection: 'column', - alignItems: 'center', - }, - title: { - marginTop: 88, - color: '#fff', - width: 325, - height: 41, - fontSize: 17, - textAlign: 'center', - }, - logo: { - marginTop: 71, - width: 85, - height: 70, - marginBottom: 15, - }, - date: { - marginTop: 15, - color: '#002fa7', - width: 325, - fontSize: 12, - height: 19, - textAlign: 'center', - }, - address: { - marginTop: 10, - color: '#002fa7', - width: 325, - fontSize: 12, - height: 19, - textAlign: 'center', - }, - qrcode: { - backgroundColor: '#ffffff', - marginTop: 40, - height: 185, - width: 185, - borderRadius: 100, - }, - qrcodeText: { - color: '#ffffff', - fontSize: 12, - marginTop: 15, - height: 17, - width: 325, - textAlign: 'center', - }, - bgImg: { - position: 'absolute', - width: 325, - height: 656, - top: 0, - left: 0, - }, - }; -}; - -module.exports = { - wxml, - style, -}; diff --git a/src/openeuler/package-events/manage/add-member.js b/src/openeuler/package-events/manage/add-member.js index 3ef8920..fb54727 100644 --- a/src/openeuler/package-events/manage/add-member.js +++ b/src/openeuler/package-events/manage/add-member.js @@ -8,6 +8,8 @@ let remoteMethods = { service: 'ENTERPRISE_EXCLUDE_MEMBER_LIST', data: { search: postData.nickname || '', + page: postData.page, + size: postData.size, }, success: function (ret) { _callback && _callback(ret); @@ -34,18 +36,48 @@ Page({ list: [], result: [], keyword: '', + pageParams: { + page: 1, + size: 50, + }, + total: 0, }, /** * 生命周期函数--监听页面显示 */ onShow: function () { - let that = this; - remoteMethods.getExcludeMemberList({}, function (data) { - that.setData({ - list: data, - }); + this.initData(); + }, + initData: function () { + let renderData = []; + remoteMethods.getExcludeMemberList( + { + ...this.data.pageParams, + nickname: this.data.keyword, + }, + (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } + this.setData({ + list: renderData, + total: data.total, + }); + } + ); + }, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, }); + this.initData(); }, onChange: function (e) { this.setData({ @@ -82,19 +114,9 @@ Page({ }); }, searchInput: function (e) { - let that = this; this.setData({ keyword: e.detail.value, }); - remoteMethods.getExcludeMemberList( - { - nickname: this.data.keyword, - }, - function (data) { - that.setData({ - list: data, - }); - } - ); + this.initData(); }, }); diff --git a/src/openeuler/package-events/manage/add-member.wxss b/src/openeuler/package-events/manage/add-member.wxss index e5635ea..0432baf 100644 --- a/src/openeuler/package-events/manage/add-member.wxss +++ b/src/openeuler/package-events/manage/add-member.wxss @@ -57,7 +57,6 @@ height: 72rpx; border-radius: 8rpx; display: inline-block; - border: 1px solid #979797; margin: 0 20rpx 0 10rpx; } diff --git a/src/openeuler/package-events/manage/del-member.js b/src/openeuler/package-events/manage/del-member.js index fcd2161..1556400 100644 --- a/src/openeuler/package-events/manage/del-member.js +++ b/src/openeuler/package-events/manage/del-member.js @@ -1,11 +1,15 @@ // pages/sig/del-member.js const appAjax = require('./../../utils/app-ajax'); let remoteMethods = { - getCludeMemberList: function (_callback) { + getCludeMemberList: function (postData, _callback) { appAjax.postJson({ autoShowWait: true, type: 'GET', service: 'ENTERPRISE_MEMBER_LIST', + data: { + page: postData.page, + size: postData.size, + }, success: function (ret) { _callback && _callback(ret); }, @@ -30,19 +34,43 @@ Page({ data: { list: [], result: [], + pageParams: { + page: 1, + size: 50, + }, + total: 0, }, /** * 生命周期函数--监听页面显示 */ onShow: function () { - let that = this; - remoteMethods.getCludeMemberList(function (data) { - that.setData({ - list: data, + this.initData(); + }, + initData: function () { + let renderData = []; + remoteMethods.getCludeMemberList(this.data.pageParams, (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } + this.setData({ + list: renderData, + total: data.total, }); }); }, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, + }); + this.initData(); + }, onChange: function (e) { this.setData({ result: e.detail, diff --git a/src/openeuler/package-events/manage/del-member.wxss b/src/openeuler/package-events/manage/del-member.wxss index ea73f42..b31edc3 100644 --- a/src/openeuler/package-events/manage/del-member.wxss +++ b/src/openeuler/package-events/manage/del-member.wxss @@ -20,7 +20,7 @@ height: 72rpx; border-radius: 8rpx; display: inline-block; - border: 1px solid #979797; + margin: 0 20rpx 0 10rpx; } diff --git a/src/openeuler/package-events/manage/enterprise-list.js b/src/openeuler/package-events/manage/enterprise-list.js index de7baec..67b8abc 100644 --- a/src/openeuler/package-events/manage/enterprise-list.js +++ b/src/openeuler/package-events/manage/enterprise-list.js @@ -1,11 +1,15 @@ // package-events/manage/enterprise-list.js const appAjax = require('./../../utils/app-ajax'); let remoteMethods = { - getMemberList: function (_callback) { + getMemberList: function (params, _callback) { appAjax.postJson({ autoShowWait: true, type: 'GET', service: 'ENTERPRISE_MEMBER_LIST', + data: { + page: params.page, + size: params.size, + }, success: function (ret) { _callback && _callback(ret); }, @@ -17,20 +21,44 @@ Page({ * 页面的初始数据 */ data: { - memberList: [], + list: [], + pageParams: { + page: 1, + size: 50, + }, + total: 0, }, /** * 生命周期函数--监听页面显示 */ onShow: function () { - let that = this; - remoteMethods.getMemberList(function (list) { - that.setData({ - memberList: list, + this.initData(); + }, + initData: function () { + let renderData = []; + remoteMethods.getMemberList({ ...this.data.pageParams, id: this.data.id }, (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } + this.setData({ + list: renderData, + total: data.total, }); }); }, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, + }); + this.initData(); + }, toDetail: function (e) { wx.navigateTo({ url: diff --git a/src/openeuler/package-events/manage/enterprise-list.wxml b/src/openeuler/package-events/manage/enterprise-list.wxml index 50dc1d2..698a780 100644 --- a/src/openeuler/package-events/manage/enterprise-list.wxml +++ b/src/openeuler/package-events/manage/enterprise-list.wxml @@ -1,6 +1,6 @@ - - + + @@ -13,7 +13,7 @@ - + diff --git a/src/openeuler/package-events/manage/enterprise-list.wxss b/src/openeuler/package-events/manage/enterprise-list.wxss index c20be43..780ac3e 100644 --- a/src/openeuler/package-events/manage/enterprise-list.wxss +++ b/src/openeuler/package-events/manage/enterprise-list.wxss @@ -25,7 +25,7 @@ page { height: 90rpx; box-shadow: 0px 5px 15px 0px rgba(0, 47, 167, 0.1); border-radius: 8px; - border: 1px solid #979797; + display: flex; justify-content: center; align-items: center; diff --git a/src/openeuler/package-events/publish/publish.js b/src/openeuler/package-events/publish/publish.js index 4c955bc..cf9b1e6 100644 --- a/src/openeuler/package-events/publish/publish.js +++ b/src/openeuler/package-events/publish/publish.js @@ -81,8 +81,6 @@ let localMethods = { const parts = time.split(':'); return parseInt(parts[0], 10) * 60 + parseInt(parts[1], 10); } - console.log(timeToMinutes(endTime)); - console.log(timeToMinutes(startTime)); return timeToMinutes(endTime) > timeToMinutes(startTime); }, validation: function (data) { @@ -125,7 +123,7 @@ let localMethods = { if (!data.schedules[i].end) { flag = false; } - if (!localMethods.validation(data.schedules[i].start, data.schedules[i].end)) { + if (!localMethods.timeValid(data.schedules[i].start, data.schedules[i].end)) { this.toast('议题开始时间必须小于结束时间'); flag = false; return; @@ -139,28 +137,6 @@ let localMethods = { } }); } - // data.schedules.forEach((item) => { - // if (!item.start) { - // flag = false; - // } - // if (!item.end) { - // flag = false; - // } - // if (!localMethods.validation(item.start, item.end)) { - // console.log(555); - // this.toast('开始时间必须小于结束时间'); - // flag = false; - // return; - // } - // if (!item.topic) { - // flag = false; - // } - // item.speakerList.forEach((item) => { - // if (!item.name) { - // flag = false; - // } - // }); - // }); if (!flag) { this.toast('请补充日程必填信息'); return; diff --git a/src/openeuler/package-meeting/meeting/meeting-list.js b/src/openeuler/package-meeting/meeting/meeting-list.js index 3176495..cdfd247 100644 --- a/src/openeuler/package-meeting/meeting/meeting-list.js +++ b/src/openeuler/package-meeting/meeting/meeting-list.js @@ -15,7 +15,10 @@ Page({ meetingConponent: this.selectComponent('#meeting'), }); }, - + onReachBottom() { + const customComponent = this.selectComponent('#meeting'); + customComponent.getMoreData(); + }, /** * 页面相关事件处理函数--监听用户下拉动作 */ @@ -23,14 +26,4 @@ Page({ wx.stopPullDownRefresh(); this.data.meetingConponent?.initData(); }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () {}, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () {}, }); diff --git a/src/openeuler/package-meeting/sig/add-member.js b/src/openeuler/package-meeting/sig/add-member.js index ad3bd81..271b3ce 100644 --- a/src/openeuler/package-meeting/sig/add-member.js +++ b/src/openeuler/package-meeting/sig/add-member.js @@ -11,6 +11,8 @@ let remoteMethods = { }, data: { search: postData.nickname || '', + page: postData.page, + size: postData.size, }, success: function (ret) { _callback && _callback(ret); @@ -37,6 +39,11 @@ Page({ list: [], result: [], sigId: '', + pageParams: { + page: 1, + size: 50, + }, + total: 0, keyword: '', }, @@ -53,14 +60,35 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - let that = this; + this.initData(); + }, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, + }); + this.initData(); + }, + initData: function () { + let renderData = []; remoteMethods.getExcludeMemberList( { + ...this.data.pageParams, id: this.data.sigId, + nickname: this.data.keyword, }, - function (data) { - that.setData({ - list: data, + (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } + this.setData({ + list: renderData, + total: data.total, }); } ); @@ -71,7 +99,6 @@ Page({ }); }, comfirm: function () { - let that = this; if (!this.data.result.length) { wx.showToast({ title: '请选择人员', @@ -102,20 +129,9 @@ Page({ }); }, searchInput: function (e) { - let that = this; this.setData({ keyword: e.detail.value, }); - remoteMethods.getExcludeMemberList( - { - id: this.data.sigId, - nickname: this.data.keyword, - }, - function (data) { - that.setData({ - list: data, - }); - } - ); + this.initData(); }, }); diff --git a/src/openeuler/package-meeting/sig/add-member.wxss b/src/openeuler/package-meeting/sig/add-member.wxss index e5635ea..80eb0c6 100644 --- a/src/openeuler/package-meeting/sig/add-member.wxss +++ b/src/openeuler/package-meeting/sig/add-member.wxss @@ -57,7 +57,7 @@ height: 72rpx; border-radius: 8rpx; display: inline-block; - border: 1px solid #979797; + margin: 0 20rpx 0 10rpx; } diff --git a/src/openeuler/package-meeting/sig/add-sig-member.js b/src/openeuler/package-meeting/sig/add-sig-member.js index 1764eff..52718dc 100644 --- a/src/openeuler/package-meeting/sig/add-sig-member.js +++ b/src/openeuler/package-meeting/sig/add-sig-member.js @@ -1,13 +1,17 @@ // pages/sig/add-sig-member.js const appAjax = require('./../../utils/app-ajax'); let remoteMethods = { - getSigMemberList: function (id, _callback) { + getSigMemberList: function (params, _callback) { appAjax.postJson({ autoShowWait: true, type: 'GET', service: 'SIG_MEMBER_LIST', otherParams: { - id: id, + id: params.id, + }, + data: { + page: params.page, + size: params.size, }, success: function (ret) { _callback && _callback(ret); @@ -20,8 +24,13 @@ Page({ * 页面的初始数据 */ data: { - memberList: [], + list: [], id: '', + pageParams: { + page: 1, + size: 50, + }, + total: 0, }, /** @@ -40,13 +49,32 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - let that = this; - remoteMethods.getSigMemberList(this.data.id, function (list) { - that.setData({ - memberList: list, + this.initData(); + }, + initData: function () { + let renderData = []; + remoteMethods.getSigMemberList({ ...this.data.pageParams, id: this.data.id }, (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } + this.setData({ + list: renderData, + total: data.total, }); }); }, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, + }); + this.initData(); + }, toDetail: function (e) { wx.navigateTo({ url: diff --git a/src/openeuler/package-meeting/sig/add-sig-member.wxml b/src/openeuler/package-meeting/sig/add-sig-member.wxml index 0b1ebe6..5b9dc06 100644 --- a/src/openeuler/package-meeting/sig/add-sig-member.wxml +++ b/src/openeuler/package-meeting/sig/add-sig-member.wxml @@ -1,6 +1,6 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/src/openeuler/package-meeting/sig/add-sig-member.wxss b/src/openeuler/package-meeting/sig/add-sig-member.wxss index 220e2e8..a0de89e 100644 --- a/src/openeuler/package-meeting/sig/add-sig-member.wxss +++ b/src/openeuler/package-meeting/sig/add-sig-member.wxss @@ -25,7 +25,7 @@ page { height: 90rpx; box-shadow: 0px 5px 15px 0px rgba(0, 47, 167, 0.1); border-radius: 8px; - border: 1px solid #979797; + display: flex; justify-content: center; align-items: center; diff --git a/src/openeuler/package-meeting/sig/del-member.js b/src/openeuler/package-meeting/sig/del-member.js index 37f92e0..ffc970a 100644 --- a/src/openeuler/package-meeting/sig/del-member.js +++ b/src/openeuler/package-meeting/sig/del-member.js @@ -9,6 +9,10 @@ let remoteMethods = { otherParams: { id: postData.id, }, + data: { + page: postData.page, + size: postData.size, + }, success: function (ret) { _callback && _callback(ret); }, @@ -34,6 +38,11 @@ Page({ list: [], result: [], sigId: '', + pageParams: { + page: 1, + size: 50, + }, + total: 0, }, /** @@ -49,14 +58,34 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - let that = this; + this.initData(); + }, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, + }); + this.initData(); + }, + initData: function () { + let renderData = []; remoteMethods.getCludeMemberList( { + ...this.data.pageParams, id: this.data.sigId, }, - function (data) { - that.setData({ - list: data, + (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } + this.setData({ + list: renderData, + total: data.total, }); } ); diff --git a/src/openeuler/package-meeting/sig/del-member.wxss b/src/openeuler/package-meeting/sig/del-member.wxss index ea73f42..b31edc3 100644 --- a/src/openeuler/package-meeting/sig/del-member.wxss +++ b/src/openeuler/package-meeting/sig/del-member.wxss @@ -20,7 +20,7 @@ height: 72rpx; border-radius: 8rpx; display: inline-block; - border: 1px solid #979797; + margin: 0 20rpx 0 10rpx; } diff --git a/src/openeuler/package-my/events/my-list.js b/src/openeuler/package-my/events/my-list.js index 298e0ff..17d84ea 100644 --- a/src/openeuler/package-my/events/my-list.js +++ b/src/openeuler/package-my/events/my-list.js @@ -4,7 +4,7 @@ const sessionUtil = require('../../utils/app-session.js'); let that = null; let remoteMethods = { - getList: function (_callback) { + getList: function (params, _callback) { let service = ''; if (that.data.type == 4) { service = 'GET_DRAFT_LIST'; @@ -36,6 +36,7 @@ let remoteMethods = { success: function (ret) { _callback && _callback(ret); }, + data: params, }); }, delDraft: function (_callback) { @@ -98,6 +99,11 @@ Page({ data: { type: 1, list: [], + pageParams: { + page: 1, + size: 50, + }, + total: 0, level: 1, actionShow: false, actions: [], @@ -145,16 +151,31 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - remoteMethods.getList((res) => { + this.initData(); + }, + initData() { + let renderData = []; + remoteMethods.getList(this.data.pageParams, (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } this.setData({ - list: res, + list: renderData, + total: data.total, }); }); }, - toSign(e) { - wx.navigateTo({ - url: `/package-events/events/sign?id=${e.currentTarget.dataset.id}`, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, }); + this.initData(); }, editDraft(e) { wx.navigateTo({ @@ -166,21 +187,27 @@ Page({ actionShow: false, }); }, + initialization() { + this.setData({ + 'pageParams.page': 1, + }); + this.initData(); + }, onActionSelect(e) { if (this.data.type == 4) { remoteMethods.delDraft(() => { - this.onShow(); + this.initialization(); }); } else if (this.data.type == 2 || this.data.type == 6 || this.data.type == 7) { if (this.data.level == 3) { if (e.detail.operaType == 1) { if (this.data.collectionId) { remoteMethods.unCollect(() => { - this.onShow(); + this.initialization(); }); } else { remoteMethods.collect(() => { - this.onShow(); + this.initialization(); }); } } else { @@ -192,11 +219,11 @@ Page({ if (e.detail.operaType == 1) { if (this.data.collectionId) { remoteMethods.unCollect(() => { - this.onShow(); + this.initialization(); }); } else { remoteMethods.collect(() => { - this.onShow(); + this.initialization(); }); } } else if (e.detail.operaType == 3) { @@ -289,11 +316,7 @@ Page({ showDialogDel: false, }); remoteMethods.delEvent(() => { - remoteMethods.getList((res) => { - this.setData({ - list: res, - }); - }); + this.initialization(); }); }, delCancel() { diff --git a/src/openeuler/package-my/events/my-list.wxml b/src/openeuler/package-my/events/my-list.wxml index 2f0449e..9b5b95e 100644 --- a/src/openeuler/package-my/events/my-list.wxml +++ b/src/openeuler/package-my/events/my-list.wxml @@ -3,7 +3,8 @@ - + {{item.enterprise}} @@ -19,7 +20,7 @@ - {{item.address||item.join_url}} + {{item.address||item.join_url || ''}} @@ -28,13 +29,12 @@ - - - + @@ -42,18 +42,22 @@ - + - - + - @@ -64,7 +68,8 @@ 已报名 {{item.register_count}}人 - + @@ -74,14 +79,17 @@ - + 暂无活动! - + 请确认下架当前活动 @@ -90,7 +98,8 @@ - + 活动一经发布,暂不支持自行下架删除。如有需要,请联系 diff --git a/src/openeuler/package-my/my/my-collection.js b/src/openeuler/package-my/my/my-collection.js index 7277efc..2b0eaf5 100644 --- a/src/openeuler/package-my/my/my-collection.js +++ b/src/openeuler/package-my/my/my-collection.js @@ -5,4 +5,8 @@ Page({ * 页面的初始数据 */ data: {}, + onReachBottom() { + const customComponent = this.selectComponent('#meeting'); + customComponent.getMoreData(); + }, }); diff --git a/src/openeuler/package-my/my/my-collection.wxml b/src/openeuler/package-my/my/my-collection.wxml index c7b754a..695d42e 100644 --- a/src/openeuler/package-my/my/my-collection.wxml +++ b/src/openeuler/package-my/my/my-collection.wxml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-meetings.js b/src/openeuler/package-my/my/my-meetings.js index acc355e..a65975c 100644 --- a/src/openeuler/package-my/my/my-meetings.js +++ b/src/openeuler/package-my/my/my-meetings.js @@ -5,4 +5,8 @@ Page({ * 页面的初始数据 */ data: {}, + onReachBottom() { + const customComponent = this.selectComponent('#meeting'); + customComponent.getMoreData(); + }, }); diff --git a/src/openeuler/package-my/my/my-meetings.wxml b/src/openeuler/package-my/my/my-meetings.wxml index 94b3f51..9704dda 100644 --- a/src/openeuler/package-my/my/my-meetings.wxml +++ b/src/openeuler/package-my/my/my-meetings.wxml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/src/openeuler/package-my/my/privecy-historical.js b/src/openeuler/package-my/my/privecy-historical.js index 59441a0..d5c5f85 100644 --- a/src/openeuler/package-my/my/privecy-historical.js +++ b/src/openeuler/package-my/my/privecy-historical.js @@ -4,44 +4,4 @@ Page({ * 页面的初始数据 */ data: {}, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function () {}, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () {}, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () {}, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () {}, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () {}, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () {}, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () {}, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () {}, }); diff --git a/src/openeuler/package-my/my/privecy-historical.wxml b/src/openeuler/package-my/my/privecy-historical.wxml index 67746fc..85aedcd 100644 --- a/src/openeuler/package-my/my/privecy-historical.wxml +++ b/src/openeuler/package-my/my/privecy-historical.wxml @@ -9,7 +9,7 @@ c) 当您创建会议后,我们会将您的Gitee ID及会议相关信息同步至本服务页面,以便对您的会议感兴趣的个人或组织及时获取相关信息。 d) 当您创建活动之前,我们会收集您的Gitee ID、所属企业名称、电话、邮箱,用于配置活动发布权限,Gitee ID和您的所属企业名称会作为活动的发布者信息呈现在活动详情页,电话、邮箱便于我们与您取得联系。 e) 当您为您创建的活动添加议题时,我们会收集您所填写议题的嘉宾名称、职位、邮箱,用于在活动议题的内容中展示。 - f) 当您在下载活动海报时,我们会申请您的相册保存权限,保存小程序生成的活动海报。 + f) 当您在保存图片时,我们会申请您的相册保存权限,保存图片到您的相册。 g) 当您在活动详情页面点击地址时,我们在获取您的同意后会关联启动腾讯地图。 2. 我们在何种情况披露或共享您的个人信息 共享是指我们向第三方披露您的个人信息。我们仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,我们共享这些信息的目的仅限于本声明披露或在您允许的范围内进行。 diff --git a/src/openeuler/pages/events/events.js b/src/openeuler/pages/events/events.js index cb30fe7..a246278 100644 --- a/src/openeuler/pages/events/events.js +++ b/src/openeuler/pages/events/events.js @@ -78,6 +78,11 @@ Page({ noAuthDialogShow: false, user: '', list: [], + pageParams: { + page: 1, + size: 50, + }, + total: 0, actionShow: false, actions: [], underDialogShow: false, @@ -102,7 +107,8 @@ Page({ }); remoteMethods.getList((res) => { that.setData({ - list: res, + list: res.data, + total: res.total, }); }); }); @@ -144,6 +150,30 @@ Page({ }, }); }, + onReachBottom() { + if (this.data.total < this.data.pageParams.size * this.data.pageParams.page) { + return false; + } + this.setData({ + 'pageParams.page': this.data.pageParams.page + 1, + }); + this.initData(); + }, + initData: function () { + let renderData = []; + remoteMethods.getList(this.data.pageParams, (data) => { + if (this.data.pageParams.page === 1) { + renderData = data.data; + } else { + renderData = this.data.list; + renderData.push(...data.data); + } + this.setData({ + list: renderData, + total: data.total, + }); + }); + }, onActionClose() { this.setData({ actionShow: false, diff --git a/src/openeuler/pages/events/events.wxml b/src/openeuler/pages/events/events.wxml index bfa0b29..1002429 100644 --- a/src/openeuler/pages/events/events.wxml +++ b/src/openeuler/pages/events/events.wxml @@ -2,16 +2,17 @@ - - - 发起人管理 - 查看活动 - + + + 发起人管理 + + 发布活动 @@ -37,7 +38,7 @@ - {{item.address||item.join_url}} + {{item.address||item.join_url || ''}} @@ -47,20 +48,24 @@ - - - + - @@ -68,18 +73,22 @@ - + - + 暂无活动! - + 请确认下架当前活动 @@ -88,7 +97,8 @@ - + 活动一经发布,暂不支持自行下架删除。如有需要,请联系 @@ -100,7 +110,8 @@ - + 您暂时没有发布活动的权限,请联系 diff --git a/src/openeuler/pages/index/index.js b/src/openeuler/pages/index/index.js index 1d30195..7694e3d 100644 --- a/src/openeuler/pages/index/index.js +++ b/src/openeuler/pages/index/index.js @@ -65,6 +65,10 @@ Page( that.data.meetingConponent?.initData(); }); }, + onReachBottom() { + const customComponent = this.selectComponent('#meeting'); + customComponent.getMoreData(); + }, actionStatus(e) { if (e.detail === 1) { this.getTabBar().setData({ diff --git a/src/openeuler/pages/meeting/meeting.js b/src/openeuler/pages/meeting/meeting.js index c892e68..9764040 100644 --- a/src/openeuler/pages/meeting/meeting.js +++ b/src/openeuler/pages/meeting/meeting.js @@ -50,6 +50,10 @@ Page( that.data.meetingConponent?.initData(); }); }, + onReachBottom() { + const customComponent = this.selectComponent('#meeting'); + customComponent.getMoreData() + }, actionStatus(e) { if (e.detail === 1) { this.getTabBar().setData({ diff --git a/src/openeuler/pages/meeting/meeting.wxml b/src/openeuler/pages/meeting/meeting.wxml index 1cd3007..1edee7d 100644 --- a/src/openeuler/pages/meeting/meeting.wxml +++ b/src/openeuler/pages/meeting/meeting.wxml @@ -2,17 +2,17 @@ - - - SIG组管理 - 查看会议 - + + + SIG组管理 + + 预定会议 diff --git a/src/openeuler/pages/my/my.wxml b/src/openeuler/pages/my/my.wxml index 358de68..f274a40 100644 --- a/src/openeuler/pages/my/my.wxml +++ b/src/openeuler/pages/my/my.wxml @@ -34,11 +34,13 @@ {{myCount.published_activities_count||0}} 已发布 - + {{myCount.drafts_count||0}} 草稿箱 - + {{myCount.publishing_activities_count||0}} {{avtivityLevel===3?'待发布':'发布中'}} diff --git a/src/openeuler/project.private.config.json b/src/openeuler/project.private.config.json index 156487a..efcd36c 100644 --- a/src/openeuler/project.private.config.json +++ b/src/openeuler/project.private.config.json @@ -5,6 +5,13 @@ "condition": { "miniprogram": { "list": [ + { + "name": "", + "pathName": "pages/index/index", + "query": "", + "launchMode": "default", + "scene": null + }, { "name": "", "pathName": "package-events/publish/publish", diff --git a/src/openeuler/typings/wx.d.ts b/src/openeuler/typings/wx.d.ts new file mode 100644 index 0000000..a2ffc2b --- /dev/null +++ b/src/openeuler/typings/wx.d.ts @@ -0,0 +1,2705 @@ +// generate time:2017-08-23 21:12:06 +// Type definitions for wx app +// Definitions by: hellopao + +/************************************************ +* * +* 微信小程序 API * +* * +************************************************/ + +interface IAnimation { + /** + * 透明度,参数范围 0~1 + */ + opacity(value: number): IAnimation; + /** + * 颜色值 + */ + backgroundColor(color: string): IAnimation; + /** + * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 + */ + width(length: number): IAnimation; + /** + * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 + */ + height(length: number): IAnimation; + /** + * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 + */ + top(length: number): IAnimation; + /** + * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 + */ + left(length: number): IAnimation; + /** + * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 + */ + bottom(length: number): IAnimation; + /** + * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 + */ + right(length: number): IAnimation; + /** + * deg的范围-180~180,从原点顺时针旋转一个deg角度 + */ + rotate(deg: number): IAnimation; + /** + * deg的范围-180~180,在X轴旋转一个deg角度 + */ + rotateX(deg: number): IAnimation; + /** + * deg的范围-180~180,在Y轴旋转一个deg角度 + */ + rotateY(deg: number): IAnimation; + /** + * deg的范围-180~180,在Z轴旋转一个deg角度 + */ + rotateZ(deg: number): IAnimation; + /** + * 同transform-function rotate3d + */ + rotate3d(x: number, y: number, z: number, deg: number): IAnimation; + /** + * 一个参数时,表示在X轴、Y轴同时缩放sx倍数;两个参数时表示在X轴缩放sx倍数,在Y轴缩放sy倍数 + */ + scale(sx: number, sy?: number): IAnimation; + /** + * 在X轴缩放sx倍数 + */ + scaleX(sx: number): IAnimation; + /** + * 在Y轴缩放sy倍数 + */ + scaleY(sy: number): IAnimation; + /** + * 在Z轴缩放sy倍数 + */ + scaleZ(sz: number): IAnimation; + /** + * 在X轴缩放sx倍数,在Y轴缩放sy倍数,在Z轴缩放sz倍数 + */ + scale3d(sx: number, sy: number, sz: number): IAnimation; + /** + * 一个参数时,表示在X轴偏移tx,单位px;两个参数时,表示在X轴偏移tx,在Y轴偏移ty,单位px。 + */ + translate(tx: number, ty?: number): IAnimation; + /** + * 在X轴偏移tx,单位px + */ + translateX(tx: number): IAnimation; + /** + * 在Y轴偏移tx,单位px + */ + translateY(tx: number): IAnimation; + /** + * 在Z轴偏移tx,单位px + */ + translateZ(tx: number): IAnimation; + /** + * 在X轴偏移tx,在Y轴偏移ty,在Z轴偏移tz,单位px + */ + translate3d(tx: number, ty: number, tz: number): IAnimation; + /** + * 参数范围-180~180;一个参数时,Y轴坐标不变,X轴坐标延顺时针倾斜ax度;两个参数时,分别在X轴倾斜ax度,在Y轴倾斜ay度 + */ + skew(ax: number, ay?: number): IAnimation; + /** + * 参数范围-180~180;Y轴坐标不变,X轴坐标延顺时针倾斜ax度 + */ + skewX(ax: number): IAnimation; + /** + * 参数范围-180~180;X轴坐标不变,Y轴坐标延顺时针倾斜ay度 + */ + skewY(ay: number): IAnimation; + /** + * 同transform-function matrix + */ + matrix(a, b, c, d, tx, ty): IAnimation; + /** + * 同transform-function matrix3d + */ + matrix3d(): IAnimation; +} + +interface ICanvasContext { + /** + * 设置填充色, 如果没有设置 fillStyle,默认颜色为 black。 + */ + setFillStyle(color: string): void; + /** + * 设置边框颜色, 如果没有设置 fillStyle,默认颜色为 black。 + */ + setStrokeStyle(color: string): void; + /** + * 设置阴影 + */ + setShadow(offsetX: number, offsetY: number, blur: number, color: string): void; + /** + * 创建一个线性的渐变颜色。需要使用 addColorStop() 来指定渐变点,至少要两个。 + */ + createLinearGradient(x0: number, y0: number, x1: number, y1: number): void; + /** + * 创建一个圆形的渐变颜色。 起点在圆心,终点在圆环。 需要使用 addColorStop() 来指定渐变点,至少要两个。 + */ + createCircularGradient(x: number, y: number, r: number): void; + /** + * 创建一个颜色的渐变点。小于最小 stop 的部分会按最小 stop 的 color 来渲染,大于最大 stop 的部分会按最大 stop 的 color 来渲染。需要使用 addColorStop() 来指定渐变点,至少要两个。 + */ + addColorStop(stop: number, color: string): void; + /** + * 设置线条端点的样式 + */ + setLineCap(lineCap: 'butt' | 'round' | 'square'): void; + /** + * 设置两线相交处的样式 + */ + setLineJoin(lineJoin: 'bevel' | 'round' | 'miter'): void; + /** + * 设置线条宽度 + */ + setLineWidth(lineWidth: number): void; + /** + * 设置最大倾斜 + */ + setMiterLimit(miterLimit: number): void; + /** + * 添加一个矩形路径到当前路径。 + */ + rect(x: number, y: number, width: number, height: number): void; + /** + * 填充一个矩形。用 setFillStyle() 设置矩形的填充色,如果没设置默认是黑色。 + */ + fillRect(x: number, y: number, width: number, height: number): void; + /** + * 一个矩形(非填充)。用 setFillStroke() 设置矩形线条的颜色,如果没设置默认是黑色。 + */ + strokeRect(x: number, y: number, width: number, height: number): void; + /** + * 在给定的矩形区域内,清除画布上的像素 + */ + clearRect(x: number, y: number, width: number, height: number): void; + /** + * 对当前路径进行填充 + */ + fill(): void; + /** + * 对当前路径进行描边 + */ + stroke(): void; + /** + * 开始一个路径 + */ + beginPath(): void; + /** + * 关闭一个路径 + */ + closePath(): void; + /** + * 把路径移动到画布中的指定点,但不创建线条。 + */ + moveTo(x: number, y: number): void; + /** + * 添加一个新点,然后在画布中创建从该点到最后指定点的线条。 + */ + lineTo(x: number, y: number): void; + /** + * 添加一个弧形路径到当前路径,顺时针绘制。 + */ + arc(x: number, y: number, radius: number, startAngle: number, sweepAngle: number): void; + /** + * 创建二次方贝塞尔曲线 + */ + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + /** + * 创建三次方贝塞尔曲线 + */ + bezierCurveTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): void; + /** + * 对横纵坐标进行缩放 + */ + scale(scaleWidth: number/**横坐标缩放的倍数1 = 100%,0.5 = 50%,2 = 200%,依次类 */, scaleHeight: number/** 纵坐标轴缩放的倍数1 = 100%,0.5 = 50%,2 = 200%,依次类 */): void; + /** + * 对坐标轴进行顺时针旋转 + */ + rotate(deg: number/**degrees * Math.PI/180;degrees范围为0~360;旋转角度,以弧度计 */): void; + /** + * 对坐标原点进行缩放 + */ + translate(x: number/**水平坐标平移量 */, y: number/**竖直坐标平移量 */): void; + /** + * 在画布上绘制被填充的文本 + */ + fillText(text: string, x: number, y: number): void; + /** + * 设置字体大小 + */ + setFontSize(fontSize: number): void; + /** + * 在画布上绘制图像 + */ + drawImage(imageResource: string, x: number, y: number, width: number, height: number): void; + /** + * 设置全局画笔透明度。 + */ + setGlobalAlpha(alpha: number): void; + /** + * 保存当前坐标轴的缩放、旋转、平移信息 + */ + save(): void; + /** + * 恢复之前保存过的坐标轴的缩放、旋转、平移信息 + */ + restore(): void; + /** + * 进行绘图 + */ + draw(): void; +} + +interface IAudioContext { + /** + * 播放 + */ + play: () => void; + /** + * 暂停 + */ + pause: () => void; + /** + * 跳转到指定位置,单位 s + */ + seek: (position: number) => void; +} + +interface IVideoContext { + /** + * 播放 + */ + play: () => void; + /** + * 暂停 + */ + pause: () => void; + /** + * 跳转到指定位置,单位 s + */ + seek: (position: number) => void; + /** + * 发送弹幕,danmu 包含两个属性 text, color。 + */ + sendDanmu: (danmu: {text: string; color: string;}) => void; +} + +interface IMapContext { + /** + * 获取当前地图中心的经纬度,返回的是 gcj02 坐标系,可以用于 wx.openLocation + */ + getCenterLocation: (obj: { + /** + * 接口调用成功的回调函数 ,res = { longitude: "经度", latitude: "纬度"} + */ + success?: (res: {longitude: string; latitude: string}) => void; + /** + * 接口调用失败的回调函数 + */ + fail?: () => void; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: () => void; + }) => void; + /** + * 将地图中心移动到当前定位点,需要配合map组件的show-location使用 + */ + moveToLocation: () => void; +} + +interface Application { + setData: (obj: any) => void; +} + +interface AppConstructor { + new (): Application; + (opts: { + /** + * 生命周期函数--监听小程序初始化 + */ + onLaunch?: () => void; + /** + * 生命周期函数--监听小程序显示 + */ + onShow?: () => void; + /** + * 生命周期函数--监听小程序隐藏 + */ + onHide?: () => void; + + [key: string]: any; + }): Application; +} + +declare var App: AppConstructor; +declare function getApp(): Application; + +declare function getCurrentPages(): Page[]; + +interface Page { + setData: (obj: any) => void; +} + +interface PageConstructor { + new (): Page; + (opts: { + /** + * 页面的初始数据 + */ + data?: any; + /** + * 页面的初始数据 + */ + onLoad?: () => void; + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady?: () => void; + /** + * 生命周期函数--监听页面显示 + */ + onShow?: () => void; + /** + * 生命周期函数--监听页面隐藏 + */ + onHide?: () => void; + /** + * 生命周期函数--监听页面卸载 + */ + onUnload?: () => void; + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefreash?: () => void; + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom?: () => void; + /** + * 用户点击右上角分享 + */ + onShareAppMessage?: () => { + /** + * 分享标题, 默认值当前小程序名称 + */ + title: string; + /** + * 分享描述, 默认值当前小程序名称 + */ + desc: string; + /** + * 分享路径 默认值当前页面 path ,必须是以 / 开头的完整路径 + */ + path: string; + }; + + [key: string]: any; + }): Page; +} + +declare var Page: PageConstructor; + +declare var wx: { + // # 网络 # + + request(obj: { + /** + * 开发者服务器接口地址 + */ + url: string; + /** + * 请求的参数 + */ + data?: any | string; + /** + * 设置请求的 header , header 中不能设置 Referer + */ + header?: any; + /** + * 默认为 GET,有效值:OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT + */ + method?: string; + /** + * 默认为 json。如果设置了 dataType 为 json,则会尝试对响应的数据做一次 JSON.parse + */ + dataType?: string; + /** + * 收到开发者服务成功返回的回调函数,res = {data: '开发者服务器返回的内容'} + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 将本地资源上传到开发者服务器。如页面通过 wx.chooseImage 等接口获取到一个本地资源的临时文件路径后,可通过此接口将本地资源上传到指定服务器。客户端发起一个 HTTPS POST 请求,其中 content-type 为 multipart/form-data 。 + */ + uploadFile(obj: { + /** + * 开发者服务器 url + */ + url: string; + /** + * 要上传文件资源的路径 + */ + filePath: string; + /** + * 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 + */ + name: string; + /** + * HTTP 请求 Header , header 中不能设置 Referer + */ + header?: any; + /** + * HTTP 请求中其他额外的 form data + */ + formData?: any; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。 + */ + downloadFile(obj: { + /** + * 下载资源的 url + */ + url: string; + /** + * HTTP 请求 Header + */ + header?: any; + /** + * 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 创建一个 WebSocket 连接;一个微信小程序同时只能有一个 WebSocket 连接,如果当前已存在一个 WebSocket 连接,会自动关闭该连接,并重新创建一个 WebSocket 连接。 + */ + connectSocket(obj: { + /** + * 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 + */ + url: string; + /** + * 请求的数据 + */ + data?: any; + /** + * HTTP Header , header 中不能设置 Referer + */ + header?: any; + /** + * 默认是GET,有效值: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT + */ + method?: string; + /** + * 子协议数组 + */ + protocols?: string[]; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 监听WebSocket连接打开事件。 + */ + onSocketOpen(callback: Function): void; + + /** + * 监听WebSocket错误。 + */ + onSocketError(callback: Function): void; + + /** + * 通过 WebSocket 连接发送数据,需要先 wx.connectSocket,并在 wx.onSocketOpen 回调之后才能发送。 + */ + sendSocketMessage(obj: { + /** + * 需要发送的内容 + */ + data: undefined; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 监听WebSocket接受到服务器的消息事件。 + */ + onSocketMessage(callback: Function): void; + + /** + * 关闭WebSocket连接。 + */ + closeSocket(obj: { + /** + * 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) + */ + code?: number; + /** + * 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) + */ + reason?: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 监听WebSocket关闭。 + */ + onSocketClose(callback: Function): void; + + // # 媒体 # + + /** + * 从本地相册选择图片或使用相机拍照。 + */ + chooseImage(obj: { + /** + * 最多可以选择的图片张数,默认9 + */ + count?: number; + /** + * original 原图,compressed 压缩图,默认二者都有 + */ + sizeType?: string[]; + /** + * album 从相册选图,camera 使用相机,默认二者都有 + */ + sourceType?: string[]; + /** + * 成功则返回图片的本地文件路径列表 tempFilePaths + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 预览图片。 + */ + previewImage(obj: { + /** + * 当前显示图片的链接,不填则默认为 urls 的第一张 + */ + current?: string; + /** + * 需要预览的图片链接列表 + */ + urls: string[]; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 获取图片信息 + */ + getImageInfo(obj: { + /** + * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 + */ + src: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + saveImageToPhotosAlbum(obj: { + /** + * 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径 + */ + filePath: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 开始录音。当主动调用wx.stopRecord,或者录音超过1分钟时自动结束录音,返回录音文件的临时文件路径。当用户离开小程序时,此接口无法调用。 + */ + startRecord(obj: { + /** + * 录音成功后调用,返回录音文件的临时文件路径,res = {tempFilePath: '录音文件的临时路径'} + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * ​ 主动调用停止录音。 + */ + stopRecord(): void; + + /** + * 开始播放语音,同时只允许一个语音文件正在播放,如果前一个语音文件还没播放完,将中断前一个语音播放。 + */ + playVoice(obj: { + /** + * 需要播放的语音文件的文件路径 + */ + filePath: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 暂停正在播放的语音。再次调用wx.playVoice播放同一个文件时,会从暂停处开始播放。如果想从头开始播放,需要先调用 wx.stopVoice。 + */ + pauseVoice(): void; + + /** + * 结束播放语音。 + */ + stopVoice(): void; + + /** + * 获取后台音乐播放状态。 + */ + getBackgroundAudioPlayerState(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 使用后台播放器播放音乐,对于微信客户端来说,只能同时有一个后台音乐在播放。当用户离开小程序后,音乐将暂停播放;当用户点击“显示在聊天顶部”时,音乐不会暂停播放;当用户在其他小程序占用了音乐播放器,原有小程序内的音乐将停止播放。 + */ + playBackgroundAudio(obj: { + /** + * 音乐链接,目前支持的格式有 m4a, aac, mp3, wav + */ + dataUrl: string; + /** + * 音乐标题 + */ + title?: string; + /** + * 封面URL + */ + coverImgUrl?: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 暂停播放音乐。 + */ + pauseBackgroundAudio(): void; + + /** + * 控制音乐播放进度。 + */ + seekBackgroundAudio(obj: { + /** + * 音乐位置,单位:秒 + */ + position: number; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 停止播放音乐。 + */ + stopBackgroundAudio(): void; + + /** + * 监听音乐播放。 + */ + onBackgroundAudioPlay(callback: Function): void; + + /** + * 监听音乐暂停。 + */ + onBackgroundAudioPause(callback: Function): void; + + /** + * 监听音乐停止。 + */ + onBackgroundAudioStop(callback: Function): void; + + getBackgroundAudioManager(): void; + + /** + * 创建并返回 audio 上下文 audioContext 对象 + */ + createAudioContext(audioId: string): IAudioContext; + + /** + * 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。 + */ + chooseVideo(obj: { + /** + * album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera'] + */ + sourceType?: string[]; + /** + * 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒 + */ + maxDuration?: number; + /** + * 默认调起的为前置还是后置摄像头。front: 前置,back: 后置,默认 back + */ + camera?: string; + /** + * 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + saveVideoToPhotosAlbum(obj: { + /** + * 视频文件路径,可以是临时文件路径也可以是永久文件路径 + */ + filePath: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 创建并返回 video 上下文 videoContext 对象 + */ + createVideoContext(videoId: string): IVideoContext; + + // # 文件 # + + /** + * 保存文件到本地。 + */ + saveFile(obj: { + /** + * 需要保存的文件的临时路径 + */ + tempFilePath: string; + /** + * 返回文件的保存路径,res = {savedFilePath: '文件的保存路径'} + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 获取本地已保存的文件列表 + */ + getSavedFileList(obj: { + /** + * 接口调用成功的回调函数,返回结果见success返回参数说明 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 获取本地文件的文件信息。此接口只能用于获取已保存到本地的文件,若需要获取临时文件信息,请使用 wx.getFileInfo 接口。 + */ + getSavedFileInfo(obj: { + /** + * 文件路径 + */ + filePath: string; + /** + * 接口调用成功的回调函数,返回结果见success返回参数说明 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 删除本地存储的文件 + */ + removeSavedFile(obj: { + /** + * 需要删除的文件路径 + */ + filePath: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx + */ + openDocument(obj: { + /** + * 文件路径,可通过 downFile 获得 + */ + filePath: string; + /** + * 文件类型,指定文件类型打开文件,有效值 doc, xls, ppt, pdf, docx, xlsx, pptx + */ + fileType?: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getFileInfo(obj: { + /** + * 本地文件路径 + */ + filePath: string; + /** + * 计算文件摘要的算法,默认值 md5,有效值:md5,sha1 + */ + digestAlgorithm?: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + // # 数据缓存 # + + /** + * 将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。 + */ + setStorage(obj: { + /** + * 本地缓存中的指定的 key + */ + key: string; + /** + * 需要存储的内容 + */ + data: any; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。 + */ + setStorageSync(key: string, data: any, ): void; + + /** + * 从本地缓存中异步获取指定 key 对应的内容。 + */ + getStorage(obj: { + /** + * 本地缓存中的指定的 key + */ + key: string; + /** + * 接口调用的回调函数,res = {data: key对应的内容} + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 从本地缓存中同步获取指定 key 对应的内容。 + */ + getStorageSync(key: string): void; + + /** + * 异步获取当前storage的相关信息 + */ + getStorageInfo(obj: { + /** + * 接口调用的回调函数,详见返回参数说明 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 同步获取当前storage的相关信息 + */ + getStorageInfoSync(): void; + + /** + * 从本地缓存中异步移除指定 key 。 + */ + removeStorage(obj: { + /** + * 本地缓存中的指定的 key + */ + key: string; + /** + * 接口调用的回调函数 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 从本地缓存中同步移除指定 key 。 + */ + removeStorageSync(key: string): void; + + /** + * 清理本地数据缓存。 + */ + clearStorage(): void; + + /** + * 同步清理本地数据缓存 + */ + clearStorageSync(): void; + + // # 位置 # + + /** + * 获取当前的地理位置、速度。当用户离开小程序后,此接口无法调用;当用户点击“显示在聊天顶部”时,此接口可继续调用。 + */ + getLocation(obj: { + /** + * 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于wx.openLocation的坐标 + */ + type?: string; + /** + * 接口调用成功的回调函数,返回内容详见返回参数说明。 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 打开地图选择位置 + */ + chooseLocation(obj: { + /** + * 接口调用成功的回调函数,返回内容详见返回参数说明。 + */ + success: Function; + /** + * 用户取消时调用 + */ + cancel?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * ​ 使用微信内置地图查看位置 + */ + openLocation(obj: { + /** + * 纬度,范围为-90~90,负数表示南纬 + */ + latitude: number; + /** + * 经度,范围为-180~180,负数表示西经 + */ + longitude: number; + /** + * 缩放比例,范围5~18,默认为18 + */ + scale?: number; + /** + * 位置名 + */ + name?: string; + /** + * 地址的详细说明 + */ + address?: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 创建并返回 map 上下文 mapContext 对象 + */ + createMapContext(mapId: string): IMapContext; + + // # 设备 # + + /** + * 获取系统信息。 + */ + getSystemInfo(obj: { + /** + * 接口调用成功的回调 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 获取系统信息同步接口 + */ + getSystemInfoSync(): void; + + /** + * 获取网络类型。 + */ + getNetworkType(obj: { + /** + * 接口调用成功,返回网络类型 networkType + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + onNetworkStatusChange(callback: Function): void; + + setScreenBrightness(obj: { + /** + * 屏幕亮度值,范围 0~1,0 最暗,1 最亮 + */ + value: number; + /** + * 接口调用成功 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getScreenBrightness(obj: { + /** + * 接口调用成功 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + vibrateLong(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + vibrateShort(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 wx.stopAccelerometer 停止监听。 + */ + onAccelerometerChange(callback: Function): void; + + startAccelerometer(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + stopAccelerometer(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 监听罗盘数据,频率:5次/秒,接口调用后会自动开始监听,可使用wx.stopCompass停止监听。 + */ + onCompassChange(callback: Function): void; + + startCompass(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + stopCompass(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + makePhoneCall(obj: { + /** + * 需要拨打的电话号码 + */ + phoneNumber: string; + /** + * 接口调用成功的回调 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 调起客户端扫码界面,扫码成功后返回对应的结果 + */ + scanCode(obj: { + /** + * 是否只能从相机扫码,不允许从相册选择图片 + */ + onlyFromCamera?: boolean; + /** + * 接口调用成功的回调函数,返回内容详见返回参数说明。 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + setClipboardData(obj: { + /** + * 需要设置的内容 + */ + data: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getClipboardData(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + openBluetoothAdapter(obj: { + /** + * 成功则返回成功初始化信息 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + closeBluetoothAdapter(obj: { + /** + * 成功则返回成功关闭模块信息 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getBluetoothAdapterState(obj: { + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + onBluetoothAdapterStateChange(callback: Function): void; + + startBluetoothDevicesDiscovery(obj: { + /** + * 蓝牙设备主 service 的 uuid 列表 + */ + services?: Array; + /** + * 是否允许重复上报同一设备, 如果允许重复上报,则onDeviceFound 方法会多次上报同一设备,但是 RSSI 值会有不同 + */ + allowDuplicatesKey?: boolean; + /** + * 上报设备的间隔,默认为0,意思是找到新设备立即上报,否则根据传入的间隔上报 + */ + interval?: number; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + stopBluetoothDevicesDiscovery(obj: { + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getBluetoothDevices(obj: { + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + onBluetoothDeviceFound(callback: Function): void; + + getConnectedBluetoothDevices(obj: { + /** + * 蓝牙设备主 service 的 uuid 列表 + */ + services: Array; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + createBLEConnection(obj: { + /** + * 蓝牙设备 id,参考 getDevices 接口 + */ + deviceId: string; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + closeBLEConnection(obj: { + /** + * 蓝牙设备 id,参考 getDevices 接口 + */ + deviceId: string; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getBLEDeviceServices(obj: { + /** + * 蓝牙设备 id,参考 getDevices 接口 + */ + deviceId: string; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getBLEDeviceCharacteristics(obj: { + /** + * 蓝牙设备 id,参考 device 对象 + */ + deviceId: string; + /** + * 蓝牙服务 uuid + */ + serviceId: string; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + readBLECharacteristicValue(obj: { + /** + * 蓝牙设备 id,参考 device 对象 + */ + deviceId: string; + /** + * 蓝牙特征值对应服务的 uuid + */ + serviceId: string; + /** + * 蓝牙特征值的 uuid + */ + characteristicId: string; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + writeBLECharacteristicValue(obj: { + /** + * 蓝牙设备 id,参考 device 对象 + */ + deviceId: string; + /** + * 蓝牙特征值对应服务的 uuid + */ + serviceId: string; + /** + * 蓝牙特征值的 uuid + */ + characteristicId: string; + /** + * 蓝牙设备特征值对应的二进制值(注意:vConsole 无法打印出 ArrayBuffer 类型数据) + */ + value: undefined; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + notifyBLECharacteristicValueChange(obj: { + /** + * 蓝牙设备 id,参考 device 对象 + */ + deviceId: string; + /** + * 蓝牙特征值对应服务的 uuid + */ + serviceId: string; + /** + * 蓝牙特征值的 uuid + */ + characteristicId: string; + /** + * true: 启用 notify; false: 停用 notify + */ + state: boolean; + /** + * 成功则返回本机蓝牙适配器状态 + */ + success: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + onBLEConnectionStateChange(callback: Function): void; + + onBLECharacteristicValueChange(callback: Function): void; + + startBeaconDiscovery(obj: { + /** + * iBeacon设备广播的 uuids + */ + uuids: string[]; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + stopBeaconDiscovery(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getBeacons(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + onBeaconUpdate(callback: Function): void; + + onBeaconServiceChange(callback: Function): void; + + onUserCaptureScreen(callback: Function): void; + + addPhoneContact(obj: { + /** + * 头像本地文件路径 + */ + photoFilePath?: string; + /** + * 昵称 + */ + nickName?: string; + /** + * 姓氏 + */ + lastName?: string; + /** + * 中间名 + */ + middleName?: string; + /** + * 名字 + */ + firstName: string; + /** + * 备注 + */ + remark?: string; + /** + * 手机号 + */ + mobilePhoneNumber?: string; + /** + * 微信号 + */ + weChatNumber?: string; + /** + * 联系地址国家 + */ + addressCountry?: string; + /** + * 联系地址省份 + */ + addressState?: string; + /** + * 联系地址城市 + */ + addressCity?: string; + /** + * 联系地址街道 + */ + addressStreet?: string; + /** + * 联系地址邮政编码 + */ + addressPostalCode?: string; + /** + * 公司 + */ + organization?: string; + /** + * 职位 + */ + title?: string; + /** + * 工作传真 + */ + workFaxNumber?: string; + /** + * 工作电话 + */ + workPhoneNumber?: string; + /** + * 公司电话 + */ + hostNumber?: string; + /** + * 电子邮件 + */ + email?: string; + /** + * 网站 + */ + url?: string; + /** + * 工作地址国家 + */ + workAddressCountry?: string; + /** + * 工作地址省份 + */ + workAddressState?: string; + /** + * 工作地址城市 + */ + workAddressCity?: string; + /** + * 工作地址街道 + */ + workAddressStreet?: string; + /** + * 工作地址邮政编码 + */ + workAddressPostalCode?: string; + /** + * 住宅传真 + */ + homeFaxNumber?: string; + /** + * 住宅电话 + */ + homePhoneNumber?: string; + /** + * 住宅地址国家 + */ + homeAddressCountry?: string; + /** + * 住宅地址省份 + */ + homeAddressState?: string; + /** + * 住宅地址城市 + */ + homeAddressCity?: string; + /** + * 住宅地址街道 + */ + homeAddressStreet?: string; + /** + * 住宅地址邮政编码 + */ + homeAddressPostalCode?: string; + /** + * 接口调用成功 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + // # 界面 # + + /** + * 显示消息提示框 + */ + showToast(obj: { + /** + * 提示的内容 + */ + title: string; + /** + * 图标,有效值 "success", "loading" + */ + icon?: string; + /** + * 自定义图标的本地路径,image 的优先级高于 icon + */ + image?: string; + /** + * 提示的延迟时间,单位毫秒,默认:1500 + */ + duration?: number; + /** + * 是否显示透明蒙层,防止触摸穿透,默认:false + */ + mask?: boolean; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + showLoading(obj: { + /** + * 提示的内容 + */ + title: string; + /** + * 是否显示透明蒙层,防止触摸穿透,默认:false + */ + mask?: boolean; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 隐藏消息提示框 + */ + hideToast(): void; + + hideLoading(): void; + + /** + * ​显示模态弹窗 + */ + showModal(obj: { + /** + * 提示的标题 + */ + title: string; + /** + * 提示的内容 + */ + content: string; + /** + * 是否显示取消按钮,默认为 true + */ + showCancel?: boolean; + /** + * 取消按钮的文字,默认为"取消",最多 4 个字符 + */ + cancelText?: string; + /** + * 取消按钮的文字颜色,默认为"#000000" + */ + cancelColor?: undefined; + /** + * 确定按钮的文字,默认为"确定",最多 4 个字符 + */ + confirmText?: string; + /** + * 确定按钮的文字颜色,默认为"#3CC51F" + */ + confirmColor?: undefined; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * ​显示操作菜单 + */ + showActionSheet(obj: { + /** + * 按钮的文字数组,数组长度最大为6个 + */ + itemList: undefined; + /** + * 按钮的文字颜色,默认为"#000000" + */ + itemColor?: undefined; + /** + * 接口调用成功的回调函数,详见返回参数说明 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + setTopBarText(obj: { + /** + * 置顶栏文字内容 + */ + text: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 动态设置当前页面的标题。 + */ + setNavigationBarTitle(obj: { + /** + * 页面标题 + */ + title: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 在当前页面显示导航条加载动画。 + */ + showNavigationBarLoading(): void; + + /** + * 隐藏导航条加载动画。 + */ + hideNavigationBarLoading(): void; + + /** + * 保留当前页面,跳转到应用内的某个页面,使用wx.navigateBack可以返回到原页面。 + */ + navigateTo(obj: { + /** + * 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2' + */ + url: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 关闭当前页面,跳转到应用内的某个页面。 + */ + redirectTo(obj: { + /** + * 需要跳转的应用内非 tabBar 的页面的路径,路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2' + */ + url: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + reLaunch(obj: { + /** + * 需要跳转的应用内页面路径 , 路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2',如果跳转的页面路径是 tabBar 页面则不能带参数 + */ + url: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 + */ + switchTab(obj: { + /** + * 需要跳转的 tabBar 页面的路径(需在 app.json 的 tabBar 字段定义的页面),路径后不能带参数 + */ + url: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages()) 获取当前的页面栈,决定需要返回几层。 + */ + navigateBack(obj: { + /** + * 返回的页面数,如果 delta 大于现有页面数,则返回到首页。 + */ + delta?: number; + }): void; + + /** + * 创建一个动画实例animation。调用实例的方法来描述动画。最后通过动画实例的export方法导出动画数据传递给组件的animation属性。 + */ + createAnimation(obj: { + /** + * 400 + */ + duration?: number; + /** + * "linear" + */ + timingFunction?: string; + /** + * 0 + */ + delay?: number; + /** + * "50% 50% 0" + */ + transformOrigin?: string; + }): IAnimation; + + pageScrollTo(obj: { + /** + * 滚动到页面的目标位置(单位px) + */ + scrollTop: number; + }): void; + + /** + * 创建 canvas 绘图上下文(指定 canvasId).Tip: 需要指定 canvasId,该绘图上下文只作用于对应的 + */ + createCanvasContext(canvasId: string): ICanvasContext; + + /** + * 把当前画布的内容导出生成图片,并返回文件路径 + */ + canvasToTempFilePath(canvasId: string): void; + + startPullDownRefresh(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 停止当前页面下拉刷新。 + */ + stopPullDownRefresh(): void; + + // # WXML节点信息 # + + // # 第三方平台 # + + getExtConfig(obj: { + /** + * 返回第三方平台自定义的数据 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getExtConfigSync(): void; + + // # 开放接口 # + + /** + * 调用接口获取登录凭证(code)进而换取用户登录态信息,包括用户的唯一标识(openid) 及本次登录的 会话密钥(session_key)。用户数据的加解密通讯需要依赖会话密钥完成。 + */ + login(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 通过上述接口获得的用户登录态拥有一定的时效性。用户越久未使用小程序,用户登录态越有可能失效。反之如果用户一直在使用小程序,则用户登录态一直保持有效。具体时效逻辑由微信维护,对开发者透明。开发者只需要调用wx.checkSession接口检测当前用户登录态是否有效。登录态过期后开发者可以再调用wx.login获取新的用户登录态。 + */ + checkSession(obj: { + /** + * 接口调用成功的回调函数,登录态未过期 + */ + success?: Function; + /** + * 接口调用失败的回调函数,登录态已过期 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + authorize(obj: { + /** + * 需要获取权限的scope,详见 scope 列表 + */ + scope: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 获取用户信息,withCredentials 为 true 时需要先调用 wx.login 接口。 + */ + getUserInfo(obj: { + /** + * 是否带上登录态信息 + */ + withCredentials?: boolean; + /** + * 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文 + */ + lang?: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + /** + * 发起微信支付。 + */ + requestPayment(obj: { + /** + * 时间戳从1970年1月1日00:00:00至今的秒数,即当前的时间 + */ + timeStamp: string; + /** + * 随机字符串,长度为32个字符以下。 + */ + nonceStr: string; + /** + * 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=* + */ + package: string; + /** + * 签名算法,暂支持 MD5 + */ + signType: string; + /** + * 签名,具体签名方案参见小程序支付接口文档; + */ + paySign: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + chooseAddress(obj: { + /** + * 返回用户选择的收货地址信息 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + addCard(obj: { + /** + * 需要添加的卡券列表,列表内对象说明请参见请求对象说明 + */ + cardList: undefined; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + openCard(obj: { + /** + * 需要打开的卡券列表,列表内参数详见openCard 请求对象说明 + */ + cardList: undefined; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + openSetting(obj: { + /** + * 接口调用成功的回调函数,返回内容详见返回参数说明。 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getSetting(obj: { + /** + * 接口调用成功的回调函数,返回内容详见返回参数说明。 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + getWeRunData(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + navigateToMiniProgram(obj: { + /** + * 要打开的小程序 appId + */ + appId: string; + /** + * 打开的页面路径,如果为空则打开首页 + */ + path?: string; + /** + * 需要传递给目标小程序的数据,目标小程序可在 App.onLaunch(),App.onShow() 中获取到这份数据。详情 + */ + extraData?: any; + /** + * 要打开的小程序版本,有效值 develop(开发版),trial(体验版),release(正式版) ,仅在当前小程序为开发版或体验版时此参数有效;如果当前小程序是体验版或正式版,则打开的小程序必定是正式版。默认值 release + */ + envVersion?: string; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + chooseInvoiceTitle(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + checkIsSupportSoterAuthentication(obj: { + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + + // # 数据 # + + /** + * 自定义分析数据上报接口。使用前,需要在小程序管理后台自定义分析中新建事件,配置好事件名与字段。 + */ + reportAnalytics(eventName: string, data: string, ): void; + + // # 拓展接口 # + + arrayBufferToBase64(arrayBuffer: string): void; + + base64ToArrayBuffer(base64: string): void; + + // # 调试接口 # + + setEnableDebug(obj: { + /** + * 是否打开调试 + */ + enableDebug: boolean; + /** + * 接口调用成功的回调函数 + */ + success?: Function; + /** + * 接口调用失败的回调函数 + */ + fail?: Function; + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + */ + complete?: Function; + }): void; + +} \ No newline at end of file diff --git a/src/openeuler/utils/app-ajax.js b/src/openeuler/utils/app-ajax.js index 43a2bb1..25b11cd 100644 --- a/src/openeuler/utils/app-ajax.js +++ b/src/openeuler/utils/app-ajax.js @@ -6,6 +6,33 @@ const appSession = require('./app-session.js'); const underscore = require('./underscore-extend.js'); const servicesConfig = require('../config/services-config.js'); const CONSTANTS = require('../config/constants.js'); +const RETRY = require('./retry-ajax.js'); + +const aa = new RETRY({ + url: 'REFRESH', + unauthorizedCode: 401, + getRefreshToken: () => '555', + onSuccess: (res) => { + const accessToken = JSON.parse(res.data).accessToken; + localStorage.setItem(LOCAL_ACCESS_KEY, accessToken); + }, + onError: () => { + console.log('refreshToken 过期了,乖乖去登录页'); + }, +}); +console.log(aa); + +let remoteMethods = { + refreshToken: function (_callback) { + appAjax.postJson({ + type: 'POST', + service: 'REFRESH', + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; /** * 获取service @@ -22,7 +49,6 @@ const _getInterfaceUrl = function (params) { params.otherParams[key] ); } - return interfaceUrl; }; @@ -38,6 +64,42 @@ const _addUrlParam = function (data) { return postData; }; +const loginQueue = []; +let isLoginning = false; + +/** + * 获取sessionId + * 参数:undefined + * 返回值:[promise]sessionId + */ +function getSessionId() { + return new Promise((res, rej) => { + // 本地sessionId缺失,重新登录 + if (!sessionId) { + loginQueue.push({ res, rej }); + + if (!isLoginning) { + isLoginning = true; + + login() + .then((r1) => { + isLoginning = false; + while (loginQueue.length) { + loginQueue.shift().res(r1); + } + }) + .catch((err) => { + isLoginning = false; + while (loginQueue.length) { + loginQueue.shift().rej(err); + } + }); + } + } else { + res(sessionId); + } + }); +} const appAjax = { /** @@ -70,9 +132,9 @@ const appAjax = { // rest请求路径 ajaxParams['url'] = CONSTANTS['SERVICE_URL'] + _getInterfaceUrl(ajaxParams); if ( - (ajaxParams.type == 'GET' || ajaxParams.type == 'DELETE') && + (ajaxParams.type === 'GET' || ajaxParams.type === 'DELETE') && ajaxParams.data && - typeof ajaxParams.data == 'object' + typeof ajaxParams.data === 'object' ) { ajaxParams['url'] = ajaxParams['url'] + _addUrlParam(ajaxParams.data); } @@ -90,10 +152,6 @@ const appAjax = { method: ajaxParams['type'] || 'POST', data: ajaxParams.data, success: function (res) { - // if (!timer && wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION)) { - // timer = setInterval(() => { - // }, 1000 * 6 * 10); - // } if (res?.data?.access && wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION)) { let data = wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION); data.access = res.data.access; @@ -102,12 +160,9 @@ const appAjax = { if (res.statusCode === 401) { wx.removeStorageSync('_app_userinfo_session'); ajaxParams.success(0, res); - const pages = getCurrentPages(); // 当前页面 - if (pages[0].route !== '/pages/auth/auth') { - wx.navigateTo({ - url: '/pages/auth/auth', - }); - } + wx.navigateTo({ + url: '/pages/auth/auth', + }); return; } if (res.statusCode.toString()[0] != 2) { diff --git a/src/openeuler/utils/app-user.js b/src/openeuler/utils/app-user.js index 823211d..5dbfdbc 100644 --- a/src/openeuler/utils/app-user.js +++ b/src/openeuler/utils/app-user.js @@ -161,6 +161,7 @@ const appUser = { userInfo.gitee = ret.gitee_name; userInfo.level = ret.level; userInfo.nickName = ret.nickname; + userInfo.avatarUrl = ret.avatar; userInfo.eventLevel = ret.activity_level; wx.setStorageSync(constants.APP_USERINFO_SESSION, userInfo); } diff --git a/src/openeuler/utils/page-mixin.js b/src/openeuler/utils/page-mixin.js index ebbd6df..b88deb8 100644 --- a/src/openeuler/utils/page-mixin.js +++ b/src/openeuler/utils/page-mixin.js @@ -94,7 +94,7 @@ let $pageMixin = function (pageConfig) { let rewriteList = [ 'onLoad', // 生命周期函数--监听页面加载 // 'onReady', // 生命周期函数--监听页面初次渲染完成 - // 'onShow', // 生命周期函数--监听页面显示 + // 'onShow', // 生命周期函数--监听页面显示 // 'onHide', // 生命周期函数--监听页面隐藏 // 'onUnload', // 生命周期函数--监听页面卸载 // 'onPullDownRefresh', // 页面相关事件处理函数--监听用户下拉动作 diff --git a/src/openeuler/utils/retry-ajax.js b/src/openeuler/utils/retry-ajax.js new file mode 100644 index 0000000..e0c1b9b --- /dev/null +++ b/src/openeuler/utils/retry-ajax.js @@ -0,0 +1,67 @@ +const appAjax = require('./app-ajax'); + +class ajaxRetry { + constructor({ url, getRefreshToken, unauthorizedCode = 401, onSuccess, onError }) { + this.url = url; + this.getRefreshToken = getRefreshToken; + this.unauthorizedCode = unauthorizedCode; + this.onSuccess = onSuccess; + this.onError = onError; + } + + requestWrapper(request) { + return new Promise((resolve, reject) => { + // 先把请求函数保存下来 + const requestFn = request; + return request() + .then(resolve) + .catch((err) => { + console.log(err); + if (err?.status === this.unauthorizedCode && !(err?.config?.url === this.url)) { + if (!this.fetchNewTokenPromise) { + this.fetchNewTokenPromise = this.fetchNewToken(); + } + this.fetchNewTokenPromise + .then(() => { + // 获取token成功后,重新执行请求 + requestFn().then(resolve).catch(reject); + }) + .finally(() => { + // 置空 + this.fetchNewTokenPromise = null; + }); + } else { + reject(err); + } + }); + }); + } + // 获取token的函数 + refreshToken() { + appAjax.postJson({ + type: 'POST', + service: this.url, + success: function () { + this.onSuccess; + }, + fail: function () { + this.onError(); + return Promise.reject(); + }, + }); + } + // fetchNewToken() { + // return new Axios() + // .get(this.url, { + // headers: { + // Authorization: this.getRefreshToken(), + // }, + // }) + // .then(this.onSuccess) + // .catch(() => { + // this.onError(); + // return Promise.reject(); + // }); + // } +} +module.exports = ajaxRetry; -- Gitee From 2d0473cec17c18d6901cc3d6753e28abfebe2a5a Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Tue, 14 Nov 2023 20:51:07 +0800 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Etoken=20?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/meeting-list/meeting-list.js | 6 +- .../package-events/events/event-detail.js | 2 +- .../package-events/manage/add-member.js | 2 +- .../package-events/manage/del-member.js | 2 +- .../package-events/publish/publish.js | 2 +- .../package-meeting/meeting/detail.js | 4 +- .../package-meeting/reserve/reserve.js | 1 - .../package-meeting/sig/add-member.js | 2 +- .../package-meeting/sig/del-member.js | 2 +- src/openeuler/package-my/my/qrcode.js | 3 - src/openeuler/utils/app-ajax.js | 119 ++++++++---------- src/openeuler/utils/app-user.js | 3 + src/openeuler/utils/retry-ajax.js | 67 ---------- 13 files changed, 62 insertions(+), 153 deletions(-) delete mode 100644 src/openeuler/utils/retry-ajax.js diff --git a/src/openeuler/components/meeting-list/meeting-list.js b/src/openeuler/components/meeting-list/meeting-list.js index 234c183..d92002e 100644 --- a/src/openeuler/components/meeting-list/meeting-list.js +++ b/src/openeuler/components/meeting-list/meeting-list.js @@ -208,7 +208,7 @@ Component({ tmplIds: ['2xSske0tAcOVKNG9EpBjlb1I-cjPWSZrpwPDTgqAmWI', 'UpxRbZf8Z9QiEPlZeRCgp_MKvvqHlo6tcToY8fToK50'], success() { remoteMethods.collect(that.data.id, (res) => { - if (res.code == 201) { + if (res.code == 200) { that.setData({ 'pageParams.page': 1, }); @@ -258,9 +258,8 @@ Component({ }); }, del: function () { - console.log(this.data.curMid); remoteMethods.delMeeting(this.data.curMid, (data) => { - if (data.code == 204) { + if (data.code == 200) { this.setData({ showDialogDel: false, 'pageParams.page': 1, @@ -283,7 +282,6 @@ Component({ if (!localMethod.checkLogin()) { return; } - console.log(e.currentTarget.dataset); this.setData({ curMid: e.currentTarget.dataset.item.mid, curJoinUrl: e.currentTarget.dataset.item.join_url, diff --git a/src/openeuler/package-events/events/event-detail.js b/src/openeuler/package-events/events/event-detail.js index d090d97..bac1e2a 100644 --- a/src/openeuler/package-events/events/event-detail.js +++ b/src/openeuler/package-events/events/event-detail.js @@ -207,7 +207,7 @@ Page({ let postData = this.data.info; postData.schedules = JSON.parse(postData.schedules); remoteMethods.draftPublish(postData, (res) => { - if (res.code === 201) { + if (res.code === 200) { wx.redirectTo({ url: '/package-events/publish/success?type=2', }); diff --git a/src/openeuler/package-events/manage/add-member.js b/src/openeuler/package-events/manage/add-member.js index fb54727..9ad45b3 100644 --- a/src/openeuler/package-events/manage/add-member.js +++ b/src/openeuler/package-events/manage/add-member.js @@ -97,7 +97,7 @@ Page({ ids: this.data.result.join('-'), }; remoteMethods.addMemberList(postData, function (data) { - if (data.code === 201) { + if (data.code === 200) { wx.showToast({ title: '操作成功', icon: 'success', diff --git a/src/openeuler/package-events/manage/del-member.js b/src/openeuler/package-events/manage/del-member.js index 1556400..9a92520 100644 --- a/src/openeuler/package-events/manage/del-member.js +++ b/src/openeuler/package-events/manage/del-member.js @@ -89,7 +89,7 @@ Page({ ids: this.data.result.join('-'), }; remoteMethods.delMemberList(postData, function (data) { - if (data.code === 204) { + if (data.code === 200) { wx.showToast({ title: '操作成功', icon: 'success', diff --git a/src/openeuler/package-events/publish/publish.js b/src/openeuler/package-events/publish/publish.js index cf9b1e6..cc12ada 100644 --- a/src/openeuler/package-events/publish/publish.js +++ b/src/openeuler/package-events/publish/publish.js @@ -553,7 +553,7 @@ Page({ return; } remoteMethods.addEvents(postData, (res) => { - if (res.code === 201) { + if (res.code === 200) { wx.redirectTo({ url: '/package-events/publish/success?type=2', }); diff --git a/src/openeuler/package-meeting/meeting/detail.js b/src/openeuler/package-meeting/meeting/detail.js index 285a8bd..34cdf52 100644 --- a/src/openeuler/package-meeting/meeting/detail.js +++ b/src/openeuler/package-meeting/meeting/detail.js @@ -109,9 +109,9 @@ Page({ } else { wx.requestSubscribeMessage({ tmplIds: ['2xSske0tAcOVKNG9EpBjlb1I-cjPWSZrpwPDTgqAmWI', 'UpxRbZf8Z9QiEPlZeRCgp_MKvvqHlo6tcToY8fToK50'], - success(res) { + success() { remoteMethods.collect(that.data.id, function (res) { - if (res.code == 201) { + if (res.code == 200) { that.setData({ collection_id: res.collection_id || '', }); diff --git a/src/openeuler/package-meeting/reserve/reserve.js b/src/openeuler/package-meeting/reserve/reserve.js index a4d4093..ad40269 100644 --- a/src/openeuler/package-meeting/reserve/reserve.js +++ b/src/openeuler/package-meeting/reserve/reserve.js @@ -202,7 +202,6 @@ Page({ wx.requestSubscribeMessage({ tmplIds: ['2xSske0tAcOVKNG9EpBjlb1I-cjPWSZrpwPDTgqAmWI'], success() { - console.log(that.data.emaillist); that.data.emaillist.replace(/;/g, ';'); let email = null; if (that.data.sendDev) { diff --git a/src/openeuler/package-meeting/sig/add-member.js b/src/openeuler/package-meeting/sig/add-member.js index 271b3ce..02039f4 100644 --- a/src/openeuler/package-meeting/sig/add-member.js +++ b/src/openeuler/package-meeting/sig/add-member.js @@ -112,7 +112,7 @@ Page({ group_id: this.data.sigId, }; remoteMethods.addMemberList(postData, function (data) { - if (data.code === 201) { + if (data.code === 200) { wx.showToast({ title: '操作成功', icon: 'success', diff --git a/src/openeuler/package-meeting/sig/del-member.js b/src/openeuler/package-meeting/sig/del-member.js index ffc970a..375273a 100644 --- a/src/openeuler/package-meeting/sig/del-member.js +++ b/src/openeuler/package-meeting/sig/del-member.js @@ -109,7 +109,7 @@ Page({ group_id: this.data.sigId, }; remoteMethods.delMemberList(postData, function (data) { - if (data.code === 204) { + if (data.code === 200) { wx.showToast({ title: '操作成功', icon: 'success', diff --git a/src/openeuler/package-my/my/qrcode.js b/src/openeuler/package-my/my/qrcode.js index dcda18e..a1dd63c 100644 --- a/src/openeuler/package-my/my/qrcode.js +++ b/src/openeuler/package-my/my/qrcode.js @@ -55,9 +55,6 @@ Page({ content: '请尝试点击右上角 “...” => “设置” 同意添加到相册后再保存~', }); }, - complete(res) { - console.log(res); - }, }); }, }); diff --git a/src/openeuler/utils/app-ajax.js b/src/openeuler/utils/app-ajax.js index 25b11cd..218b2ce 100644 --- a/src/openeuler/utils/app-ajax.js +++ b/src/openeuler/utils/app-ajax.js @@ -2,31 +2,18 @@ * 请求方法 */ -const appSession = require('./app-session.js'); const underscore = require('./underscore-extend.js'); const servicesConfig = require('../config/services-config.js'); const CONSTANTS = require('../config/constants.js'); -const RETRY = require('./retry-ajax.js'); - -const aa = new RETRY({ - url: 'REFRESH', - unauthorizedCode: 401, - getRefreshToken: () => '555', - onSuccess: (res) => { - const accessToken = JSON.parse(res.data).accessToken; - localStorage.setItem(LOCAL_ACCESS_KEY, accessToken); - }, - onError: () => { - console.log('refreshToken 过期了,乖乖去登录页'); - }, -}); -console.log(aa); let remoteMethods = { - refreshToken: function (_callback) { + refreshToken: function (refresh, _callback) { appAjax.postJson({ type: 'POST', service: 'REFRESH', + data: { + refresh, + }, success: function (ret) { _callback && _callback(ret); }, @@ -61,46 +48,32 @@ const _addUrlParam = function (data) { postData += '&' + key + '=' + data[key]; } } - return postData; }; -const loginQueue = []; -let isLoginning = false; -/** - * 获取sessionId - * 参数:undefined - * 返回值:[promise]sessionId - */ -function getSessionId() { - return new Promise((res, rej) => { - // 本地sessionId缺失,重新登录 - if (!sessionId) { - loginQueue.push({ res, rej }); +let messageQueue = []; +let isRefreshing = false; - if (!isLoginning) { - isLoginning = true; +const handleSuccessfulRefresh = function (newTokens, userData) { + userData.access = newTokens.access; + userData.refresh = newTokens.refresh; + wx.setStorageSync(CONSTANTS.APP_USERINFO_SESSION, userData); + processMessageQueue(); + isRefreshing = false; +}; - login() - .then((r1) => { - isLoginning = false; - while (loginQueue.length) { - loginQueue.shift().res(r1); - } - }) - .catch((err) => { - isLoginning = false; - while (loginQueue.length) { - loginQueue.shift().rej(err); - } - }); - } - } else { - res(sessionId); - } - }); -} +const clearUserDataAndNavigate = function () { + messageQueue = []; + wx.removeStorageSync('_app_userinfo_session'); + isRefreshing = false; + wx.navigateTo({ url: '/pages/auth/auth' }); +}; +const processMessageQueue = function () { + while (messageQueue.length) { + appAjax.postJson(messageQueue.shift()); + } +}; const appAjax = { /** * 提交请求 @@ -123,7 +96,9 @@ const appAjax = { loadingText: '加载中...', // 加载的提示语 autoCloseWait: true, // 自动关闭菊花 headers: { - Authorization: appSession.getToken() ? 'Bearer ' + appSession.getToken() : '', + Authorization: wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION).access + ? 'Bearer ' + wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION).access + : '', }, isAsync: true, }; @@ -152,28 +127,40 @@ const appAjax = { method: ajaxParams['type'] || 'POST', data: ajaxParams.data, success: function (res) { - if (res?.data?.access && wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION)) { - let data = wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION); + const data = wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION); + if (res?.data?.access && data) { data.access = res.data.access; wx.setStorageSync(CONSTANTS.APP_USERINFO_SESSION, data); } - if (res.statusCode === 401) { - wx.removeStorageSync('_app_userinfo_session'); - ajaxParams.success(0, res); - wx.navigateTo({ - url: '/pages/auth/auth', - }); - return; - } + ajaxParams.success(res.data, res); + if (res.statusCode.toString()[0] != 2) { let message = ''; if (res?.data?.detail && res.statusCode === 400) { message = res.data.detail; + } else if (res.statusCode === 401) { + message = '请登陆!'; } else if (res.statusCode === 418) { message = '您的请求疑似攻击行为!'; } else { message = '有点忙开个小差,稍后再试~'; } + // 刷新token + if (res.statusCode === 401 && data && params.service !== 'REFRESH') { + messageQueue.push(params); + if (!isRefreshing) { + isRefreshing = true; + remoteMethods.refreshToken(data?.refresh, (res) => { + if (!res.refresh) { + clearUserDataAndNavigate(); + } else { + handleSuccessfulRefresh(res, data); + } + isRefreshing = false; + }); + } + return; + } if (ajaxParams.error) { ajaxParams.error(message, res); } else { @@ -186,16 +173,8 @@ const appAjax = { } return; } - ajaxParams.success(res.data, res); }, fail: function (res) { - if (res?.data?.access) { - if (res.data.access && wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION)) { - let data = wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION); - data.access = res.data.access; - wx.setStorageSync(CONSTANTS.APP_USERINFO_SESSION, data); - } - } let message = res?.data?.detail && res.statusCode === 400 ? res.data.detail : '有点忙开个小差,稍后再试~'; ajaxParams.error && ajaxParams.error(message, res); }, diff --git a/src/openeuler/utils/app-user.js b/src/openeuler/utils/app-user.js index 5dbfdbc..7637f00 100644 --- a/src/openeuler/utils/app-user.js +++ b/src/openeuler/utils/app-user.js @@ -158,6 +158,8 @@ const appUser = { }, success: function (ret) { if (ret) { + // 更新userInfo数据 + userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); userInfo.gitee = ret.gitee_name; userInfo.level = ret.level; userInfo.nickName = ret.nickname; @@ -202,6 +204,7 @@ const appUser = { userInfo.gitee = result.gitee_name; userInfo.userId = result.user_id; userInfo.nickName = result.nickname; + userInfo.refresh = result.refresh; // // 缓存用户信息 appUser.saveLoginInfo(userInfo || {}); // 回调 diff --git a/src/openeuler/utils/retry-ajax.js b/src/openeuler/utils/retry-ajax.js deleted file mode 100644 index e0c1b9b..0000000 --- a/src/openeuler/utils/retry-ajax.js +++ /dev/null @@ -1,67 +0,0 @@ -const appAjax = require('./app-ajax'); - -class ajaxRetry { - constructor({ url, getRefreshToken, unauthorizedCode = 401, onSuccess, onError }) { - this.url = url; - this.getRefreshToken = getRefreshToken; - this.unauthorizedCode = unauthorizedCode; - this.onSuccess = onSuccess; - this.onError = onError; - } - - requestWrapper(request) { - return new Promise((resolve, reject) => { - // 先把请求函数保存下来 - const requestFn = request; - return request() - .then(resolve) - .catch((err) => { - console.log(err); - if (err?.status === this.unauthorizedCode && !(err?.config?.url === this.url)) { - if (!this.fetchNewTokenPromise) { - this.fetchNewTokenPromise = this.fetchNewToken(); - } - this.fetchNewTokenPromise - .then(() => { - // 获取token成功后,重新执行请求 - requestFn().then(resolve).catch(reject); - }) - .finally(() => { - // 置空 - this.fetchNewTokenPromise = null; - }); - } else { - reject(err); - } - }); - }); - } - // 获取token的函数 - refreshToken() { - appAjax.postJson({ - type: 'POST', - service: this.url, - success: function () { - this.onSuccess; - }, - fail: function () { - this.onError(); - return Promise.reject(); - }, - }); - } - // fetchNewToken() { - // return new Axios() - // .get(this.url, { - // headers: { - // Authorization: this.getRefreshToken(), - // }, - // }) - // .then(this.onSuccess) - // .catch(() => { - // this.onError(); - // return Promise.reject(); - // }); - // } -} -module.exports = ajaxRetry; -- Gitee From d65f6f6198238640aba6f27c6e6ac8593873bc1f Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Sat, 18 Nov 2023 09:28:52 +0800 Subject: [PATCH 05/10] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4wx.getUserProfil?= =?UTF-8?q?e=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/meeting-list/meeting-list.js | 4 +- .../components/privacy-text/privacy-text.wxml | 22 +- .../package-events/events/event-detail.js | 54 +- .../package-events/events/event-list.js | 2 +- .../package-events/manage/member-detail.js | 17 +- .../package-events/publish/publish.js | 4 +- .../package-meeting/sig/member-detail.js | 14 +- src/openeuler/package-my/events/my-list.js | 3 + src/openeuler/pages/auth/auth.js | 95 +- src/openeuler/pages/auth/auth.wxml | 15 +- src/openeuler/pages/events/events.js | 37 +- src/openeuler/pages/index/index.js | 21 +- src/openeuler/pages/meeting/meeting.js | 8 +- src/openeuler/pages/my/my.js | 4 - src/openeuler/typings/wx.d.ts | 2705 ----------------- src/openeuler/utils/app-ajax.js | 12 +- src/openeuler/utils/app-user.js | 55 +- src/openeuler/utils/page-mixin.js | 9 - 18 files changed, 165 insertions(+), 2916 deletions(-) delete mode 100644 src/openeuler/typings/wx.d.ts diff --git a/src/openeuler/components/meeting-list/meeting-list.js b/src/openeuler/components/meeting-list/meeting-list.js index d92002e..c3da1bb 100644 --- a/src/openeuler/components/meeting-list/meeting-list.js +++ b/src/openeuler/components/meeting-list/meeting-list.js @@ -16,8 +16,8 @@ const remoteMethods = { if (that?.properties.pageType === 2) { params = { ...params, - topic: that.data.curKeyword, - search: that.data.filterSigName === '全部SIG' ? '' : that.data.filterSigName, + search: that.data.curKeyword, + group_name: that.data.filterSigName === '全部SIG' ? '' : that.data.filterSigName, }; } appAjax.postJson({ diff --git a/src/openeuler/components/privacy-text/privacy-text.wxml b/src/openeuler/components/privacy-text/privacy-text.wxml index d31e74c..02824ba 100644 --- a/src/openeuler/components/privacy-text/privacy-text.wxml +++ b/src/openeuler/components/privacy-text/privacy-text.wxml @@ -8,17 +8,29 @@ 1. “我们如何收集和处理您的个人信息” 章节中,根据个人信息处理的合法基础进行了刷新。 2. “如何访问或控制您的个人信息” 章节中,该等权利刷新为上述权利。 1.我们如何收集和处理您的个人信息 - a) 当您登录时,我们会收集您的微信昵称、头像和性别,用于确认您是否具有创建会议的权限,向您发送会议通知及向第三方告知会议的组织人(maintainer)等。无论您是否拥有相关权限,您均可以收藏、订阅会议信息。 - b) 当您预定会议之前,我们会收集您的Gitee ID和所属SIG组别名称,用于配置预定会议权限,并作为会议信息的部分展示在小程序。 - c ) 当您预定会议时,如您填写邮箱地址我们会收集填写邮箱并向其发送会议通知。 + a ) 当您登录时,我们会收集您的OpenID用于确认您的身份。 + b ) 当您预定会议之前,我们会收集您的Gitee ID和所属SIG组名称,用于配置预定会议权限,并作为会议信息的部分展示在小程序。 + c ) 当您预定会议时,如您填写邮箱地址我们会收集填您填写的邮箱并向其发送会议通知。 d ) 当您创建会议后,我们会将您的Gitee ID及会议相关信息同步至本服务页面及openEuler社区网站(https://www.openeuler.org)以便对您的会议感兴趣的个人或组织及时获取相关信息。 e ) 当您创建活动之前,我们会收集您的Gitee ID用于配置活动发布权限。 f ) 当您为您创建的活动添加议题时,我们会收集您所填写议题的嘉宾名称、职位用于在活动议题的内容中展示。 - g ) 当您在下载活动海报时,我们会申请您的相册保存权限,保存小程序生成的活动海报。 - h ) 当您在活动详情页面点击地址时,我们在获取您的同意后会关联启动腾讯地图。 + g ) 当您在发布活动时,为方便您快速填写活动地址,我们在获取您的明示同意后会关联启动腾讯地图。如您同意启动我们会获取你选择的活动地址信息。 + h ) 当您在保存二维码时,我们会申请您的相册保存权限,保存二维码。 + i ) 当您点击“复制”按钮及复制图标时,我们会使用你的剪切板,用于快速复制信息。 2. 我们在何种情况披露或共享您的个人信息 共享是指我们向第三方披露您的个人信息。我们仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,我们共享这些信息的目的仅限于本声明披露或在您允许的范围内进行。 a) 为了保护国家安全、公共安全以及您和其他个人的重大合法权益而需要共享您的个人信息。 + + + 第三方名称 + + + 处理目的和方式 + + + 第三方名称 + + 3. 我们将保留多久您的个人信息 我们将会在达成本声明所述目的所需的期限内保留您的个人信息,除非按照法律要求或您的要求需要延长保留期。 一般而言,我们会自您使用本服务时获取您的个人信息之日起,根据可适用法律的要求或服务协议的约定,在留存期限内存储或保留您的个人信息。在您的个人信息超出保留期限后,且没有法律要求我们继续处理您的特定个人信息的情况下,我们将会根据可适用法律的要求删除您的个人信息,或进行匿名化处理。 diff --git a/src/openeuler/package-events/events/event-detail.js b/src/openeuler/package-events/events/event-detail.js index bac1e2a..651b291 100644 --- a/src/openeuler/package-events/events/event-detail.js +++ b/src/openeuler/package-events/events/event-detail.js @@ -147,26 +147,34 @@ Page({ info: res, }); let arr = []; - JSON.parse(res.schedules).forEach((item) => { - if (item.speakerList) { - arr.push({ - duration: item.start + '-' + item.end, - title: item.topic, - speakerList: item.speakerList, - }); - } else { - arr.push({ - duration: item.start + '-' + item.end, - title: item.topic, - speakerList: [ - { - name: item.speaker || '', - title: item.desc || '', - }, - ], - }); - } - }); + try { + JSON.parse(res.schedules).forEach((item) => { + if (item.speakerList) { + arr.push({ + duration: item.start + '-' + item.end, + title: item.topic, + speakerList: item.speakerList, + }); + } else { + arr.push({ + duration: item.start + '-' + item.end, + title: item.topic, + speakerList: [ + { + name: item.speaker || '', + title: item.desc || '', + }, + ], + }); + } + }); + } catch (error) { + wx.showToast({ + title: error, + icon: 'none', + duration: 2000, + }); + } this.setData({ steps: arr, }); @@ -205,7 +213,11 @@ Page({ }, draftPublish() { let postData = this.data.info; - postData.schedules = JSON.parse(postData.schedules); + try { + postData.schedules = JSON.parse(postData.schedules); + } catch (error) { + return; + } remoteMethods.draftPublish(postData, (res) => { if (res.code === 200) { wx.redirectTo({ diff --git a/src/openeuler/package-events/events/event-list.js b/src/openeuler/package-events/events/event-list.js index 4b7d280..56f8f8d 100644 --- a/src/openeuler/package-events/events/event-list.js +++ b/src/openeuler/package-events/events/event-list.js @@ -140,7 +140,7 @@ Page({ that = this; this.initData(); remoteMethods.getCount((res) => { - that.setData({ + this.setData({ 'pageParams.page': 1, level: sessionUtil.getUserInfoByKey('eventLevel') || 1, user: sessionUtil.getUserInfoByKey('userId'), diff --git a/src/openeuler/package-events/manage/member-detail.js b/src/openeuler/package-events/manage/member-detail.js index 0b5edcb..f32ea67 100644 --- a/src/openeuler/package-events/manage/member-detail.js +++ b/src/openeuler/package-events/manage/member-detail.js @@ -11,9 +11,6 @@ let remoteMethods = { }, data: { gitee_name: postData.name, - enterprise: postData.enterprise, - telephone: postData.telephone, - email: postData.email, }, success: function (ret) { _callback && _callback(ret); @@ -66,21 +63,15 @@ Page({ name: that.data.name, }, function (data) { - if (data.code == 400) { - wx.showToast({ - title: data.msg, - icon: 'none', - duration: 2000, - }); - return; - } - if (data.gitee_name) { + if (data.code === 200) { wx.showToast({ title: '操作成功', icon: 'success', duration: 2000, }); - wx.navigateBack(); + that.setData({ + rawName: that.data.name, + }); } } ); diff --git a/src/openeuler/package-events/publish/publish.js b/src/openeuler/package-events/publish/publish.js index cc12ada..2483b06 100644 --- a/src/openeuler/package-events/publish/publish.js +++ b/src/openeuler/package-events/publish/publish.js @@ -340,8 +340,8 @@ Page({ that.setData({ address: res.address, addressName: res.name, - longitude: res.longitude, - latitude: res.latitude, + longitude: res.longitude.toFixed(5), + latitude: res.latitude.toFixed(5), }); }, fail: function (res) { diff --git a/src/openeuler/package-meeting/sig/member-detail.js b/src/openeuler/package-meeting/sig/member-detail.js index e85ad23..f8ce471 100644 --- a/src/openeuler/package-meeting/sig/member-detail.js +++ b/src/openeuler/package-meeting/sig/member-detail.js @@ -63,21 +63,15 @@ Page({ name: that.data.name, }, function (data) { - if (data.code == 400) { - wx.showToast({ - title: data.msg, - icon: 'none', - duration: 2000, - }); - return; - } - if (data.gitee_name) { + if (data.code === 200) { wx.showToast({ title: '操作成功', icon: 'success', duration: 2000, }); - wx.navigateBack(); + that.setData({ + rawName: that.data.name, + }); } } ); diff --git a/src/openeuler/package-my/events/my-list.js b/src/openeuler/package-my/events/my-list.js index 17d84ea..c9904f2 100644 --- a/src/openeuler/package-my/events/my-list.js +++ b/src/openeuler/package-my/events/my-list.js @@ -316,6 +316,9 @@ Page({ showDialogDel: false, }); remoteMethods.delEvent(() => { + this.setData({ + 'pageParams.page': 1, + }); this.initialization(); }); }, diff --git a/src/openeuler/pages/auth/auth.js b/src/openeuler/pages/auth/auth.js index 659199a..46b8b4c 100644 --- a/src/openeuler/pages/auth/auth.js +++ b/src/openeuler/pages/auth/auth.js @@ -14,7 +14,6 @@ Page( url: '', id: '', record: false, - canIUseGetUserProfile: false, isPrivecyShown: false, }, onLoad(options) { @@ -24,41 +23,9 @@ Page( id: options.id, }); } - - if (wx.getUserProfile) { - this.setData({ - canIUseGetUserProfile: true, - }); - } - }, - /** - * 绑定获取用户信息 - */ - bindGetUserInfo: function () { - wx.getSetting({ - success: function (res) { - if (res.authSetting['scope.userInfo']) { - appUser.wxLogin(function () { - const pages = getCurrentPages(); // 当前页面 - const beforePage = - pages[pages.length - 2].route === 'pages/auth/auth' ? pages[pages.length - 3] : pages[pages.length - 2]; // 前一个页面 - const id = beforePage?.options.id || that.data.id; - const url = id ? '/' + beforePage?.route + '?id=' + id : '/' + beforePage?.route; - if (!sessionUtil.getUserInfoByKey('agreePrivacy')) { - this.setData({ - isPrivecyShown: true, - url, - }); - } - wx.reLaunch({ - url: url, - }); - }); - } - }, - }); }, bindGetUserProfile() { + console.log(555); if (!this.data.record) { wx.showToast( { @@ -70,31 +37,23 @@ Page( ); return false; } - wx.getUserProfile({ - desc: '用于会议和活动所需信息', - success: (res) => { - appUser.wxGetUserProfileLogin(function () { - const pages = getCurrentPages(); // 当前页面 - const beforePage = - pages[pages.length - 2]?.route === 'pages/auth/auth' ? pages[pages.length - 3] : pages[pages.length - 2]; // 前一个页面 - const id = beforePage?.options.id || that.data.id; - const url = id ? '/' + beforePage?.route + '?id=' + id : '/' + beforePage?.route; - if (!sessionUtil.getUserInfoByKey('agreePrivacy')) { - that.setData({ - isPrivecyShown: true, - url: url, - }); - } else { - wx.reLaunch({ - url: url, - }); - } - }, res.userInfo); - }, - fail: (err) => { - console.log(err); - }, - }); + appUser.wxGetUserProfileLogin(function () { + const pages = getCurrentPages(); // 当前页面 + const beforePage = + pages[pages.length - 2]?.route === 'pages/auth/auth' ? pages[pages.length - 3] : pages[pages.length - 2]; // 前一个页面 + const id = beforePage?.options.id || that.data.id; + const url = id ? '/' + beforePage?.route + '?id=' + id : '/' + beforePage?.route; + if (!sessionUtil.getUserInfoByKey('agreePrivacy')) { + that.setData({ + isPrivecyShown: true, + url: url, + }); + } else { + wx.reLaunch({ + url: url, + }); + } + }, {}); }, recordoOnChange: function (event) { this.setData({ @@ -130,9 +89,21 @@ Page( }); }, setStorage: function () { - let data = wx.getStorageSync('_app_userinfo_session'); - data.agreePrivacy = true; - wx.setStorageSync('_app_userinfo_session', data); + // let data = wx.getStorageSync('_app_userinfo_session'); + // data.agreePrivacy = true; + // wx.setStorageSync('_app_userinfo_session', data); + wx.getStorage({ + key: '_app_userinfo_session', + encrypt: true, + success(data) { + data.agreePrivacy = true; + wx.setStorage({ + key: '_app_userinfo_session', + encrypt: true, + data: data, + }); + }, + }); }, handleClick: function () { this.setAgreeState(() => { diff --git a/src/openeuler/pages/auth/auth.wxml b/src/openeuler/pages/auth/auth.wxml index 575353a..6ac7a31 100644 --- a/src/openeuler/pages/auth/auth.wxml +++ b/src/openeuler/pages/auth/auth.wxml @@ -3,14 +3,7 @@ 为便于您在使用 openEuler 会议预定小程序的过程中能够获得所有操作权限, 需要您允许授权使用微信用户信息。 - - - + 已阅读并同意隐私声明 - + 隐私声明更新通知 diff --git a/src/openeuler/pages/events/events.js b/src/openeuler/pages/events/events.js index a246278..0cbf301 100644 --- a/src/openeuler/pages/events/events.js +++ b/src/openeuler/pages/events/events.js @@ -5,7 +5,7 @@ const appUser = require('../../utils/app-user.js'); let that = null; let remoteMethods = { - getList: function (_callback) { + getList: function (params, _callback) { appAjax.postJson({ autoShowWait: true, type: 'GET', @@ -13,6 +13,7 @@ let remoteMethods = { success: function (ret) { _callback && _callback(ret); }, + data: params, }); }, delDraft: function (_callback) { @@ -105,13 +106,8 @@ Page({ level: sessionUtil.getUserInfoByKey('eventLevel') || 1, user: sessionUtil.getUserInfoByKey('userId'), }); - remoteMethods.getList((res) => { - that.setData({ - list: res.data, - total: res.total, - }); - }); }); + this.initData(); }, /** * 生命周期函数--监听页面显示 @@ -187,11 +183,17 @@ Page({ if (e.detail.operaType == 1) { if (this.data.collectionId) { remoteMethods.unCollect(() => { - this.onLoad(); + this.setData({ + 'pageParams.page': 1, + }); + this.initData(); }); } else { remoteMethods.collect(() => { - this.onLoad(); + this.setData({ + 'pageParams.page': 1, + }); + this.initData(); }); } } else { @@ -203,11 +205,17 @@ Page({ if (e.detail.operaType == 1) { if (this.data.collectionId) { remoteMethods.unCollect(() => { - this.onLoad(); + this.setData({ + 'pageParams.page': 1, + }); + this.initData(); }); } else { remoteMethods.collect(() => { - this.onLoad(); + this.setData({ + 'pageParams.page': 1, + }); + this.initData(); }); } } else if (e.detail.operaType == 3) { @@ -224,11 +232,10 @@ Page({ showDialogDel: false, }); remoteMethods.delEvent(() => { - remoteMethods.getList((res) => { - this.setData({ - list: res, - }); + this.setData({ + 'pageParams.page': 1, }); + this.initData(); }); }, delCancel() { diff --git a/src/openeuler/pages/index/index.js b/src/openeuler/pages/index/index.js index 7694e3d..2d3f186 100644 --- a/src/openeuler/pages/index/index.js +++ b/src/openeuler/pages/index/index.js @@ -34,24 +34,16 @@ Page( url: e.currentTarget.dataset.url, }); }, - previewImage(e) { - const current = e.target.dataset.src; //获取当前点击的 图片 url - wx.previewImage({ - current, - urls: [current], - }); - }, onLoad: function () { wx.showShareMenu({ withShareTicket: true, menus: ['shareAppMessage', 'shareTimeline'], }); that = this; - appUser.updateUserInfo(function () { - that.setData({ - meetingConponent: that.selectComponent('#meeting'), - iphoneX: that.getTabBar().data.iPhoneX, - }); + appUser.updateUserInfo(); + this.setData({ + meetingConponent: that.selectComponent('#meeting'), + iphoneX: that.getTabBar().data.iPhoneX, }); }, onShow: function () { @@ -61,9 +53,8 @@ Page( }, onPullDownRefresh: function () { wx.stopPullDownRefresh(); - appUser.updateUserInfo(function () { - that.data.meetingConponent?.initData(); - }); + appUser.updateUserInfo(); + this.data.meetingConponent?.initData(); }, onReachBottom() { const customComponent = this.selectComponent('#meeting'); diff --git a/src/openeuler/pages/meeting/meeting.js b/src/openeuler/pages/meeting/meeting.js index 9764040..d0e3e11 100644 --- a/src/openeuler/pages/meeting/meeting.js +++ b/src/openeuler/pages/meeting/meeting.js @@ -43,16 +43,16 @@ Page( }, onPullDownRefresh: function () { wx.stopPullDownRefresh(); - appUser.updateUserInfo(function () { - that.setData({ + appUser.updateUserInfo(() => { + this.setData({ level: sessionUtil.getUserInfoByKey('level') || 1, }); - that.data.meetingConponent?.initData(); }); + this.data.meetingConponent?.initData(); }, onReachBottom() { const customComponent = this.selectComponent('#meeting'); - customComponent.getMoreData() + customComponent.getMoreData(); }, actionStatus(e) { if (e.detail === 1) { diff --git a/src/openeuler/pages/my/my.js b/src/openeuler/pages/my/my.js index 99e31e7..8fbb3ca 100644 --- a/src/openeuler/pages/my/my.js +++ b/src/openeuler/pages/my/my.js @@ -61,10 +61,6 @@ Page({ copy: function (e) { wx.setClipboardData({ data: `${e.currentTarget.dataset.copy}`, - success: function () {}, - fail: function (err) { - console.log(err); - }, }); }, onPullDownRefresh() { diff --git a/src/openeuler/typings/wx.d.ts b/src/openeuler/typings/wx.d.ts deleted file mode 100644 index a2ffc2b..0000000 --- a/src/openeuler/typings/wx.d.ts +++ /dev/null @@ -1,2705 +0,0 @@ -// generate time:2017-08-23 21:12:06 -// Type definitions for wx app -// Definitions by: hellopao - -/************************************************ -* * -* 微信小程序 API * -* * -************************************************/ - -interface IAnimation { - /** - * 透明度,参数范围 0~1 - */ - opacity(value: number): IAnimation; - /** - * 颜色值 - */ - backgroundColor(color: string): IAnimation; - /** - * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 - */ - width(length: number): IAnimation; - /** - * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 - */ - height(length: number): IAnimation; - /** - * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 - */ - top(length: number): IAnimation; - /** - * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 - */ - left(length: number): IAnimation; - /** - * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 - */ - bottom(length: number): IAnimation; - /** - * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值 - */ - right(length: number): IAnimation; - /** - * deg的范围-180~180,从原点顺时针旋转一个deg角度 - */ - rotate(deg: number): IAnimation; - /** - * deg的范围-180~180,在X轴旋转一个deg角度 - */ - rotateX(deg: number): IAnimation; - /** - * deg的范围-180~180,在Y轴旋转一个deg角度 - */ - rotateY(deg: number): IAnimation; - /** - * deg的范围-180~180,在Z轴旋转一个deg角度 - */ - rotateZ(deg: number): IAnimation; - /** - * 同transform-function rotate3d - */ - rotate3d(x: number, y: number, z: number, deg: number): IAnimation; - /** - * 一个参数时,表示在X轴、Y轴同时缩放sx倍数;两个参数时表示在X轴缩放sx倍数,在Y轴缩放sy倍数 - */ - scale(sx: number, sy?: number): IAnimation; - /** - * 在X轴缩放sx倍数 - */ - scaleX(sx: number): IAnimation; - /** - * 在Y轴缩放sy倍数 - */ - scaleY(sy: number): IAnimation; - /** - * 在Z轴缩放sy倍数 - */ - scaleZ(sz: number): IAnimation; - /** - * 在X轴缩放sx倍数,在Y轴缩放sy倍数,在Z轴缩放sz倍数 - */ - scale3d(sx: number, sy: number, sz: number): IAnimation; - /** - * 一个参数时,表示在X轴偏移tx,单位px;两个参数时,表示在X轴偏移tx,在Y轴偏移ty,单位px。 - */ - translate(tx: number, ty?: number): IAnimation; - /** - * 在X轴偏移tx,单位px - */ - translateX(tx: number): IAnimation; - /** - * 在Y轴偏移tx,单位px - */ - translateY(tx: number): IAnimation; - /** - * 在Z轴偏移tx,单位px - */ - translateZ(tx: number): IAnimation; - /** - * 在X轴偏移tx,在Y轴偏移ty,在Z轴偏移tz,单位px - */ - translate3d(tx: number, ty: number, tz: number): IAnimation; - /** - * 参数范围-180~180;一个参数时,Y轴坐标不变,X轴坐标延顺时针倾斜ax度;两个参数时,分别在X轴倾斜ax度,在Y轴倾斜ay度 - */ - skew(ax: number, ay?: number): IAnimation; - /** - * 参数范围-180~180;Y轴坐标不变,X轴坐标延顺时针倾斜ax度 - */ - skewX(ax: number): IAnimation; - /** - * 参数范围-180~180;X轴坐标不变,Y轴坐标延顺时针倾斜ay度 - */ - skewY(ay: number): IAnimation; - /** - * 同transform-function matrix - */ - matrix(a, b, c, d, tx, ty): IAnimation; - /** - * 同transform-function matrix3d - */ - matrix3d(): IAnimation; -} - -interface ICanvasContext { - /** - * 设置填充色, 如果没有设置 fillStyle,默认颜色为 black。 - */ - setFillStyle(color: string): void; - /** - * 设置边框颜色, 如果没有设置 fillStyle,默认颜色为 black。 - */ - setStrokeStyle(color: string): void; - /** - * 设置阴影 - */ - setShadow(offsetX: number, offsetY: number, blur: number, color: string): void; - /** - * 创建一个线性的渐变颜色。需要使用 addColorStop() 来指定渐变点,至少要两个。 - */ - createLinearGradient(x0: number, y0: number, x1: number, y1: number): void; - /** - * 创建一个圆形的渐变颜色。 起点在圆心,终点在圆环。 需要使用 addColorStop() 来指定渐变点,至少要两个。 - */ - createCircularGradient(x: number, y: number, r: number): void; - /** - * 创建一个颜色的渐变点。小于最小 stop 的部分会按最小 stop 的 color 来渲染,大于最大 stop 的部分会按最大 stop 的 color 来渲染。需要使用 addColorStop() 来指定渐变点,至少要两个。 - */ - addColorStop(stop: number, color: string): void; - /** - * 设置线条端点的样式 - */ - setLineCap(lineCap: 'butt' | 'round' | 'square'): void; - /** - * 设置两线相交处的样式 - */ - setLineJoin(lineJoin: 'bevel' | 'round' | 'miter'): void; - /** - * 设置线条宽度 - */ - setLineWidth(lineWidth: number): void; - /** - * 设置最大倾斜 - */ - setMiterLimit(miterLimit: number): void; - /** - * 添加一个矩形路径到当前路径。 - */ - rect(x: number, y: number, width: number, height: number): void; - /** - * 填充一个矩形。用 setFillStyle() 设置矩形的填充色,如果没设置默认是黑色。 - */ - fillRect(x: number, y: number, width: number, height: number): void; - /** - * 一个矩形(非填充)。用 setFillStroke() 设置矩形线条的颜色,如果没设置默认是黑色。 - */ - strokeRect(x: number, y: number, width: number, height: number): void; - /** - * 在给定的矩形区域内,清除画布上的像素 - */ - clearRect(x: number, y: number, width: number, height: number): void; - /** - * 对当前路径进行填充 - */ - fill(): void; - /** - * 对当前路径进行描边 - */ - stroke(): void; - /** - * 开始一个路径 - */ - beginPath(): void; - /** - * 关闭一个路径 - */ - closePath(): void; - /** - * 把路径移动到画布中的指定点,但不创建线条。 - */ - moveTo(x: number, y: number): void; - /** - * 添加一个新点,然后在画布中创建从该点到最后指定点的线条。 - */ - lineTo(x: number, y: number): void; - /** - * 添加一个弧形路径到当前路径,顺时针绘制。 - */ - arc(x: number, y: number, radius: number, startAngle: number, sweepAngle: number): void; - /** - * 创建二次方贝塞尔曲线 - */ - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - /** - * 创建三次方贝塞尔曲线 - */ - bezierCurveTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): void; - /** - * 对横纵坐标进行缩放 - */ - scale(scaleWidth: number/**横坐标缩放的倍数1 = 100%,0.5 = 50%,2 = 200%,依次类 */, scaleHeight: number/** 纵坐标轴缩放的倍数1 = 100%,0.5 = 50%,2 = 200%,依次类 */): void; - /** - * 对坐标轴进行顺时针旋转 - */ - rotate(deg: number/**degrees * Math.PI/180;degrees范围为0~360;旋转角度,以弧度计 */): void; - /** - * 对坐标原点进行缩放 - */ - translate(x: number/**水平坐标平移量 */, y: number/**竖直坐标平移量 */): void; - /** - * 在画布上绘制被填充的文本 - */ - fillText(text: string, x: number, y: number): void; - /** - * 设置字体大小 - */ - setFontSize(fontSize: number): void; - /** - * 在画布上绘制图像 - */ - drawImage(imageResource: string, x: number, y: number, width: number, height: number): void; - /** - * 设置全局画笔透明度。 - */ - setGlobalAlpha(alpha: number): void; - /** - * 保存当前坐标轴的缩放、旋转、平移信息 - */ - save(): void; - /** - * 恢复之前保存过的坐标轴的缩放、旋转、平移信息 - */ - restore(): void; - /** - * 进行绘图 - */ - draw(): void; -} - -interface IAudioContext { - /** - * 播放 - */ - play: () => void; - /** - * 暂停 - */ - pause: () => void; - /** - * 跳转到指定位置,单位 s - */ - seek: (position: number) => void; -} - -interface IVideoContext { - /** - * 播放 - */ - play: () => void; - /** - * 暂停 - */ - pause: () => void; - /** - * 跳转到指定位置,单位 s - */ - seek: (position: number) => void; - /** - * 发送弹幕,danmu 包含两个属性 text, color。 - */ - sendDanmu: (danmu: {text: string; color: string;}) => void; -} - -interface IMapContext { - /** - * 获取当前地图中心的经纬度,返回的是 gcj02 坐标系,可以用于 wx.openLocation - */ - getCenterLocation: (obj: { - /** - * 接口调用成功的回调函数 ,res = { longitude: "经度", latitude: "纬度"} - */ - success?: (res: {longitude: string; latitude: string}) => void; - /** - * 接口调用失败的回调函数 - */ - fail?: () => void; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: () => void; - }) => void; - /** - * 将地图中心移动到当前定位点,需要配合map组件的show-location使用 - */ - moveToLocation: () => void; -} - -interface Application { - setData: (obj: any) => void; -} - -interface AppConstructor { - new (): Application; - (opts: { - /** - * 生命周期函数--监听小程序初始化 - */ - onLaunch?: () => void; - /** - * 生命周期函数--监听小程序显示 - */ - onShow?: () => void; - /** - * 生命周期函数--监听小程序隐藏 - */ - onHide?: () => void; - - [key: string]: any; - }): Application; -} - -declare var App: AppConstructor; -declare function getApp(): Application; - -declare function getCurrentPages(): Page[]; - -interface Page { - setData: (obj: any) => void; -} - -interface PageConstructor { - new (): Page; - (opts: { - /** - * 页面的初始数据 - */ - data?: any; - /** - * 页面的初始数据 - */ - onLoad?: () => void; - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady?: () => void; - /** - * 生命周期函数--监听页面显示 - */ - onShow?: () => void; - /** - * 生命周期函数--监听页面隐藏 - */ - onHide?: () => void; - /** - * 生命周期函数--监听页面卸载 - */ - onUnload?: () => void; - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefreash?: () => void; - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom?: () => void; - /** - * 用户点击右上角分享 - */ - onShareAppMessage?: () => { - /** - * 分享标题, 默认值当前小程序名称 - */ - title: string; - /** - * 分享描述, 默认值当前小程序名称 - */ - desc: string; - /** - * 分享路径 默认值当前页面 path ,必须是以 / 开头的完整路径 - */ - path: string; - }; - - [key: string]: any; - }): Page; -} - -declare var Page: PageConstructor; - -declare var wx: { - // # 网络 # - - request(obj: { - /** - * 开发者服务器接口地址 - */ - url: string; - /** - * 请求的参数 - */ - data?: any | string; - /** - * 设置请求的 header , header 中不能设置 Referer - */ - header?: any; - /** - * 默认为 GET,有效值:OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT - */ - method?: string; - /** - * 默认为 json。如果设置了 dataType 为 json,则会尝试对响应的数据做一次 JSON.parse - */ - dataType?: string; - /** - * 收到开发者服务成功返回的回调函数,res = {data: '开发者服务器返回的内容'} - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 将本地资源上传到开发者服务器。如页面通过 wx.chooseImage 等接口获取到一个本地资源的临时文件路径后,可通过此接口将本地资源上传到指定服务器。客户端发起一个 HTTPS POST 请求,其中 content-type 为 multipart/form-data 。 - */ - uploadFile(obj: { - /** - * 开发者服务器 url - */ - url: string; - /** - * 要上传文件资源的路径 - */ - filePath: string; - /** - * 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 - */ - name: string; - /** - * HTTP 请求 Header , header 中不能设置 Referer - */ - header?: any; - /** - * HTTP 请求中其他额外的 form data - */ - formData?: any; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。 - */ - downloadFile(obj: { - /** - * 下载资源的 url - */ - url: string; - /** - * HTTP 请求 Header - */ - header?: any; - /** - * 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 创建一个 WebSocket 连接;一个微信小程序同时只能有一个 WebSocket 连接,如果当前已存在一个 WebSocket 连接,会自动关闭该连接,并重新创建一个 WebSocket 连接。 - */ - connectSocket(obj: { - /** - * 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 - */ - url: string; - /** - * 请求的数据 - */ - data?: any; - /** - * HTTP Header , header 中不能设置 Referer - */ - header?: any; - /** - * 默认是GET,有效值: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT - */ - method?: string; - /** - * 子协议数组 - */ - protocols?: string[]; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 监听WebSocket连接打开事件。 - */ - onSocketOpen(callback: Function): void; - - /** - * 监听WebSocket错误。 - */ - onSocketError(callback: Function): void; - - /** - * 通过 WebSocket 连接发送数据,需要先 wx.connectSocket,并在 wx.onSocketOpen 回调之后才能发送。 - */ - sendSocketMessage(obj: { - /** - * 需要发送的内容 - */ - data: undefined; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 监听WebSocket接受到服务器的消息事件。 - */ - onSocketMessage(callback: Function): void; - - /** - * 关闭WebSocket连接。 - */ - closeSocket(obj: { - /** - * 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) - */ - code?: number; - /** - * 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) - */ - reason?: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 监听WebSocket关闭。 - */ - onSocketClose(callback: Function): void; - - // # 媒体 # - - /** - * 从本地相册选择图片或使用相机拍照。 - */ - chooseImage(obj: { - /** - * 最多可以选择的图片张数,默认9 - */ - count?: number; - /** - * original 原图,compressed 压缩图,默认二者都有 - */ - sizeType?: string[]; - /** - * album 从相册选图,camera 使用相机,默认二者都有 - */ - sourceType?: string[]; - /** - * 成功则返回图片的本地文件路径列表 tempFilePaths - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 预览图片。 - */ - previewImage(obj: { - /** - * 当前显示图片的链接,不填则默认为 urls 的第一张 - */ - current?: string; - /** - * 需要预览的图片链接列表 - */ - urls: string[]; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 获取图片信息 - */ - getImageInfo(obj: { - /** - * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 - */ - src: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - saveImageToPhotosAlbum(obj: { - /** - * 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径 - */ - filePath: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 开始录音。当主动调用wx.stopRecord,或者录音超过1分钟时自动结束录音,返回录音文件的临时文件路径。当用户离开小程序时,此接口无法调用。 - */ - startRecord(obj: { - /** - * 录音成功后调用,返回录音文件的临时文件路径,res = {tempFilePath: '录音文件的临时路径'} - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * ​ 主动调用停止录音。 - */ - stopRecord(): void; - - /** - * 开始播放语音,同时只允许一个语音文件正在播放,如果前一个语音文件还没播放完,将中断前一个语音播放。 - */ - playVoice(obj: { - /** - * 需要播放的语音文件的文件路径 - */ - filePath: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 暂停正在播放的语音。再次调用wx.playVoice播放同一个文件时,会从暂停处开始播放。如果想从头开始播放,需要先调用 wx.stopVoice。 - */ - pauseVoice(): void; - - /** - * 结束播放语音。 - */ - stopVoice(): void; - - /** - * 获取后台音乐播放状态。 - */ - getBackgroundAudioPlayerState(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 使用后台播放器播放音乐,对于微信客户端来说,只能同时有一个后台音乐在播放。当用户离开小程序后,音乐将暂停播放;当用户点击“显示在聊天顶部”时,音乐不会暂停播放;当用户在其他小程序占用了音乐播放器,原有小程序内的音乐将停止播放。 - */ - playBackgroundAudio(obj: { - /** - * 音乐链接,目前支持的格式有 m4a, aac, mp3, wav - */ - dataUrl: string; - /** - * 音乐标题 - */ - title?: string; - /** - * 封面URL - */ - coverImgUrl?: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 暂停播放音乐。 - */ - pauseBackgroundAudio(): void; - - /** - * 控制音乐播放进度。 - */ - seekBackgroundAudio(obj: { - /** - * 音乐位置,单位:秒 - */ - position: number; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 停止播放音乐。 - */ - stopBackgroundAudio(): void; - - /** - * 监听音乐播放。 - */ - onBackgroundAudioPlay(callback: Function): void; - - /** - * 监听音乐暂停。 - */ - onBackgroundAudioPause(callback: Function): void; - - /** - * 监听音乐停止。 - */ - onBackgroundAudioStop(callback: Function): void; - - getBackgroundAudioManager(): void; - - /** - * 创建并返回 audio 上下文 audioContext 对象 - */ - createAudioContext(audioId: string): IAudioContext; - - /** - * 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。 - */ - chooseVideo(obj: { - /** - * album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera'] - */ - sourceType?: string[]; - /** - * 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒 - */ - maxDuration?: number; - /** - * 默认调起的为前置还是后置摄像头。front: 前置,back: 后置,默认 back - */ - camera?: string; - /** - * 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - saveVideoToPhotosAlbum(obj: { - /** - * 视频文件路径,可以是临时文件路径也可以是永久文件路径 - */ - filePath: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 创建并返回 video 上下文 videoContext 对象 - */ - createVideoContext(videoId: string): IVideoContext; - - // # 文件 # - - /** - * 保存文件到本地。 - */ - saveFile(obj: { - /** - * 需要保存的文件的临时路径 - */ - tempFilePath: string; - /** - * 返回文件的保存路径,res = {savedFilePath: '文件的保存路径'} - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 获取本地已保存的文件列表 - */ - getSavedFileList(obj: { - /** - * 接口调用成功的回调函数,返回结果见success返回参数说明 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 获取本地文件的文件信息。此接口只能用于获取已保存到本地的文件,若需要获取临时文件信息,请使用 wx.getFileInfo 接口。 - */ - getSavedFileInfo(obj: { - /** - * 文件路径 - */ - filePath: string; - /** - * 接口调用成功的回调函数,返回结果见success返回参数说明 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 删除本地存储的文件 - */ - removeSavedFile(obj: { - /** - * 需要删除的文件路径 - */ - filePath: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx - */ - openDocument(obj: { - /** - * 文件路径,可通过 downFile 获得 - */ - filePath: string; - /** - * 文件类型,指定文件类型打开文件,有效值 doc, xls, ppt, pdf, docx, xlsx, pptx - */ - fileType?: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getFileInfo(obj: { - /** - * 本地文件路径 - */ - filePath: string; - /** - * 计算文件摘要的算法,默认值 md5,有效值:md5,sha1 - */ - digestAlgorithm?: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - // # 数据缓存 # - - /** - * 将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。 - */ - setStorage(obj: { - /** - * 本地缓存中的指定的 key - */ - key: string; - /** - * 需要存储的内容 - */ - data: any; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。 - */ - setStorageSync(key: string, data: any, ): void; - - /** - * 从本地缓存中异步获取指定 key 对应的内容。 - */ - getStorage(obj: { - /** - * 本地缓存中的指定的 key - */ - key: string; - /** - * 接口调用的回调函数,res = {data: key对应的内容} - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 从本地缓存中同步获取指定 key 对应的内容。 - */ - getStorageSync(key: string): void; - - /** - * 异步获取当前storage的相关信息 - */ - getStorageInfo(obj: { - /** - * 接口调用的回调函数,详见返回参数说明 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 同步获取当前storage的相关信息 - */ - getStorageInfoSync(): void; - - /** - * 从本地缓存中异步移除指定 key 。 - */ - removeStorage(obj: { - /** - * 本地缓存中的指定的 key - */ - key: string; - /** - * 接口调用的回调函数 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 从本地缓存中同步移除指定 key 。 - */ - removeStorageSync(key: string): void; - - /** - * 清理本地数据缓存。 - */ - clearStorage(): void; - - /** - * 同步清理本地数据缓存 - */ - clearStorageSync(): void; - - // # 位置 # - - /** - * 获取当前的地理位置、速度。当用户离开小程序后,此接口无法调用;当用户点击“显示在聊天顶部”时,此接口可继续调用。 - */ - getLocation(obj: { - /** - * 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于wx.openLocation的坐标 - */ - type?: string; - /** - * 接口调用成功的回调函数,返回内容详见返回参数说明。 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 打开地图选择位置 - */ - chooseLocation(obj: { - /** - * 接口调用成功的回调函数,返回内容详见返回参数说明。 - */ - success: Function; - /** - * 用户取消时调用 - */ - cancel?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * ​ 使用微信内置地图查看位置 - */ - openLocation(obj: { - /** - * 纬度,范围为-90~90,负数表示南纬 - */ - latitude: number; - /** - * 经度,范围为-180~180,负数表示西经 - */ - longitude: number; - /** - * 缩放比例,范围5~18,默认为18 - */ - scale?: number; - /** - * 位置名 - */ - name?: string; - /** - * 地址的详细说明 - */ - address?: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 创建并返回 map 上下文 mapContext 对象 - */ - createMapContext(mapId: string): IMapContext; - - // # 设备 # - - /** - * 获取系统信息。 - */ - getSystemInfo(obj: { - /** - * 接口调用成功的回调 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 获取系统信息同步接口 - */ - getSystemInfoSync(): void; - - /** - * 获取网络类型。 - */ - getNetworkType(obj: { - /** - * 接口调用成功,返回网络类型 networkType - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - onNetworkStatusChange(callback: Function): void; - - setScreenBrightness(obj: { - /** - * 屏幕亮度值,范围 0~1,0 最暗,1 最亮 - */ - value: number; - /** - * 接口调用成功 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getScreenBrightness(obj: { - /** - * 接口调用成功 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - vibrateLong(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - vibrateShort(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 wx.stopAccelerometer 停止监听。 - */ - onAccelerometerChange(callback: Function): void; - - startAccelerometer(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - stopAccelerometer(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 监听罗盘数据,频率:5次/秒,接口调用后会自动开始监听,可使用wx.stopCompass停止监听。 - */ - onCompassChange(callback: Function): void; - - startCompass(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - stopCompass(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - makePhoneCall(obj: { - /** - * 需要拨打的电话号码 - */ - phoneNumber: string; - /** - * 接口调用成功的回调 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 调起客户端扫码界面,扫码成功后返回对应的结果 - */ - scanCode(obj: { - /** - * 是否只能从相机扫码,不允许从相册选择图片 - */ - onlyFromCamera?: boolean; - /** - * 接口调用成功的回调函数,返回内容详见返回参数说明。 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - setClipboardData(obj: { - /** - * 需要设置的内容 - */ - data: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getClipboardData(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - openBluetoothAdapter(obj: { - /** - * 成功则返回成功初始化信息 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - closeBluetoothAdapter(obj: { - /** - * 成功则返回成功关闭模块信息 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getBluetoothAdapterState(obj: { - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - onBluetoothAdapterStateChange(callback: Function): void; - - startBluetoothDevicesDiscovery(obj: { - /** - * 蓝牙设备主 service 的 uuid 列表 - */ - services?: Array; - /** - * 是否允许重复上报同一设备, 如果允许重复上报,则onDeviceFound 方法会多次上报同一设备,但是 RSSI 值会有不同 - */ - allowDuplicatesKey?: boolean; - /** - * 上报设备的间隔,默认为0,意思是找到新设备立即上报,否则根据传入的间隔上报 - */ - interval?: number; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - stopBluetoothDevicesDiscovery(obj: { - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getBluetoothDevices(obj: { - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - onBluetoothDeviceFound(callback: Function): void; - - getConnectedBluetoothDevices(obj: { - /** - * 蓝牙设备主 service 的 uuid 列表 - */ - services: Array; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - createBLEConnection(obj: { - /** - * 蓝牙设备 id,参考 getDevices 接口 - */ - deviceId: string; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - closeBLEConnection(obj: { - /** - * 蓝牙设备 id,参考 getDevices 接口 - */ - deviceId: string; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getBLEDeviceServices(obj: { - /** - * 蓝牙设备 id,参考 getDevices 接口 - */ - deviceId: string; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getBLEDeviceCharacteristics(obj: { - /** - * 蓝牙设备 id,参考 device 对象 - */ - deviceId: string; - /** - * 蓝牙服务 uuid - */ - serviceId: string; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - readBLECharacteristicValue(obj: { - /** - * 蓝牙设备 id,参考 device 对象 - */ - deviceId: string; - /** - * 蓝牙特征值对应服务的 uuid - */ - serviceId: string; - /** - * 蓝牙特征值的 uuid - */ - characteristicId: string; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - writeBLECharacteristicValue(obj: { - /** - * 蓝牙设备 id,参考 device 对象 - */ - deviceId: string; - /** - * 蓝牙特征值对应服务的 uuid - */ - serviceId: string; - /** - * 蓝牙特征值的 uuid - */ - characteristicId: string; - /** - * 蓝牙设备特征值对应的二进制值(注意:vConsole 无法打印出 ArrayBuffer 类型数据) - */ - value: undefined; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - notifyBLECharacteristicValueChange(obj: { - /** - * 蓝牙设备 id,参考 device 对象 - */ - deviceId: string; - /** - * 蓝牙特征值对应服务的 uuid - */ - serviceId: string; - /** - * 蓝牙特征值的 uuid - */ - characteristicId: string; - /** - * true: 启用 notify; false: 停用 notify - */ - state: boolean; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - onBLEConnectionStateChange(callback: Function): void; - - onBLECharacteristicValueChange(callback: Function): void; - - startBeaconDiscovery(obj: { - /** - * iBeacon设备广播的 uuids - */ - uuids: string[]; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - stopBeaconDiscovery(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getBeacons(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - onBeaconUpdate(callback: Function): void; - - onBeaconServiceChange(callback: Function): void; - - onUserCaptureScreen(callback: Function): void; - - addPhoneContact(obj: { - /** - * 头像本地文件路径 - */ - photoFilePath?: string; - /** - * 昵称 - */ - nickName?: string; - /** - * 姓氏 - */ - lastName?: string; - /** - * 中间名 - */ - middleName?: string; - /** - * 名字 - */ - firstName: string; - /** - * 备注 - */ - remark?: string; - /** - * 手机号 - */ - mobilePhoneNumber?: string; - /** - * 微信号 - */ - weChatNumber?: string; - /** - * 联系地址国家 - */ - addressCountry?: string; - /** - * 联系地址省份 - */ - addressState?: string; - /** - * 联系地址城市 - */ - addressCity?: string; - /** - * 联系地址街道 - */ - addressStreet?: string; - /** - * 联系地址邮政编码 - */ - addressPostalCode?: string; - /** - * 公司 - */ - organization?: string; - /** - * 职位 - */ - title?: string; - /** - * 工作传真 - */ - workFaxNumber?: string; - /** - * 工作电话 - */ - workPhoneNumber?: string; - /** - * 公司电话 - */ - hostNumber?: string; - /** - * 电子邮件 - */ - email?: string; - /** - * 网站 - */ - url?: string; - /** - * 工作地址国家 - */ - workAddressCountry?: string; - /** - * 工作地址省份 - */ - workAddressState?: string; - /** - * 工作地址城市 - */ - workAddressCity?: string; - /** - * 工作地址街道 - */ - workAddressStreet?: string; - /** - * 工作地址邮政编码 - */ - workAddressPostalCode?: string; - /** - * 住宅传真 - */ - homeFaxNumber?: string; - /** - * 住宅电话 - */ - homePhoneNumber?: string; - /** - * 住宅地址国家 - */ - homeAddressCountry?: string; - /** - * 住宅地址省份 - */ - homeAddressState?: string; - /** - * 住宅地址城市 - */ - homeAddressCity?: string; - /** - * 住宅地址街道 - */ - homeAddressStreet?: string; - /** - * 住宅地址邮政编码 - */ - homeAddressPostalCode?: string; - /** - * 接口调用成功 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - // # 界面 # - - /** - * 显示消息提示框 - */ - showToast(obj: { - /** - * 提示的内容 - */ - title: string; - /** - * 图标,有效值 "success", "loading" - */ - icon?: string; - /** - * 自定义图标的本地路径,image 的优先级高于 icon - */ - image?: string; - /** - * 提示的延迟时间,单位毫秒,默认:1500 - */ - duration?: number; - /** - * 是否显示透明蒙层,防止触摸穿透,默认:false - */ - mask?: boolean; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - showLoading(obj: { - /** - * 提示的内容 - */ - title: string; - /** - * 是否显示透明蒙层,防止触摸穿透,默认:false - */ - mask?: boolean; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 隐藏消息提示框 - */ - hideToast(): void; - - hideLoading(): void; - - /** - * ​显示模态弹窗 - */ - showModal(obj: { - /** - * 提示的标题 - */ - title: string; - /** - * 提示的内容 - */ - content: string; - /** - * 是否显示取消按钮,默认为 true - */ - showCancel?: boolean; - /** - * 取消按钮的文字,默认为"取消",最多 4 个字符 - */ - cancelText?: string; - /** - * 取消按钮的文字颜色,默认为"#000000" - */ - cancelColor?: undefined; - /** - * 确定按钮的文字,默认为"确定",最多 4 个字符 - */ - confirmText?: string; - /** - * 确定按钮的文字颜色,默认为"#3CC51F" - */ - confirmColor?: undefined; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * ​显示操作菜单 - */ - showActionSheet(obj: { - /** - * 按钮的文字数组,数组长度最大为6个 - */ - itemList: undefined; - /** - * 按钮的文字颜色,默认为"#000000" - */ - itemColor?: undefined; - /** - * 接口调用成功的回调函数,详见返回参数说明 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - setTopBarText(obj: { - /** - * 置顶栏文字内容 - */ - text: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 动态设置当前页面的标题。 - */ - setNavigationBarTitle(obj: { - /** - * 页面标题 - */ - title: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 在当前页面显示导航条加载动画。 - */ - showNavigationBarLoading(): void; - - /** - * 隐藏导航条加载动画。 - */ - hideNavigationBarLoading(): void; - - /** - * 保留当前页面,跳转到应用内的某个页面,使用wx.navigateBack可以返回到原页面。 - */ - navigateTo(obj: { - /** - * 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2' - */ - url: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 关闭当前页面,跳转到应用内的某个页面。 - */ - redirectTo(obj: { - /** - * 需要跳转的应用内非 tabBar 的页面的路径,路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2' - */ - url: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - reLaunch(obj: { - /** - * 需要跳转的应用内页面路径 , 路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2',如果跳转的页面路径是 tabBar 页面则不能带参数 - */ - url: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 - */ - switchTab(obj: { - /** - * 需要跳转的 tabBar 页面的路径(需在 app.json 的 tabBar 字段定义的页面),路径后不能带参数 - */ - url: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages()) 获取当前的页面栈,决定需要返回几层。 - */ - navigateBack(obj: { - /** - * 返回的页面数,如果 delta 大于现有页面数,则返回到首页。 - */ - delta?: number; - }): void; - - /** - * 创建一个动画实例animation。调用实例的方法来描述动画。最后通过动画实例的export方法导出动画数据传递给组件的animation属性。 - */ - createAnimation(obj: { - /** - * 400 - */ - duration?: number; - /** - * "linear" - */ - timingFunction?: string; - /** - * 0 - */ - delay?: number; - /** - * "50% 50% 0" - */ - transformOrigin?: string; - }): IAnimation; - - pageScrollTo(obj: { - /** - * 滚动到页面的目标位置(单位px) - */ - scrollTop: number; - }): void; - - /** - * 创建 canvas 绘图上下文(指定 canvasId).Tip: 需要指定 canvasId,该绘图上下文只作用于对应的 - */ - createCanvasContext(canvasId: string): ICanvasContext; - - /** - * 把当前画布的内容导出生成图片,并返回文件路径 - */ - canvasToTempFilePath(canvasId: string): void; - - startPullDownRefresh(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 停止当前页面下拉刷新。 - */ - stopPullDownRefresh(): void; - - // # WXML节点信息 # - - // # 第三方平台 # - - getExtConfig(obj: { - /** - * 返回第三方平台自定义的数据 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getExtConfigSync(): void; - - // # 开放接口 # - - /** - * 调用接口获取登录凭证(code)进而换取用户登录态信息,包括用户的唯一标识(openid) 及本次登录的 会话密钥(session_key)。用户数据的加解密通讯需要依赖会话密钥完成。 - */ - login(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 通过上述接口获得的用户登录态拥有一定的时效性。用户越久未使用小程序,用户登录态越有可能失效。反之如果用户一直在使用小程序,则用户登录态一直保持有效。具体时效逻辑由微信维护,对开发者透明。开发者只需要调用wx.checkSession接口检测当前用户登录态是否有效。登录态过期后开发者可以再调用wx.login获取新的用户登录态。 - */ - checkSession(obj: { - /** - * 接口调用成功的回调函数,登录态未过期 - */ - success?: Function; - /** - * 接口调用失败的回调函数,登录态已过期 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - authorize(obj: { - /** - * 需要获取权限的scope,详见 scope 列表 - */ - scope: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 获取用户信息,withCredentials 为 true 时需要先调用 wx.login 接口。 - */ - getUserInfo(obj: { - /** - * 是否带上登录态信息 - */ - withCredentials?: boolean; - /** - * 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文 - */ - lang?: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - /** - * 发起微信支付。 - */ - requestPayment(obj: { - /** - * 时间戳从1970年1月1日00:00:00至今的秒数,即当前的时间 - */ - timeStamp: string; - /** - * 随机字符串,长度为32个字符以下。 - */ - nonceStr: string; - /** - * 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=* - */ - package: string; - /** - * 签名算法,暂支持 MD5 - */ - signType: string; - /** - * 签名,具体签名方案参见小程序支付接口文档; - */ - paySign: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - chooseAddress(obj: { - /** - * 返回用户选择的收货地址信息 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - addCard(obj: { - /** - * 需要添加的卡券列表,列表内对象说明请参见请求对象说明 - */ - cardList: undefined; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - openCard(obj: { - /** - * 需要打开的卡券列表,列表内参数详见openCard 请求对象说明 - */ - cardList: undefined; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - openSetting(obj: { - /** - * 接口调用成功的回调函数,返回内容详见返回参数说明。 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getSetting(obj: { - /** - * 接口调用成功的回调函数,返回内容详见返回参数说明。 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - getWeRunData(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - navigateToMiniProgram(obj: { - /** - * 要打开的小程序 appId - */ - appId: string; - /** - * 打开的页面路径,如果为空则打开首页 - */ - path?: string; - /** - * 需要传递给目标小程序的数据,目标小程序可在 App.onLaunch(),App.onShow() 中获取到这份数据。详情 - */ - extraData?: any; - /** - * 要打开的小程序版本,有效值 develop(开发版),trial(体验版),release(正式版) ,仅在当前小程序为开发版或体验版时此参数有效;如果当前小程序是体验版或正式版,则打开的小程序必定是正式版。默认值 release - */ - envVersion?: string; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - chooseInvoiceTitle(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - checkIsSupportSoterAuthentication(obj: { - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - - // # 数据 # - - /** - * 自定义分析数据上报接口。使用前,需要在小程序管理后台自定义分析中新建事件,配置好事件名与字段。 - */ - reportAnalytics(eventName: string, data: string, ): void; - - // # 拓展接口 # - - arrayBufferToBase64(arrayBuffer: string): void; - - base64ToArrayBuffer(base64: string): void; - - // # 调试接口 # - - setEnableDebug(obj: { - /** - * 是否打开调试 - */ - enableDebug: boolean; - /** - * 接口调用成功的回调函数 - */ - success?: Function; - /** - * 接口调用失败的回调函数 - */ - fail?: Function; - /** - * 接口调用结束的回调函数(调用成功、失败都会执行) - */ - complete?: Function; - }): void; - -} \ No newline at end of file diff --git a/src/openeuler/utils/app-ajax.js b/src/openeuler/utils/app-ajax.js index 218b2ce..eaf4c6a 100644 --- a/src/openeuler/utils/app-ajax.js +++ b/src/openeuler/utils/app-ajax.js @@ -1,10 +1,7 @@ -/** - * 请求方法 - */ - const underscore = require('./underscore-extend.js'); const servicesConfig = require('../config/services-config.js'); const CONSTANTS = require('../config/constants.js'); +const sessionUtil = require('./app-session.js'); let remoteMethods = { refreshToken: function (refresh, _callback) { @@ -64,7 +61,7 @@ const handleSuccessfulRefresh = function (newTokens, userData) { const clearUserDataAndNavigate = function () { messageQueue = []; - wx.removeStorageSync('_app_userinfo_session'); + sessionUtil.clearUserInfo(); isRefreshing = false; wx.navigateTo({ url: '/pages/auth/auth' }); }; @@ -90,7 +87,7 @@ const appAjax = { // 默认参数 let defaultParams = { service: '', // 服务的配置名称 - success: function (d) {}, // 成功后回调 + success: function () {}, // 成功后回调 error: null, // 失败后回调 autoShowWait: false, // 自动显示菊花 loadingText: '加载中...', // 加载的提示语 @@ -100,7 +97,6 @@ const appAjax = { ? 'Bearer ' + wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION).access : '', }, - isAsync: true, }; let isShowToast = false; let ajaxParams = underscore.deepExtend(true, defaultParams, params); @@ -139,7 +135,7 @@ const appAjax = { if (res?.data?.detail && res.statusCode === 400) { message = res.data.detail; } else if (res.statusCode === 401) { - message = '请登陆!'; + message = '请重新登陆~'; } else if (res.statusCode === 418) { message = '您的请求疑似攻击行为!'; } else { diff --git a/src/openeuler/utils/app-user.js b/src/openeuler/utils/app-user.js index 7637f00..2f969c2 100644 --- a/src/openeuler/utils/app-user.js +++ b/src/openeuler/utils/app-user.js @@ -14,37 +14,33 @@ const privateMethods = { icon: 'loading', mask: true, }); - wx.login({ success: function (data) { - wx.getUserInfo({ - success: function (res) { - // 登录 - appAjax.postJson({ - headers: { - Authorization: '', - }, - service: 'LOGIN', - data: { - userInfo: res.userInfo, - code: data.code, - }, - success: function (result) { - res.userInfo.agreePrivacy = result.agree_privacy_policy; - res.userInfo.access = result.access; - res.userInfo.level = result.level; - res.userInfo.nickName = result.nickname; - res.userInfo.eventLevel = result.activity_level; - res.userInfo.gitee = result.gitee_name; - res.userInfo.userId = result.user_id; - // 缓存用户信息 - appUser.saveLoginInfo(res.userInfo || {}); - // 回调 - callback && callback(res.userInfo || {}); - }, - }); + appAjax.postJson({ + headers: { + Authorization: '', + }, + service: 'LOGIN', + data: { + code: data.code, + }, + success: function (result) { + let userInfo = {}; + userInfo.agreePrivacy = result.agree_privacy_policy; + userInfo.access = result.access; + userInfo.level = result.level; + userInfo.nickName = result.nickname; + userInfo.avatarUrl = result.avatar; + userInfo.eventLevel = result.activity_level; + userInfo.gitee = result.gitee_name; + userInfo.userId = result.user_id; + userInfo.refresh = result.refresh; + // 缓存用户信息 + appUser.saveLoginInfo(userInfo || {}); + // 回调 + callback && callback(userInfo || {}); }, - fail: function () { + complete() { wx.hideToast(); }, }); @@ -114,7 +110,6 @@ const appUser = { wx.getSetting({ success: function (res) { if (res.authSetting['scope.userInfo']) { - // 已经授权,可以直接调用 getUserInfo 获取头像昵称 privateMethods._login(callback); } else { app.loginCallback = function () { @@ -185,7 +180,6 @@ const appUser = { icon: 'loading', mask: true, }); - wx.login({ success: function (data) { appAjax.postJson({ @@ -204,6 +198,7 @@ const appUser = { userInfo.gitee = result.gitee_name; userInfo.userId = result.user_id; userInfo.nickName = result.nickname; + userInfo.avatarUrl = result.avatar; userInfo.refresh = result.refresh; // // 缓存用户信息 appUser.saveLoginInfo(userInfo || {}); diff --git a/src/openeuler/utils/page-mixin.js b/src/openeuler/utils/page-mixin.js index b88deb8..b3a0d2e 100644 --- a/src/openeuler/utils/page-mixin.js +++ b/src/openeuler/utils/page-mixin.js @@ -3,7 +3,6 @@ */ const _ = require('./underscore-extend'); -const constants = require('../config/constants'); const { deepExtend: $extend } = _; const app = getApp(); @@ -75,7 +74,6 @@ const lifeCycle = { let local = { getLifeCycle(rewriteList, lifeCycle, pageConfig) { let config = {}; - rewriteList.forEach((i) => { if (i in pageConfig) { config[i] = function () { @@ -93,13 +91,6 @@ let local = { let $pageMixin = function (pageConfig) { let rewriteList = [ 'onLoad', // 生命周期函数--监听页面加载 - // 'onReady', // 生命周期函数--监听页面初次渲染完成 - // 'onShow', // 生命周期函数--监听页面显示 - // 'onHide', // 生命周期函数--监听页面隐藏 - // 'onUnload', // 生命周期函数--监听页面卸载 - // 'onPullDownRefresh', // 页面相关事件处理函数--监听用户下拉动作 - // 'onReachBottom', // 页面上拉触底事件的处理函数 - // 'onShareAppMessage' // 用户点击右上角分享 ]; let lifeConfig = local.getLifeCycle(rewriteList, lifeCycle, pageConfig); -- Gitee From c4636fed5ed9dfc0c1cb00335be29227862159d8 Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Sat, 18 Nov 2023 20:56:58 +0800 Subject: [PATCH 06/10] =?UTF-8?q?feat:=20=E7=BC=93=E5=AD=98=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/meeting-list/meeting-list.js | 16 ++++---- .../components/privacy-text/privacy-text.wxml | 11 ------ .../components/user-info/user-info.js | 8 ++-- src/openeuler/config/constants.js | 4 +- src/openeuler/custom-tab-bar/index.js | 4 +- .../package-events/events/event-detail.js | 35 ++++------------- .../package-events/events/event-detail.wxml | 14 ++++--- .../package-events/events/event-detail.wxss | 6 ++- .../package-events/events/event-list.js | 6 +-- .../package-events/manage/add-member.js | 1 + .../package-meeting/meeting/detail.js | 15 +++++-- .../package-meeting/reserve/reserve.js | 8 ++-- src/openeuler/package-my/events/my-list.js | 39 +++++++++---------- src/openeuler/package-my/my/privecy-seting.js | 24 ++++++++---- src/openeuler/pages/auth/auth.js | 39 +++++++++---------- src/openeuler/pages/events/events.js | 16 +++----- src/openeuler/pages/index/index.js | 8 ++-- src/openeuler/pages/meeting/meeting.js | 12 +++--- src/openeuler/pages/my/my.js | 22 +++++++---- src/openeuler/utils/app-ajax.js | 35 ++++++++++------- src/openeuler/utils/app-session.js | 16 +++++--- src/openeuler/utils/app-user.js | 24 +++++++----- src/openeuler/utils/utils.js | 23 +++++++++++ 23 files changed, 207 insertions(+), 179 deletions(-) diff --git a/src/openeuler/components/meeting-list/meeting-list.js b/src/openeuler/components/meeting-list/meeting-list.js index c3da1bb..014831c 100644 --- a/src/openeuler/components/meeting-list/meeting-list.js +++ b/src/openeuler/components/meeting-list/meeting-list.js @@ -13,7 +13,7 @@ const remoteMethods = { }); }, getMeettingData: function (params, _callback) { - if (that?.properties.pageType === 2) { + if (that.properties.pageType === 2) { params = { ...params, search: that.data.curKeyword, @@ -71,8 +71,8 @@ const remoteMethods = { }, }; const localMethod = { - checkLogin() { - if (!sessionUtil.getUserInfoByKey('access')) { + async checkLogin() { + if (!(await sessionUtil.getUserInfoByKey('access'))) { wx.navigateTo({ url: '/pages/auth/auth', }); @@ -278,8 +278,8 @@ Component({ url: '/package-meeting/meeting/detail?id=' + e.currentTarget.dataset.id, }); }, - getMore(e) { - if (!localMethod.checkLogin()) { + async getMore(e) { + if (!(await localMethod.checkLogin())) { return; } this.setData({ @@ -290,7 +290,7 @@ Component({ }); const collectDesc = this.data.collectionId ? '取消收藏' : '收藏会议'; const userId = e.currentTarget.dataset.item.user_id; - if (sessionUtil.getUserInfoByKey('level') === 1) { + if ((await sessionUtil.getUserInfoByKey('level')) === 1) { this.setData({ actions: [ { @@ -303,8 +303,8 @@ Component({ }, ], }); - } else if (sessionUtil.getUserInfoByKey('level') === 2) { - if (sessionUtil.getUserInfoByKey('userId') === userId) { + } else if ((await sessionUtil.getUserInfoByKey('level')) === 2) { + if ((await sessionUtil.getUserInfoByKey('userId')) === userId) { this.setData({ actions: [ { diff --git a/src/openeuler/components/privacy-text/privacy-text.wxml b/src/openeuler/components/privacy-text/privacy-text.wxml index 02824ba..6dae1d3 100644 --- a/src/openeuler/components/privacy-text/privacy-text.wxml +++ b/src/openeuler/components/privacy-text/privacy-text.wxml @@ -20,17 +20,6 @@ 2. 我们在何种情况披露或共享您的个人信息 共享是指我们向第三方披露您的个人信息。我们仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,我们共享这些信息的目的仅限于本声明披露或在您允许的范围内进行。 a) 为了保护国家安全、公共安全以及您和其他个人的重大合法权益而需要共享您的个人信息。 - - - 第三方名称 - - - 处理目的和方式 - - - 第三方名称 - - 3. 我们将保留多久您的个人信息 我们将会在达成本声明所述目的所需的期限内保留您的个人信息,除非按照法律要求或您的要求需要延长保留期。 一般而言,我们会自您使用本服务时获取您的个人信息之日起,根据可适用法律的要求或服务协议的约定,在留存期限内存储或保留您的个人信息。在您的个人信息超出保留期限后,且没有法律要求我们继续处理您的特定个人信息的情况下,我们将会根据可适用法律的要求删除您的个人信息,或进行匿名化处理。 diff --git a/src/openeuler/components/user-info/user-info.js b/src/openeuler/components/user-info/user-info.js index 5d432b4..e3ee522 100644 --- a/src/openeuler/components/user-info/user-info.js +++ b/src/openeuler/components/user-info/user-info.js @@ -44,15 +44,15 @@ Component({ pageLifetimes: { // 组件所在页面的生命周期函数 - show: function () { + show: async function () { this.setData({ - isLogin: sessionUtil.getUserInfoByKey('access') || false, + isLogin: (await sessionUtil.getUserInfoByKey('access')) || false, }); if (this.data.isLogin) { this.setData({ - avatarUrl: sessionUtil.getUserInfoByKey('avatarUrl'), + avatarUrl: await sessionUtil.getUserInfoByKey('avatarUrl'), text: localMethods.getCurText(), - nickName: sessionUtil.getUserInfoByKey('nickName'), + nickName: await sessionUtil.getUserInfoByKey('nickName'), }); } }, diff --git a/src/openeuler/config/constants.js b/src/openeuler/config/constants.js index 9968916..0151ce9 100644 --- a/src/openeuler/config/constants.js +++ b/src/openeuler/config/constants.js @@ -5,8 +5,8 @@ let _ = require('../utils/underscore-extend.js'); // 服务连接配置 let serviceConfig = { - // SERVICE_URL: 'https://api.openeuler.org/meetings', // 正式环境 - SERVICE_URL: 'https://meetingserver-openeuler.test.osinfra.cn', // 测试环境 + SERVICE_URL: 'https://api.openeuler.org/meetings', // 正式环境 + // SERVICE_URL: 'https://meetingserver-openeuler.test.osinfra.cn', // 测试环境 // SERVICE_URL: 'https://meetings-beta.openeuler.org', // 测试环境 }; diff --git a/src/openeuler/custom-tab-bar/index.js b/src/openeuler/custom-tab-bar/index.js index 026a360..e03df36 100644 --- a/src/openeuler/custom-tab-bar/index.js +++ b/src/openeuler/custom-tab-bar/index.js @@ -31,8 +31,8 @@ Component({ * 组件的方法列表 */ methods: { - switchTap: function (e) { - if (!sessionUtil.getUserInfoByKey('access') && Number(e.currentTarget.dataset.index) === 3) { + switchTap: async function (e) { + if (!(await sessionUtil.getUserInfoByKey('access')) && Number(e.currentTarget.dataset.index) === 3) { wx.navigateTo({ url: '/pages/auth/auth', }); diff --git a/src/openeuler/package-events/events/event-detail.js b/src/openeuler/package-events/events/event-detail.js index 651b291..306de58 100644 --- a/src/openeuler/package-events/events/event-detail.js +++ b/src/openeuler/package-events/events/event-detail.js @@ -113,13 +113,13 @@ Page({ /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { + onLoad: async function (options) { that = this; this.setData({ id: options.id || decodeURIComponent(options.scene), scene: decodeURIComponent(options.scene) || '', type: options.type, - level: sessionUtil.getUserInfoByKey('eventLevel') || 1, + level: (await sessionUtil.getUserInfoByKey('eventLevel')) || 1, }); wx.getSystemInfo({ success(res) { @@ -138,9 +138,9 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () { + onShow: async function () { this.setData({ - user: sessionUtil.getUserInfoByKey('userId'), + user: await sessionUtil.getUserInfoByKey('userId'), }); remoteMethods.getDraftDetail((res) => { this.setData({ @@ -185,27 +185,6 @@ Page({ tabIndex: e.currentTarget.dataset.index, }); }, - openLocation(e) { - if (e.currentTarget.dataset.item.activity_type == 2) { - return; - } - wx.showModal({ - title: '提示', - content: '即将唤起腾讯地图,是否同意?', - success(res) { - if (res.confirm) { - wx.openLocation({ - latitude: Number(e.currentTarget.dataset.item.latitude), - longitude: Number(e.currentTarget.dataset.item.longitude), - name: e.currentTarget.dataset.item.detail_address, // 名称 - address: e.currentTarget.dataset.item.address, // 地址 - }); - } else if (res.cancel) { - return false; - } - }, - }); - }, toEditDraft() { wx.redirectTo({ url: `/package-events/publish/publish?id=${this.data.id}&type=${this.data.type}`, @@ -270,10 +249,10 @@ Page({ }, copyLink: function () { wx.setClipboardData({ - data: this.data.info.join_url, - success: function () { + data: this.data.info.register_url, + success: () => { that.setData({ - showDialog: false, + showRegister: false, }); }, }); diff --git a/src/openeuler/package-events/events/event-detail.wxml b/src/openeuler/package-events/events/event-detail.wxml index b8aa7e8..0244216 100644 --- a/src/openeuler/package-events/events/event-detail.wxml +++ b/src/openeuler/package-events/events/event-detail.wxml @@ -1,7 +1,8 @@ - + - + {{info.register_url}} diff --git a/src/openeuler/package-events/events/event-detail.wxss b/src/openeuler/package-events/events/event-detail.wxss index 413f2db..1463b09 100644 --- a/src/openeuler/package-events/events/event-detail.wxss +++ b/src/openeuler/package-events/events/event-detail.wxss @@ -121,6 +121,11 @@ page { align-items: center; } +.container .detail-wrapper .address .left { + display: flex; + align-items: center; +} + .container .detail-wrapper .address .left image { width: 28rpx; height: 28rpx; @@ -134,7 +139,6 @@ page { color: #6d7278; overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; display: inline-block; } diff --git a/src/openeuler/package-events/events/event-list.js b/src/openeuler/package-events/events/event-list.js index 56f8f8d..0e03cbf 100644 --- a/src/openeuler/package-events/events/event-list.js +++ b/src/openeuler/package-events/events/event-list.js @@ -139,11 +139,11 @@ Page({ onLoad: function () { that = this; this.initData(); - remoteMethods.getCount((res) => { + remoteMethods.getCount(async (res) => { this.setData({ 'pageParams.page': 1, - level: sessionUtil.getUserInfoByKey('eventLevel') || 1, - user: sessionUtil.getUserInfoByKey('userId'), + level: (await sessionUtil.getUserInfoByKey('eventLevel')) || 1, + user: await sessionUtil.getUserInfoByKey('userId'), allNum: res.all_activities_count, signUpNum: res.registering_activities_count, goingNum: res.going_activities_count, diff --git a/src/openeuler/package-events/manage/add-member.js b/src/openeuler/package-events/manage/add-member.js index 9ad45b3..dcf5cd7 100644 --- a/src/openeuler/package-events/manage/add-member.js +++ b/src/openeuler/package-events/manage/add-member.js @@ -115,6 +115,7 @@ Page({ }, searchInput: function (e) { this.setData({ + 'pageParams.page': 1, keyword: e.detail.value, }); this.initData(); diff --git a/src/openeuler/package-meeting/meeting/detail.js b/src/openeuler/package-meeting/meeting/detail.js index 34cdf52..884bf80 100644 --- a/src/openeuler/package-meeting/meeting/detail.js +++ b/src/openeuler/package-meeting/meeting/detail.js @@ -50,6 +50,7 @@ Page({ id: '', info: {}, collection_id: null, + isLogin: false, }, /** @@ -74,8 +75,11 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () { + onShow: async function () { let that = this; + this.setData({ + isLogin: (await sessionUtil.getUserInfoByKey('access')) ? true : false, + }); remoteMethods.getMeetingDetail(this.data.id, function (data) { if (data) { that.setData({ @@ -92,16 +96,16 @@ Page({ path: `/package-meeting/meeting/detail?id=${this.data.id}`, }; }, - collect: function () { + collect: async function () { let that = this; - if (!sessionUtil.getUserInfoByKey('access')) { + if (!this.data.isLogin) { wx.navigateTo({ url: '/pages/auth/auth', }); return; } if (this.data.collection_id != null) { - remoteMethods.uncollect(this.data.collection_id, function (res) { + remoteMethods.uncollect(this.data.collection_id, function () { that.setData({ collection_id: null, }); @@ -118,6 +122,9 @@ Page({ } }); }, + fail(err) { + console.log(err); + }, }); } }, diff --git a/src/openeuler/package-meeting/reserve/reserve.js b/src/openeuler/package-meeting/reserve/reserve.js index ad40269..8958488 100644 --- a/src/openeuler/package-meeting/reserve/reserve.js +++ b/src/openeuler/package-meeting/reserve/reserve.js @@ -192,6 +192,7 @@ Page({ agenda: '', emaillist: '', privacyState: false, + sendDev: false, }); }, meeting: function () { @@ -328,13 +329,12 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () { - that = this; + onShow: async function () { this.setData({ - sponsor: appSession.getUserInfoByKey('gitee') || '', + sponsor: (await appSession.getUserInfoByKey('gitee')) || '', }); let that = this; - remoteMethods.getUserGroup(appSession.getUserInfoByKey('userId'), function (data) { + remoteMethods.getUserGroup(await appSession.getUserInfoByKey('userId'), function (data) { if (data && data.length) { that.setData({ sigList: data, diff --git a/src/openeuler/package-my/events/my-list.js b/src/openeuler/package-my/events/my-list.js index c9904f2..f537475 100644 --- a/src/openeuler/package-my/events/my-list.js +++ b/src/openeuler/package-my/events/my-list.js @@ -5,6 +5,7 @@ const sessionUtil = require('../../utils/app-session.js'); let that = null; let remoteMethods = { getList: function (params, _callback) { + console.log(that.data.type); let service = ''; if (that.data.type == 4) { service = 'GET_DRAFT_LIST'; @@ -119,40 +120,36 @@ Page({ /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { + onLoad: async function (options) { + let type = Number(options.type); this.setData({ - type: options.type, - level: sessionUtil.getUserInfoByKey('eventLevel'), - user: sessionUtil.getUserInfoByKey('userId'), + type: type, + level: await sessionUtil.getUserInfoByKey('eventLevel'), + user: await sessionUtil.getUserInfoByKey('userId'), }); that = this; let title = ''; - if (options.type == 1) { + if (type === 1) { title = '待发布'; - } else if (options.type == 2) { + } else if (type === 2) { title = '已发布'; - } else if (options.type == 3) { + } else if (type === 3) { title = '报名表单'; - } else if (options.type == 4) { + } else if (type === 4) { title = '草稿箱'; - } else if (options.type == 5) { + } else if (type === 5) { title = '发布中'; - } else if (options.type == 6) { + } else if (type === 6) { title = '我收藏的活动'; - } else if (options.type == 7) { + } else if (type === 7) { title = '我报名的活动'; } wx.setNavigationBarTitle({ title, }); - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { this.initData(); }, + initData() { let renderData = []; remoteMethods.getList(this.data.pageParams, (data) => { @@ -198,8 +195,8 @@ Page({ remoteMethods.delDraft(() => { this.initialization(); }); - } else if (this.data.type == 2 || this.data.type == 6 || this.data.type == 7) { - if (this.data.level == 3) { + } else if (this.data.type === 2 || this.data.type === 6 || this.data.type === 7) { + if (this.data.level === 3) { if (e.detail.operaType == 1) { if (this.data.collectionId) { remoteMethods.unCollect(() => { @@ -216,7 +213,7 @@ Page({ }); } } else { - if (e.detail.operaType == 1) { + if (e.detail.operaType === 1) { if (this.data.collectionId) { remoteMethods.unCollect(() => { this.initialization(); @@ -226,7 +223,7 @@ Page({ this.initialization(); }); } - } else if (e.detail.operaType == 3) { + } else if (e.detail.operaType === 3) { return; } else { this.setData({ diff --git a/src/openeuler/package-my/my/privecy-seting.js b/src/openeuler/package-my/my/privecy-seting.js index 8233959..9075762 100644 --- a/src/openeuler/package-my/my/privecy-seting.js +++ b/src/openeuler/package-my/my/privecy-seting.js @@ -41,13 +41,13 @@ Page({ isLogoffDiaShown: false, content: '', deleteText: '', - gitee: '' + gitee: '', }, - onLoad: function () { + onLoad: async function () { this.setData({ - avatarUrl: sessionUtil.getUserInfoByKey('avatarUrl'), - nickName: sessionUtil.getUserInfoByKey('nickName'), - gitee: sessionUtil.getUserInfoByKey('gitee'), + avatarUrl: await sessionUtil.getUserInfoByKey('avatarUrl'), + nickName: await sessionUtil.getUserInfoByKey('nickName'), + gitee: await sessionUtil.getUserInfoByKey('gitee'), }); }, shownDialog: function (e) { @@ -70,8 +70,16 @@ Page({ }); return false; } - remoteMethods.handleLogoff(() => { - this.handleLogout(); + remoteMethods.handleLogoff((res) => { + if (res.code === 200) { + this.handleLogout(); + } else { + wx.showToast({ + title: res.msg, + icon: 'none', + duration: 2000, + }); + } }); }, confirmLogout: function () { @@ -96,4 +104,4 @@ Page({ isPrivecyDiaShown: false, }); }, -}); \ No newline at end of file +}); diff --git a/src/openeuler/pages/auth/auth.js b/src/openeuler/pages/auth/auth.js index 46b8b4c..0528ce5 100644 --- a/src/openeuler/pages/auth/auth.js +++ b/src/openeuler/pages/auth/auth.js @@ -3,6 +3,7 @@ const mixin = require('../../utils/page-mixin.js').$pageMixin; const appUser = require('../../utils/app-user.js'); const appAjax = require('./../../utils/app-ajax'); const sessionUtil = require('../../utils/app-session.js'); +const { getStorageSync, setStorageSync } = require('../../utils/utils'); let that = null; Page( @@ -25,7 +26,6 @@ Page( } }, bindGetUserProfile() { - console.log(555); if (!this.data.record) { wx.showToast( { @@ -37,13 +37,14 @@ Page( ); return false; } - appUser.wxGetUserProfileLogin(function () { + appUser.wxGetUserProfileLogin(async function () { const pages = getCurrentPages(); // 当前页面 const beforePage = pages[pages.length - 2]?.route === 'pages/auth/auth' ? pages[pages.length - 3] : pages[pages.length - 2]; // 前一个页面 const id = beforePage?.options.id || that.data.id; const url = id ? '/' + beforePage?.route + '?id=' + id : '/' + beforePage?.route; - if (!sessionUtil.getUserInfoByKey('agreePrivacy')) { + console.log(await sessionUtil.getUserInfoByKey('agreePrivacy')); + if (!(await sessionUtil.getUserInfoByKey('agreePrivacy'))) { that.setData({ isPrivecyShown: true, url: url, @@ -88,26 +89,22 @@ Page( }, }); }, - setStorage: function () { - // let data = wx.getStorageSync('_app_userinfo_session'); - // data.agreePrivacy = true; - // wx.setStorageSync('_app_userinfo_session', data); - wx.getStorage({ - key: '_app_userinfo_session', - encrypt: true, - success(data) { - data.agreePrivacy = true; - wx.setStorage({ - key: '_app_userinfo_session', - encrypt: true, - data: data, - }); - }, - }); + setStorage: async function () { + try { + let data = await getStorageSync('_app_userinfo_session'); + data.agreePrivacy = true; + await setStorageSync('_app_userinfo_session', data); + } catch (error) { + wx.removeStorageSync('_app_userinfo_session'); + } }, handleClick: function () { - this.setAgreeState(() => { - this.setStorage(); + this.setAgreeState((res) => { + if (res.code === 200) { + this.setStorage(); + } else { + wx.removeStorageSync('_app_userinfo_session'); + } this.setData({ isPrivecyShown: false, }); diff --git a/src/openeuler/pages/events/events.js b/src/openeuler/pages/events/events.js index 0cbf301..0a7220b 100644 --- a/src/openeuler/pages/events/events.js +++ b/src/openeuler/pages/events/events.js @@ -101,10 +101,10 @@ Page({ this.setData({ iphoneX: this.getTabBar().data.iPhoneX, }); - appUser.updateUserInfo(function () { + appUser.updateUserInfo(async function () { that.setData({ - level: sessionUtil.getUserInfoByKey('eventLevel') || 1, - user: sessionUtil.getUserInfoByKey('userId'), + level: (await sessionUtil.getUserInfoByKey('eventLevel')) || 1, + user: await sessionUtil.getUserInfoByKey('userId'), }); }); this.initData(); @@ -117,9 +117,9 @@ Page({ _tabbat: 2, }); }, - navigateTo(e) { + async navigateTo(e) { const url = e.currentTarget.dataset.url; - if (url.includes('publish') && !sessionUtil.getUserInfoByKey('access')) { + if (url.includes('publish') && !(await sessionUtil.getUserInfoByKey('access'))) { wx.navigateTo({ url: '/pages/auth/auth', }); @@ -306,12 +306,6 @@ Page({ } }, toUpdateSchedule(e) { - if (!sessionUtil.getUserInfoByKey('access')) { - wx.navigateTo({ - url: '/pages/auth/auth', - }); - return; - } wx.navigateTo({ url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=5`, }); diff --git a/src/openeuler/pages/index/index.js b/src/openeuler/pages/index/index.js index 2d3f186..e193d1a 100644 --- a/src/openeuler/pages/index/index.js +++ b/src/openeuler/pages/index/index.js @@ -18,8 +18,8 @@ Page( meetingConponent: null, autoplay: false, }, - handleContact(e) { - if (!sessionUtil.getUserInfoByKey('access')) { + async handleContact(e) { + if (!(await sessionUtil.getUserInfoByKey('access'))) { wx.navigateTo({ url: '/pages/auth/auth', }); @@ -71,8 +71,8 @@ Page( }); } }, - checkLogin() { - if (!sessionUtil.getUserInfoByKey('access')) { + async checkLogin() { + if (!(await sessionUtil.getUserInfoByKey('access'))) { wx.navigateTo({ url: '/pages/auth/auth', }); diff --git a/src/openeuler/pages/meeting/meeting.js b/src/openeuler/pages/meeting/meeting.js index d0e3e11..3b9aa64 100644 --- a/src/openeuler/pages/meeting/meeting.js +++ b/src/openeuler/pages/meeting/meeting.js @@ -25,9 +25,9 @@ Page( }); let that = this; - appUser.updateUserInfo(function () { + appUser.updateUserInfo(async function () { that.setData({ - level: sessionUtil.getUserInfoByKey('level'), + level: await sessionUtil.getUserInfoByKey('level'), }); }); }, @@ -43,9 +43,9 @@ Page( }, onPullDownRefresh: function () { wx.stopPullDownRefresh(); - appUser.updateUserInfo(() => { + appUser.updateUserInfo(async () => { this.setData({ - level: sessionUtil.getUserInfoByKey('level') || 1, + level: (await sessionUtil.getUserInfoByKey('level')) || 1, }); }); this.data.meetingConponent?.initData(); @@ -65,9 +65,9 @@ Page( }); } }, - navigateTo(e) { + async navigateTo(e) { const url = e.currentTarget.dataset.url; - if (url.includes('reserve') && !sessionUtil.getUserInfoByKey('access')) { + if (url.includes('reserve') && !(await sessionUtil.getUserInfoByKey('access'))) { wx.navigateTo({ url: '/pages/auth/auth', }); diff --git a/src/openeuler/pages/my/my.js b/src/openeuler/pages/my/my.js index 8fbb3ca..23a5184 100644 --- a/src/openeuler/pages/my/my.js +++ b/src/openeuler/pages/my/my.js @@ -31,14 +31,22 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function () { - this.setData({ - iphoneX: this.getTabBar().data.iPhoneX, - avatarUrl: sessionUtil.getUserInfoByKey('avatarUrl'), - nickName: sessionUtil.getUserInfoByKey('nickName'), - level: sessionUtil.getUserInfoByKey('level'), - userId: sessionUtil.getUserInfoByKey('userId'), - avtivityLevel: sessionUtil.getUserInfoByKey('eventLevel'), + let that = this; + wx.getStorage({ + key: '_app_userinfo_session', + encrypt: true, + success(res) { + that.setData({ + iphoneX: that.getTabBar().data.iPhoneX, + avatarUrl: res.data?.avatarUrl, + nickName: res.data?.nickName, + level: res.data?.level, + userId: res.data?.userId, + avtivityLevel: res.data?.eventLevel, + }); + }, }); + remoteMethods.getMyCount((res) => { this.setData({ myCount: res, diff --git a/src/openeuler/utils/app-ajax.js b/src/openeuler/utils/app-ajax.js index eaf4c6a..beadb5c 100644 --- a/src/openeuler/utils/app-ajax.js +++ b/src/openeuler/utils/app-ajax.js @@ -2,6 +2,7 @@ const underscore = require('./underscore-extend.js'); const servicesConfig = require('../config/services-config.js'); const CONSTANTS = require('../config/constants.js'); const sessionUtil = require('./app-session.js'); +const { getStorageSync, setStorageSync } = require('./utils'); let remoteMethods = { refreshToken: function (refresh, _callback) { @@ -51,10 +52,10 @@ const _addUrlParam = function (data) { let messageQueue = []; let isRefreshing = false; -const handleSuccessfulRefresh = function (newTokens, userData) { +const handleSuccessfulRefresh = async function (newTokens, userData) { userData.access = newTokens.access; userData.refresh = newTokens.refresh; - wx.setStorageSync(CONSTANTS.APP_USERINFO_SESSION, userData); + await setStorageSync(CONSTANTS.APP_USERINFO_SESSION, userData); processMessageQueue(); isRefreshing = false; }; @@ -83,8 +84,14 @@ const appAjax = { * error: "", // 失败回调 * complete: "" // 完成回调 */ - postJson: function (params) { + postJson: async function (params) { // 默认参数 + let storage; + try { + storage = await getStorageSync(CONSTANTS.APP_USERINFO_SESSION); + } catch (error) { + storage = null; + } let defaultParams = { service: '', // 服务的配置名称 success: function () {}, // 成功后回调 @@ -93,9 +100,7 @@ const appAjax = { loadingText: '加载中...', // 加载的提示语 autoCloseWait: true, // 自动关闭菊花 headers: { - Authorization: wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION).access - ? 'Bearer ' + wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION).access - : '', + Authorization: storage ? 'Bearer ' + storage.access : '', }, }; let isShowToast = false; @@ -122,11 +127,10 @@ const appAjax = { header: ajaxParams.headers, method: ajaxParams['type'] || 'POST', data: ajaxParams.data, - success: function (res) { - const data = wx.getStorageSync(CONSTANTS.APP_USERINFO_SESSION); - if (res?.data?.access && data) { - data.access = res.data.access; - wx.setStorageSync(CONSTANTS.APP_USERINFO_SESSION, data); + success: async function (res) { + if (res?.data?.access && storage) { + storage.access = res.data.access; + await setStorageSync(CONSTANTS.APP_USERINFO_SESSION, storage); } ajaxParams.success(res.data, res); @@ -142,21 +146,24 @@ const appAjax = { message = '有点忙开个小差,稍后再试~'; } // 刷新token - if (res.statusCode === 401 && data && params.service !== 'REFRESH') { + if (res.statusCode === 401 && storage && params.service !== 'REFRESH') { messageQueue.push(params); if (!isRefreshing) { isRefreshing = true; - remoteMethods.refreshToken(data?.refresh, (res) => { + remoteMethods.refreshToken(storage?.refresh, (res) => { if (!res.refresh) { clearUserDataAndNavigate(); } else { - handleSuccessfulRefresh(res, data); + handleSuccessfulRefresh(res, storage); } isRefreshing = false; }); } return; } + if (res.statusCode === 401 && !storage) { + clearUserDataAndNavigate(); + } if (ajaxParams.error) { ajaxParams.error(message, res); } else { diff --git a/src/openeuler/utils/app-session.js b/src/openeuler/utils/app-session.js index aa2d05a..8daed39 100644 --- a/src/openeuler/utils/app-session.js +++ b/src/openeuler/utils/app-session.js @@ -1,10 +1,16 @@ const constants = require('../config/constants.js'); +const { getStorageSync } = require('./utils'); + /** * 获取用户信息 */ -const _getUserinfo = function () { - const userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); - +const _getUserinfo = async function () { + let userInfo; + try { + userInfo = await getStorageSync(constants.APP_USERINFO_SESSION); + } catch (error) { + userInfo = null; + } return userInfo; }; @@ -12,12 +18,12 @@ const _getUserinfo = function () { * 通过key获取值 * @params key */ -const _getValueByKey = function (key) { +const _getValueByKey = async function (key) { if (!key) { return; } - const userinfo = _getUserinfo(); + const userinfo = await _getUserinfo(); if (!userinfo) { return; diff --git a/src/openeuler/utils/app-user.js b/src/openeuler/utils/app-user.js index 2f969c2..22a7032 100644 --- a/src/openeuler/utils/app-user.js +++ b/src/openeuler/utils/app-user.js @@ -1,6 +1,7 @@ const appAjax = require('./app-ajax.js'); const appSession = require('./app-session.js'); const constants = require('../config/constants'); +const { getStorageSync, setStorageSync } = require('./utils'); const app = getApp(); const privateMethods = { @@ -138,12 +139,17 @@ const appUser = { * 保存用户信息 * @param {Object} result */ - saveLoginInfo: function (result) { - wx.setStorageSync(constants.APP_USERINFO_SESSION, result); + saveLoginInfo: async function (result) { + await setStorageSync(constants.APP_USERINFO_SESSION, result); }, - updateUserInfo: function (callback) { - let userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); + updateUserInfo: async function (callback) { + let userInfo; + try { + userInfo = await getStorageSync(constants.APP_USERINFO_SESSION); + } catch (error) { + userInfo = null; + } if (userInfo && userInfo.userId) { appAjax.postJson({ type: 'GET', @@ -151,16 +157,16 @@ const appUser = { otherParams: { id: userInfo.userId, }, - success: function (ret) { + success: async function (ret) { if (ret) { // 更新userInfo数据 - userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); + userInfo = await getStorageSync(constants.APP_USERINFO_SESSION); userInfo.gitee = ret.gitee_name; userInfo.level = ret.level; userInfo.nickName = ret.nickname; userInfo.avatarUrl = ret.avatar; userInfo.eventLevel = ret.activity_level; - wx.setStorageSync(constants.APP_USERINFO_SESSION, userInfo); + await setStorageSync(constants.APP_USERINFO_SESSION, userInfo); } callback && callback(); }, @@ -190,7 +196,7 @@ const appUser = { data: { code: data.code, }, - success: function (result) { + success: async function (result) { userInfo.agreePrivacy = result.agree_privacy_policy; userInfo.access = result.access; userInfo.level = result.level; @@ -201,7 +207,7 @@ const appUser = { userInfo.avatarUrl = result.avatar; userInfo.refresh = result.refresh; // // 缓存用户信息 - appUser.saveLoginInfo(userInfo || {}); + await appUser.saveLoginInfo(userInfo || {}); // 回调 callback && callback(userInfo || {}); }, diff --git a/src/openeuler/utils/utils.js b/src/openeuler/utils/utils.js index 3e98206..a9e2622 100644 --- a/src/openeuler/utils/utils.js +++ b/src/openeuler/utils/utils.js @@ -30,6 +30,29 @@ let utils = { return fmt; }; }, + setStorageSync(key, data) { + return new Promise((resolve, reject) => { + wx.setStorage({ + key: key, + data: data, + encrypt: true, + success: resolve, + fail: reject, + }); + }); + }, + getStorageSync(key) { + return new Promise((resolve, reject) => { + wx.getStorage({ + key: key, + encrypt: true, + success: (res) => { + resolve(res.data); + }, + fail: reject, + }); + }); + }, }; module.exports = utils; -- Gitee From aeb675fe6d723c65724f0a19d32849e8ea1e5e50 Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Sat, 18 Nov 2023 21:18:17 +0800 Subject: [PATCH 07/10] =?UTF-8?q?docs:=20=E9=9A=90=E7=A7=81=E5=A3=B0?= =?UTF-8?q?=E6=98=8E=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/privacy-text/privacy-text.wxml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openeuler/components/privacy-text/privacy-text.wxml b/src/openeuler/components/privacy-text/privacy-text.wxml index 6dae1d3..525070e 100644 --- a/src/openeuler/components/privacy-text/privacy-text.wxml +++ b/src/openeuler/components/privacy-text/privacy-text.wxml @@ -6,23 +6,23 @@ 版本更新说明 请您仔细阅读此次隐私声明的更新内容: 1. “我们如何收集和处理您的个人信息” 章节中,根据个人信息处理的合法基础进行了刷新。 - 2. “如何访问或控制您的个人信息” 章节中,该等权利刷新为上述权利。 + 2. “我们将保留多久您的个人信息” 章节中,对时间进行了更新。 + 3. “如何访问或控制您的个人信息” 章节中,该等权利刷新为上述权利。 1.我们如何收集和处理您的个人信息 - a ) 当您登录时,我们会收集您的OpenID用于确认您的身份。 + a ) 当您登录时,我们会收集您的OpenID用于,用于记录您微信与本服务的绑定关系,以确保您账号的唯一性。当您收藏会议并同意接收微信通知的消息推送,在会议即将开始前,我们会使用您的微信OpenID通过微信通知为您发送会议开始提醒。 b ) 当您预定会议之前,我们会收集您的Gitee ID和所属SIG组名称,用于配置预定会议权限,并作为会议信息的部分展示在小程序。 c ) 当您预定会议时,如您填写邮箱地址我们会收集填您填写的邮箱并向其发送会议通知。 d ) 当您创建会议后,我们会将您的Gitee ID及会议相关信息同步至本服务页面及openEuler社区网站(https://www.openeuler.org)以便对您的会议感兴趣的个人或组织及时获取相关信息。 e ) 当您创建活动之前,我们会收集您的Gitee ID用于配置活动发布权限。 - f ) 当您为您创建的活动添加议题时,我们会收集您所填写议题的嘉宾名称、职位用于在活动议题的内容中展示。 - g ) 当您在发布活动时,为方便您快速填写活动地址,我们在获取您的明示同意后会关联启动腾讯地图。如您同意启动我们会获取你选择的活动地址信息。 - h ) 当您在保存二维码时,我们会申请您的相册保存权限,保存二维码。 - i ) 当您点击“复制”按钮及复制图标时,我们会使用你的剪切板,用于快速复制信息。 + f ) 当您创建的活动编辑活动地图时,为方便您快速填写活动地址,我们在获取您的明示同意后会关联启动腾讯地图。如您同意启动我们会获取你选择的活动地址。当您为您创建的活动添加议题时,我们会收集您所填写议题的嘉宾名称、职位、议题内容用于在活动议题的内容中及openEuler社区网站(https://www.openeuler.org)展示。 + g ) 当您在保存二维码时,我们会申请您的相册保存权限,保存二维码。 + h ) 当您点击“复制”按钮及复制图标时,我们会使用你的剪切板,用于快速复制信息。 2. 我们在何种情况披露或共享您的个人信息 共享是指我们向第三方披露您的个人信息。我们仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,我们共享这些信息的目的仅限于本声明披露或在您允许的范围内进行。 a) 为了保护国家安全、公共安全以及您和其他个人的重大合法权益而需要共享您的个人信息。 3. 我们将保留多久您的个人信息 我们将会在达成本声明所述目的所需的期限内保留您的个人信息,除非按照法律要求或您的要求需要延长保留期。 - 一般而言,我们会自您使用本服务时获取您的个人信息之日起,根据可适用法律的要求或服务协议的约定,在留存期限内存储或保留您的个人信息。在您的个人信息超出保留期限后,且没有法律要求我们继续处理您的特定个人信息的情况下,我们将会根据可适用法律的要求删除您的个人信息,或进行匿名化处理。 + 一般而言,我们会自您使用本服务时获取您的个人信息之日起,根据可适用法律的要求或服务协议的约定,在36个月留存期限内存储或保留您的个人信息。在您的个人信息超出保留期限后,且没有法律要求我们继续处理您的特定个人信息的情况下,我们将会根据可适用法律的要求删除您的个人信息,或进行匿名化处理。 4. 我们将如何保护您的个人信息 我们重视您的个人信息安全。我们采用适当的物理、管理和技术保障措施来保护您的个人信息。例如,我们会使用加密技术确保信息的机密性;我们会使用保护机制防止信息遭到恶意攻击;我们会部署访问控制机制,确保只有授权人员才可访问个人信息;以及我们会举办安全和隐私保护培训等。总之,我们会尽力保护您的个人信息。尽管如此,任何措施都无法做到无懈可击,也没有任何产品与服务、网站、信息传输、计算机系统、网络连接是绝对安全的。 5. 如何访问或控制您的个人信息 @@ -45,7 +45,7 @@ 如果您对本协议有任何疑问或主张任何与个人信息有关的权利,您可以通过以下方式与我们联系 联系邮箱:contact@openeuler.io 联系热线:+86 18683791700 - 最近更新时间:2023年10月28日 - 隐私声明版本:v2023102801 + 最近更新时间:2023年11月18日 + 隐私声明版本:v202311月18日 \ No newline at end of file -- Gitee From d71b7b44a9fa7e0ca2b6cdb20ecabb858bc83fe8 Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Sat, 18 Nov 2023 21:25:14 +0800 Subject: [PATCH 08/10] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=20console?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/openeuler/package-meeting/meeting/detail.js | 3 --- src/openeuler/package-my/events/my-list.js | 1 - src/openeuler/pages/auth/auth.js | 1 - 3 files changed, 5 deletions(-) diff --git a/src/openeuler/package-meeting/meeting/detail.js b/src/openeuler/package-meeting/meeting/detail.js index 884bf80..b169f79 100644 --- a/src/openeuler/package-meeting/meeting/detail.js +++ b/src/openeuler/package-meeting/meeting/detail.js @@ -122,9 +122,6 @@ Page({ } }); }, - fail(err) { - console.log(err); - }, }); } }, diff --git a/src/openeuler/package-my/events/my-list.js b/src/openeuler/package-my/events/my-list.js index f537475..d1c320b 100644 --- a/src/openeuler/package-my/events/my-list.js +++ b/src/openeuler/package-my/events/my-list.js @@ -5,7 +5,6 @@ const sessionUtil = require('../../utils/app-session.js'); let that = null; let remoteMethods = { getList: function (params, _callback) { - console.log(that.data.type); let service = ''; if (that.data.type == 4) { service = 'GET_DRAFT_LIST'; diff --git a/src/openeuler/pages/auth/auth.js b/src/openeuler/pages/auth/auth.js index 0528ce5..bba834f 100644 --- a/src/openeuler/pages/auth/auth.js +++ b/src/openeuler/pages/auth/auth.js @@ -43,7 +43,6 @@ Page( pages[pages.length - 2]?.route === 'pages/auth/auth' ? pages[pages.length - 3] : pages[pages.length - 2]; // 前一个页面 const id = beforePage?.options.id || that.data.id; const url = id ? '/' + beforePage?.route + '?id=' + id : '/' + beforePage?.route; - console.log(await sessionUtil.getUserInfoByKey('agreePrivacy')); if (!(await sessionUtil.getUserInfoByKey('agreePrivacy'))) { that.setData({ isPrivecyShown: true, -- Gitee From df57df2ffb5679cfbdb77e9a83e28172e15c169b Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Tue, 21 Nov 2023 10:37:58 +0800 Subject: [PATCH 09/10] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/openeuler/config/constants.js | 4 +- .../@vant/weapp/action-sheet/index.js | 74 ---- .../@vant/weapp/action-sheet/index.json | 8 - .../@vant/weapp/action-sheet/index.wxml | 69 ---- .../@vant/weapp/action-sheet/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/area/index.js | 235 ----------- .../@vant/weapp/area/index.json | 6 - .../@vant/weapp/area/index.wxml | 20 - .../@vant/weapp/area/index.wxs | 8 - .../@vant/weapp/area/index.wxss | 1 - .../@vant/weapp/button/index.js | 67 ---- .../@vant/weapp/button/index.json | 7 - .../@vant/weapp/button/index.wxml | 56 --- .../@vant/weapp/button/index.wxs | 39 -- .../@vant/weapp/button/index.wxss | 1 - .../@vant/weapp/calendar/calendar.wxml | 68 ---- .../weapp/calendar/components/header/index.js | 45 --- .../calendar/components/header/index.json | 3 - .../calendar/components/header/index.wxml | 16 - .../calendar/components/header/index.wxss | 1 - .../weapp/calendar/components/month/index.js | 158 -------- .../calendar/components/month/index.json | 3 - .../calendar/components/month/index.wxml | 39 -- .../weapp/calendar/components/month/index.wxs | 71 ---- .../calendar/components/month/index.wxss | 1 - .../@vant/weapp/calendar/index.js | 379 ------------------ .../@vant/weapp/calendar/index.json | 10 - .../@vant/weapp/calendar/index.wxml | 26 -- .../@vant/weapp/calendar/index.wxs | 37 -- .../@vant/weapp/calendar/index.wxss | 1 - .../@vant/weapp/calendar/utils.js | 97 ----- .../@vant/weapp/calendar/utils.wxs | 25 -- .../miniprogram_npm/@vant/weapp/card/index.js | 51 --- .../@vant/weapp/card/index.json | 6 - .../@vant/weapp/card/index.wxml | 56 --- .../@vant/weapp/card/index.wxss | 1 - .../@vant/weapp/cell-group/index.js | 13 - .../@vant/weapp/cell-group/index.json | 3 - .../@vant/weapp/cell-group/index.wxml | 11 - .../@vant/weapp/cell-group/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/cell/index.js | 40 -- .../@vant/weapp/cell/index.json | 6 - .../@vant/weapp/cell/index.wxml | 47 --- .../@vant/weapp/cell/index.wxs | 17 - .../@vant/weapp/cell/index.wxss | 1 - .../@vant/weapp/checkbox-group/index.js | 39 -- .../@vant/weapp/checkbox-group/index.json | 3 - .../@vant/weapp/checkbox-group/index.wxml | 5 - .../@vant/weapp/checkbox-group/index.wxss | 1 - .../@vant/weapp/checkbox/index.js | 79 ---- .../@vant/weapp/checkbox/index.json | 6 - .../@vant/weapp/checkbox/index.wxml | 31 -- .../@vant/weapp/checkbox/index.wxs | 20 - .../@vant/weapp/checkbox/index.wxss | 1 - .../@vant/weapp/circle/canvas.js | 47 --- .../@vant/weapp/circle/index.js | 207 ---------- .../@vant/weapp/circle/index.json | 3 - .../@vant/weapp/circle/index.wxml | 9 - .../@vant/weapp/circle/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/col/index.js | 11 - .../@vant/weapp/col/index.json | 3 - .../@vant/weapp/col/index.wxml | 9 - .../miniprogram_npm/@vant/weapp/col/index.wxs | 18 - .../@vant/weapp/col/index.wxss | 1 - .../@vant/weapp/collapse-item/animate.js | 43 -- .../@vant/weapp/collapse-item/index.js | 62 --- .../@vant/weapp/collapse-item/index.json | 6 - .../@vant/weapp/collapse-item/index.wxml | 45 --- .../@vant/weapp/collapse-item/index.wxss | 1 - .../@vant/weapp/collapse/index.js | 48 --- .../@vant/weapp/collapse/index.json | 3 - .../@vant/weapp/collapse/index.wxml | 3 - .../@vant/weapp/collapse/index.wxss | 1 - .../@vant/weapp/common/color.js | 10 - .../@vant/weapp/common/component.js | 49 --- .../@vant/weapp/common/index.wxss | 1 - .../@vant/weapp/common/relation.js | 65 --- .../@vant/weapp/common/style/clearfix.wxss | 1 - .../@vant/weapp/common/style/ellipsis.wxss | 1 - .../@vant/weapp/common/style/hairline.wxss | 1 - .../weapp/common/style/mixins/clearfix.wxss | 0 .../weapp/common/style/mixins/ellipsis.wxss | 0 .../weapp/common/style/mixins/hairline.wxss | 0 .../@vant/weapp/common/style/var.wxss | 0 .../@vant/weapp/common/utils.js | 107 ----- .../@vant/weapp/common/validator.js | 43 -- .../@vant/weapp/common/version.js | 70 ---- .../@vant/weapp/count-down/index.js | 104 ----- .../@vant/weapp/count-down/index.json | 3 - .../@vant/weapp/count-down/index.wxml | 4 - .../@vant/weapp/count-down/index.wxss | 1 - .../@vant/weapp/count-down/utils.js | 64 --- .../@vant/weapp/datetime-picker/index.js | 329 --------------- .../@vant/weapp/datetime-picker/index.json | 6 - .../@vant/weapp/datetime-picker/index.wxml | 16 - .../@vant/weapp/datetime-picker/index.wxss | 1 - .../@vant/weapp/definitions/index.js | 2 - .../@vant/weapp/dialog/dialog.js | 92 ----- .../@vant/weapp/dialog/index.js | 131 ------ .../@vant/weapp/dialog/index.json | 9 - .../@vant/weapp/dialog/index.wxml | 122 ------ .../@vant/weapp/dialog/index.wxss | 1 - .../@vant/weapp/divider/index.js | 14 - .../@vant/weapp/divider/index.json | 4 - .../@vant/weapp/divider/index.wxml | 9 - .../@vant/weapp/divider/index.wxs | 18 - .../@vant/weapp/divider/index.wxss | 1 - .../@vant/weapp/dropdown-item/index.js | 136 ------- .../@vant/weapp/dropdown-item/index.json | 8 - .../@vant/weapp/dropdown-item/index.wxml | 50 --- .../@vant/weapp/dropdown-item/index.wxss | 1 - .../@vant/weapp/dropdown-item/shared.js | 2 - .../@vant/weapp/dropdown-menu/index.js | 122 ------ .../@vant/weapp/dropdown-menu/index.json | 3 - .../@vant/weapp/dropdown-menu/index.wxml | 23 -- .../@vant/weapp/dropdown-menu/index.wxs | 16 - .../@vant/weapp/dropdown-menu/index.wxss | 1 - .../@vant/weapp/empty/index.js | 12 - .../@vant/weapp/empty/index.json | 4 - .../@vant/weapp/empty/index.wxml | 22 - .../@vant/weapp/empty/index.wxs | 15 - .../@vant/weapp/empty/index.wxss | 1 - .../@vant/weapp/field/index.js | 137 ------- .../@vant/weapp/field/index.json | 7 - .../@vant/weapp/field/index.wxml | 56 --- .../@vant/weapp/field/index.wxs | 18 - .../@vant/weapp/field/index.wxss | 1 - .../@vant/weapp/field/input.wxml | 29 -- .../@vant/weapp/field/props.js | 67 ---- .../@vant/weapp/field/textarea.wxml | 30 -- .../@vant/weapp/goods-action-button/index.js | 42 -- .../weapp/goods-action-button/index.json | 6 - .../weapp/goods-action-button/index.wxml | 33 -- .../weapp/goods-action-button/index.wxss | 1 - .../@vant/weapp/goods-action-icon/index.js | 29 -- .../@vant/weapp/goods-action-icon/index.json | 7 - .../@vant/weapp/goods-action-icon/index.wxml | 41 -- .../@vant/weapp/goods-action-icon/index.wxss | 1 - .../@vant/weapp/goods-action/index.js | 17 - .../@vant/weapp/goods-action/index.json | 3 - .../@vant/weapp/goods-action/index.wxml | 5 - .../@vant/weapp/goods-action/index.wxss | 1 - .../@vant/weapp/grid-item/index.js | 54 --- .../@vant/weapp/grid-item/index.json | 6 - .../@vant/weapp/grid-item/index.wxml | 27 -- .../@vant/weapp/grid-item/index.wxs | 32 -- .../@vant/weapp/grid-item/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/grid/index.js | 57 --- .../@vant/weapp/grid/index.json | 3 - .../@vant/weapp/grid/index.wxml | 8 - .../@vant/weapp/grid/index.wxs | 13 - .../@vant/weapp/grid/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/icon/index.js | 23 -- .../@vant/weapp/icon/index.json | 6 - .../@vant/weapp/icon/index.wxml | 20 - .../@vant/weapp/icon/index.wxs | 43 -- .../@vant/weapp/icon/index.wxss | 1 - .../@vant/weapp/image/index.js | 66 --- .../@vant/weapp/image/index.json | 7 - .../@vant/weapp/image/index.wxml | 35 -- .../@vant/weapp/image/index.wxs | 32 -- .../@vant/weapp/image/index.wxss | 1 - .../@vant/weapp/index-anchor/index.js | 28 -- .../@vant/weapp/index-anchor/index.json | 3 - .../@vant/weapp/index-anchor/index.wxml | 14 - .../@vant/weapp/index-anchor/index.wxss | 1 - .../@vant/weapp/index-bar/index.js | 243 ----------- .../@vant/weapp/index-bar/index.json | 3 - .../@vant/weapp/index-bar/index.wxml | 22 - .../@vant/weapp/index-bar/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/info/index.js | 10 - .../@vant/weapp/info/index.json | 3 - .../@vant/weapp/info/index.wxml | 7 - .../@vant/weapp/info/index.wxss | 1 - .../@vant/weapp/loading/index.js | 18 - .../@vant/weapp/loading/index.json | 3 - .../@vant/weapp/loading/index.wxml | 19 - .../@vant/weapp/loading/index.wxs | 22 - .../@vant/weapp/loading/index.wxss | 1 - .../@vant/weapp/mixins/basic.js | 14 - .../@vant/weapp/mixins/button.js | 54 --- .../@vant/weapp/mixins/link.js | 27 -- .../@vant/weapp/mixins/page-scroll.js | 47 --- .../@vant/weapp/mixins/touch.js | 40 -- .../@vant/weapp/mixins/transition.js | 124 ------ .../@vant/weapp/nav-bar/index.js | 68 ---- .../@vant/weapp/nav-bar/index.json | 6 - .../@vant/weapp/nav-bar/index.wxml | 42 -- .../@vant/weapp/nav-bar/index.wxs | 13 - .../@vant/weapp/nav-bar/index.wxss | 1 - .../@vant/weapp/notice-bar/index.js | 125 ------ .../@vant/weapp/notice-bar/index.json | 6 - .../@vant/weapp/notice-bar/index.wxml | 38 -- .../@vant/weapp/notice-bar/index.wxs | 15 - .../@vant/weapp/notice-bar/index.wxss | 1 - .../@vant/weapp/notify/index.js | 68 ---- .../@vant/weapp/notify/index.json | 6 - .../@vant/weapp/notify/index.wxml | 21 - .../@vant/weapp/notify/index.wxs | 22 - .../@vant/weapp/notify/index.wxss | 1 - .../@vant/weapp/notify/notify.js | 67 ---- .../@vant/weapp/overlay/index.js | 32 -- .../@vant/weapp/overlay/index.json | 6 - .../@vant/weapp/overlay/index.wxml | 7 - .../@vant/weapp/overlay/index.wxss | 1 - .../@vant/weapp/panel/index.js | 11 - .../@vant/weapp/panel/index.json | 6 - .../@vant/weapp/panel/index.wxml | 19 - .../@vant/weapp/panel/index.wxss | 1 - .../@vant/weapp/picker-column/index.js | 122 ------ .../@vant/weapp/picker-column/index.json | 3 - .../@vant/weapp/picker-column/index.wxml | 23 -- .../@vant/weapp/picker-column/index.wxs | 36 -- .../@vant/weapp/picker-column/index.wxss | 1 - .../@vant/weapp/picker/index.js | 161 -------- .../@vant/weapp/picker/index.json | 7 - .../@vant/weapp/picker/index.wxml | 37 -- .../@vant/weapp/picker/index.wxs | 42 -- .../@vant/weapp/picker/index.wxss | 1 - .../@vant/weapp/picker/shared.js | 24 -- .../@vant/weapp/picker/toolbar.wxml | 23 -- .../@vant/weapp/popup/index.js | 99 ----- .../@vant/weapp/popup/index.json | 7 - .../@vant/weapp/popup/index.wxml | 21 - .../@vant/weapp/popup/index.wxs | 18 - .../@vant/weapp/popup/index.wxss | 1 - .../@vant/weapp/progress/index.js | 55 --- .../@vant/weapp/progress/index.json | 3 - .../@vant/weapp/progress/index.wxml | 20 - .../@vant/weapp/progress/index.wxs | 36 -- .../@vant/weapp/progress/index.wxss | 1 - .../@vant/weapp/radio-group/index.js | 24 -- .../@vant/weapp/radio-group/index.json | 3 - .../@vant/weapp/radio-group/index.wxml | 5 - .../@vant/weapp/radio-group/index.wxss | 1 - .../@vant/weapp/radio/index.js | 68 ---- .../@vant/weapp/radio/index.json | 6 - .../@vant/weapp/radio/index.wxml | 30 -- .../@vant/weapp/radio/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/rate/index.js | 93 ----- .../@vant/weapp/rate/index.json | 6 - .../@vant/weapp/rate/index.wxml | 35 -- .../@vant/weapp/rate/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/row/index.js | 26 -- .../@vant/weapp/row/index.json | 3 - .../@vant/weapp/row/index.wxml | 5 - .../miniprogram_npm/@vant/weapp/row/index.wxs | 18 - .../@vant/weapp/row/index.wxss | 1 - .../@vant/weapp/search/index.js | 100 ----- .../@vant/weapp/search/index.json | 6 - .../@vant/weapp/search/index.wxml | 54 --- .../@vant/weapp/search/index.wxss | 1 - .../@vant/weapp/share-sheet/index.js | 57 --- .../@vant/weapp/share-sheet/index.json | 7 - .../@vant/weapp/share-sheet/index.wxml | 46 --- .../@vant/weapp/share-sheet/index.wxs | 12 - .../@vant/weapp/share-sheet/index.wxss | 1 - .../@vant/weapp/share-sheet/options.js | 27 -- .../@vant/weapp/share-sheet/options.json | 3 - .../@vant/weapp/share-sheet/options.wxml | 20 - .../@vant/weapp/share-sheet/options.wxs | 14 - .../@vant/weapp/share-sheet/options.wxss | 1 - .../@vant/weapp/sidebar-item/index.js | 32 -- .../@vant/weapp/sidebar-item/index.json | 6 - .../@vant/weapp/sidebar-item/index.wxml | 18 - .../@vant/weapp/sidebar-item/index.wxss | 1 - .../@vant/weapp/sidebar/index.js | 36 -- .../@vant/weapp/sidebar/index.json | 3 - .../@vant/weapp/sidebar/index.wxml | 3 - .../@vant/weapp/sidebar/index.wxss | 1 - .../@vant/weapp/skeleton/index.js | 48 --- .../@vant/weapp/skeleton/index.json | 4 - .../@vant/weapp/skeleton/index.wxml | 29 -- .../@vant/weapp/skeleton/index.wxss | 1 - .../@vant/weapp/slider/index.js | 206 ---------- .../@vant/weapp/slider/index.json | 3 - .../@vant/weapp/slider/index.wxml | 68 ---- .../@vant/weapp/slider/index.wxs | 14 - .../@vant/weapp/slider/index.wxss | 1 - .../@vant/weapp/stepper/index.js | 203 ---------- .../@vant/weapp/stepper/index.json | 3 - .../@vant/weapp/stepper/index.wxml | 43 -- .../@vant/weapp/stepper/index.wxs | 22 - .../@vant/weapp/stepper/index.wxss | 1 - .../@vant/weapp/steps/index.js | 35 -- .../@vant/weapp/steps/index.json | 6 - .../@vant/weapp/steps/index.wxml | 54 --- .../@vant/weapp/steps/index.wxss | 1 - .../@vant/weapp/sticky/index.js | 126 ------ .../@vant/weapp/sticky/index.json | 3 - .../@vant/weapp/sticky/index.wxml | 8 - .../@vant/weapp/sticky/index.wxs | 25 -- .../@vant/weapp/sticky/index.wxss | 1 - .../@vant/weapp/submit-bar/index.js | 58 --- .../@vant/weapp/submit-bar/index.json | 7 - .../@vant/weapp/submit-bar/index.wxml | 44 -- .../@vant/weapp/submit-bar/index.wxss | 1 - .../@vant/weapp/swipe-cell/index.js | 135 ------- .../@vant/weapp/swipe-cell/index.json | 3 - .../@vant/weapp/swipe-cell/index.wxml | 20 - .../@vant/weapp/swipe-cell/index.wxss | 1 - .../@vant/weapp/switch/index.js | 38 -- .../@vant/weapp/switch/index.json | 6 - .../@vant/weapp/switch/index.wxml | 16 - .../@vant/weapp/switch/index.wxs | 26 -- .../@vant/weapp/switch/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/tab/index.js | 58 --- .../@vant/weapp/tab/index.json | 3 - .../@vant/weapp/tab/index.wxml | 8 - .../@vant/weapp/tab/index.wxss | 1 - .../@vant/weapp/tabbar-item/index.js | 70 ---- .../@vant/weapp/tabbar-item/index.json | 7 - .../@vant/weapp/tabbar-item/index.wxml | 28 -- .../@vant/weapp/tabbar-item/index.wxss | 1 - .../@vant/weapp/tabbar/index.js | 68 ---- .../@vant/weapp/tabbar/index.json | 3 - .../@vant/weapp/tabbar/index.wxml | 10 - .../@vant/weapp/tabbar/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/tabs/index.js | 327 --------------- .../@vant/weapp/tabs/index.json | 7 - .../@vant/weapp/tabs/index.wxml | 63 --- .../@vant/weapp/tabs/index.wxs | 83 ---- .../@vant/weapp/tabs/index.wxss | 1 - .../miniprogram_npm/@vant/weapp/tag/index.js | 23 -- .../@vant/weapp/tag/index.json | 6 - .../@vant/weapp/tag/index.wxml | 15 - .../miniprogram_npm/@vant/weapp/tag/index.wxs | 13 - .../@vant/weapp/tag/index.wxss | 1 - .../@vant/weapp/toast/index.js | 31 -- .../@vant/weapp/toast/index.json | 9 - .../@vant/weapp/toast/index.wxml | 36 -- .../@vant/weapp/toast/index.wxss | 1 - .../@vant/weapp/toast/toast.js | 83 ---- .../@vant/weapp/transition/index.js | 15 - .../@vant/weapp/transition/index.json | 3 - .../@vant/weapp/transition/index.wxml | 10 - .../@vant/weapp/transition/index.wxs | 17 - .../@vant/weapp/transition/index.wxss | 1 - .../@vant/weapp/tree-select/index.js | 70 ---- .../@vant/weapp/tree-select/index.json | 8 - .../@vant/weapp/tree-select/index.wxml | 41 -- .../@vant/weapp/tree-select/index.wxs | 12 - .../@vant/weapp/tree-select/index.wxss | 1 - .../@vant/weapp/uploader/index.js | 183 --------- .../@vant/weapp/uploader/index.json | 7 - .../@vant/weapp/uploader/index.wxml | 84 ---- .../@vant/weapp/uploader/index.wxs | 17 - .../@vant/weapp/uploader/index.wxss | 1 - .../@vant/weapp/uploader/shared.js | 60 --- .../@vant/weapp/uploader/utils.js | 112 ------ .../@vant/weapp/wxs/add-unit.wxs | 12 - .../miniprogram_npm/@vant/weapp/wxs/array.wxs | 5 - .../miniprogram_npm/@vant/weapp/wxs/bem.wxs | 39 -- .../@vant/weapp/wxs/memoize.wxs | 55 --- .../@vant/weapp/wxs/object.wxs | 13 - .../miniprogram_npm/@vant/weapp/wxs/style.wxs | 42 -- .../miniprogram_npm/@vant/weapp/wxs/utils.wxs | 10 - .../package-events/events/event-detail.wxml | 24 +- .../package-events/events/event-list.js | 13 - .../package-events/events/event-list.wxml | 18 +- .../package-events/publish/success.js | 6 - .../package-meeting/reserve/reserve.js | 1 + src/openeuler/package-my/events/my-list.js | 35 +- src/openeuler/package-my/events/my-list.wxml | 20 +- src/openeuler/package-my/my/privecy-seting.js | 12 +- .../package-my/my/privecy-seting.wxml | 2 +- src/openeuler/pages/events/events.js | 23 +- src/openeuler/pages/events/events.wxml | 16 +- src/openeuler/pages/my/my.js | 1 - src/openeuler/project.private.config.json | 3 +- 370 files changed, 47 insertions(+), 11164 deletions(-) delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/area/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/area/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/button/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/button/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/card/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/card/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/col/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/col/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/color.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/component.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/style/var.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/common/version.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/field/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/field/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/field/props.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action-button/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action-button/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action-button/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action-button/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action-icon/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action-icon/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action-icon/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action-icon/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/goods-action/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid-item/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid-item/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid-item/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid-item/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid-item/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/grid/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/icon/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/icon/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/icon/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/icon/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/icon/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/image/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/image/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/image/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/image/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/image/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/index-anchor/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/index-anchor/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/index-anchor/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/index-anchor/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/index-bar/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/index-bar/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/index-bar/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/index-bar/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/info/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/info/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/info/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/info/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/loading/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/loading/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/loading/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/loading/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/loading/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/mixins/basic.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/mixins/button.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/mixins/link.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/mixins/page-scroll.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/mixins/touch.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/mixins/transition.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/nav-bar/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/nav-bar/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/nav-bar/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/nav-bar/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/nav-bar/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notice-bar/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notice-bar/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notice-bar/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notice-bar/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notice-bar/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notify/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notify/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notify/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notify/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notify/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/notify/notify.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/overlay/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/overlay/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/overlay/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/overlay/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/panel/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/panel/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/panel/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/panel/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker-column/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker-column/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker-column/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker-column/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker-column/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker/shared.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/picker/toolbar.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/popup/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/popup/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/popup/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/popup/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/popup/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/progress/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/progress/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/progress/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/progress/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/progress/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/radio-group/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/radio-group/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/radio-group/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/radio-group/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/radio/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/radio/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/radio/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/radio/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/rate/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/rate/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/rate/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/rate/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/row/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/row/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/row/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/row/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/row/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/search/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/search/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/search/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/search/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/options.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/options.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/options.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/options.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/share-sheet/options.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sidebar-item/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sidebar-item/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sidebar-item/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sidebar-item/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sidebar/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sidebar/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sidebar/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sidebar/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/skeleton/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/skeleton/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/skeleton/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/skeleton/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/slider/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/slider/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/slider/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/slider/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/slider/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/stepper/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/stepper/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/stepper/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/stepper/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/stepper/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/steps/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/steps/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/steps/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/steps/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sticky/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sticky/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sticky/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sticky/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/sticky/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/submit-bar/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/submit-bar/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/submit-bar/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/submit-bar/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/swipe-cell/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/swipe-cell/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/swipe-cell/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/swipe-cell/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/switch/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/switch/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/switch/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/switch/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/switch/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tab/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tab/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tab/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tab/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabbar-item/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabbar-item/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabbar-item/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabbar-item/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabbar/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabbar/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabbar/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabbar/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabs/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabs/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabs/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabs/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tabs/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tag/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tag/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tag/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tag/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tag/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/toast/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/toast/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/toast/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/toast/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/toast/toast.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/transition/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/transition/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/transition/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/transition/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/transition/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tree-select/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tree-select/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tree-select/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tree-select/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/tree-select/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/uploader/index.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/uploader/index.json delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/uploader/index.wxml delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/uploader/index.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/uploader/index.wxss delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/uploader/shared.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/uploader/utils.js delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/wxs/add-unit.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/wxs/array.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/wxs/bem.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/wxs/memoize.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/wxs/object.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/wxs/style.wxs delete mode 100644 src/openeuler/miniprogram_npm/@vant/weapp/wxs/utils.wxs diff --git a/src/openeuler/config/constants.js b/src/openeuler/config/constants.js index 0151ce9..1a303d5 100644 --- a/src/openeuler/config/constants.js +++ b/src/openeuler/config/constants.js @@ -5,9 +5,9 @@ let _ = require('../utils/underscore-extend.js'); // 服务连接配置 let serviceConfig = { - SERVICE_URL: 'https://api.openeuler.org/meetings', // 正式环境 + // SERVICE_URL: 'https://api.openeuler.org/meetings', // 正式环境 // SERVICE_URL: 'https://meetingserver-openeuler.test.osinfra.cn', // 测试环境 - // SERVICE_URL: 'https://meetings-beta.openeuler.org', // 测试环境 + SERVICE_URL: 'https://meetings-beta.openeuler.org', // 测试环境 }; // 存储配置 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js deleted file mode 100644 index a39818a..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var button_1 = require("../mixins/button"); -(0, component_1.VantComponent)({ - classes: ['list-class'], - mixins: [button_1.button], - props: { - show: Boolean, - title: String, - cancelText: String, - description: String, - round: { - type: Boolean, - value: true, - }, - zIndex: { - type: Number, - value: 100, - }, - actions: { - type: Array, - value: [], - }, - overlay: { - type: Boolean, - value: true, - }, - closeOnClickOverlay: { - type: Boolean, - value: true, - }, - closeOnClickAction: { - type: Boolean, - value: true, - }, - safeAreaInsetBottom: { - type: Boolean, - value: true, - }, - }, - methods: { - onSelect: function (event) { - var _this = this; - var index = event.currentTarget.dataset.index; - var _a = this.data, actions = _a.actions, closeOnClickAction = _a.closeOnClickAction, canIUseGetUserProfile = _a.canIUseGetUserProfile; - var item = actions[index]; - if (item) { - this.$emit('select', item); - if (closeOnClickAction) { - this.onClose(); - } - if (item.openType === 'getUserInfo' && canIUseGetUserProfile) { - wx.getUserProfile({ - desc: item.getUserProfileDesc || ' ', - complete: function (userProfile) { - _this.$emit('getuserinfo', userProfile); - }, - }); - } - } - }, - onCancel: function () { - this.$emit('cancel'); - }, - onClose: function () { - this.$emit('close'); - }, - onClickOverlay: function () { - this.$emit('click-overlay'); - this.onClose(); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json deleted file mode 100644 index 19bf989..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-icon": "../icon/index", - "van-popup": "../popup/index", - "van-loading": "../loading/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml deleted file mode 100644 index d59a45d..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - {{ title }} - - - - {{ description }} - - - - - - - - - - {{ cancelText }} - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss deleted file mode 100644 index eedd361..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-action-sheet{color:var(--action-sheet-item-text-color,#323233);max-height:var(--action-sheet-max-height,90%)!important}.van-action-sheet__cancel,.van-action-sheet__item{background-color:var(--action-sheet-item-background,#fff);font-size:var(--action-sheet-item-font-size,16px);line-height:var(--action-sheet-item-line-height,22px);padding:14px 16px;text-align:center}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5}.van-action-sheet__cancel:after,.van-action-sheet__item:after{border-width:0}.van-action-sheet__cancel{color:var(--action-sheet-cancel-text-color,#646566)}.van-action-sheet__gap{background-color:var(--action-sheet-cancel-padding-color,#f7f8fa);display:block;height:var(--action-sheet-cancel-padding-top,8px)}.van-action-sheet__item--disabled{color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{color:var(--action-sheet-subname-color,#969799);font-size:var(--action-sheet-subname-font-size,12px);line-height:var(--action-sheet-subname-line-height,20px);margin-top:var(--padding-xs,8px)}.van-action-sheet__header{font-size:var(--action-sheet-header-font-size,16px);font-weight:var(--font-weight-bold,500);line-height:var(--action-sheet-header-height,48px);text-align:center}.van-action-sheet__description{color:var(--action-sheet-description-color,#969799);font-size:var(--action-sheet-description-font-size,14px);line-height:var(--action-sheet-description-line-height,20px);padding:20px var(--padding-md,16px);text-align:center}.van-action-sheet__close{color:var(--action-sheet-close-icon-color,#c8c9cc);font-size:var(--action-sheet-close-icon-size,22px)!important;line-height:inherit!important;padding:var(--action-sheet-close-icon-padding,0 16px);position:absolute!important;right:0;top:0}.van-action-sheet__loading{display:flex!important} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js deleted file mode 100644 index 73de66d..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js +++ /dev/null @@ -1,235 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var shared_1 = require("../picker/shared"); -var utils_1 = require("../common/utils"); -var EMPTY_CODE = '000000'; -(0, component_1.VantComponent)({ - classes: ['active-class', 'toolbar-class', 'column-class'], - props: __assign(__assign({}, shared_1.pickerProps), { showToolbar: { - type: Boolean, - value: true, - }, value: { - type: String, - observer: function (value) { - this.code = value; - this.setValues(); - }, - }, areaList: { - type: Object, - value: {}, - observer: 'setValues', - }, columnsNum: { - type: null, - value: 3, - }, columnsPlaceholder: { - type: Array, - observer: function (val) { - this.setData({ - typeToColumnsPlaceholder: { - province: val[0] || '', - city: val[1] || '', - county: val[2] || '', - }, - }); - }, - } }), - data: { - columns: [{ values: [] }, { values: [] }, { values: [] }], - typeToColumnsPlaceholder: {}, - }, - mounted: function () { - var _this = this; - (0, utils_1.requestAnimationFrame)(function () { - _this.setValues(); - }); - }, - methods: { - getPicker: function () { - if (this.picker == null) { - this.picker = this.selectComponent('.van-area__picker'); - } - return this.picker; - }, - onCancel: function (event) { - this.emit('cancel', event.detail); - }, - onConfirm: function (event) { - var index = event.detail.index; - var value = event.detail.value; - value = this.parseValues(value); - this.emit('confirm', { value: value, index: index }); - }, - emit: function (type, detail) { - detail.values = detail.value; - delete detail.value; - this.$emit(type, detail); - }, - parseValues: function (values) { - var columnsPlaceholder = this.data.columnsPlaceholder; - return values.map(function (value, index) { - if (value && - (!value.code || value.name === columnsPlaceholder[index])) { - return __assign(__assign({}, value), { code: '', name: '' }); - } - return value; - }); - }, - onChange: function (event) { - var _this = this; - var _a; - var _b = event.detail, index = _b.index, picker = _b.picker, value = _b.value; - this.code = value[index].code; - (_a = this.setValues()) === null || _a === void 0 ? void 0 : _a.then(function () { - _this.$emit('change', { - picker: picker, - values: _this.parseValues(picker.getValues()), - index: index, - }); - }); - }, - getConfig: function (type) { - var areaList = this.data.areaList; - return (areaList && areaList["".concat(type, "_list")]) || {}; - }, - getList: function (type, code) { - if (type !== 'province' && !code) { - return []; - } - var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder; - var list = this.getConfig(type); - var result = Object.keys(list).map(function (code) { return ({ - code: code, - name: list[code], - }); }); - if (code != null) { - // oversea code - if (code[0] === '9' && type === 'city') { - code = '9'; - } - result = result.filter(function (item) { return item.code.indexOf(code) === 0; }); - } - if (typeToColumnsPlaceholder[type] && result.length) { - // set columns placeholder - var codeFill = type === 'province' - ? '' - : type === 'city' - ? EMPTY_CODE.slice(2, 4) - : EMPTY_CODE.slice(4, 6); - result.unshift({ - code: "".concat(code).concat(codeFill), - name: typeToColumnsPlaceholder[type], - }); - } - return result; - }, - getIndex: function (type, code) { - var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; - var list = this.getList(type, code.slice(0, compareNum - 2)); - // oversea code - if (code[0] === '9' && type === 'province') { - compareNum = 1; - } - code = code.slice(0, compareNum); - for (var i = 0; i < list.length; i++) { - if (list[i].code.slice(0, compareNum) === code) { - return i; - } - } - return 0; - }, - setValues: function () { - var picker = this.getPicker(); - if (!picker) { - return; - } - var code = this.code || this.getDefaultCode(); - var provinceList = this.getList('province'); - var cityList = this.getList('city', code.slice(0, 2)); - var stack = []; - var indexes = []; - var columnsNum = this.data.columnsNum; - if (columnsNum >= 1) { - stack.push(picker.setColumnValues(0, provinceList, false)); - indexes.push(this.getIndex('province', code)); - } - if (columnsNum >= 2) { - stack.push(picker.setColumnValues(1, cityList, false)); - indexes.push(this.getIndex('city', code)); - if (cityList.length && code.slice(2, 4) === '00') { - code = cityList[0].code; - } - } - if (columnsNum === 3) { - stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4)), false)); - indexes.push(this.getIndex('county', code)); - } - return Promise.all(stack) - .catch(function () { }) - .then(function () { return picker.setIndexes(indexes); }) - .catch(function () { }); - }, - getDefaultCode: function () { - var columnsPlaceholder = this.data.columnsPlaceholder; - if (columnsPlaceholder.length) { - return EMPTY_CODE; - } - var countyCodes = Object.keys(this.getConfig('county')); - if (countyCodes[0]) { - return countyCodes[0]; - } - var cityCodes = Object.keys(this.getConfig('city')); - if (cityCodes[0]) { - return cityCodes[0]; - } - return ''; - }, - getValues: function () { - var picker = this.getPicker(); - if (!picker) { - return []; - } - return this.parseValues(picker.getValues().filter(function (value) { return !!value; })); - }, - getDetail: function () { - var values = this.getValues(); - var area = { - code: '', - country: '', - province: '', - city: '', - county: '', - }; - if (!values.length) { - return area; - } - var names = values.map(function (item) { return item.name; }); - area.code = values[values.length - 1].code; - if (area.code[0] === '9') { - area.country = names[1] || ''; - area.province = names[2] || ''; - } - else { - area.province = names[0] || ''; - area.city = names[1] || ''; - area.county = names[2] || ''; - } - return area; - }, - reset: function (code) { - this.code = code || ''; - return this.setValues(); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json deleted file mode 100644 index a778e91..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-picker": "../picker/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml deleted file mode 100644 index 3a437b7..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs deleted file mode 100644 index 07723c1..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable */ -function displayColumns(columns, columnsNum) { - return columns.slice(0, +columnsNum); -} - -module.exports = { - displayColumns: displayColumns, -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxss deleted file mode 100644 index 99694d6..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js deleted file mode 100644 index 984135c..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var button_1 = require("../mixins/button"); -var version_1 = require("../common/version"); -var mixins = [button_1.button]; -if ((0, version_1.canIUseFormFieldButton)()) { - mixins.push('wx://form-field-button'); -} -(0, component_1.VantComponent)({ - mixins: mixins, - classes: ['hover-class', 'loading-class'], - data: { - baseStyle: '', - }, - props: { - formType: String, - icon: String, - classPrefix: { - type: String, - value: 'van-icon', - }, - plain: Boolean, - block: Boolean, - round: Boolean, - square: Boolean, - loading: Boolean, - hairline: Boolean, - disabled: Boolean, - loadingText: String, - customStyle: String, - loadingType: { - type: String, - value: 'circular', - }, - type: { - type: String, - value: 'default', - }, - dataset: null, - size: { - type: String, - value: 'normal', - }, - loadingSize: { - type: String, - value: '20px', - }, - color: String, - }, - methods: { - onClick: function (event) { - var _this = this; - this.$emit('click', event); - var _a = this.data, canIUseGetUserProfile = _a.canIUseGetUserProfile, openType = _a.openType, getUserProfileDesc = _a.getUserProfileDesc, lang = _a.lang; - if (openType === 'getUserInfo' && canIUseGetUserProfile) { - wx.getUserProfile({ - desc: getUserProfileDesc || ' ', - lang: lang || 'en', - complete: function (userProfile) { - _this.$emit('getuserinfo', userProfile); - }, - }); - } - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json deleted file mode 100644 index e00a588..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-icon": "../icon/index", - "van-loading": "../loading/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml deleted file mode 100644 index e7f60f1..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml +++ /dev/null @@ -1,56 +0,0 @@ - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs deleted file mode 100644 index 8b649fe..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable */ -var style = require('../wxs/style.wxs'); - -function rootStyle(data) { - if (!data.color) { - return data.customStyle; - } - - var properties = { - color: data.plain ? data.color : '#fff', - background: data.plain ? null : data.color, - }; - - // hide border when color is linear-gradient - if (data.color.indexOf('gradient') !== -1) { - properties.border = 0; - } else { - properties['border-color'] = data.color; - } - - return style([properties, data.customStyle]); -} - -function loadingColor(data) { - if (data.plain) { - return data.color ? data.color : '#c9c9c9'; - } - - if (data.type === 'default') { - return '#c9c9c9'; - } - - return '#fff'; -} - -module.exports = { - rootStyle: rootStyle, - loadingColor: loadingColor, -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss deleted file mode 100644 index bd8bb5a..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-button{-webkit-text-size-adjust:100%;align-items:center;-webkit-appearance:none;border-radius:var(--button-border-radius,2px);box-sizing:border-box;display:inline-flex;font-size:var(--button-default-font-size,16px);height:var(--button-default-height,44px);justify-content:center;line-height:var(--button-line-height,20px);padding:0;position:relative;text-align:center;transition:opacity .2s;vertical-align:middle}.van-button:before{background-color:#000;border:inherit;border-color:#000;border-radius:inherit;content:" ";height:100%;left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{background:var(--button-default-background-color,#fff);border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0);color:var(--button-default-color,#323233)}.van-button--primary{background:var(--button-primary-background-color,#07c160);border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160);color:var(--button-primary-color,#fff)}.van-button--info{background:var(--button-info-background-color,#1989fa);border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa);color:var(--button-info-color,#fff)}.van-button--danger{background:var(--button-danger-background-color,#ee0a24);border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24);color:var(--button-danger-color,#fff)}.van-button--warning{background:var(--button-warning-background-color,#ff976a);border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a);color:var(--button-warning-color,#fff)}.van-button--plain{background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:var(--button-warning-background-color,#ff976a)}.van-button--large{height:var(--button-large-height,50px);width:100%}.van-button--normal{font-size:var(--button-normal-font-size,14px);padding:0 15px}.van-button--small{font-size:var(--button-small-font-size,12px);height:var(--button-small-height,30px);min-width:var(--button-small-min-width,60px);padding:0 var(--padding-xs,8px)}.van-button--mini{display:inline-block;font-size:var(--button-mini-font-size,10px);height:var(--button-mini-height,22px);min-width:var(--button-mini-min-width,50px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:flex;width:100%}.van-button--round{border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{opacity:var(--button-disabled-opacity,.5)}.van-button__text{display:inline}.van-button__icon+.van-button__text:not(:empty),.van-button__loading-text{margin-left:4px}.van-button__icon{line-height:inherit!important;min-width:1em;vertical-align:top}.van-button--hairline{border-width:0;padding-top:1px}.van-button--hairline:after{border-color:inherit;border-radius:calc(var(--button-border-radius, 2px)*2);border-width:1px}.van-button--hairline.van-button--round:after{border-radius:var(--button-round-border-radius,999px)}.van-button--hairline.van-button--square:after{border-radius:0} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml deleted file mode 100644 index 2ba6f30..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml +++ /dev/null @@ -1,68 +0,0 @@ - -
- -
- - - - - - - - - - - - {{ - computed.getButtonDisabled(type, currentDate, minRange) - ? confirmDisabledText - : confirmText - }} - - -
diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js deleted file mode 100644 index 544b3a4..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../../../common/component"); -(0, component_1.VantComponent)({ - props: { - title: { - type: String, - value: '日期选择', - }, - subtitle: String, - showTitle: Boolean, - showSubtitle: Boolean, - firstDayOfWeek: { - type: Number, - observer: 'initWeekDay', - }, - }, - data: { - weekdays: [], - }, - created: function () { - this.initWeekDay(); - }, - methods: { - initWeekDay: function () { - var defaultWeeks = ['日', '一', '二', '三', '四', '五', '六']; - var firstDayOfWeek = this.data.firstDayOfWeek || 0; - this.setData({ - weekdays: __spreadArray(__spreadArray([], defaultWeeks.slice(firstDayOfWeek, 7), true), defaultWeeks.slice(0, firstDayOfWeek), true), - }); - }, - onClickSubtitle: function (event) { - this.$emit('click-subtitle', event); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml deleted file mode 100644 index 7e56c83..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml +++ /dev/null @@ -1,16 +0,0 @@ - - - - {{ title }} - - - - {{ subtitle }} - - - - - {{ item }} - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss deleted file mode 100644 index 272537e..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../../../common/index.wxss';.van-calendar__header{box-shadow:var(--calendar-header-box-shadow,0 2px 10px hsla(220,1%,50%,.16));flex-shrink:0}.van-calendar__header-subtitle,.van-calendar__header-title{font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:flex}.van-calendar__weekday{flex:1;font-size:var(--calendar-weekdays-font-size,12px);line-height:var(--calendar-weekdays-height,30px);text-align:center} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js deleted file mode 100644 index 4d137f5..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js +++ /dev/null @@ -1,158 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../../../common/component"); -var utils_1 = require("../../utils"); -(0, component_1.VantComponent)({ - props: { - date: { - type: null, - observer: 'setDays', - }, - type: { - type: String, - observer: 'setDays', - }, - color: String, - minDate: { - type: null, - observer: 'setDays', - }, - maxDate: { - type: null, - observer: 'setDays', - }, - showMark: Boolean, - rowHeight: null, - formatter: { - type: null, - observer: 'setDays', - }, - currentDate: { - type: null, - observer: 'setDays', - }, - firstDayOfWeek: { - type: Number, - observer: 'setDays', - }, - allowSameDay: Boolean, - showSubtitle: Boolean, - showMonthTitle: Boolean, - }, - data: { - visible: true, - days: [], - }, - methods: { - onClick: function (event) { - var index = event.currentTarget.dataset.index; - var item = this.data.days[index]; - if (item.type !== 'disabled') { - this.$emit('click', item); - } - }, - setDays: function () { - var days = []; - var startDate = new Date(this.data.date); - var year = startDate.getFullYear(); - var month = startDate.getMonth(); - var totalDay = (0, utils_1.getMonthEndDay)(startDate.getFullYear(), startDate.getMonth() + 1); - for (var day = 1; day <= totalDay; day++) { - var date = new Date(year, month, day); - var type = this.getDayType(date); - var config = { - date: date, - type: type, - text: day, - bottomInfo: this.getBottomInfo(type), - }; - if (this.data.formatter) { - config = this.data.formatter(config); - } - days.push(config); - } - this.setData({ days: days }); - }, - getMultipleDayType: function (day) { - var currentDate = this.data.currentDate; - if (!Array.isArray(currentDate)) { - return ''; - } - var isSelected = function (date) { - return currentDate.some(function (item) { return (0, utils_1.compareDay)(item, date) === 0; }); - }; - if (isSelected(day)) { - var prevDay = (0, utils_1.getPrevDay)(day); - var nextDay = (0, utils_1.getNextDay)(day); - var prevSelected = isSelected(prevDay); - var nextSelected = isSelected(nextDay); - if (prevSelected && nextSelected) { - return 'multiple-middle'; - } - if (prevSelected) { - return 'end'; - } - return nextSelected ? 'start' : 'multiple-selected'; - } - return ''; - }, - getRangeDayType: function (day) { - var _a = this.data, currentDate = _a.currentDate, allowSameDay = _a.allowSameDay; - if (!Array.isArray(currentDate)) { - return ''; - } - var startDay = currentDate[0], endDay = currentDate[1]; - if (!startDay) { - return ''; - } - var compareToStart = (0, utils_1.compareDay)(day, startDay); - if (!endDay) { - return compareToStart === 0 ? 'start' : ''; - } - var compareToEnd = (0, utils_1.compareDay)(day, endDay); - if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) { - return 'start-end'; - } - if (compareToStart === 0) { - return 'start'; - } - if (compareToEnd === 0) { - return 'end'; - } - if (compareToStart > 0 && compareToEnd < 0) { - return 'middle'; - } - return ''; - }, - getDayType: function (day) { - var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, currentDate = _a.currentDate; - if ((0, utils_1.compareDay)(day, minDate) < 0 || (0, utils_1.compareDay)(day, maxDate) > 0) { - return 'disabled'; - } - if (type === 'single') { - return (0, utils_1.compareDay)(day, currentDate) === 0 ? 'selected' : ''; - } - if (type === 'multiple') { - return this.getMultipleDayType(day); - } - /* istanbul ignore else */ - if (type === 'range') { - return this.getRangeDayType(day); - } - return ''; - }, - getBottomInfo: function (type) { - if (this.data.type === 'range') { - if (type === 'start') { - return '开始'; - } - if (type === 'end') { - return '结束'; - } - if (type === 'start-end') { - return '开始/结束'; - } - } - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml deleted file mode 100644 index 0c73b2f..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - {{ computed.formatMonthTitle(date) }} - - - - - {{ computed.getMark(date) }} - - - - - {{ item.topInfo }} - {{ item.text }} - - {{ item.bottomInfo }} - - - - - {{ item.topInfo }} - {{ item.text }} - - {{ item.bottomInfo }} - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs deleted file mode 100644 index 55e45a5..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs +++ /dev/null @@ -1,71 +0,0 @@ -/* eslint-disable */ -var utils = require('../../utils.wxs'); - -function getMark(date) { - return getDate(date).getMonth() + 1; -} - -var ROW_HEIGHT = 64; - -function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) { - var style = []; - var current = getDate(date).getDay() || 7; - var offset = current < firstDayOfWeek ? (7 - firstDayOfWeek + current) : - current === 7 && firstDayOfWeek === 0 ? 0 : - (current - firstDayOfWeek); - - if (index === 0) { - style.push(['margin-left', (100 * offset) / 7 + '%']); - } - - if (rowHeight !== ROW_HEIGHT) { - style.push(['height', rowHeight + 'px']); - } - - if (color) { - if ( - type === 'start' || - type === 'end' || - type === 'start-end' || - type === 'multiple-selected' || - type === 'multiple-middle' - ) { - style.push(['background', color]); - } else if (type === 'middle') { - style.push(['color', color]); - } - } - - return style - .map(function(item) { - return item.join(':'); - }) - .join(';'); -} - -function formatMonthTitle(date) { - date = getDate(date); - return date.getFullYear() + '年' + (date.getMonth() + 1) + '月'; -} - -function getMonthStyle(visible, date, rowHeight) { - if (!visible) { - date = getDate(date); - - var totalDay = utils.getMonthEndDay( - date.getFullYear(), - date.getMonth() + 1 - ); - var offset = getDate(date).getDay(); - var padding = Math.ceil((totalDay + offset) / 7) * rowHeight; - - return 'padding-bottom:' + padding + 'px'; - } -} - -module.exports = { - getMark: getMark, - getDayStyle: getDayStyle, - formatMonthTitle: formatMonthTitle, - getMonthStyle: getMonthStyle -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss deleted file mode 100644 index 9aee73d..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../../../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:100%}.van-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.van-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{color:var(--calendar-month-mark-color,rgba(242,243,245,.8));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.van-calendar__day,.van-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.van-calendar__day{font-size:var(--calendar-day-font-size,16px);height:var(--calendar-day-height,64px);position:relative;width:14.285%}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#ee0a24);color:var(--calendar-range-edge-color,#fff)}.van-calendar__day--start{border-radius:4px 0 0 4px}.van-calendar__day--end{border-radius:0 4px 4px 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px}.van-calendar__day--middle{color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{background-color:currentColor;bottom:0;content:"";left:0;opacity:var(--calendar-range-middle-background-opacity,.1);position:absolute;right:0;top:0}.van-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.van-calendar__bottom-info,.van-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.van-calendar__bottom-info,.van-calendar__top-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,54px);width:var(--calendar-selected-day-size,54px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js deleted file mode 100644 index eea8751..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js +++ /dev/null @@ -1,379 +0,0 @@ -"use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var utils_1 = require("./utils"); -var toast_1 = __importDefault(require("../toast/toast")); -var utils_2 = require("../common/utils"); -var initialMinDate = (0, utils_1.getToday)().getTime(); -var initialMaxDate = (function () { - var now = (0, utils_1.getToday)(); - return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime(); -})(); -var getTime = function (date) { - return date instanceof Date ? date.getTime() : date; -}; -(0, component_1.VantComponent)({ - props: { - title: { - type: String, - value: '日期选择', - }, - color: String, - show: { - type: Boolean, - observer: function (val) { - if (val) { - this.initRect(); - this.scrollIntoView(); - } - }, - }, - formatter: null, - confirmText: { - type: String, - value: '确定', - }, - confirmDisabledText: { - type: String, - value: '确定', - }, - rangePrompt: String, - showRangePrompt: { - type: Boolean, - value: true, - }, - defaultDate: { - type: null, - value: (0, utils_1.getToday)().getTime(), - observer: function (val) { - this.setData({ currentDate: val }); - this.scrollIntoView(); - }, - }, - allowSameDay: Boolean, - type: { - type: String, - value: 'single', - observer: 'reset', - }, - minDate: { - type: Number, - value: initialMinDate, - }, - maxDate: { - type: Number, - value: initialMaxDate, - }, - position: { - type: String, - value: 'bottom', - }, - rowHeight: { - type: null, - value: utils_1.ROW_HEIGHT, - }, - round: { - type: Boolean, - value: true, - }, - poppable: { - type: Boolean, - value: true, - }, - showMark: { - type: Boolean, - value: true, - }, - showTitle: { - type: Boolean, - value: true, - }, - showConfirm: { - type: Boolean, - value: true, - }, - showSubtitle: { - type: Boolean, - value: true, - }, - safeAreaInsetBottom: { - type: Boolean, - value: true, - }, - closeOnClickOverlay: { - type: Boolean, - value: true, - }, - maxRange: { - type: null, - value: null, - }, - minRange: { - type: Number, - value: 1, - }, - firstDayOfWeek: { - type: Number, - value: 0, - }, - readonly: Boolean, - }, - data: { - subtitle: '', - currentDate: null, - scrollIntoView: '', - }, - watch: { - minDate: function () { - this.initRect(); - }, - maxDate: function () { - this.initRect(); - }, - }, - created: function () { - this.setData({ - currentDate: this.getInitialDate(this.data.defaultDate), - }); - }, - mounted: function () { - if (this.data.show || !this.data.poppable) { - this.initRect(); - this.scrollIntoView(); - } - }, - methods: { - reset: function () { - this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) }); - this.scrollIntoView(); - }, - initRect: function () { - var _this = this; - if (this.contentObserver != null) { - this.contentObserver.disconnect(); - } - var contentObserver = this.createIntersectionObserver({ - thresholds: [0, 0.1, 0.9, 1], - observeAll: true, - }); - this.contentObserver = contentObserver; - contentObserver.relativeTo('.van-calendar__body'); - contentObserver.observe('.month', function (res) { - if (res.boundingClientRect.top <= res.relativeRect.top) { - // @ts-ignore - _this.setData({ subtitle: (0, utils_1.formatMonthTitle)(res.dataset.date) }); - } - }); - }, - limitDateRange: function (date, minDate, maxDate) { - if (minDate === void 0) { minDate = null; } - if (maxDate === void 0) { maxDate = null; } - minDate = minDate || this.data.minDate; - maxDate = maxDate || this.data.maxDate; - if ((0, utils_1.compareDay)(date, minDate) === -1) { - return minDate; - } - if ((0, utils_1.compareDay)(date, maxDate) === 1) { - return maxDate; - } - return date; - }, - getInitialDate: function (defaultDate) { - var _this = this; - if (defaultDate === void 0) { defaultDate = null; } - var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, allowSameDay = _a.allowSameDay; - if (!defaultDate) - return []; - var now = (0, utils_1.getToday)().getTime(); - if (type === 'range') { - if (!Array.isArray(defaultDate)) { - defaultDate = []; - } - var _b = defaultDate || [], startDay = _b[0], endDay = _b[1]; - var startDate = getTime(startDay || now); - var start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : (0, utils_1.getPrevDay)(new Date(maxDate)).getTime()); - var date = getTime(endDay || now); - var end = this.limitDateRange(date, allowSameDay ? date : (0, utils_1.getNextDay)(new Date(minDate)).getTime()); - return [start, end]; - } - if (type === 'multiple') { - if (Array.isArray(defaultDate)) { - return defaultDate.map(function (date) { return _this.limitDateRange(date); }); - } - return [this.limitDateRange(now)]; - } - if (!defaultDate || Array.isArray(defaultDate)) { - defaultDate = now; - } - return this.limitDateRange(defaultDate); - }, - scrollIntoView: function () { - var _this = this; - (0, utils_2.requestAnimationFrame)(function () { - var _a = _this.data, currentDate = _a.currentDate, type = _a.type, show = _a.show, poppable = _a.poppable, minDate = _a.minDate, maxDate = _a.maxDate; - if (!currentDate) - return; - // @ts-ignore - var targetDate = type === 'single' ? currentDate : currentDate[0]; - var displayed = show || !poppable; - if (!targetDate || !displayed) { - return; - } - var months = (0, utils_1.getMonths)(minDate, maxDate); - months.some(function (month, index) { - if ((0, utils_1.compareMonth)(month, targetDate) === 0) { - _this.setData({ scrollIntoView: "month".concat(index) }); - return true; - } - return false; - }); - }); - }, - onOpen: function () { - this.$emit('open'); - }, - onOpened: function () { - this.$emit('opened'); - }, - onClose: function () { - this.$emit('close'); - }, - onClosed: function () { - this.$emit('closed'); - }, - onClickDay: function (event) { - if (this.data.readonly) { - return; - } - var date = event.detail.date; - var _a = this.data, type = _a.type, currentDate = _a.currentDate, allowSameDay = _a.allowSameDay; - if (type === 'range') { - // @ts-ignore - var startDay_1 = currentDate[0], endDay = currentDate[1]; - if (startDay_1 && !endDay) { - var compareToStart = (0, utils_1.compareDay)(date, startDay_1); - if (compareToStart === 1) { - var days_1 = this.selectComponent('.month').data.days; - days_1.some(function (day, index) { - var isDisabled = day.type === 'disabled' && - getTime(startDay_1) < getTime(day.date) && - getTime(day.date) < getTime(date); - if (isDisabled) { - (date = days_1[index - 1].date); - } - return isDisabled; - }); - this.select([startDay_1, date], true); - } - else if (compareToStart === -1) { - this.select([date, null]); - } - else if (allowSameDay) { - this.select([date, date], true); - } - } - else { - this.select([date, null]); - } - } - else if (type === 'multiple') { - var selectedIndex_1; - // @ts-ignore - var selected = currentDate.some(function (dateItem, index) { - var equal = (0, utils_1.compareDay)(dateItem, date) === 0; - if (equal) { - selectedIndex_1 = index; - } - return equal; - }); - if (selected) { - // @ts-ignore - var cancelDate = currentDate.splice(selectedIndex_1, 1); - this.setData({ currentDate: currentDate }); - this.unselect(cancelDate); - } - else { - // @ts-ignore - this.select(__spreadArray(__spreadArray([], currentDate, true), [date], false)); - } - } - else { - this.select(date, true); - } - }, - unselect: function (dateArray) { - var date = dateArray[0]; - if (date) { - this.$emit('unselect', (0, utils_1.copyDates)(date)); - } - }, - select: function (date, complete) { - if (complete && this.data.type === 'range') { - var valid = this.checkRange(date); - if (!valid) { - // auto selected to max range if showConfirm - if (this.data.showConfirm) { - this.emit([ - date[0], - (0, utils_1.getDayByOffset)(date[0], this.data.maxRange - 1), - ]); - } - else { - this.emit(date); - } - return; - } - } - this.emit(date); - if (complete && !this.data.showConfirm) { - this.onConfirm(); - } - }, - emit: function (date) { - this.setData({ - currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), - }); - this.$emit('select', (0, utils_1.copyDates)(date)); - }, - checkRange: function (date) { - var _a = this.data, maxRange = _a.maxRange, rangePrompt = _a.rangePrompt, showRangePrompt = _a.showRangePrompt; - if (maxRange && (0, utils_1.calcDateNum)(date) > maxRange) { - if (showRangePrompt) { - (0, toast_1.default)({ - context: this, - message: rangePrompt || "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ".concat(maxRange, " \u5929"), - }); - } - this.$emit('over-range'); - return false; - } - return true; - }, - onConfirm: function () { - var _this = this; - if (this.data.type === 'range' && - !this.checkRange(this.data.currentDate)) { - return; - } - wx.nextTick(function () { - // @ts-ignore - _this.$emit('confirm', (0, utils_1.copyDates)(_this.data.currentDate)); - }); - }, - onClickSubtitle: function (event) { - this.$emit('click-subtitle', event); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json deleted file mode 100644 index 397d5ae..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "component": true, - "usingComponents": { - "header": "./components/header/index", - "month": "./components/month/index", - "van-button": "../button/index", - "van-popup": "../popup/index", - "van-toast": "../toast/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml deleted file mode 100644 index 9667eef..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs deleted file mode 100644 index 0a56646..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs +++ /dev/null @@ -1,37 +0,0 @@ -/* eslint-disable */ -var utils = require('./utils.wxs'); - -function getMonths(minDate, maxDate) { - var months = []; - var cursor = getDate(minDate); - - cursor.setDate(1); - - do { - months.push(cursor.getTime()); - cursor.setMonth(cursor.getMonth() + 1); - } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1); - - return months; -} - -function getButtonDisabled(type, currentDate, minRange) { - if (currentDate == null) { - return true; - } - - if (type === 'range') { - return !currentDate[0] || !currentDate[1]; - } - - if (type === 'multiple') { - return currentDate.length < minRange; - } - - return !currentDate; -} - -module.exports = { - getMonths: getMonths, - getButtonDisabled: getButtonDisabled -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss deleted file mode 100644 index a1f1cf0..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js deleted file mode 100644 index c9e5df7..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getToday = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0; -exports.ROW_HEIGHT = 64; -function formatMonthTitle(date) { - if (!(date instanceof Date)) { - date = new Date(date); - } - return "".concat(date.getFullYear(), "\u5E74").concat(date.getMonth() + 1, "\u6708"); -} -exports.formatMonthTitle = formatMonthTitle; -function compareMonth(date1, date2) { - if (!(date1 instanceof Date)) { - date1 = new Date(date1); - } - if (!(date2 instanceof Date)) { - date2 = new Date(date2); - } - var year1 = date1.getFullYear(); - var year2 = date2.getFullYear(); - var month1 = date1.getMonth(); - var month2 = date2.getMonth(); - if (year1 === year2) { - return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; - } - return year1 > year2 ? 1 : -1; -} -exports.compareMonth = compareMonth; -function compareDay(day1, day2) { - if (!(day1 instanceof Date)) { - day1 = new Date(day1); - } - if (!(day2 instanceof Date)) { - day2 = new Date(day2); - } - var compareMonthResult = compareMonth(day1, day2); - if (compareMonthResult === 0) { - var date1 = day1.getDate(); - var date2 = day2.getDate(); - return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; - } - return compareMonthResult; -} -exports.compareDay = compareDay; -function getDayByOffset(date, offset) { - date = new Date(date); - date.setDate(date.getDate() + offset); - return date; -} -exports.getDayByOffset = getDayByOffset; -function getPrevDay(date) { - return getDayByOffset(date, -1); -} -exports.getPrevDay = getPrevDay; -function getNextDay(date) { - return getDayByOffset(date, 1); -} -exports.getNextDay = getNextDay; -function getToday() { - var today = new Date(); - today.setHours(0, 0, 0, 0); - return today; -} -exports.getToday = getToday; -function calcDateNum(date) { - var day1 = new Date(date[0]).getTime(); - var day2 = new Date(date[1]).getTime(); - return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; -} -exports.calcDateNum = calcDateNum; -function copyDates(dates) { - if (Array.isArray(dates)) { - return dates.map(function (date) { - if (date === null) { - return date; - } - return new Date(date); - }); - } - return new Date(dates); -} -exports.copyDates = copyDates; -function getMonthEndDay(year, month) { - return 32 - new Date(year, month - 1, 32).getDate(); -} -exports.getMonthEndDay = getMonthEndDay; -function getMonths(minDate, maxDate) { - var months = []; - var cursor = new Date(minDate); - cursor.setDate(1); - do { - months.push(cursor.getTime()); - cursor.setMonth(cursor.getMonth() + 1); - } while (compareMonth(cursor, maxDate) !== 1); - return months; -} -exports.getMonths = getMonths; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs deleted file mode 100644 index e57f6b3..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable */ -function getMonthEndDay(year, month) { - return 32 - getDate(year, month - 1, 32).getDate(); -} - -function compareMonth(date1, date2) { - date1 = getDate(date1); - date2 = getDate(date2); - - var year1 = date1.getFullYear(); - var year2 = date2.getFullYear(); - var month1 = date1.getMonth(); - var month2 = date2.getMonth(); - - if (year1 === year2) { - return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; - } - - return year1 > year2 ? 1 : -1; -} - -module.exports = { - getMonthEndDay: getMonthEndDay, - compareMonth: compareMonth -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js deleted file mode 100644 index 2815655..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var link_1 = require("../mixins/link"); -var component_1 = require("../common/component"); -(0, component_1.VantComponent)({ - classes: [ - 'num-class', - 'desc-class', - 'thumb-class', - 'title-class', - 'price-class', - 'origin-price-class', - ], - mixins: [link_1.link], - props: { - tag: String, - num: String, - desc: String, - thumb: String, - title: String, - price: { - type: String, - observer: 'updatePrice', - }, - centered: Boolean, - lazyLoad: Boolean, - thumbLink: String, - originPrice: String, - thumbMode: { - type: String, - value: 'aspectFit', - }, - currency: { - type: String, - value: '¥', - }, - }, - methods: { - updatePrice: function () { - var price = this.data.price; - var priceArr = price.toString().split('.'); - this.setData({ - integerStr: priceArr[0], - decimalStr: priceArr[1] ? ".".concat(priceArr[1]) : '', - }); - }, - onClickThumb: function () { - this.jumpLink('thumbLink'); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json deleted file mode 100644 index e917407..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-tag": "../tag/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml deleted file mode 100644 index 62173e4..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - {{ tag }} - - - - - - - {{ title }} - - - {{ desc }} - - - - - - - - - {{ currency }} - {{ integerStr }} - {{ decimalStr }} - - - {{ currency }} {{ originPrice }} - - x {{ num }} - - - - - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss deleted file mode 100644 index 0f4d7c5..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-card{background-color:var(--card-background-color,#fafafa);box-sizing:border-box;color:var(--card-text-color,#323233);font-size:var(--card-font-size,12px);padding:var(--card-padding,8px 16px);position:relative}.van-card__header{display:flex}.van-card__header--center{align-items:center;justify-content:center}.van-card__thumb{flex:none;height:var(--card-thumb-size,88px);margin-right:var(--padding-xs,8px);position:relative;width:var(--card-thumb-size,88px)}.van-card__thumb:empty{display:none}.van-card__img{border-radius:8px;height:100%;width:100%}.van-card__content{display:flex;flex:1;flex-direction:column;justify-content:space-between;min-height:var(--card-thumb-size,88px);min-width:0;position:relative}.van-card__content--center{justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{font-weight:700;line-height:var(--card-title-line-height,16px)}.van-card__desc{color:var(--card-desc-color,#646566);line-height:var(--card-desc-line-height,20px)}.van-card__bottom{line-height:20px}.van-card__price{color:var(--card-price-color,#ee0a24);display:inline-block;font-size:var(--card-price-font-size,12px);font-weight:700}.van-card__price-integer{font-size:var(--card-price-integer-font-size,16px)}.van-card__price-decimal,.van-card__price-integer{font-family:var(--card-price-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif)}.van-card__origin-price{color:var(--card-origin-price-color,#646566);display:inline-block;font-size:var(--card-origin-price-font-size,10px);margin-left:5px;text-decoration:line-through}.van-card__num{float:right}.van-card__tag{left:0;position:absolute!important;top:2px}.van-card__footer{flex:none;text-align:right;width:100%} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js deleted file mode 100644 index 34a93a6..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -(0, component_1.VantComponent)({ - props: { - title: String, - border: { - type: Boolean, - value: true, - }, - inset: Boolean, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml deleted file mode 100644 index 311e064..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml +++ /dev/null @@ -1,11 +0,0 @@ - - - - {{ title }} - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss deleted file mode 100644 index 08b252f..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-cell-group--inset{border-radius:var(--cell-group-inset-border-radius,8px);margin:var(--cell-group-inset-padding,0 16px);overflow:hidden}.van-cell-group__title{color:var(--cell-group-title-color,#969799);font-size:var(--cell-group-title-font-size,14px);line-height:var(--cell-group-title-line-height,16px);padding:var(--cell-group-title-padding,16px 16px 8px)}.van-cell-group__title--inset{padding:var(--cell-group-inset-title-padding,16px 16px 8px 32px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js deleted file mode 100644 index 80f3039..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var link_1 = require("../mixins/link"); -var component_1 = require("../common/component"); -(0, component_1.VantComponent)({ - classes: [ - 'title-class', - 'label-class', - 'value-class', - 'right-icon-class', - 'hover-class', - ], - mixins: [link_1.link], - props: { - title: null, - value: null, - icon: String, - size: String, - label: String, - center: Boolean, - isLink: Boolean, - required: Boolean, - clickable: Boolean, - titleWidth: String, - customStyle: String, - arrowDirection: String, - useLabelSlot: Boolean, - border: { - type: Boolean, - value: true, - }, - titleStyle: String, - }, - methods: { - onClick: function (event) { - this.$emit('click', event.detail); - this.jumpLink(); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json deleted file mode 100644 index 0a336c0..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-icon": "../icon/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml deleted file mode 100644 index 8387c3c..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - {{ title }} - - - - - {{ label }} - - - - - {{ value }} - - - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs deleted file mode 100644 index e3500c4..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable */ -var style = require('../wxs/style.wxs'); -var addUnit = require('../wxs/add-unit.wxs'); - -function titleStyle(data) { - return style([ - { - 'max-width': addUnit(data.titleWidth), - 'min-width': addUnit(data.titleWidth), - }, - data.titleStyle, - ]); -} - -module.exports = { - titleStyle: titleStyle, -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss deleted file mode 100644 index 1802f8e..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-cell{background-color:var(--cell-background-color,#fff);box-sizing:border-box;color:var(--cell-text-color,#323233);display:flex;font-size:var(--cell-font-size,14px);line-height:var(--cell-line-height,24px);padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);position:relative;width:100%}.van-cell:after{border-bottom:1px solid #ebedf0;bottom:0;box-sizing:border-box;content:" ";left:16px;pointer-events:none;position:absolute;right:16px;transform:scaleY(.5);transform-origin:center}.van-cell--borderless:after{display:none}.van-cell-group{background-color:var(--cell-background-color,#fff)}.van-cell__label{color:var(--cell-label-color,#969799);font-size:var(--cell-label-font-size,12px);line-height:var(--cell-label-line-height,18px);margin-top:var(--cell-label-margin-top,3px)}.van-cell__value{color:var(--cell-value-color,#969799);overflow:hidden;text-align:right;vertical-align:middle}.van-cell__title,.van-cell__value{flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{align-items:center;display:flex;font-size:var(--cell-icon-size,16px);height:var(--cell-line-height,24px)}.van-cell__left-icon-wrap{margin-right:var(--padding-base,4px)}.van-cell__right-icon-wrap{color:var(--cell-right-icon-color,#969799);margin-left:var(--padding-base,4px)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{color:var(--cell-required-color,#ee0a24);content:"*";font-size:var(--cell-font-size,14px);left:var(--padding-xs,8px);position:absolute}.van-cell--center{align-items:center}.van-cell--large{padding-bottom:var(--cell-large-vertical-padding,12px);padding-top:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:var(--cell-large-label-font-size,14px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js deleted file mode 100644 index 80c93a1..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var relation_1 = require("../common/relation"); -var component_1 = require("../common/component"); -(0, component_1.VantComponent)({ - field: true, - relation: (0, relation_1.useChildren)('checkbox', function (target) { - this.updateChild(target); - }), - props: { - max: Number, - value: { - type: Array, - observer: 'updateChildren', - }, - disabled: { - type: Boolean, - observer: 'updateChildren', - }, - direction: { - type: String, - value: 'vertical', - }, - }, - methods: { - updateChildren: function () { - var _this = this; - this.children.forEach(function (child) { return _this.updateChild(child); }); - }, - updateChild: function (child) { - var _a = this.data, value = _a.value, disabled = _a.disabled, direction = _a.direction; - child.setData({ - value: value.indexOf(child.data.name) !== -1, - parentDisabled: disabled, - direction: direction, - }); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml deleted file mode 100644 index 638bf9d..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss deleted file mode 100644 index c5666d7..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-checkbox-group--horizontal{display:flex;flex-wrap:wrap} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js deleted file mode 100644 index 6247365..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var relation_1 = require("../common/relation"); -var component_1 = require("../common/component"); -function emit(target, value) { - target.$emit('input', value); - target.$emit('change', value); -} -(0, component_1.VantComponent)({ - field: true, - relation: (0, relation_1.useParent)('checkbox-group'), - classes: ['icon-class', 'label-class'], - props: { - value: Boolean, - disabled: Boolean, - useIconSlot: Boolean, - checkedColor: String, - labelPosition: { - type: String, - value: 'right', - }, - labelDisabled: Boolean, - shape: { - type: String, - value: 'round', - }, - iconSize: { - type: null, - value: 20, - }, - }, - data: { - parentDisabled: false, - direction: 'vertical', - }, - methods: { - emitChange: function (value) { - if (this.parent) { - this.setParentValue(this.parent, value); - } - else { - emit(this, value); - } - }, - toggle: function () { - var _a = this.data, parentDisabled = _a.parentDisabled, disabled = _a.disabled, value = _a.value; - if (!disabled && !parentDisabled) { - this.emitChange(!value); - } - }, - onClickLabel: function () { - var _a = this.data, labelDisabled = _a.labelDisabled, parentDisabled = _a.parentDisabled, disabled = _a.disabled, value = _a.value; - if (!disabled && !labelDisabled && !parentDisabled) { - this.emitChange(!value); - } - }, - setParentValue: function (parent, value) { - var parentValue = parent.data.value.slice(); - var name = this.data.name; - var max = parent.data.max; - if (value) { - if (max && parentValue.length >= max) { - return; - } - if (parentValue.indexOf(name) === -1) { - parentValue.push(name); - emit(parent, parentValue); - } - } - else { - var index = parentValue.indexOf(name); - if (index !== -1) { - parentValue.splice(index, 1); - emit(parent, parentValue); - } - } - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json deleted file mode 100644 index 0a336c0..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-icon": "../icon/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml deleted file mode 100644 index 39a7bb0..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs deleted file mode 100644 index eb9c772..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable */ -var style = require('../wxs/style.wxs'); -var addUnit = require('../wxs/add-unit.wxs'); - -function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) { - var styles = { - 'font-size': addUnit(iconSize), - }; - - if (checkedColor && value && !disabled && !parentDisabled) { - styles['border-color'] = checkedColor; - styles['background-color'] = checkedColor; - } - - return style(styles); -} - -module.exports = { - iconStyle: iconStyle, -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss deleted file mode 100644 index da2272a..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox--horizontal{margin-right:12px}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{flex:none}.van-checkbox__icon{align-items:center;border:1px solid var(--checkbox-border-color,#c8c9cc);box-sizing:border-box;color:transparent;display:flex;font-size:var(--checkbox-size,20px);height:1em;justify-content:center;text-align:center;transition-duration:var(--checkbox-transition-duration,.2s);transition-property:color,border-color,background-color;width:1em}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:var(--checkbox-checked-icon-color,#1989fa);color:#fff}.van-checkbox__icon--disabled{background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;color:var(--checkbox-label-color,#323233);padding-left:var(--checkbox-label-margin,10px)}.van-checkbox__label--left{float:left;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js b/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js deleted file mode 100644 index d81df74..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.adaptor = void 0; -function adaptor(ctx) { - // @ts-ignore - return Object.assign(ctx, { - setStrokeStyle: function (val) { - ctx.strokeStyle = val; - }, - setLineWidth: function (val) { - ctx.lineWidth = val; - }, - setLineCap: function (val) { - ctx.lineCap = val; - }, - setFillStyle: function (val) { - ctx.fillStyle = val; - }, - setFontSize: function (val) { - ctx.font = String(val); - }, - setGlobalAlpha: function (val) { - ctx.globalAlpha = val; - }, - setLineJoin: function (val) { - ctx.lineJoin = val; - }, - setTextAlign: function (val) { - ctx.textAlign = val; - }, - setMiterLimit: function (val) { - ctx.miterLimit = val; - }, - setShadow: function (offsetX, offsetY, blur, color) { - ctx.shadowOffsetX = offsetX; - ctx.shadowOffsetY = offsetY; - ctx.shadowBlur = blur; - ctx.shadowColor = color; - }, - setTextBaseline: function (val) { - ctx.textBaseline = val; - }, - createCircularGradient: function () { }, - draw: function () { }, - }); -} -exports.adaptor = adaptor; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js deleted file mode 100644 index e131e4b..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js +++ /dev/null @@ -1,207 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var color_1 = require("../common/color"); -var component_1 = require("../common/component"); -var utils_1 = require("../common/utils"); -var validator_1 = require("../common/validator"); -var version_1 = require("../common/version"); -var canvas_1 = require("./canvas"); -function format(rate) { - return Math.min(Math.max(rate, 0), 100); -} -var PERIMETER = 2 * Math.PI; -var BEGIN_ANGLE = -Math.PI / 2; -var STEP = 1; -(0, component_1.VantComponent)({ - props: { - text: String, - lineCap: { - type: String, - value: 'round', - }, - value: { - type: Number, - value: 0, - observer: 'reRender', - }, - speed: { - type: Number, - value: 50, - }, - size: { - type: Number, - value: 100, - observer: function () { - this.drawCircle(this.currentValue); - }, - }, - fill: String, - layerColor: { - type: String, - value: color_1.WHITE, - }, - color: { - type: null, - value: color_1.BLUE, - observer: function () { - var _this = this; - this.setHoverColor().then(function () { - _this.drawCircle(_this.currentValue); - }); - }, - }, - type: { - type: String, - value: '', - }, - strokeWidth: { - type: Number, - value: 4, - }, - clockwise: { - type: Boolean, - value: true, - }, - }, - data: { - hoverColor: color_1.BLUE, - }, - methods: { - getContext: function () { - var _this = this; - var _a = this.data, type = _a.type, size = _a.size; - if (type === '' || !(0, version_1.canIUseCanvas2d)()) { - var ctx = wx.createCanvasContext('van-circle', this); - return Promise.resolve(ctx); - } - var dpr = (0, utils_1.getSystemInfoSync)().pixelRatio; - return new Promise(function (resolve) { - wx.createSelectorQuery() - .in(_this) - .select('#van-circle') - .node() - .exec(function (res) { - var canvas = res[0].node; - var ctx = canvas.getContext(type); - if (!_this.inited) { - _this.inited = true; - canvas.width = size * dpr; - canvas.height = size * dpr; - ctx.scale(dpr, dpr); - } - resolve((0, canvas_1.adaptor)(ctx)); - }); - }); - }, - setHoverColor: function () { - var _this = this; - var _a = this.data, color = _a.color, size = _a.size; - if ((0, validator_1.isObj)(color)) { - return this.getContext().then(function (context) { - if (!context) - return; - var LinearColor = context.createLinearGradient(size, 0, 0, 0); - Object.keys(color) - .sort(function (a, b) { return parseFloat(a) - parseFloat(b); }) - .map(function (key) { - return LinearColor.addColorStop(parseFloat(key) / 100, color[key]); - }); - _this.hoverColor = LinearColor; - }); - } - this.hoverColor = color; - return Promise.resolve(); - }, - presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) { - var _a = this.data, strokeWidth = _a.strokeWidth, lineCap = _a.lineCap, clockwise = _a.clockwise, size = _a.size; - var position = size / 2; - var radius = position - strokeWidth / 2; - context.setStrokeStyle(strokeStyle); - context.setLineWidth(strokeWidth); - context.setLineCap(lineCap); - context.beginPath(); - context.arc(position, position, radius, beginAngle, endAngle, !clockwise); - context.stroke(); - if (fill) { - context.setFillStyle(fill); - context.fill(); - } - }, - renderLayerCircle: function (context) { - var _a = this.data, layerColor = _a.layerColor, fill = _a.fill; - this.presetCanvas(context, layerColor, 0, PERIMETER, fill); - }, - renderHoverCircle: function (context, formatValue) { - var clockwise = this.data.clockwise; - // 结束角度 - var progress = PERIMETER * (formatValue / 100); - var endAngle = clockwise - ? BEGIN_ANGLE + progress - : 3 * Math.PI - (BEGIN_ANGLE + progress); - this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle); - }, - drawCircle: function (currentValue) { - var _this = this; - var size = this.data.size; - this.getContext().then(function (context) { - if (!context) - return; - context.clearRect(0, 0, size, size); - _this.renderLayerCircle(context); - var formatValue = format(currentValue); - if (formatValue !== 0) { - _this.renderHoverCircle(context, formatValue); - } - context.draw(); - }); - }, - reRender: function () { - var _this = this; - // tofector 动画暂时没有想到好的解决方案 - var _a = this.data, value = _a.value, speed = _a.speed; - if (speed <= 0 || speed > 1000) { - this.drawCircle(value); - return; - } - this.clearMockInterval(); - this.currentValue = this.currentValue || 0; - var run = function () { - _this.interval = setTimeout(function () { - if (_this.currentValue !== value) { - if (Math.abs(_this.currentValue - value) < STEP) { - _this.currentValue = value; - } - else if (_this.currentValue < value) { - _this.currentValue += STEP; - } - else { - _this.currentValue -= STEP; - } - _this.drawCircle(_this.currentValue); - run(); - } - else { - _this.clearMockInterval(); - } - }, 1000 / speed); - }; - run(); - }, - clearMockInterval: function () { - if (this.interval) { - clearTimeout(this.interval); - this.interval = null; - } - }, - }, - mounted: function () { - var _this = this; - this.currentValue = this.data.value; - this.setHoverColor().then(function () { - _this.drawCircle(_this.currentValue); - }); - }, - destroyed: function () { - this.clearMockInterval(); - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml deleted file mode 100644 index 52bc59f..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - {{ text }} - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss deleted file mode 100644 index 2200751..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-circle{display:inline-block;position:relative;text-align:center}.van-circle__text{color:var(--circle-text-color,#323233);left:0;position:absolute;top:50%;transform:translateY(-50%);width:100%} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js deleted file mode 100644 index 63c56eb..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var relation_1 = require("../common/relation"); -var component_1 = require("../common/component"); -(0, component_1.VantComponent)({ - relation: (0, relation_1.useParent)('row'), - props: { - span: Number, - offset: Number, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml deleted file mode 100644 index 975348b..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs deleted file mode 100644 index 507c1cb..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable */ -var style = require('../wxs/style.wxs'); -var addUnit = require('../wxs/add-unit.wxs'); - -function rootStyle(data) { - if (!data.gutter) { - return ''; - } - - return style({ - 'padding-right': addUnit(data.gutter / 2), - 'padding-left': addUnit(data.gutter / 2), - }); -} - -module.exports = { - rootStyle: rootStyle, -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss deleted file mode 100644 index 2fa265e..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-col{box-sizing:border-box;float:left}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js deleted file mode 100644 index 5734087..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.setContentAnimate = void 0; -var utils_1 = require("../common/utils"); -function useAnimation(context, expanded, mounted, height) { - var animation = wx.createAnimation({ - duration: 0, - timingFunction: 'ease-in-out', - }); - if (expanded) { - if (height === 0) { - animation.height('auto').top(1).step(); - } - else { - animation - .height(height) - .top(1) - .step({ - duration: mounted ? 300 : 1, - }) - .height('auto') - .step(); - } - context.setData({ - animation: animation.export(), - }); - return; - } - animation.height(height).top(0).step({ duration: 1 }).height(0).step({ - duration: 300, - }); - context.setData({ - animation: animation.export(), - }); -} -function setContentAnimate(context, expanded, mounted) { - (0, utils_1.getRect)(context, '.van-collapse-item__content') - .then(function (rect) { return rect.height; }) - .then(function (height) { - useAnimation(context, expanded, mounted, height); - }); -} -exports.setContentAnimate = setContentAnimate; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js deleted file mode 100644 index 982490e..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var relation_1 = require("../common/relation"); -var animate_1 = require("./animate"); -(0, component_1.VantComponent)({ - classes: ['title-class', 'content-class'], - relation: (0, relation_1.useParent)('collapse'), - props: { - size: String, - name: null, - title: null, - value: null, - icon: String, - label: String, - disabled: Boolean, - clickable: Boolean, - border: { - type: Boolean, - value: true, - }, - isLink: { - type: Boolean, - value: true, - }, - }, - data: { - expanded: false, - }, - mounted: function () { - this.updateExpanded(); - this.mounted = true; - }, - methods: { - updateExpanded: function () { - if (!this.parent) { - return; - } - var _a = this.parent.data, value = _a.value, accordion = _a.accordion; - var _b = this.parent.children, children = _b === void 0 ? [] : _b; - var name = this.data.name; - var index = children.indexOf(this); - var currentName = name == null ? index : name; - var expanded = accordion - ? value === currentName - : (value || []).some(function (name) { return name === currentName; }); - if (expanded !== this.data.expanded) { - (0, animate_1.setContentAnimate)(this, expanded, this.mounted); - } - this.setData({ index: index, expanded: expanded }); - }, - onClick: function () { - if (this.data.disabled) { - return; - } - var _a = this.data, name = _a.name, expanded = _a.expanded; - var index = this.parent.children.indexOf(this); - var currentName = name == null ? index : name; - this.parent.switch(currentName, !expanded); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json deleted file mode 100644 index 0e5425c..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-cell": "../cell/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml deleted file mode 100644 index f11d0d4..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss deleted file mode 100644 index 4a65b5a..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{transform:rotate(90deg);transition:transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{background-color:var(--collapse-item-content-background-color,#fff);color:var(--collapse-item-content-text-color,#969799);font-size:var(--collapse-item-content-font-size,13px);line-height:var(--collapse-item-content-line-height,1.5);padding:var(--collapse-item-content-padding,15px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js deleted file mode 100644 index 943d542..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var relation_1 = require("../common/relation"); -(0, component_1.VantComponent)({ - relation: (0, relation_1.useChildren)('collapse-item'), - props: { - value: { - type: null, - observer: 'updateExpanded', - }, - accordion: { - type: Boolean, - observer: 'updateExpanded', - }, - border: { - type: Boolean, - value: true, - }, - }, - methods: { - updateExpanded: function () { - this.children.forEach(function (child) { - child.updateExpanded(); - }); - }, - switch: function (name, expanded) { - var _a = this.data, accordion = _a.accordion, value = _a.value; - var changeItem = name; - if (!accordion) { - name = expanded - ? (value || []).concat(name) - : (value || []).filter(function (activeName) { return activeName !== name; }); - } - else { - name = expanded ? name : ''; - } - if (expanded) { - this.$emit('open', changeItem); - } - else { - this.$emit('close', changeItem); - } - this.$emit('change', name); - this.$emit('input', name); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml deleted file mode 100644 index fd4e171..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxss deleted file mode 100644 index 99694d6..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js deleted file mode 100644 index 008a45a..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.GRAY_DARK = exports.GRAY = exports.ORANGE = exports.GREEN = exports.WHITE = exports.BLUE = exports.RED = void 0; -exports.RED = '#ee0a24'; -exports.BLUE = '#1989fa'; -exports.WHITE = '#fff'; -exports.GREEN = '#07c160'; -exports.ORANGE = '#ff976a'; -exports.GRAY = '#323233'; -exports.GRAY_DARK = '#969799'; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js deleted file mode 100644 index 66da00e..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.VantComponent = void 0; -var basic_1 = require("../mixins/basic"); -function mapKeys(source, target, map) { - Object.keys(map).forEach(function (key) { - if (source[key]) { - target[map[key]] = source[key]; - } - }); -} -function VantComponent(vantOptions) { - var options = {}; - mapKeys(vantOptions, options, { - data: 'data', - props: 'properties', - watch: 'observers', - mixins: 'behaviors', - methods: 'methods', - beforeCreate: 'created', - created: 'attached', - mounted: 'ready', - destroyed: 'detached', - classes: 'externalClasses', - }); - // add default externalClasses - options.externalClasses = options.externalClasses || []; - options.externalClasses.push('custom-class'); - // add default behaviors - options.behaviors = options.behaviors || []; - options.behaviors.push(basic_1.basic); - // add relations - var relation = vantOptions.relation; - if (relation) { - options.relations = relation.relations; - options.behaviors.push(relation.mixin); - } - // map field to form-field behavior - if (vantOptions.field) { - options.behaviors.push('wx://form-field'); - } - // add default options - options.options = { - multipleSlots: true, - addGlobalClass: true, - }; - Component(options); -} -exports.VantComponent = VantComponent; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss deleted file mode 100644 index a73bb7a..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{clear:both;content:"";display:table}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js deleted file mode 100644 index 008256c..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.useChildren = exports.useParent = void 0; -function useParent(name, onEffect) { - var _a; - var path = "../".concat(name, "/index"); - return { - relations: (_a = {}, - _a[path] = { - type: 'ancestor', - linked: function () { - onEffect && onEffect.call(this); - }, - linkChanged: function () { - onEffect && onEffect.call(this); - }, - unlinked: function () { - onEffect && onEffect.call(this); - }, - }, - _a), - mixin: Behavior({ - created: function () { - var _this = this; - Object.defineProperty(this, 'parent', { - get: function () { return _this.getRelationNodes(path)[0]; }, - }); - Object.defineProperty(this, 'index', { - // @ts-ignore - get: function () { var _a, _b; return (_b = (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.indexOf(_this); }, - }); - }, - }), - }; -} -exports.useParent = useParent; -function useChildren(name, onEffect) { - var _a; - var path = "../".concat(name, "/index"); - return { - relations: (_a = {}, - _a[path] = { - type: 'descendant', - linked: function (target) { - onEffect && onEffect.call(this, target); - }, - linkChanged: function (target) { - onEffect && onEffect.call(this, target); - }, - unlinked: function (target) { - onEffect && onEffect.call(this, target); - }, - }, - _a), - mixin: Behavior({ - created: function () { - var _this = this; - Object.defineProperty(this, 'children', { - get: function () { return _this.getRelationNodes(path) || []; }, - }); - }, - }), - }; -} -exports.useChildren = useChildren; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss deleted file mode 100644 index 442246f..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss +++ /dev/null @@ -1 +0,0 @@ -.van-clearfix:after{clear:both;content:"";display:table} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss deleted file mode 100644 index ee701df..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss +++ /dev/null @@ -1 +0,0 @@ -.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss deleted file mode 100644 index f7c6260..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss +++ /dev/null @@ -1 +0,0 @@ -.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/var.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/var.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js deleted file mode 100644 index 80fb803..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0; -var validator_1 = require("./validator"); -var version_1 = require("./version"); -var validator_2 = require("./validator"); -Object.defineProperty(exports, "isDef", { enumerable: true, get: function () { return validator_2.isDef; } }); -var version_2 = require("./version"); -Object.defineProperty(exports, "getSystemInfoSync", { enumerable: true, get: function () { return version_2.getSystemInfoSync; } }); -function range(num, min, max) { - return Math.min(Math.max(num, min), max); -} -exports.range = range; -function nextTick(cb) { - if ((0, version_1.canIUseNextTick)()) { - wx.nextTick(cb); - } - else { - setTimeout(function () { - cb(); - }, 1000 / 30); - } -} -exports.nextTick = nextTick; -function addUnit(value) { - if (!(0, validator_1.isDef)(value)) { - return undefined; - } - value = String(value); - return (0, validator_1.isNumber)(value) ? "".concat(value, "px") : value; -} -exports.addUnit = addUnit; -function requestAnimationFrame(cb) { - return setTimeout(function () { - cb(); - }, 1000 / 30); -} -exports.requestAnimationFrame = requestAnimationFrame; -function pickExclude(obj, keys) { - if (!(0, validator_1.isPlainObject)(obj)) { - return {}; - } - return Object.keys(obj).reduce(function (prev, key) { - if (!keys.includes(key)) { - prev[key] = obj[key]; - } - return prev; - }, {}); -} -exports.pickExclude = pickExclude; -function getRect(context, selector) { - return new Promise(function (resolve) { - wx.createSelectorQuery() - .in(context) - .select(selector) - .boundingClientRect() - .exec(function (rect) { - if (rect === void 0) { rect = []; } - return resolve(rect[0]); - }); - }); -} -exports.getRect = getRect; -function getAllRect(context, selector) { - return new Promise(function (resolve) { - wx.createSelectorQuery() - .in(context) - .selectAll(selector) - .boundingClientRect() - .exec(function (rect) { - if (rect === void 0) { rect = []; } - return resolve(rect[0]); - }); - }); -} -exports.getAllRect = getAllRect; -function groupSetData(context, cb) { - if ((0, version_1.canIUseGroupSetData)()) { - context.groupSetData(cb); - } - else { - cb(); - } -} -exports.groupSetData = groupSetData; -function toPromise(promiseLike) { - if ((0, validator_1.isPromise)(promiseLike)) { - return promiseLike; - } - return Promise.resolve(promiseLike); -} -exports.toPromise = toPromise; -// 浮点数精度处理 -function addNumber(num1, num2) { - var cardinal = Math.pow(10, 10); - return Math.round((num1 + num2) * cardinal) / cardinal; -} -exports.addNumber = addNumber; -// 限制value在[min, max]之间 -var clamp = function (num, min, max) { return Math.min(Math.max(num, min), max); }; -exports.clamp = clamp; -function getCurrentPage() { - var pages = getCurrentPages(); - return pages[pages.length - 1]; -} -exports.getCurrentPage = getCurrentPage; -exports.isPC = ['mac', 'windows'].includes((0, version_1.getSystemInfoSync)().platform); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js deleted file mode 100644 index 169e796..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isVideoUrl = exports.isImageUrl = exports.isBoolean = exports.isNumber = exports.isObj = exports.isDef = exports.isPromise = exports.isPlainObject = exports.isFunction = void 0; -// eslint-disable-next-line @typescript-eslint/ban-types -function isFunction(val) { - return typeof val === 'function'; -} -exports.isFunction = isFunction; -function isPlainObject(val) { - return val !== null && typeof val === 'object' && !Array.isArray(val); -} -exports.isPlainObject = isPlainObject; -function isPromise(val) { - return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch); -} -exports.isPromise = isPromise; -function isDef(value) { - return value !== undefined && value !== null; -} -exports.isDef = isDef; -function isObj(x) { - var type = typeof x; - return x !== null && (type === 'object' || type === 'function'); -} -exports.isObj = isObj; -function isNumber(value) { - return /^\d+(\.\d+)?$/.test(value); -} -exports.isNumber = isNumber; -function isBoolean(value) { - return typeof value === 'boolean'; -} -exports.isBoolean = isBoolean; -var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; -var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i; -function isImageUrl(url) { - return IMAGE_REGEXP.test(url); -} -exports.isImageUrl = isImageUrl; -function isVideoUrl(url) { - return VIDEO_REGEXP.test(url); -} -exports.isVideoUrl = isVideoUrl; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js deleted file mode 100644 index 5937008..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.canIUseGetUserProfile = exports.canIUseCanvas2d = exports.canIUseNextTick = exports.canIUseGroupSetData = exports.canIUseAnimate = exports.canIUseFormFieldButton = exports.canIUseModel = exports.getSystemInfoSync = void 0; -var systemInfo; -function getSystemInfoSync() { - if (systemInfo == null) { - systemInfo = wx.getSystemInfoSync(); - } - return systemInfo; -} -exports.getSystemInfoSync = getSystemInfoSync; -function compareVersion(v1, v2) { - v1 = v1.split('.'); - v2 = v2.split('.'); - var len = Math.max(v1.length, v2.length); - while (v1.length < len) { - v1.push('0'); - } - while (v2.length < len) { - v2.push('0'); - } - for (var i = 0; i < len; i++) { - var num1 = parseInt(v1[i], 10); - var num2 = parseInt(v2[i], 10); - if (num1 > num2) { - return 1; - } - if (num1 < num2) { - return -1; - } - } - return 0; -} -function gte(version) { - var system = getSystemInfoSync(); - return compareVersion(system.SDKVersion, version) >= 0; -} -function canIUseModel() { - return gte('2.9.3'); -} -exports.canIUseModel = canIUseModel; -function canIUseFormFieldButton() { - return gte('2.10.3'); -} -exports.canIUseFormFieldButton = canIUseFormFieldButton; -function canIUseAnimate() { - return gte('2.9.0'); -} -exports.canIUseAnimate = canIUseAnimate; -function canIUseGroupSetData() { - return gte('2.4.0'); -} -exports.canIUseGroupSetData = canIUseGroupSetData; -function canIUseNextTick() { - try { - return wx.canIUse('nextTick'); - } - catch (e) { - return gte('2.7.1'); - } -} -exports.canIUseNextTick = canIUseNextTick; -function canIUseCanvas2d() { - return gte('2.9.0'); -} -exports.canIUseCanvas2d = canIUseCanvas2d; -function canIUseGetUserProfile() { - return !!wx.getUserProfile; -} -exports.canIUseGetUserProfile = canIUseGetUserProfile; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js deleted file mode 100644 index afc780b..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var utils_1 = require("./utils"); -function simpleTick(fn) { - return setTimeout(fn, 30); -} -(0, component_1.VantComponent)({ - props: { - useSlot: Boolean, - millisecond: Boolean, - time: { - type: Number, - observer: 'reset', - }, - format: { - type: String, - value: 'HH:mm:ss', - }, - autoStart: { - type: Boolean, - value: true, - }, - }, - data: { - timeData: (0, utils_1.parseTimeData)(0), - formattedTime: '0', - }, - destroyed: function () { - clearTimeout(this.tid); - this.tid = null; - }, - methods: { - // 开始 - start: function () { - if (this.counting) { - return; - } - this.counting = true; - this.endTime = Date.now() + this.remain; - this.tick(); - }, - // 暂停 - pause: function () { - this.counting = false; - clearTimeout(this.tid); - }, - // 重置 - reset: function () { - this.pause(); - this.remain = this.data.time; - this.setRemain(this.remain); - if (this.data.autoStart) { - this.start(); - } - }, - tick: function () { - if (this.data.millisecond) { - this.microTick(); - } - else { - this.macroTick(); - } - }, - microTick: function () { - var _this = this; - this.tid = simpleTick(function () { - _this.setRemain(_this.getRemain()); - if (_this.remain !== 0) { - _this.microTick(); - } - }); - }, - macroTick: function () { - var _this = this; - this.tid = simpleTick(function () { - var remain = _this.getRemain(); - if (!(0, utils_1.isSameSecond)(remain, _this.remain) || remain === 0) { - _this.setRemain(remain); - } - if (_this.remain !== 0) { - _this.macroTick(); - } - }); - }, - getRemain: function () { - return Math.max(this.endTime - Date.now(), 0); - }, - setRemain: function (remain) { - this.remain = remain; - var timeData = (0, utils_1.parseTimeData)(remain); - if (this.data.useSlot) { - this.$emit('change', timeData); - } - this.setData({ - formattedTime: (0, utils_1.parseFormat)(this.data.format, timeData), - }); - if (remain === 0) { - this.pause(); - this.$emit('finish'); - } - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml deleted file mode 100644 index e206e16..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml +++ /dev/null @@ -1,4 +0,0 @@ - - - {{ formattedTime }} - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss deleted file mode 100644 index 8b957f7..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-count-down{color:var(--count-down-text-color,#323233);font-size:var(--count-down-font-size,14px);line-height:var(--count-down-line-height,20px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js deleted file mode 100644 index a7cfa5f..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isSameSecond = exports.parseFormat = exports.parseTimeData = void 0; -function padZero(num, targetLength) { - if (targetLength === void 0) { targetLength = 2; } - var str = num + ''; - while (str.length < targetLength) { - str = '0' + str; - } - return str; -} -var SECOND = 1000; -var MINUTE = 60 * SECOND; -var HOUR = 60 * MINUTE; -var DAY = 24 * HOUR; -function parseTimeData(time) { - var days = Math.floor(time / DAY); - var hours = Math.floor((time % DAY) / HOUR); - var minutes = Math.floor((time % HOUR) / MINUTE); - var seconds = Math.floor((time % MINUTE) / SECOND); - var milliseconds = Math.floor(time % SECOND); - return { - days: days, - hours: hours, - minutes: minutes, - seconds: seconds, - milliseconds: milliseconds, - }; -} -exports.parseTimeData = parseTimeData; -function parseFormat(format, timeData) { - var days = timeData.days; - var hours = timeData.hours, minutes = timeData.minutes, seconds = timeData.seconds, milliseconds = timeData.milliseconds; - if (format.indexOf('DD') === -1) { - hours += days * 24; - } - else { - format = format.replace('DD', padZero(days)); - } - if (format.indexOf('HH') === -1) { - minutes += hours * 60; - } - else { - format = format.replace('HH', padZero(hours)); - } - if (format.indexOf('mm') === -1) { - seconds += minutes * 60; - } - else { - format = format.replace('mm', padZero(minutes)); - } - if (format.indexOf('ss') === -1) { - milliseconds += seconds * 1000; - } - else { - format = format.replace('ss', padZero(seconds)); - } - return format.replace('SSS', padZero(milliseconds, 3)); -} -exports.parseFormat = parseFormat; -function isSameSecond(time1, time2) { - return Math.floor(time1 / 1000) === Math.floor(time2 / 1000); -} -exports.isSameSecond = isSameSecond; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js deleted file mode 100644 index e30afef..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js +++ /dev/null @@ -1,329 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var validator_1 = require("../common/validator"); -var shared_1 = require("../picker/shared"); -var currentYear = new Date().getFullYear(); -function isValidDate(date) { - return (0, validator_1.isDef)(date) && !isNaN(new Date(date).getTime()); -} -function range(num, min, max) { - return Math.min(Math.max(num, min), max); -} -function padZero(val) { - return "00".concat(val).slice(-2); -} -function times(n, iteratee) { - var index = -1; - var result = Array(n < 0 ? 0 : n); - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} -function getTrueValue(formattedValue) { - if (formattedValue === undefined) { - formattedValue = '1'; - } - while (isNaN(parseInt(formattedValue, 10))) { - formattedValue = formattedValue.slice(1); - } - return parseInt(formattedValue, 10); -} -function getMonthEndDay(year, month) { - return 32 - new Date(year, month - 1, 32).getDate(); -} -var defaultFormatter = function (type, value) { return value; }; -(0, component_1.VantComponent)({ - classes: ['active-class', 'toolbar-class', 'column-class'], - props: __assign(__assign({}, shared_1.pickerProps), { value: { - type: null, - observer: 'updateValue', - }, filter: null, type: { - type: String, - value: 'datetime', - observer: 'updateValue', - }, showToolbar: { - type: Boolean, - value: true, - }, formatter: { - type: null, - value: defaultFormatter, - }, minDate: { - type: Number, - value: new Date(currentYear - 10, 0, 1).getTime(), - observer: 'updateValue', - }, maxDate: { - type: Number, - value: new Date(currentYear + 10, 11, 31).getTime(), - observer: 'updateValue', - }, minHour: { - type: Number, - value: 0, - observer: 'updateValue', - }, maxHour: { - type: Number, - value: 23, - observer: 'updateValue', - }, minMinute: { - type: Number, - value: 0, - observer: 'updateValue', - }, maxMinute: { - type: Number, - value: 59, - observer: 'updateValue', - } }), - data: { - innerValue: Date.now(), - columns: [], - }, - methods: { - updateValue: function () { - var _this = this; - var data = this.data; - var val = this.correctValue(data.value); - var isEqual = val === data.innerValue; - this.updateColumnValue(val).then(function () { - if (!isEqual) { - _this.$emit('input', val); - } - }); - }, - getPicker: function () { - if (this.picker == null) { - this.picker = this.selectComponent('.van-datetime-picker'); - var picker_1 = this.picker; - var setColumnValues_1 = picker_1.setColumnValues; - picker_1.setColumnValues = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return setColumnValues_1.apply(picker_1, __spreadArray(__spreadArray([], args, true), [false], false)); - }; - } - return this.picker; - }, - updateColumns: function () { - var _a = this.data.formatter, formatter = _a === void 0 ? defaultFormatter : _a; - var results = this.getOriginColumns().map(function (column) { return ({ - values: column.values.map(function (value) { return formatter(column.type, value); }), - }); }); - return this.set({ columns: results }); - }, - getOriginColumns: function () { - var filter = this.data.filter; - var results = this.getRanges().map(function (_a) { - var type = _a.type, range = _a.range; - var values = times(range[1] - range[0] + 1, function (index) { - var value = range[0] + index; - return type === 'year' ? "".concat(value) : padZero(value); - }); - if (filter) { - values = filter(type, values); - } - return { type: type, values: values }; - }); - return results; - }, - getRanges: function () { - var data = this.data; - if (data.type === 'time') { - return [ - { - type: 'hour', - range: [data.minHour, data.maxHour], - }, - { - type: 'minute', - range: [data.minMinute, data.maxMinute], - }, - ]; - } - var _a = this.getBoundary('max', data.innerValue), maxYear = _a.maxYear, maxDate = _a.maxDate, maxMonth = _a.maxMonth, maxHour = _a.maxHour, maxMinute = _a.maxMinute; - var _b = this.getBoundary('min', data.innerValue), minYear = _b.minYear, minDate = _b.minDate, minMonth = _b.minMonth, minHour = _b.minHour, minMinute = _b.minMinute; - var result = [ - { - type: 'year', - range: [minYear, maxYear], - }, - { - type: 'month', - range: [minMonth, maxMonth], - }, - { - type: 'day', - range: [minDate, maxDate], - }, - { - type: 'hour', - range: [minHour, maxHour], - }, - { - type: 'minute', - range: [minMinute, maxMinute], - }, - ]; - if (data.type === 'date') - result.splice(3, 2); - if (data.type === 'year-month') - result.splice(2, 3); - return result; - }, - correctValue: function (value) { - var data = this.data; - // validate value - var isDateType = data.type !== 'time'; - if (isDateType && !isValidDate(value)) { - value = data.minDate; - } - else if (!isDateType && !value) { - var minHour = data.minHour; - value = "".concat(padZero(minHour), ":00"); - } - // time type - if (!isDateType) { - var _a = value.split(':'), hour = _a[0], minute = _a[1]; - hour = padZero(range(hour, data.minHour, data.maxHour)); - minute = padZero(range(minute, data.minMinute, data.maxMinute)); - return "".concat(hour, ":").concat(minute); - } - // date type - value = Math.max(value, data.minDate); - value = Math.min(value, data.maxDate); - return value; - }, - getBoundary: function (type, innerValue) { - var _a; - var value = new Date(innerValue); - var boundary = new Date(this.data["".concat(type, "Date")]); - var year = boundary.getFullYear(); - var month = 1; - var date = 1; - var hour = 0; - var minute = 0; - if (type === 'max') { - month = 12; - date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1); - hour = 23; - minute = 59; - } - if (value.getFullYear() === year) { - month = boundary.getMonth() + 1; - if (value.getMonth() + 1 === month) { - date = boundary.getDate(); - if (value.getDate() === date) { - hour = boundary.getHours(); - if (value.getHours() === hour) { - minute = boundary.getMinutes(); - } - } - } - } - return _a = {}, - _a["".concat(type, "Year")] = year, - _a["".concat(type, "Month")] = month, - _a["".concat(type, "Date")] = date, - _a["".concat(type, "Hour")] = hour, - _a["".concat(type, "Minute")] = minute, - _a; - }, - onCancel: function () { - this.$emit('cancel'); - }, - onConfirm: function () { - this.$emit('confirm', this.data.innerValue); - }, - onChange: function () { - var _this = this; - var data = this.data; - var value; - var picker = this.getPicker(); - var originColumns = this.getOriginColumns(); - if (data.type === 'time') { - var indexes = picker.getIndexes(); - value = "".concat(+originColumns[0].values[indexes[0]], ":").concat(+originColumns[1] - .values[indexes[1]]); - } - else { - var indexes = picker.getIndexes(); - var values = indexes.map(function (value, index) { return originColumns[index].values[value]; }); - var year = getTrueValue(values[0]); - var month = getTrueValue(values[1]); - var maxDate = getMonthEndDay(year, month); - var date = getTrueValue(values[2]); - if (data.type === 'year-month') { - date = 1; - } - date = date > maxDate ? maxDate : date; - var hour = 0; - var minute = 0; - if (data.type === 'datetime') { - hour = getTrueValue(values[3]); - minute = getTrueValue(values[4]); - } - value = new Date(year, month - 1, date, hour, minute); - } - value = this.correctValue(value); - this.updateColumnValue(value).then(function () { - _this.$emit('input', value); - _this.$emit('change', picker); - }); - }, - updateColumnValue: function (value) { - var _this = this; - var values = []; - var type = this.data.type; - var formatter = this.data.formatter || defaultFormatter; - var picker = this.getPicker(); - if (type === 'time') { - var pair = value.split(':'); - values = [formatter('hour', pair[0]), formatter('minute', pair[1])]; - } - else { - var date = new Date(value); - values = [ - formatter('year', "".concat(date.getFullYear())), - formatter('month', padZero(date.getMonth() + 1)), - ]; - if (type === 'date') { - values.push(formatter('day', padZero(date.getDate()))); - } - if (type === 'datetime') { - values.push(formatter('day', padZero(date.getDate())), formatter('hour', padZero(date.getHours())), formatter('minute', padZero(date.getMinutes()))); - } - } - return this.set({ innerValue: value }) - .then(function () { return _this.updateColumns(); }) - .then(function () { return picker.setValues(values); }); - }, - }, - created: function () { - var _this = this; - var innerValue = this.correctValue(this.data.value); - this.updateColumnValue(innerValue).then(function () { - _this.$emit('input', innerValue); - }); - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json deleted file mode 100644 index a778e91..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-picker": "../picker/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml deleted file mode 100644 index ade2202..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss deleted file mode 100644 index 99694d6..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js deleted file mode 100644 index c8ad2e5..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js deleted file mode 100644 index 400f4f1..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var queue = []; -var defaultOptions = { - show: false, - title: '', - width: null, - theme: 'default', - message: '', - zIndex: 100, - overlay: true, - selector: '#van-dialog', - className: '', - asyncClose: false, - beforeClose: null, - transition: 'scale', - customStyle: '', - messageAlign: '', - overlayStyle: '', - confirmButtonText: '确认', - cancelButtonText: '取消', - showConfirmButton: true, - showCancelButton: false, - closeOnClickOverlay: false, - confirmButtonOpenType: '', -}; -var currentOptions = __assign({}, defaultOptions); -function getContext() { - var pages = getCurrentPages(); - return pages[pages.length - 1]; -} -var Dialog = function (options) { - options = __assign(__assign({}, currentOptions), options); - return new Promise(function (resolve, reject) { - var context = (typeof options.context === 'function' - ? options.context() - : options.context) || getContext(); - var dialog = context.selectComponent(options.selector); - delete options.context; - delete options.selector; - if (dialog) { - dialog.setData(__assign({ callback: function (action, instance) { - action === 'confirm' ? resolve(instance) : reject(instance); - } }, options)); - wx.nextTick(function () { - dialog.setData({ show: true }); - }); - queue.push(dialog); - } - else { - console.warn('未找到 van-dialog 节点,请确认 selector 及 context 是否正确'); - } - }); -}; -Dialog.alert = function (options) { return Dialog(options); }; -Dialog.confirm = function (options) { - return Dialog(__assign({ showCancelButton: true }, options)); -}; -Dialog.close = function () { - queue.forEach(function (dialog) { - dialog.close(); - }); - queue = []; -}; -Dialog.stopLoading = function () { - queue.forEach(function (dialog) { - dialog.stopLoading(); - }); -}; -Dialog.currentOptions = currentOptions; -Dialog.defaultOptions = defaultOptions; -Dialog.setDefaultOptions = function (options) { - currentOptions = __assign(__assign({}, currentOptions), options); - Dialog.currentOptions = currentOptions; -}; -Dialog.resetDefaultOptions = function () { - currentOptions = __assign({}, defaultOptions); - Dialog.currentOptions = currentOptions; -}; -Dialog.resetDefaultOptions(); -exports.default = Dialog; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js deleted file mode 100644 index f10f50f..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var button_1 = require("../mixins/button"); -var color_1 = require("../common/color"); -var utils_1 = require("../common/utils"); -(0, component_1.VantComponent)({ - mixins: [button_1.button], - classes: ['cancle-button-class', 'confirm-button-class'], - props: { - show: { - type: Boolean, - observer: function (show) { - !show && this.stopLoading(); - }, - }, - title: String, - message: String, - theme: { - type: String, - value: 'default', - }, - confirmButtonId: String, - className: String, - customStyle: String, - asyncClose: Boolean, - messageAlign: String, - beforeClose: null, - overlayStyle: String, - useSlot: Boolean, - useTitleSlot: Boolean, - useConfirmButtonSlot: Boolean, - useCancelButtonSlot: Boolean, - showCancelButton: Boolean, - closeOnClickOverlay: Boolean, - confirmButtonOpenType: String, - width: null, - zIndex: { - type: Number, - value: 2000, - }, - confirmButtonText: { - type: String, - value: '确认', - }, - cancelButtonText: { - type: String, - value: '取消', - }, - confirmButtonColor: { - type: String, - value: color_1.RED, - }, - cancelButtonColor: { - type: String, - value: color_1.GRAY, - }, - showConfirmButton: { - type: Boolean, - value: true, - }, - overlay: { - type: Boolean, - value: true, - }, - transition: { - type: String, - value: 'scale', - }, - }, - data: { - loading: { - confirm: false, - cancel: false, - }, - callback: (function () { }), - }, - methods: { - onConfirm: function () { - this.handleAction('confirm'); - }, - onCancel: function () { - this.handleAction('cancel'); - }, - onClickOverlay: function () { - this.close('overlay'); - }, - close: function (action) { - var _this = this; - this.setData({ show: false }); - wx.nextTick(function () { - _this.$emit('close', action); - var callback = _this.data.callback; - if (callback) { - callback(action, _this); - } - }); - }, - stopLoading: function () { - this.setData({ - loading: { - confirm: false, - cancel: false, - }, - }); - }, - handleAction: function (action) { - var _a; - var _this = this; - this.$emit(action, { dialog: this }); - var _b = this.data, asyncClose = _b.asyncClose, beforeClose = _b.beforeClose; - if (!asyncClose && !beforeClose) { - this.close(action); - return; - } - this.setData((_a = {}, - _a["loading.".concat(action)] = true, - _a)); - if (beforeClose) { - (0, utils_1.toPromise)(beforeClose(action)).then(function (value) { - if (value) { - _this.close(action); - } - else { - _this.stopLoading(); - } - }); - } - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json deleted file mode 100644 index 43417fc..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-popup": "../popup/index", - "van-button": "../button/index", - "van-goods-action": "../goods-action/index", - "van-goods-action-button": "../goods-action-button/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml deleted file mode 100644 index 8e0bb22..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - {{ title }} - - - - - {{ message }} - - - - - {{ cancelButtonText }} - - - {{ confirmButtonText }} - - - - - - - - - {{ cancelButtonText }} - - - - - - - - {{ confirmButtonText }} - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss deleted file mode 100644 index 507a789..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-dialog{background-color:var(--dialog-background-color,#fff);border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,320px)}@media (max-width:321px){.van-dialog{width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{font-weight:var(--dialog-header-font-weight,500);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.van-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{-webkit-overflow-scrolling:touch;font-size:var(--dialog-message-font-size,14px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,#646566);padding-top:var(--dialog-has-title-message-padding-top,8px)}.van-dialog__message--round-button{color:#323233;padding-bottom:16px}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex}.van-dialog__footer--round-button{padding:8px 24px 16px!important;position:relative!important}.van-dialog__button{flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js deleted file mode 100644 index 5c63844..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -(0, component_1.VantComponent)({ - props: { - dashed: Boolean, - hairline: Boolean, - contentPosition: String, - fontSize: String, - borderColor: String, - textColor: String, - customStyle: String, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json deleted file mode 100644 index a89ef4d..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml deleted file mode 100644 index f6a5a45..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs deleted file mode 100644 index 215b14f..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable */ -var style = require('../wxs/style.wxs'); -var addUnit = require('../wxs/add-unit.wxs'); - -function rootStyle(data) { - return style([ - { - 'border-color': data.borderColor, - color: data.textColor, - 'font-size': addUnit(data.fontSize), - }, - data.customStyle, - ]); -} - -module.exports = { - rootStyle: rootStyle, -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss deleted file mode 100644 index e91dc44..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-divider{align-items:center;border:0 solid var(--divider-border-color,#ebedf0);color:var(--divider-text-color,#969799);display:flex;font-size:var(--divider-font-size,14px);line-height:var(--divider-line-height,24px);margin:var(--divider-margin,16px 0)}.van-divider:after,.van-divider:before{border-color:inherit;border-style:inherit;border-width:1px 0 0;box-sizing:border-box;display:block;flex:1;height:1px}.van-divider:before{content:""}.van-divider--hairline:after,.van-divider--hairline:before{transform:scaleY(.5)}.van-divider--dashed{border-style:dashed}.van-divider--center:before,.van-divider--left:before,.van-divider--right:before{margin-right:var(--divider-content-padding,16px)}.van-divider--center:after,.van-divider--left:after,.van-divider--right:after{content:"";margin-left:var(--divider-content-padding,16px)}.van-divider--left:before{max-width:var(--divider-content-left-width,10%)}.van-divider--right:after{max-width:var(--divider-content-right-width,10%)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js deleted file mode 100644 index 826c26a..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var relation_1 = require("../common/relation"); -var component_1 = require("../common/component"); -(0, component_1.VantComponent)({ - classes: ['item-title-class'], - field: true, - relation: (0, relation_1.useParent)('dropdown-menu', function () { - this.updateDataFromParent(); - }), - props: { - value: { - type: null, - observer: 'rerender', - }, - title: { - type: String, - observer: 'rerender', - }, - disabled: Boolean, - titleClass: { - type: String, - observer: 'rerender', - }, - options: { - type: Array, - value: [], - observer: 'rerender', - }, - popupStyle: String, - useBeforeToggle: { - type: Boolean, - value: false, - }, - rootPortal: { - type: Boolean, - value: false, - }, - }, - data: { - transition: true, - showPopup: false, - showWrapper: false, - displayTitle: '', - safeAreaTabBar: false, - }, - methods: { - rerender: function () { - var _this = this; - wx.nextTick(function () { - var _a; - (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.updateItemListData(); - }); - }, - updateDataFromParent: function () { - if (this.parent) { - var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction, safeAreaTabBar = _a.safeAreaTabBar; - this.setData({ - overlay: overlay, - duration: duration, - activeColor: activeColor, - closeOnClickOverlay: closeOnClickOverlay, - direction: direction, - safeAreaTabBar: safeAreaTabBar, - }); - } - }, - onOpen: function () { - this.$emit('open'); - }, - onOpened: function () { - this.$emit('opened'); - }, - onClose: function () { - this.$emit('close'); - }, - onClosed: function () { - this.$emit('closed'); - this.setData({ showWrapper: false }); - }, - onOptionTap: function (event) { - var option = event.currentTarget.dataset.option; - var value = option.value; - var shouldEmitChange = this.data.value !== value; - this.setData({ showPopup: false, value: value }); - this.$emit('close'); - this.rerender(); - if (shouldEmitChange) { - this.$emit('change', value); - } - }, - toggle: function (show, options) { - var _this = this; - if (options === void 0) { options = {}; } - var showPopup = this.data.showPopup; - if (typeof show !== 'boolean') { - show = !showPopup; - } - if (show === showPopup) { - return; - } - this.onBeforeToggle(show).then(function (status) { - var _a; - if (!status) { - return; - } - _this.setData({ - transition: !options.immediate, - showPopup: show, - }); - if (show) { - (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.getChildWrapperStyle().then(function (wrapperStyle) { - _this.setData({ wrapperStyle: wrapperStyle, showWrapper: true }); - _this.rerender(); - }); - } - else { - _this.rerender(); - } - }); - }, - onBeforeToggle: function (status) { - var _this = this; - var useBeforeToggle = this.data.useBeforeToggle; - if (!useBeforeToggle) { - return Promise.resolve(true); - } - return new Promise(function (resolve) { - _this.$emit('before-toggle', { - status: status, - callback: function (value) { return resolve(value); }, - }); - }); - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json deleted file mode 100644 index 88d5409..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-popup": "../popup/index", - "van-cell": "../cell/index", - "van-icon": "../icon/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml deleted file mode 100644 index 63904f4..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - {{ item.text }} - - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss deleted file mode 100644 index 80505e9..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-dropdown-item{left:0;overflow:hidden;position:fixed;right:0}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js deleted file mode 100644 index c8ad2e5..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js deleted file mode 100644 index aed2921..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js +++ /dev/null @@ -1,122 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -var relation_1 = require("../common/relation"); -var utils_1 = require("../common/utils"); -var ARRAY = []; -(0, component_1.VantComponent)({ - field: true, - classes: ['title-class'], - relation: (0, relation_1.useChildren)('dropdown-item', function () { - this.updateItemListData(); - }), - props: { - activeColor: { - type: String, - observer: 'updateChildrenData', - }, - overlay: { - type: Boolean, - value: true, - observer: 'updateChildrenData', - }, - zIndex: { - type: Number, - value: 10, - }, - duration: { - type: Number, - value: 200, - observer: 'updateChildrenData', - }, - direction: { - type: String, - value: 'down', - observer: 'updateChildrenData', - }, - safeAreaTabBar: { - type: Boolean, - value: false, - }, - closeOnClickOverlay: { - type: Boolean, - value: true, - observer: 'updateChildrenData', - }, - closeOnClickOutside: { - type: Boolean, - value: true, - }, - }, - data: { - itemListData: [], - }, - beforeCreate: function () { - var windowHeight = (0, utils_1.getSystemInfoSync)().windowHeight; - this.windowHeight = windowHeight; - ARRAY.push(this); - }, - destroyed: function () { - var _this = this; - ARRAY = ARRAY.filter(function (item) { return item !== _this; }); - }, - methods: { - updateItemListData: function () { - this.setData({ - itemListData: this.children.map(function (child) { return child.data; }), - }); - }, - updateChildrenData: function () { - this.children.forEach(function (child) { - child.updateDataFromParent(); - }); - }, - toggleItem: function (active) { - this.children.forEach(function (item, index) { - var showPopup = item.data.showPopup; - if (index === active) { - item.toggle(); - } - else if (showPopup) { - item.toggle(false, { immediate: true }); - } - }); - }, - close: function () { - this.children.forEach(function (child) { - child.toggle(false, { immediate: true }); - }); - }, - getChildWrapperStyle: function () { - var _this = this; - var _a = this.data, zIndex = _a.zIndex, direction = _a.direction; - return (0, utils_1.getRect)(this, '.van-dropdown-menu').then(function (rect) { - var _a = rect.top, top = _a === void 0 ? 0 : _a, _b = rect.bottom, bottom = _b === void 0 ? 0 : _b; - var offset = direction === 'down' ? bottom : _this.windowHeight - top; - var wrapperStyle = "z-index: ".concat(zIndex, ";"); - if (direction === 'down') { - wrapperStyle += "top: ".concat((0, utils_1.addUnit)(offset), ";"); - } - else { - wrapperStyle += "bottom: ".concat((0, utils_1.addUnit)(offset), ";"); - } - return wrapperStyle; - }); - }, - onTitleTap: function (event) { - var _this = this; - var index = event.currentTarget.dataset.index; - var child = this.children[index]; - if (!child.data.disabled) { - ARRAY.forEach(function (menuItem) { - if (menuItem && - menuItem.data.closeOnClickOutside && - menuItem !== _this) { - menuItem.close(); - } - }); - this.toggleItem(index); - } - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json deleted file mode 100644 index 467ce29..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml deleted file mode 100644 index ec165a9..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - {{ computed.displayTitle(item) }} - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs deleted file mode 100644 index 6538854..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable */ -function displayTitle(item) { - if (item.title) { - return item.title; - } - - var match = item.options.filter(function(option) { - return option.value === item.value; - }); - var displayTitle = match.length ? match[0].text : ''; - return displayTitle; -} - -module.exports = { - displayTitle: displayTitle -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss deleted file mode 100644 index dba000e..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:11px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js deleted file mode 100644 index 755e638..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var component_1 = require("../common/component"); -(0, component_1.VantComponent)({ - props: { - description: String, - image: { - type: String, - value: 'default', - }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json deleted file mode 100644 index a89ef4d..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml deleted file mode 100644 index 9c7b719..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - {{ description }} - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs deleted file mode 100644 index cf92ece..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-disable */ -var PRESETS = ['error', 'search', 'default', 'network']; - -function imageUrl(image) { - if (PRESETS.indexOf(image) !== -1) { - return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png'; - } - - return image; -} - -module.exports = { - imageUrl: imageUrl, -}; - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss deleted file mode 100644 index 0fb74fe..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-empty{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding:32px 0}.van-empty__image{height:160px;width:160px}.van-empty__image:empty{display:none}.van-empty__image__img{height:100%;width:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{color:#969799;font-size:14px;line-height:20px;margin-top:16px;padding:0 60px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js deleted file mode 100644 index c20d266..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js +++ /dev/null @@ -1,137 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var utils_1 = require("../common/utils"); -var component_1 = require("../common/component"); -var props_1 = require("./props"); -(0, component_1.VantComponent)({ - field: true, - classes: ['input-class', 'right-icon-class', 'label-class'], - props: __assign(__assign(__assign(__assign({}, props_1.commonProps), props_1.inputProps), props_1.textareaProps), { size: String, icon: String, label: String, error: Boolean, center: Boolean, isLink: Boolean, leftIcon: String, rightIcon: String, autosize: null, required: Boolean, iconClass: String, clickable: Boolean, inputAlign: String, customStyle: String, errorMessage: String, arrowDirection: String, showWordLimit: Boolean, errorMessageAlign: String, readonly: { - type: Boolean, - observer: 'setShowClear', - }, clearable: { - type: Boolean, - observer: 'setShowClear', - }, clearTrigger: { - type: String, - value: 'focus', - }, border: { - type: Boolean, - value: true, - }, titleWidth: { - type: String, - value: '6.2em', - }, clearIcon: { - type: String, - value: 'clear', - }, extraEventParams: { - type: Boolean, - value: false, - } }), - data: { - focused: false, - innerValue: '', - showClear: false, - }, - created: function () { - this.value = this.data.value; - this.setData({ innerValue: this.value }); - }, - methods: { - formatValue: function (value) { - var maxlength = this.data.maxlength; - if (maxlength !== -1 && value.length > maxlength) { - return value.slice(0, maxlength); - } - return value; - }, - onInput: function (event) { - var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; - var formatValue = this.formatValue(value); - this.value = formatValue; - this.setShowClear(); - return this.emitChange(__assign(__assign({}, event.detail), { value: formatValue })); - }, - onFocus: function (event) { - this.focused = true; - this.setShowClear(); - this.$emit('focus', event.detail); - }, - onBlur: function (event) { - this.focused = false; - this.setShowClear(); - this.$emit('blur', event.detail); - }, - onClickIcon: function () { - this.$emit('click-icon'); - }, - onClickInput: function (event) { - this.$emit('click-input', event.detail); - }, - onClear: function () { - var _this = this; - this.setData({ innerValue: '' }); - this.value = ''; - this.setShowClear(); - (0, utils_1.nextTick)(function () { - _this.emitChange({ value: '' }); - _this.$emit('clear', ''); - }); - }, - onConfirm: function (event) { - var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; - this.value = value; - this.setShowClear(); - this.$emit('confirm', value); - }, - setValue: function (value) { - this.value = value; - this.setShowClear(); - if (value === '') { - this.setData({ innerValue: '' }); - } - this.emitChange({ value: value }); - }, - onLineChange: function (event) { - this.$emit('linechange', event.detail); - }, - onKeyboardHeightChange: function (event) { - this.$emit('keyboardheightchange', event.detail); - }, - emitChange: function (detail) { - var extraEventParams = this.data.extraEventParams; - this.setData({ value: detail.value }); - var result; - var data = extraEventParams - ? __assign(__assign({}, detail), { callback: function (data) { - result = data; - } }) : detail.value; - this.$emit('input', data); - this.$emit('change', data); - return result; - }, - setShowClear: function () { - var _a = this.data, clearable = _a.clearable, readonly = _a.readonly, clearTrigger = _a.clearTrigger; - var _b = this, focused = _b.focused, value = _b.value; - var showClear = false; - if (clearable && !readonly) { - var hasValue = !!value; - var trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused); - showClear = hasValue && trigger; - } - this.setData({ showClear: showClear }); - }, - noop: function () { }, - }, -}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json deleted file mode 100644 index 5906c50..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "van-cell": "../cell/index", - "van-icon": "../icon/index" - } -} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml deleted file mode 100644 index 6018993..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs deleted file mode 100644 index 78575b9..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable */ -var style = require('../wxs/style.wxs'); -var addUnit = require('../wxs/add-unit.wxs'); - -function inputStyle(autosize) { - if (autosize && autosize.constructor === 'Object') { - return style({ - 'min-height': addUnit(autosize.minHeight), - 'max-height': addUnit(autosize.maxHeight), - }); - } - - return ''; -} - -module.exports = { - inputStyle: inputStyle, -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss deleted file mode 100644 index 5f7d306..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-field{--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:var(--field-label-color,#646566)}.van-field__label--disabled{color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{align-items:center;display:flex}.van-field__body--textarea{box-sizing:border-box;line-height:1.2em;min-height:var(--cell-line-height,24px);padding:3.6px 0}.van-field__control:empty+.van-field__control{display:block}.van-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,#323233);display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:left;width:100%}.van-field__control:empty{display:none}.van-field__control--textarea{height:var(--field-text-area-min-height,18px);min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;color:var(--field-input-disabled-text-color,#c8c9cc);opacity:1}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__placeholder{color:var(--field-placeholder-text-color,#c8c9cc);left:0;pointer-events:none;position:absolute;right:0;top:0}.van-field__placeholder--error{color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{flex-shrink:0}.van-field__clear-root{color:var(--field-clear-icon-color,#c8c9cc);font-size:var(--field-clear-icon-size,16px)}.van-field__icon-container{color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{color:var(--field-error-message-color,#ee0a24);display:block;font-size:var(--field-error-message-text-font-size,12px);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{color:var(--field-word-limit-color,#646566);font-size:var(--field-word-limit-font-size,12px);line-height:var(--field-word-limit-line-height,16px);margin-top:var(--padding-base,4px);text-align:right}.van-field__word-num{display:inline}.van-field__word-num--full{color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml deleted file mode 100644 index e39a5ee..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js b/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js deleted file mode 100644 index 3cb8dca..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.textareaProps = exports.inputProps = exports.commonProps = void 0; -exports.commonProps = { - value: { - type: String, - observer: function (value) { - if (value !== this.value) { - this.setData({ innerValue: value }); - this.value = value; - } - }, - }, - placeholder: String, - placeholderStyle: String, - placeholderClass: String, - disabled: Boolean, - maxlength: { - type: Number, - value: -1, - }, - cursorSpacing: { - type: Number, - value: 50, - }, - autoFocus: Boolean, - focus: Boolean, - cursor: { - type: Number, - value: -1, - }, - selectionStart: { - type: Number, - value: -1, - }, - selectionEnd: { - type: Number, - value: -1, - }, - adjustPosition: { - type: Boolean, - value: true, - }, - holdKeyboard: Boolean, -}; -exports.inputProps = { - type: { - type: String, - value: 'text', - }, - password: Boolean, - confirmType: String, - confirmHold: Boolean, - alwaysEmbed: Boolean, -}; -exports.textareaProps = { - autoHeight: Boolean, - fixed: Boolean, - showConfirmBar: { - type: Boolean, - value: true, - }, - disableDefaultPadding: { - type: Boolean, - value: true, - }, -}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml deleted file mode 100644 index d42c184..0000000 --- a/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml +++ /dev/null @@ -1,30 +0,0 @@ -