@cloudbase/weda-ui 0.2.6-alhpa.0 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +240 -0
- package/package.json +5 -5
- package/src/configs/components/container.json +2 -1
- package/src/configs/components/form/input.json +6 -0
- package/src/configs/components/form/richText.json +2 -1
- package/src/configs/components/form/uploader.json +9 -4
- package/src/configs/components/image.json +2 -1
- package/src/configs/components/link.json +2 -1
- package/src/configs/components/richtextview.json +2 -1
- package/src/configs/components/scrollVeiw.json +2 -1
- package/src/configs/components/swiper.json +2 -1
- package/src/configs/components/tabs.json +31 -86
- package/src/configs/components/text.json +2 -1
- package/src/configs/index.js +3 -7
- package/src/index.js +2 -3
- package/src/mp/.gitignore +10 -0
- package/src/mp/components/form/input/index.js +5 -1
- package/src/mp/components/form/input/index.wxml +2 -1
- package/src/mp/components/form/select/index.js +2 -2
- package/src/mp/components/form/textarea/index.wxml +1 -0
- package/src/mp/components/form/uploader/index.js +48 -14
- package/src/mp/components/form/uploader/index.wxml +9 -2
- package/src/mp/components/image/index.js +57 -8
- package/src/mp/components/image/index.json +4 -1
- package/src/mp/components/image/index.wxml +4 -2
- package/src/mp/components/image/index.wxss +14 -0
- package/src/mp/components/richText/index.wxml +3 -1
- package/src/mp/components/tabs/index.js +22 -6
- package/src/mp/utils/deepEqual.js +42 -0
- package/src/web/actions/index.js +2 -4
- package/src/web/components/form/checkbox/index.jsx +8 -10
- package/src/web/components/form/enumSelect/MultipleSelect.jsx +12 -23
- package/src/web/components/form/enumSelect/NormalSelect.jsx +12 -12
- package/src/web/components/form/enumSelect/SelectContainer.jsx +43 -0
- package/src/web/components/form/enumSelect/hooks/index.js +7 -4
- package/src/web/components/form/enumSelect/props/propsTypes.js +7 -0
- package/src/web/components/form/formcell/index.jsx +1 -1
- package/src/web/components/form/input/index.jsx +16 -18
- package/src/web/components/form/radio/index.jsx +7 -7
- package/src/web/components/form/select/h5.jsx +1 -1
- package/src/web/components/form/select/region/{cities.json → cities.js} +2 -2
- package/src/web/components/form/select/region/index.js +3 -3
- package/src/web/components/form/select/region/{provinces.json → provinces.js} +2 -2
- package/src/web/components/form/select/region/{regions.json → regions.js} +2 -2
- package/src/web/components/form/switch/index.jsx +4 -9
- package/src/web/components/form/textarea/index.jsx +4 -12
- package/src/web/components/form/uploader/index.css +15 -0
- package/src/web/components/form/uploader/index.jsx +2 -2
- package/src/web/components/form/uploader/uploader.h5.jsx +237 -0
- package/src/web/components/form/uploader/{uploaderPc.jsx → uploader.pc.jsx} +69 -56
- package/src/web/components/image/image.jsx +79 -5
- package/src/web/components/image/index.css +17 -0
- package/src/web/components/image/index.jsx +1 -0
- package/src/web/components/index.js +27 -62
- package/src/web/components/richTextView/index.css +0 -10
- package/src/web/components/richTextView/index.jsx +1 -12
- package/src/web/components/tabs/{index.js → index.jsx} +3 -3
- package/src/web/components/tabs/{tabsH5.js → tabs.h5.jsx} +9 -47
- package/src/web/components/tabs/{tabsPc.js → tabs.pc.jsx} +13 -47
- package/src/web/components/uploaderView/index.jsx +1 -1
- package/src/web/index.js +2 -3
- package/src/web/utils/isObjectEqual.js +10 -1
- package/src/web/utils/useSyncValue.js +14 -0
- package/src/web/weda-ui.css +8 -0
- package/src/configs/components/form/enumSelect.json +0 -127
- package/src/configs/components/form/mapPosition.json +0 -33
- package/src/configs/components/markdown.json +0 -17
- package/src/mp/components/markdown/index.js +0 -27
- package/src/mp/components/markdown/index.json +0 -6
- package/src/mp/components/markdown/index.wxml +0 -1
- package/src/mp/components/markdown/towxml/audio-player/Audio.js +0 -99
- package/src/mp/components/markdown/towxml/audio-player/audio-player.js +0 -102
- package/src/mp/components/markdown/towxml/audio-player/audio-player.json +0 -5
- package/src/mp/components/markdown/towxml/audio-player/audio-player.wxml +0 -14
- package/src/mp/components/markdown/towxml/audio-player/audio-player.wxss +0 -175
- package/src/mp/components/markdown/towxml/audio-player/loading.svg +0 -1
- package/src/mp/components/markdown/towxml/config.js +0 -285
- package/src/mp/components/markdown/towxml/decode.js +0 -26
- package/src/mp/components/markdown/towxml/decode.json +0 -12
- package/src/mp/components/markdown/towxml/decode.wxml +0 -1
- package/src/mp/components/markdown/towxml/decode.wxss +0 -0
- package/src/mp/components/markdown/towxml/img/img.js +0 -98
- package/src/mp/components/markdown/towxml/img/img.json +0 -3
- package/src/mp/components/markdown/towxml/img/img.wxml +0 -1
- package/src/mp/components/markdown/towxml/img/img.wxss +0 -0
- package/src/mp/components/markdown/towxml/index.js +0 -19
- package/src/mp/components/markdown/towxml/latex/latex.js +0 -53
- package/src/mp/components/markdown/towxml/latex/latex.json +0 -5
- package/src/mp/components/markdown/towxml/latex/latex.wxml +0 -1
- package/src/mp/components/markdown/towxml/latex/latex.wxss +0 -0
- package/src/mp/components/markdown/towxml/parse/highlight/highlight.js +0 -729
- package/src/mp/components/markdown/towxml/parse/highlight/index.js +0 -7
- package/src/mp/components/markdown/towxml/parse/highlight/languages/bash.js +0 -91
- package/src/mp/components/markdown/towxml/parse/highlight/languages/c-like.js +0 -244
- package/src/mp/components/markdown/towxml/parse/highlight/languages/c.js +0 -20
- package/src/mp/components/markdown/towxml/parse/highlight/languages/css.js +0 -138
- package/src/mp/components/markdown/towxml/parse/highlight/languages/dart.js +0 -135
- package/src/mp/components/markdown/towxml/parse/highlight/languages/go.js +0 -57
- package/src/mp/components/markdown/towxml/parse/highlight/languages/htmlbars.js +0 -79
- package/src/mp/components/markdown/towxml/parse/highlight/languages/java.js +0 -126
- package/src/mp/components/markdown/towxml/parse/highlight/languages/javascript.js +0 -263
- package/src/mp/components/markdown/towxml/parse/highlight/languages/json.js +0 -51
- package/src/mp/components/markdown/towxml/parse/highlight/languages/less.js +0 -177
- package/src/mp/components/markdown/towxml/parse/highlight/languages/nginx.js +0 -103
- package/src/mp/components/markdown/towxml/parse/highlight/languages/php.js +0 -152
- package/src/mp/components/markdown/towxml/parse/highlight/languages/python-repl.js +0 -27
- package/src/mp/components/markdown/towxml/parse/highlight/languages/python.js +0 -146
- package/src/mp/components/markdown/towxml/parse/highlight/languages/scss.js +0 -137
- package/src/mp/components/markdown/towxml/parse/highlight/languages/shell.js +0 -23
- package/src/mp/components/markdown/towxml/parse/highlight/languages/typescript.js +0 -198
- package/src/mp/components/markdown/towxml/parse/highlight/languages/xml.js +0 -143
- package/src/mp/components/markdown/towxml/parse/highlight/style/github.wxss +0 -99
- package/src/mp/components/markdown/towxml/parse/highlight/style/monokai.wxss +0 -70
- package/src/mp/components/markdown/towxml/parse/index.js +0 -106
- package/src/mp/components/markdown/towxml/parse/markdown/index.js +0 -53
- package/src/mp/components/markdown/towxml/parse/markdown/markdown.js +0 -5834
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/emoji.js +0 -1773
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/ins.js +0 -120
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/latex.js +0 -193
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/mark.js +0 -120
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/sub.js +0 -95
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/sup.js +0 -95
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/todo.js +0 -220
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/yuml.js +0 -18
- package/src/mp/components/markdown/towxml/parse/parse2/Parser.js +0 -263
- package/src/mp/components/markdown/towxml/parse/parse2/Tokenizer.js +0 -507
- package/src/mp/components/markdown/towxml/parse/parse2/domhandler/index.js +0 -104
- package/src/mp/components/markdown/towxml/parse/parse2/domhandler/node.js +0 -169
- package/src/mp/components/markdown/towxml/parse/parse2/entities/decode.js +0 -54
- package/src/mp/components/markdown/towxml/parse/parse2/entities/decode_codepoint.js +0 -19
- package/src/mp/components/markdown/towxml/parse/parse2/entities/encode.js +0 -54
- package/src/mp/components/markdown/towxml/parse/parse2/entities/index.js +0 -30
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/decode.js +0 -31
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/entities.js +0 -2128
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/legacy.js +0 -109
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/xml.js +0 -2
- package/src/mp/components/markdown/towxml/parse/parse2/index.js +0 -8
- package/src/mp/components/markdown/towxml/style/main.wxss +0 -378
- package/src/mp/components/markdown/towxml/style/theme/dark.wxss +0 -73
- package/src/mp/components/markdown/towxml/style/theme/light.wxss +0 -63
- package/src/mp/components/markdown/towxml/table/table.js +0 -11
- package/src/mp/components/markdown/towxml/table/table.json +0 -6
- package/src/mp/components/markdown/towxml/table/table.wxml +0 -24
- package/src/mp/components/markdown/towxml/table/table.wxss +0 -0
- package/src/mp/components/markdown/towxml/todogroup/todogroup.js +0 -19
- package/src/mp/components/markdown/towxml/todogroup/todogroup.json +0 -6
- package/src/mp/components/markdown/towxml/todogroup/todogroup.wxml +0 -13
- package/src/mp/components/markdown/towxml/todogroup/todogroup.wxss +0 -3
- package/src/mp/components/markdown/towxml/towxml.js +0 -17
- package/src/mp/components/markdown/towxml/towxml.json +0 -6
- package/src/mp/components/markdown/towxml/towxml.wxml +0 -5
- package/src/mp/components/markdown/towxml/towxml.wxss +0 -8
- package/src/mp/components/markdown/towxml/yuml/yuml.js +0 -51
- package/src/mp/components/markdown/towxml/yuml/yuml.json +0 -5
- package/src/mp/components/markdown/towxml/yuml/yuml.wxml +0 -5
- package/src/mp/components/markdown/towxml/yuml/yuml.wxss +0 -0
- package/src/web/components/form/enumSelect/FormContainer.jsx +0 -41
- package/src/web/components/form/position/MapView.jsx +0 -124
- package/src/web/components/form/position/SelectModal.css +0 -3
- package/src/web/components/form/position/SelectModal.jsx +0 -112
- package/src/web/components/form/position/constants.js +0 -7
- package/src/web/components/form/position/index.jsx +0 -68
- package/src/web/components/form/uploader/uploaderH5.jsx +0 -196
- package/src/web/components/link/test/__snapshots__/storybook.test.js.snap +0 -754
- package/src/web/components/markdown/index.jsx +0 -40
- package/src/web/wedatheme/.code.yml +0 -16
- package/src/web/wedatheme/.editorconfig +0 -9
- package/src/web/wedatheme/.eslintrc +0 -20
- package/src/web/wedatheme/.orange-ci.yml +0 -55
- package/src/web/wedatheme/.vscode/extensions.json +0 -3
- package/src/web/wedatheme/.vscode/settings.json +0 -11
- package/src/web/wedatheme/README.md +0 -50
- package/src/web/wedatheme/i18n/README.md +0 -4
- package/src/web/wedatheme/i18n/translation/index.js +0 -10
- package/src/web/wedatheme/i18n/translation/zh.js +0 -15
- package/src/web/wedatheme/jsconfig.json +0 -15
- package/src/web/wedatheme/mock/app.js +0 -42
- package/src/web/wedatheme/mock/history-context.js +0 -8
- package/src/web/wedatheme/mock/index.js +0 -3
- package/src/web/wedatheme/mock/layout/AppLayout.jsx +0 -28
- package/src/web/wedatheme/mock/layout/MenuWithRouter.jsx +0 -50
- package/src/web/wedatheme/mock/layout/index.js +0 -1
- package/src/web/wedatheme/package.json +0 -61
- package/src/web/wedatheme/public/index.html +0 -19
- package/src/web/wedatheme/src/app.js +0 -22
- package/src/web/wedatheme/src/components/README.md +0 -4
- package/src/web/wedatheme/src/configs/menu.js +0 -9
- package/src/web/wedatheme/src/routes/wedatheme-index/Component.jsx +0 -402
- package/src/web/wedatheme/src/routes/wedatheme-index/Form.jsx +0 -729
- package/src/web/wedatheme/src/routes/wedatheme-index/FormItem.jsx +0 -18
- package/src/web/wedatheme/src/routes/wedatheme-index/WedathemeIndex.jsx +0 -1276
- package/src/web/wedatheme/src/routes/wedatheme-index/index.js +0 -1
- package/src/web/wedatheme/src/routes/weui2td/WEUI2TD.jsx +0 -3
- package/src/web/wedatheme/src/routes/weui2td/index.js +0 -1
- package/src/web/wedatheme/src/styles/_btn.scss +0 -24
- package/src/web/wedatheme/src/styles/_icon.scss +0 -653
- package/src/web/wedatheme/src/styles/_map.scss +0 -12
- package/src/web/wedatheme/src/styles/_middle.scss +0 -340
- package/src/web/wedatheme/src/styles/_upload.scss +0 -47
- package/src/web/wedatheme/src/styles/assets/alert-close.svg +0 -3
- package/src/web/wedatheme/src/styles/assets/and.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowdown--line.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowdown.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowleft--line.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowleft.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowright--line.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowright-blue--line.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowright.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowup--line.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/arrowup.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/bell-warning.svg +0 -3
- package/src/web/wedatheme/src/styles/assets/btnback.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/calendar.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/chartcolumn-1.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/chartcolumn.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/chartline-1.svg +0 -9
- package/src/web/wedatheme/src/styles/assets/chartline.svg +0 -9
- package/src/web/wedatheme/src/styles/assets/chartpie-1.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/chartpie.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/check-1.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/check-2.svg +0 -1
- package/src/web/wedatheme/src/styles/assets/check.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/close-1.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/close.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/consult.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/convertip--blue.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/convertip.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/copy.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/cur-active.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/cur.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/daily.svg +0 -13
- package/src/web/wedatheme/src/styles/assets/database.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/datasheet.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/delete-white.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/delete.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/detail.svg +0 -13
- package/src/web/wedatheme/src/styles/assets/dismiss.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/download.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/drop.svg +0 -15
- package/src/web/wedatheme/src/styles/assets/email-error.svg +0 -14
- package/src/web/wedatheme/src/styles/assets/email-warning.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/email.svg +0 -14
- package/src/web/wedatheme/src/styles/assets/emailv.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/error-1.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/error-filled.svg +0 -3
- package/src/web/wedatheme/src/styles/assets/error.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/externallink.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/favorable.svg +0 -9
- package/src/web/wedatheme/src/styles/assets/filter.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/firstpage.svg +0 -13
- package/src/web/wedatheme/src/styles/assets/folderclose.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/folderopen.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/fullscreenquit.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/fullsreen.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/globe-gray.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/guide.svg +0 -9
- package/src/web/wedatheme/src/styles/assets/help.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/hide.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/info.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/infoblue-1.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/infoblue-filled.svg +0 -3
- package/src/web/wedatheme/src/styles/assets/infoblue.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/jump-black.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/jump.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/lastpage.svg +0 -13
- package/src/web/wedatheme/src/styles/assets/loading.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/local.svg +0 -10
- package/src/web/wedatheme/src/styles/assets/menu-fold-white.svg +0 -6
- package/src/web/wedatheme/src/styles/assets/menu-fold.svg +0 -6
- package/src/web/wedatheme/src/styles/assets/minus.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/monitor.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/more.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/multi-line.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/news.svg +0 -3
- package/src/web/wedatheme/src/styles/assets/not.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/notice.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/pencil.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/pending-1.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/pending-gray.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/pending.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/percent-blue.svg +0 -16
- package/src/web/wedatheme/src/styles/assets/percent.svg +0 -16
- package/src/web/wedatheme/src/styles/assets/phone-error.svg +0 -11
- package/src/web/wedatheme/src/styles/assets/phone-warning.svg +0 -9
- package/src/web/wedatheme/src/styles/assets/phone.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/phonev.svg +0 -9
- package/src/web/wedatheme/src/styles/assets/plus.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/qq.svg +0 -11
- package/src/web/wedatheme/src/styles/assets/realname.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/realnamev.svg +0 -9
- package/src/web/wedatheme/src/styles/assets/refresh-blue.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/refresh.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/relationship-1.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/relationship.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/remind.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/search.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/setting.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/shopcart.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/show.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/sort.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/sortdown.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/sortup.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/success-1.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/success-filled.svg +0 -3
- package/src/web/wedatheme/src/styles/assets/success.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/table-1.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/table.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/tag.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/time.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/transfer.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/trenddown.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/trendup.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/viewgrid.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/viewlist.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/warning-1.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/warning-filled.svg +0 -3
- package/src/web/wedatheme/src/styles/assets/warning.svg +0 -8
- package/src/web/wedatheme/src/styles/assets/wechat-error.svg +0 -14
- package/src/web/wedatheme/src/styles/assets/wechat-warning.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/wechat.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/wechatv.svg +0 -12
- package/src/web/wedatheme/src/styles/assets/zoom-in-white.svg +0 -4
- package/src/web/wedatheme/src/styles/assets/zoom-in.svg +0 -4
- package/src/web/wedatheme/src/styles/assets/zoom-out-white.svg +0 -4
- package/src/web/wedatheme/src/styles/assets/zoom-out.svg +0 -4
- package/src/web/wedatheme/src/styles/index.scss +0 -18
- package/src/web/wedatheme/src/styles/main.css +0 -166
- package/src/web/wedatheme/src/styles/theme/_alert.scss +0 -73
- package/src/web/wedatheme/src/styles/theme/_badge.scss +0 -38
- package/src/web/wedatheme/src/styles/theme/_blank-page-v2.scss +0 -7
- package/src/web/wedatheme/src/styles/theme/_breadcrumb.scss +0 -8
- package/src/web/wedatheme/src/styles/theme/_bubble.scss +0 -24
- package/src/web/wedatheme/src/styles/theme/_button.scss +0 -212
- package/src/web/wedatheme/src/styles/theme/_card.scss +0 -12
- package/src/web/wedatheme/src/styles/theme/_cascader.scss +0 -43
- package/src/web/wedatheme/src/styles/theme/_checkbox&radio.scss +0 -83
- package/src/web/wedatheme/src/styles/theme/_datepicker.scss +0 -36
- package/src/web/wedatheme/src/styles/theme/_dialog.scss +0 -39
- package/src/web/wedatheme/src/styles/theme/_divider.scss +0 -1
- package/src/web/wedatheme/src/styles/theme/_drawer.scss +0 -15
- package/src/web/wedatheme/src/styles/theme/_dropdown.scss +0 -53
- package/src/web/wedatheme/src/styles/theme/_form.scss +0 -38
- package/src/web/wedatheme/src/styles/theme/_icon.scss +0 -0
- package/src/web/wedatheme/src/styles/theme/_input&textarea&select.scss +0 -85
- package/src/web/wedatheme/src/styles/theme/_inputnumber.scss +0 -16
- package/src/web/wedatheme/src/styles/theme/_link.scss +0 -14
- package/src/web/wedatheme/src/styles/theme/_list.scss +0 -41
- package/src/web/wedatheme/src/styles/theme/_metrics-board.scss +0 -14
- package/src/web/wedatheme/src/styles/theme/_notification.scss +0 -27
- package/src/web/wedatheme/src/styles/theme/_pagination.scss +0 -22
- package/src/web/wedatheme/src/styles/theme/_popconfirm.scss +0 -4
- package/src/web/wedatheme/src/styles/theme/_progress.scss +0 -28
- package/src/web/wedatheme/src/styles/theme/_region-select.scss +0 -17
- package/src/web/wedatheme/src/styles/theme/_search.scss +0 -18
- package/src/web/wedatheme/src/styles/theme/_segment.scss +0 -69
- package/src/web/wedatheme/src/styles/theme/_slider.scss +0 -18
- package/src/web/wedatheme/src/styles/theme/_status.scss +0 -4
- package/src/web/wedatheme/src/styles/theme/_steps.scss +0 -68
- package/src/web/wedatheme/src/styles/theme/_switch.scss +0 -11
- package/src/web/wedatheme/src/styles/theme/_table.scss +0 -44
- package/src/web/wedatheme/src/styles/theme/_tabs.scss +0 -44
- package/src/web/wedatheme/src/styles/theme/_tag-search.scss +0 -9
- package/src/web/wedatheme/src/styles/theme/_tag.scss +0 -48
- package/src/web/wedatheme/src/styles/theme/_timeline.scss +0 -0
- package/src/web/wedatheme/src/styles/theme/_toast.scss +0 -3
- package/src/web/wedatheme/src/styles/theme/_transfer.scss +0 -9
- package/src/web/wedatheme/src/styles/theme/_tree.scss +0 -11
- package/src/web/wedatheme/src/styles/theme/_upload.scss +0 -14
- package/src/web/wedatheme/src/styles/theme/_variables.scss +0 -140
- package/src/web/wedatheme/src/styles/theme/index.scss +0 -91
- package/src/web/wedatheme/style-package/README.md +0 -31
- package/src/web/wedatheme/style-package/ef6fa527e24e354765d806b826b41391.svg +0 -627
- package/src/web/wedatheme/style-package/index.css +0 -3
- package/src/web/wedatheme/style-package/package.json +0 -15
- package/src/web/wedatheme/tea.config.js +0 -66
- package/src/web/wedatheme/webpack/css.config.js +0 -114
- package/src/web/wedatheme/webpack/plugins/css-package-plugin.js +0 -23
- package/src/web/wedatheme/webpack/plugins/inject-assets-plugin.js +0 -32
- package/src/web/wedatheme/webpack/plugins/package-json-plugin.js +0 -66
|
@@ -2,73 +2,38 @@ import * as React from 'react';
|
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import { Tabs as TeaTabs, TabPanel, ConfigProvider } from 'tea-component';
|
|
4
4
|
import classNames from '../../utils/classnames';
|
|
5
|
+
import { useSyncValue } from '../../utils/useSyncValue';
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
export default function TabsPc({
|
|
8
9
|
tabs,
|
|
10
|
+
selectedIndex,
|
|
9
11
|
events,
|
|
10
12
|
className,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
panel3,
|
|
14
|
-
panel4,
|
|
15
|
-
panel5,
|
|
16
|
-
panel6,
|
|
17
|
-
panel7,
|
|
18
|
-
panel8,
|
|
19
|
-
panel9,
|
|
20
|
-
panel10,
|
|
21
|
-
panel11,
|
|
22
|
-
panel12,
|
|
23
|
-
panel13,
|
|
24
|
-
panel14,
|
|
25
|
-
panel15,
|
|
26
|
-
panel16,
|
|
27
|
-
panel17,
|
|
28
|
-
panel18,
|
|
29
|
-
panel19,
|
|
30
|
-
panel20,
|
|
31
|
-
style
|
|
13
|
+
style,
|
|
14
|
+
...restProps
|
|
32
15
|
}) {
|
|
33
16
|
|
|
34
|
-
const
|
|
35
|
-
panel1,
|
|
36
|
-
panel2,
|
|
37
|
-
panel3,
|
|
38
|
-
panel4,
|
|
39
|
-
panel5,
|
|
40
|
-
panel6,
|
|
41
|
-
panel7,
|
|
42
|
-
panel8,
|
|
43
|
-
panel9,
|
|
44
|
-
panel10,
|
|
45
|
-
panel11,
|
|
46
|
-
panel12,
|
|
47
|
-
panel13,
|
|
48
|
-
panel14,
|
|
49
|
-
panel15,
|
|
50
|
-
panel16,
|
|
51
|
-
panel17,
|
|
52
|
-
panel18,
|
|
53
|
-
panel19,
|
|
54
|
-
panel20
|
|
55
|
-
};
|
|
56
|
-
|
|
17
|
+
const [activeIndex, setActiveIndex] = useSyncValue(selectedIndex);
|
|
57
18
|
const _tabs = Array.isArray(tabs) && tabs.length && tabs.map((item, index) => {
|
|
58
19
|
return {
|
|
59
|
-
id:
|
|
20
|
+
id: index,
|
|
60
21
|
label: item.title
|
|
61
22
|
};
|
|
62
23
|
});
|
|
63
24
|
|
|
64
25
|
|
|
65
26
|
|
|
27
|
+
// React.useEffect(() => {
|
|
28
|
+
// console.log('render');
|
|
29
|
+
// });
|
|
66
30
|
const onActive = (e) => {
|
|
31
|
+
setActiveIndex(e.id);
|
|
67
32
|
events && events.change(e);
|
|
68
33
|
};
|
|
69
34
|
return (
|
|
70
35
|
<ConfigProvider classPrefix="wedatea2td">
|
|
71
|
-
<TeaTabs
|
|
36
|
+
<TeaTabs style={style} tabs={_tabs} activeId={activeIndex} onActive={onActive} className={classNames(
|
|
72
37
|
"weda-tabs_pc",
|
|
73
38
|
{
|
|
74
39
|
[className]: className
|
|
@@ -81,7 +46,7 @@ export default function TabsPc({
|
|
|
81
46
|
id={item.id}
|
|
82
47
|
label={item.label}
|
|
83
48
|
>
|
|
84
|
-
{
|
|
49
|
+
{restProps[`panel${index + 1}`]}
|
|
85
50
|
</TabPanel>
|
|
86
51
|
)
|
|
87
52
|
)}
|
|
@@ -93,6 +58,7 @@ export default function TabsPc({
|
|
|
93
58
|
TabsPc.propTypes = {
|
|
94
59
|
tabs: PropTypes.array,
|
|
95
60
|
className: PropTypes.string,
|
|
61
|
+
selectedIndex: PropTypes.number,
|
|
96
62
|
style: PropTypes.object,
|
|
97
63
|
events: PropTypes.objectOf(PropTypes.func),
|
|
98
64
|
panel1: PropTypes.node,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
|
-
import { TcbImage } from '../form/uploader/
|
|
3
|
+
import { TcbImage } from '../form/uploader/uploader.pc';
|
|
4
4
|
import classNames from '../../utils/classnames';
|
|
5
5
|
import './index.css';
|
|
6
6
|
|
package/src/web/index.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import isEqual from 'lodash.isequal';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export function serde(a) {
|
|
4
|
+
return JSON.parse(JSON.stringify(a));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const isObj = (a) => typeof a === 'object' && a !== null;
|
|
8
|
+
|
|
9
|
+
export default function (a, b, shouldSerde = false) {
|
|
10
|
+
if(shouldSerde && isObj(a) && isObj(b)) { // for Proxy created by mbox
|
|
11
|
+
return isEqual(serde(a), serde(b));
|
|
12
|
+
}
|
|
4
13
|
return isEqual(a, b);
|
|
5
14
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { usePrevious } from "react-use";
|
|
3
|
+
|
|
4
|
+
export function useSyncValue(defaultValue, comparotor = Object.is) {
|
|
5
|
+
const [stateValue, setStateValue] = useState(defaultValue);
|
|
6
|
+
const prevValue = usePrevious(defaultValue);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!comparotor(prevValue, defaultValue)) {
|
|
9
|
+
setStateValue(defaultValue);
|
|
10
|
+
}
|
|
11
|
+
}, [defaultValue]);
|
|
12
|
+
return [stateValue, setStateValue];
|
|
13
|
+
}
|
|
14
|
+
|
package/src/web/weda-ui.css
CHANGED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json",
|
|
3
|
-
"data": {
|
|
4
|
-
"properties": {
|
|
5
|
-
"label": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"default": "标题",
|
|
8
|
-
"title": "标题"
|
|
9
|
-
},
|
|
10
|
-
"labelVisible": {
|
|
11
|
-
"type": "boolean",
|
|
12
|
-
"default": true,
|
|
13
|
-
"title": "显示标题"
|
|
14
|
-
},
|
|
15
|
-
"requiredFlag": {
|
|
16
|
-
"type": "boolean",
|
|
17
|
-
"default": false,
|
|
18
|
-
"title": "是否显示必填标记"
|
|
19
|
-
},
|
|
20
|
-
"layout": {
|
|
21
|
-
"title": "布局方式",
|
|
22
|
-
"type": "string",
|
|
23
|
-
"default": "horizontal",
|
|
24
|
-
"enum": [
|
|
25
|
-
{
|
|
26
|
-
"label": "水平",
|
|
27
|
-
"value": "horizontal"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"label": "垂直",
|
|
31
|
-
"value": "vertical"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
"defaultValue": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"default": "",
|
|
39
|
-
"title": "默认值"
|
|
40
|
-
},
|
|
41
|
-
"name": {
|
|
42
|
-
"type": "string",
|
|
43
|
-
"default": "",
|
|
44
|
-
"title": "默认值"
|
|
45
|
-
},
|
|
46
|
-
"placeholder": {
|
|
47
|
-
"type": "string",
|
|
48
|
-
"default": "请选择",
|
|
49
|
-
"title": "占位符"
|
|
50
|
-
},
|
|
51
|
-
"disabled": {
|
|
52
|
-
"type": "boolean",
|
|
53
|
-
"default": false,
|
|
54
|
-
"title": "是否禁用"
|
|
55
|
-
},
|
|
56
|
-
"options": {
|
|
57
|
-
"type": "array",
|
|
58
|
-
"default": [{ "value": "123", "text": "eqwe" }],
|
|
59
|
-
"title": "选项列表"
|
|
60
|
-
},
|
|
61
|
-
"clearable": {
|
|
62
|
-
"type": "boolean",
|
|
63
|
-
"default": false,
|
|
64
|
-
"title": "是否支持清空"
|
|
65
|
-
},
|
|
66
|
-
"appearance": {
|
|
67
|
-
"type": "array",
|
|
68
|
-
"default": "button",
|
|
69
|
-
"enum": [
|
|
70
|
-
{
|
|
71
|
-
"label": "无边框,适用于页面标题和表格内",
|
|
72
|
-
"value": "default"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"label": "为按钮风格,有边框,多用于操作栏中",
|
|
76
|
-
"value": "button"
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
|
-
"isMultipleEnum": {
|
|
81
|
-
"type": "boolean",
|
|
82
|
-
"default": false,
|
|
83
|
-
"title": "是否为多选"
|
|
84
|
-
},
|
|
85
|
-
"allOption": {
|
|
86
|
-
"type": "boolean",
|
|
87
|
-
"default": false,
|
|
88
|
-
"title": "表示全选的选项"
|
|
89
|
-
},
|
|
90
|
-
"boxSizeSync": {
|
|
91
|
-
"type": "boolean",
|
|
92
|
-
"default": true,
|
|
93
|
-
"title": "弹出区域尺寸(宽度)是否同步按钮尺寸"
|
|
94
|
-
},
|
|
95
|
-
"type": {
|
|
96
|
-
"type": "array",
|
|
97
|
-
"default": "button",
|
|
98
|
-
"enum": [
|
|
99
|
-
{
|
|
100
|
-
"label": "模拟下拉框",
|
|
101
|
-
"value": "simulate"
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
"searchable": {
|
|
106
|
-
"type": "boolean",
|
|
107
|
-
"default": true,
|
|
108
|
-
"title": "支持搜索"
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"meta": {
|
|
113
|
-
"title": "模型选择框",
|
|
114
|
-
"description": "模型选择框",
|
|
115
|
-
"category": "表单"
|
|
116
|
-
},
|
|
117
|
-
"events": [
|
|
118
|
-
{
|
|
119
|
-
"name": "change",
|
|
120
|
-
"title": "值改变"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"name": "cancel",
|
|
124
|
-
"title": "取消"
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json",
|
|
3
|
-
"data": {
|
|
4
|
-
"properties": {
|
|
5
|
-
"defaultValue": {
|
|
6
|
-
"type": "string",
|
|
7
|
-
"default": "",
|
|
8
|
-
"title": "默认值"
|
|
9
|
-
},
|
|
10
|
-
"label": {
|
|
11
|
-
"type": "string",
|
|
12
|
-
"default": "标题",
|
|
13
|
-
"title": "标题"
|
|
14
|
-
},
|
|
15
|
-
"labelVisible": {
|
|
16
|
-
"type": "boolean",
|
|
17
|
-
"default": true,
|
|
18
|
-
"title": "显示标题"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"meta": {
|
|
23
|
-
"title": "地理位置",
|
|
24
|
-
"description": "地理位置",
|
|
25
|
-
"category": "表单"
|
|
26
|
-
},
|
|
27
|
-
"events": [
|
|
28
|
-
{
|
|
29
|
-
"name": "change",
|
|
30
|
-
"title": "值改变"
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json",
|
|
3
|
-
"data": {
|
|
4
|
-
"properties": {
|
|
5
|
-
"source": {
|
|
6
|
-
"title": "markdown 内容",
|
|
7
|
-
"type": "textarea",
|
|
8
|
-
"default": "> 这是 `markdown` 文本"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"meta": {
|
|
13
|
-
"title": "Markdown",
|
|
14
|
-
"description": "markdown 预览",
|
|
15
|
-
"category": "展示"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const towxml = require('./towxml/index');
|
|
2
|
-
|
|
3
|
-
Component({
|
|
4
|
-
options: {
|
|
5
|
-
virtualHost: true,
|
|
6
|
-
},
|
|
7
|
-
data: {
|
|
8
|
-
nodes: {},
|
|
9
|
-
},
|
|
10
|
-
properties: {
|
|
11
|
-
source: {
|
|
12
|
-
type: String,
|
|
13
|
-
value: '> 这是 `markdown` 文本',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
methods: {
|
|
17
|
-
updateNodes() {
|
|
18
|
-
const nodes = towxml(this.properties.source, 'markdown', {});
|
|
19
|
-
this.setData({ nodes });
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
observers: {
|
|
23
|
-
source() {
|
|
24
|
-
this.updateNodes();
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<towxml className="weda-ui" nodes="{{nodes}}"></towxml>
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
const fillIn = (val) => `${val < 10 ? '0' : ''}${val}`;
|
|
2
|
-
const formatTime = (_time) => {
|
|
3
|
-
const time = Math.round(_time);
|
|
4
|
-
const second = Math.round(time % 60);
|
|
5
|
-
const minute = Math.floor((time / 60) % 60);
|
|
6
|
-
const hour = Math.floor(time / 60 / 60);
|
|
7
|
-
return `${fillIn(hour)}:${fillIn(minute)}:${fillIn(second)}`;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
class Audio {
|
|
11
|
-
constructor(obj) {
|
|
12
|
-
const _ts = this;
|
|
13
|
-
const option = (_ts.option = obj.attr);
|
|
14
|
-
|
|
15
|
-
(_ts.loop = option.loop === 'true'), (_ts.autoplay = option.autoplay === 'true');
|
|
16
|
-
_ts.create();
|
|
17
|
-
_ts.index = 0;
|
|
18
|
-
}
|
|
19
|
-
create() {
|
|
20
|
-
const _ts = this;
|
|
21
|
-
const { option } = _ts;
|
|
22
|
-
const audio = (_ts.audio = wx.createInnerAudioContext());
|
|
23
|
-
audio.src = option.src;
|
|
24
|
-
|
|
25
|
-
// 说明可以播放了
|
|
26
|
-
audio.onCanplay(() => {
|
|
27
|
-
if (_ts.autoplay && !_ts.index) {
|
|
28
|
-
_ts.play();
|
|
29
|
-
}
|
|
30
|
-
if (!_ts.autoplay && !_ts.index) {
|
|
31
|
-
_ts.eventCanplay();
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// 更新时间
|
|
36
|
-
audio.onTimeUpdate(() => {
|
|
37
|
-
// _ts.status = 'update';
|
|
38
|
-
_ts.duration = audio.duration;
|
|
39
|
-
_ts.currentTime = audio.currentTime;
|
|
40
|
-
|
|
41
|
-
// 定义播放结束
|
|
42
|
-
if (_ts.duration - _ts.currentTime < 0.5) {
|
|
43
|
-
_ts.index++;
|
|
44
|
-
if (_ts.loop) {
|
|
45
|
-
audio.stop();
|
|
46
|
-
} else {
|
|
47
|
-
_ts.stop();
|
|
48
|
-
}
|
|
49
|
-
audio.seek(0);
|
|
50
|
-
}
|
|
51
|
-
_ts.eventTimeUpdate(formatTime(_ts.duration), formatTime(_ts.currentTime));
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
audio.onSeeked(() => {
|
|
56
|
-
if (_ts.loop) {
|
|
57
|
-
_ts.play();
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
// 播放
|
|
62
|
-
play() {
|
|
63
|
-
const _ts = this;
|
|
64
|
-
_ts.status = 'play';
|
|
65
|
-
_ts.audio.play();
|
|
66
|
-
_ts.eventPlay();
|
|
67
|
-
}
|
|
68
|
-
// 暂停
|
|
69
|
-
pause() {
|
|
70
|
-
const _ts = this;
|
|
71
|
-
_ts.status = 'pause';
|
|
72
|
-
_ts.audio.pause();
|
|
73
|
-
_ts.eventPause();
|
|
74
|
-
}
|
|
75
|
-
// 停止
|
|
76
|
-
stop() {
|
|
77
|
-
const _ts = this;
|
|
78
|
-
_ts.status = 'stop';
|
|
79
|
-
_ts.audio.stop();
|
|
80
|
-
_ts.eventStop();
|
|
81
|
-
}
|
|
82
|
-
// 销毁
|
|
83
|
-
destroy() {
|
|
84
|
-
const _ts = this;
|
|
85
|
-
_ts.stop();
|
|
86
|
-
_ts.audio.destroy();
|
|
87
|
-
}
|
|
88
|
-
eventCanplay() {}
|
|
89
|
-
eventTimeUpdate() {}
|
|
90
|
-
eventEnded() {}
|
|
91
|
-
eventError() {}
|
|
92
|
-
eventPause() {}
|
|
93
|
-
eventPlay() {}
|
|
94
|
-
eventSeeked() {}
|
|
95
|
-
eventSeeking() {}
|
|
96
|
-
eventStop() {}
|
|
97
|
-
eventWaiting() {}
|
|
98
|
-
}
|
|
99
|
-
module.exports = Audio;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
const Audio = require('./Audio');
|
|
2
|
-
Component({
|
|
3
|
-
options: {
|
|
4
|
-
styleIsolation: 'shared',
|
|
5
|
-
},
|
|
6
|
-
properties: {
|
|
7
|
-
data: {
|
|
8
|
-
type: Object,
|
|
9
|
-
value: {},
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
lifetimes: {
|
|
13
|
-
// 页面生命周期
|
|
14
|
-
attached() {
|
|
15
|
-
const _ts = this;
|
|
16
|
-
const audio = (_ts.audio = new Audio(this.data.data));
|
|
17
|
-
|
|
18
|
-
audio.eventPlay = function () {
|
|
19
|
-
_ts.setData({ tips: { state: 'h2w__audio--play', text: 'Playing' } });
|
|
20
|
-
};
|
|
21
|
-
audio.eventCanplay = function () {
|
|
22
|
-
_ts.setData({ tips: { state: 'h2w__audio--readyed', text: 'Readyed' } });
|
|
23
|
-
};
|
|
24
|
-
audio.eventTimeUpdate = function (duration, currentTime) {
|
|
25
|
-
_ts.setData({
|
|
26
|
-
time: {
|
|
27
|
-
currentTime,
|
|
28
|
-
duration,
|
|
29
|
-
schedule: `${(Math.round(_ts.audio.currentTime) / Math.round(_ts.audio.duration)) * 100}%`,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
audio.eventPause = function () {
|
|
34
|
-
_ts.setData({ tips: { state: 'h2w__audio--pause', text: 'Pause' } });
|
|
35
|
-
};
|
|
36
|
-
audio.eventStop = function () {
|
|
37
|
-
_ts.setData({ tips: { state: 'h2w__audio--end', text: 'End' } });
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// // 更新播放状态
|
|
41
|
-
// _ts.audio.onTimeUpdate = function(duration,currentTime){
|
|
42
|
-
// _ts.setData({
|
|
43
|
-
// playerData:{
|
|
44
|
-
// state:'h2w__audio--play',
|
|
45
|
-
// tips:'Playing',
|
|
46
|
-
// currentTime:currentTime,
|
|
47
|
-
// duration:duration,
|
|
48
|
-
// schedule:_ts.audio.currentTime / _ts.audio.duration * 100 + '%'
|
|
49
|
-
// }
|
|
50
|
-
// });
|
|
51
|
-
// };
|
|
52
|
-
|
|
53
|
-
// _ts.audio.onPause = function(){
|
|
54
|
-
// _ts.setData({playerData:{state:'h2w__audio--pause',tips:'Pause'}});
|
|
55
|
-
// };
|
|
56
|
-
|
|
57
|
-
// _ts.audio.onCanplay = function(){
|
|
58
|
-
// _ts.setData({playerData:{state:'h2w__audio--readyed',tips:'Readyed'}});
|
|
59
|
-
// };
|
|
60
|
-
|
|
61
|
-
// _ts.audio.onError = function(){
|
|
62
|
-
// _ts.setData({playerData:{state:'h2w__audio--error',tips:'Error'}});
|
|
63
|
-
// };
|
|
64
|
-
|
|
65
|
-
// _ts.audio.onEnded = ()=>{
|
|
66
|
-
// _ts.setData({playerData:{state:'h2w__audio--end',tips:'End'}});
|
|
67
|
-
// };
|
|
68
|
-
},
|
|
69
|
-
moved() {
|
|
70
|
-
_ts.audio.destroy();
|
|
71
|
-
},
|
|
72
|
-
detached: () => {},
|
|
73
|
-
},
|
|
74
|
-
data: {
|
|
75
|
-
tips: {
|
|
76
|
-
state: '',
|
|
77
|
-
text: '--',
|
|
78
|
-
},
|
|
79
|
-
time: {
|
|
80
|
-
currentTime: '00:00:00',
|
|
81
|
-
duration: '00:00:00',
|
|
82
|
-
schedule: '0%',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
methods: {
|
|
86
|
-
playAndPause() {
|
|
87
|
-
const _ts = this;
|
|
88
|
-
const { audio } = _ts;
|
|
89
|
-
|
|
90
|
-
// console.log(audio);
|
|
91
|
-
|
|
92
|
-
audio.isTouch = true;
|
|
93
|
-
if (audio.status === 'update' || audio.status === 'play') {
|
|
94
|
-
// console.log('pause');
|
|
95
|
-
audio.pause();
|
|
96
|
-
} else {
|
|
97
|
-
// console.log('play');
|
|
98
|
-
audio.play();
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<view class="h2w__audio {{tips.state || 'h2w__audio--loading'}}" bind:tap="playAndPause">
|
|
2
|
-
<view class="h2w__audioIcon"></view>
|
|
3
|
-
<view class="h2w__audioCover">
|
|
4
|
-
<image class="h2w__audioLoading" src="loading.svg"></image>
|
|
5
|
-
<image class="h2w__audioCoverImg" src="{{data.attr.poster}}"></image>
|
|
6
|
-
</view>
|
|
7
|
-
<view class="h2w__audioInfo">
|
|
8
|
-
<view class="h2w__audioTips">{{tips.text || 'Error'}}</view>
|
|
9
|
-
<view class="h2w__audioSchedule" style="width:{{time.schedule}};"></view>
|
|
10
|
-
<view class="h2w__audioTitle">{{data.attr.name}}</view>
|
|
11
|
-
<view class="h2w__audioAuthor">{{data.attr.author}}</view>
|
|
12
|
-
<view class="h2w__audioTime">{{time.currentTime || '00:00:00'}} / {{time.duration || '00:00:00'}}</view>
|
|
13
|
-
</view>
|
|
14
|
-
</view>
|