From 9b09d13712c0c005891450a3bf4b6d848ec0ff37 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 29 十一月 2023 10:28:24 +0800
Subject: [PATCH] 2023.11.29
---
pages/mSelfPatrol/components/emergency-self-patrol/index.json | 4
miniprogram_npm/tdesign-miniprogram/icon/type.js | 1
pages/mService/cScheduletoday/index.js | 150
miniprogram_npm/tdesign-miniprogram/progress/progress.wxss | 156
pages/mUser/personalauthentication/personalauthentication.js | 4
miniprogram_npm/tdesign-miniprogram/button/button.json | 7
miniprogram_npm/tdesign-miniprogram/overlay/overlay.json | 3
pages/mSelfPatrol/components/emergency-self-patrol/index.wxss | 35
miniprogram_npm/tdesign-miniprogram/popup/popup.wxs | 8
miniprogram_npm/tdesign-miniprogram/badge/type.js | 1
pages/mSelfPatrol/patrolhome/index.wxml | 29
miniprogram_npm/tdesign-miniprogram/side-bar-item/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/progress/progress.wxs | 44
miniprogram_npm/tdesign-miniprogram/button/button.wxss | 451 +
miniprogram_npm/tdesign-miniprogram/cell/cell.js | 57
miniprogram_npm/tdesign-miniprogram/grid/README.md | 84
miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.json | 7
pages/mUser/baseC/cSceneInfo/cSceneInfo.wxss | 72
pages/mConsult/consultsearch/consultsearch.js | 2
miniprogram_npm/tdesign-miniprogram/common/config.d.ts | 5
miniprogram_npm/tdesign-miniprogram/popup/type.d.ts | 62
miniprogram_npm/tdesign-miniprogram/common/bus.js | 16
miniprogram_npm/tdesign-miniprogram/image/image.wxml | 52
miniprogram_npm/tdesign-miniprogram/progress/utils.js | 30
miniprogram_npm/tdesign-miniprogram/side-bar-item/props.js | 20
package-lock.json | 44
miniprogram_npm/tdesign-miniprogram/image/image.d.ts | 27
miniprogram_npm/tdesign-miniprogram/common/utils.wxs | 137
component/form/index.wxss | 68
miniprogram_npm/tdesign-miniprogram/common/src/superComponent.js | 5
pages/mUser/companyauthentication/companyauthentication.js | 3
miniprogram_npm/tdesign-miniprogram/grid/type.js | 1
miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxss | 42
miniprogram_npm/tdesign-miniprogram/image/image-info.json | 75
pages/mLedger/ledgerupload/ledgerupload.wxml | 94
miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxss | 202
miniprogram_npm/tdesign-miniprogram/common/version.d.ts | 2
miniprogram_npm/tdesign-miniprogram/common/style/index.wxss | 27
.prettierrc | 25
data/schedules.js | 4
miniprogram_npm/tdesign-miniprogram/mixins/transition.d.ts | 1
miniprogram_npm/tdesign-miniprogram/sticky/index.d.ts | 3
res/icons/icon9.png | 0
component/form/index.json | 10
service/userservice.js | 2
miniprogram_npm/tdesign-miniprogram/common/src/superComponent.d.ts | 19
miniprogram_npm/tdesign-miniprogram/common/src/index.d.ts | 4
pages/mSelfPatrol/patrolhome/index.js | 38
service/configservice.js | 0
miniprogram_npm/tdesign-miniprogram/common/src/control.d.ts | 15
service/ledgerservice.js | 81
pages/mPromise/promiseresult/promiseresult.wxml | 10
miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxss | 0
miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.d.ts | 3
miniprogram_npm/tdesign-miniprogram/side-bar/type.d.ts | 10
.prettierignore | 4
pages/mLearn/learn/learn.js | 4
pages/mUser/personalauthentication/personalauthentication.wxml | 2
miniprogram_npm/tdesign-miniprogram/image/README.en-US.md | 25
miniprogram_npm/tdesign-miniprogram/button/type.js | 1
miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.js | 58
miniprogram_npm/tdesign-miniprogram/image/index.d.ts | 4
miniprogram_npm/tdesign-miniprogram/switch/README.en-US.md | 22
miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxml | 24
miniprogram_npm/tdesign-miniprogram/sticky/type.d.ts | 26
miniprogram_npm/tdesign-miniprogram/loading/props.js | 51
miniprogram_npm/tdesign-miniprogram/tab-panel/type.d.ts | 35
pages/mService/cSchedule/cSchedule.wxml | 39
miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxss | 121
miniprogram_npm/tdesign-miniprogram/tab-panel/props.js | 28
miniprogram_npm/tdesign-miniprogram/checkbox/README.md | 106
miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.d.ts | 20
miniprogram_npm/tdesign-miniprogram/popup/props.js | 51
miniprogram_npm/tdesign-miniprogram/common/style/mixins/_cursor.wxss | 0
miniprogram_npm/tdesign-miniprogram/common/src/control.js | 40
pages/mSelfPatrol/components/self-patrol/index.js | 110
miniprogram_npm/tdesign-miniprogram/common/common.js | 1
miniprogram_npm/tdesign-miniprogram/popup/type.js | 1
miniprogram_npm/tdesign-miniprogram/common/style/utilities/_animation.wxss | 8
pages/home/home.js | 342
pages/mConsult/consultonline/consultonline.wxml | 2
pages/mUser/sceneauthentication/industrial/index.wxss | 41
miniprogram_npm/tdesign-miniprogram/mixins/touch.d.ts | 2
miniprogram_npm/tdesign-miniprogram/side-bar/props.js | 10
pages/mConsult/consultsearch/consultsearch.wxml | 42
pages/home/home.wxml | 95
pages/mSelfPatrol/patrolhome/index.wxss | 4
miniprogram_npm/tdesign-miniprogram/badge/props.js | 41
miniprogram_npm/tdesign-miniprogram/grid/grid.wxss | 40
miniprogram_npm/tdesign-miniprogram/dialog/dialog.js | 146
pages/mUser/sceneauthentication/industrial/index.json | 13
miniprogram_npm/tdesign-miniprogram/dialog/dialog.json | 8
miniprogram_npm/tdesign-miniprogram/dialog/index.d.ts | 41
miniprogram_npm/tdesign-miniprogram/grid/grid.json | 4
package.json | 17
pages/mSelfPatrol/patrolhome/index.json | 7
miniprogram_npm/tdesign-miniprogram/badge/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/loading/README.en-US.md | 21
miniprogram_npm/tdesign-miniprogram/dialog/README.en-US.md | 30
miniprogram_npm/tdesign-miniprogram/common/style/base.wxss | 0
miniprogram_npm/tdesign-miniprogram/dialog/dialog.d.ts | 28
miniprogram_npm/tdesign-miniprogram/overlay/overlay.js | 65
miniprogram_npm/tdesign-miniprogram/sticky/type.js | 1
miniprogram_npm/tdesign-miniprogram/progress/utils.d.ts | 11
miniprogram_npm/tdesign-miniprogram/button/index.d.ts | 3
component/form/index.wxml | 96
service/baserequest.js | 92
pages/mLedger/ledgerhistory/ledgerhistory.wxml | 56
miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.js | 142
pages/mPromise/promisefile/promisefile.js | 129
miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.d.ts | 11
component/form/index.js | 22
component/inputcell/inputcell.wxml | 35
miniprogram_npm/tdesign-miniprogram/common/src/index.js | 4
miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxs | 20
miniprogram_npm/tdesign-miniprogram/common/config.js | 4
style/animation.wxss | 17
miniprogram_npm/tdesign-miniprogram/badge/badge.wxs | 70
miniprogram_npm/tdesign-miniprogram/image/README.md | 65
miniprogram_npm/tdesign-miniprogram/switch/switch.js | 53
miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.js | 128
miniprogram_npm/tdesign-miniprogram/common/template/icon.wxml | 15
miniprogram_npm/tdesign-miniprogram/grid-item/type.js | 1
miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.js | 154
pages/mLedger/ledgerhome/ledgerhome.js | 247
miniprogram_npm/tdesign-miniprogram/badge/README.md | 47
miniprogram_npm/tdesign-miniprogram/cell/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/icon/icon.d.ts | 18
pages/mPromise/promiseinfo/promiseinfo.js | 239
miniprogram_npm/tdesign-miniprogram/cell/cell.json | 7
miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.d.ts | 19
miniprogram_npm/tdesign-miniprogram/cell/cell.wxss | 122
miniprogram_npm/tdesign-miniprogram/grid/README.en-US.md | 29
miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.d.ts | 6
pages/mUser/sceneauthentication/industrial/index.js | 309
miniprogram_npm/tdesign-miniprogram/common/common.d.ts | 35
miniprogram_npm/tdesign-miniprogram/icon/props.d.ts | 3
data/sceneInfo.js | 69
pages/mUser/baseC/cSceneInfo/cSceneInfo.wxml | 60
pages/mUser/userlogin/userlogin.js | 141
pages/mAssessment/gradereport/gradereport.wxml | 32
miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxml | 57
miniprogram_npm/tdesign-miniprogram/icon/icon.wxml | 15
miniprogram_npm/tdesign-miniprogram/image/index.js | 2
pages/mConsult/consultdetailqa/consultdetailqa.wxml | 2
miniprogram_npm/tdesign-miniprogram/checkbox-group/type.js | 1
miniprogram_npm/tdesign-miniprogram/popup/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/common/style/utilities/_index.wxss | 27
miniprogram_npm/tdesign-miniprogram/common/template/button.wxml | 37
miniprogram_npm/tdesign-miniprogram/checkbox-group/type.d.ts | 38
miniprogram_npm/tdesign-miniprogram/tabs/README.md | 144
miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.js | 61
miniprogram_npm/tdesign-miniprogram/tabs/README.en-US.md | 37
pages/mUser/mine/mine.wxml | 16
miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.d.ts | 100
miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxss | 124
miniprogram_npm/tdesign-miniprogram/grid-item/props.js | 37
miniprogram_npm/tdesign-miniprogram/popup/popup.js | 44
miniprogram_npm/tdesign-miniprogram/cell/cell.wxml | 58
miniprogram_npm/tdesign-miniprogram/image/type.js | 1
miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxss | 38
pages/mService/pScheduledetail/pScheduledetail.wxml | 6
miniprogram_npm/tdesign-miniprogram/progress/props.js | 32
miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.json | 8
miniprogram_npm/tdesign-miniprogram/common/shared/date.d.ts | 21
miniprogram_npm/tdesign-miniprogram/cell/README.en-US.md | 27
pages/home/home.wxss | 29
miniprogram_npm/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss | 0
miniprogram_npm/tdesign-miniprogram/checkbox-group/props.d.ts | 3
base/behaviors/bInputCheck.js | 200
miniprogram_npm/tdesign-miniprogram/cell/cell.d.ts | 16
pages/home/home.json | 3
miniprogram_npm/tdesign-miniprogram/badge/README.en-US.md | 17
pages/mLedger/ledgerupload/ledgerupload.wxss | 53
miniprogram_npm/tdesign-miniprogram/button/README.md | 107
miniprogram_npm/tdesign-miniprogram/loading/index.d.ts | 3
miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxss | 33
miniprogram_npm/tdesign-miniprogram/grid/grid.js | 69
miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.json | 4
miniprogram_npm/tdesign-miniprogram/checkbox/type.d.ts | 74
miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxml | 56
miniprogram_npm/tdesign-miniprogram/common/src/flatTool.d.ts | 15
miniprogram_npm/tdesign-miniprogram/icon/README.md | 101
miniprogram_npm/tdesign-miniprogram/dialog/props.js | 52
pages/mConsult/consultonline/consultonline.js | 3
miniprogram_npm/tdesign-miniprogram/dialog/props.d.ts | 3
pages/mService/cScheduletoday/index.json | 6
miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxml | 10
pages/mLedger/ledgerupload/ledgerupload.json | 3
miniprogram_npm/tdesign-miniprogram/icon/type.d.ts | 27
pages/mLedger/behaviors/bUploadLedger.js | 128
miniprogram_npm/tdesign-miniprogram/sticky/sticky.d.ts | 30
miniprogram_npm/tdesign-miniprogram/common/bus.d.ts | 6
miniprogram_npm/tdesign-miniprogram/dialog/type.js | 1
miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.json | 7
pages/mUser/mine/mine.js | 176
data/promise.js | 26
miniprogram_npm/tdesign-miniprogram/grid-item/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/button/button.js | 97
miniprogram_npm/tdesign-miniprogram/common/style/utilities/_float.wxss | 6
miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxss | 92
pages/mUser/companyauthentication/companyauthentication.wxml | 2
miniprogram_npm/tdesign-miniprogram/image/image.json | 7
miniprogram_npm/tdesign-miniprogram/common/shared/date.js | 41
pages/icons/icons.js | 2
pages/mService/cScheduletoday/index.wxss | 110
miniprogram_npm/tdesign-miniprogram/image/image.wxss | 58
miniprogram_npm/tdesign-miniprogram/common/utils.js | 233
miniprogram_npm/tdesign-miniprogram/cell/type.d.ts | 71
miniprogram_npm/tdesign-miniprogram/grid/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/button/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/progress/type.js | 1
pages/mService/pScheduledetail/pScheduledetail.js | 45
miniprogram_npm/tdesign-miniprogram/checkbox/props.js | 66
miniprogram_npm/tdesign-miniprogram/badge/type.d.ts | 46
pages/mUser/baseC/cSceneInfo/cSceneInfo.js | 455
miniprogram_npm/tdesign-miniprogram/tabs/type.d.ts | 51
pages/mUser/baseC/template-inputcell.wxml | 103
miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts | 50
miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.d.ts | 31
miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.d.ts | 24
miniprogram_npm/tdesign-miniprogram/sticky/index.js | 3
miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxml | 75
miniprogram_npm/tdesign-miniprogram/icon/icon.wxss | 770 +
utils/util.js | 91
miniprogram_npm/tdesign-miniprogram/image/props.js | 44
pages/mSelfPatrol/components/self-patrol/index.json | 4
miniprogram_npm/tdesign-miniprogram/image/type.d.ts | 50
miniprogram_npm/tdesign-miniprogram/loading/loading.d.ts | 81
miniprogram_npm/tdesign-miniprogram/dialog/type.d.ts | 63
miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.js | 58
pages/mLearn/baseC/cLearnItem/cLearnItem.wxml | 28
miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss | 0
pages/mConsult/consultdetailcase/consultdetailcase.wxml | 2
pages/mPromise/promisesign/promisesign.wxml | 33
app.wxss | 9
miniprogram_npm/tdesign-miniprogram/switch/switch.json | 7
miniprogram_npm/tdesign-miniprogram/tabs/props.js | 39
miniprogram_npm/tdesign-miniprogram/tabs/index.js | 3
miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md | 25
miniprogram_npm/tdesign-miniprogram/progress/type.d.ts | 40
miniprogram_npm/tdesign-miniprogram/switch/switch.wxss | 161
pages/mConsult/cResultItemSearch/cResultItemSearch.wxml | 8
miniprogram_npm/tdesign-miniprogram/loading/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/icon/props.js | 20
miniprogram_npm/tdesign-miniprogram/button/type.d.ts | 108
pages/mUser/sceneauthentication/sceneauthentication.wxml | 2
miniprogram_npm/tdesign-miniprogram/checkbox/README.en-US.md | 47
miniprogram_npm/tdesign-miniprogram/button/props.js | 100
miniprogram_npm/tdesign-miniprogram/image/image.js | 100
miniprogram_npm/tdesign-miniprogram/sticky/sticky.json | 4
component/inputcell/inputcell.wxss | 10
pages/mService/cSchedule/cSchedule.js | 4
pages/mExtra/pSupervisionchange/pSupervisionchange.js | 2
miniprogram_npm/tdesign-miniprogram/progress/progress.js | 81
miniprogram_npm/tdesign-miniprogram/sticky/props.js | 21
app.json | 28
pages/mUser/userregistercompany/userregistercompany.js | 194
miniprogram_npm/tdesign-miniprogram/common/template/badge.wxml | 16
miniprogram_npm/tdesign-miniprogram/dialog/index.js | 72
miniprogram_npm/tdesign-miniprogram/loading/README.md | 70
miniprogram_npm/tdesign-miniprogram/loading/loading.wxss | 218
miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.json | 6
miniprogram_npm/tdesign-miniprogram/badge/badge.js | 43
miniprogram_npm/tdesign-miniprogram/side-bar-item/type.js | 1
miniprogram_npm/tdesign-miniprogram/side-bar/props.d.ts | 3
pages/mLedger/ledgerhome/ledgerhome.wxml | 111
miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxss | 33
miniprogram_npm/tdesign-miniprogram/switch/switch.wxml | 32
miniprogram_npm/tdesign-miniprogram/checkbox-group/props.js | 31
component/checkboxgroup/checkboxgroup.js | 2
miniprogram_npm/tdesign-miniprogram/mixins/transition.js | 123
miniprogram_npm/tdesign-miniprogram/side-bar-item/type.d.ts | 21
miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.js | 88
pages/mLedger/ledgerhistory/ledgerhistory.js | 4
miniprogram_npm/tdesign-miniprogram/switch/switch.d.ts | 21
miniprogram_npm/tdesign-miniprogram/progress/props.d.ts | 3
pages/mService/cScheduletoday/index.wxml | 50
miniprogram_npm/tdesign-miniprogram/side-bar/README.md | 69
miniprogram_npm/tdesign-miniprogram/button/index.js | 3
miniprogram_npm/tdesign-miniprogram/progress/README.md | 71
miniprogram_npm/tdesign-miniprogram/tabs/index.d.ts | 3
miniprogram_npm/tdesign-miniprogram/common/src/flatTool.js | 57
miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxs | 13
miniprogram_npm/tdesign-miniprogram/common/component.js | 5
service/notificationservice.js | 18
miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxml | 79
pages/mService/behaviors/bScheduleManager.js | 148
miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.d.ts | 23
pages/mNotice/notice/notice.wxss | 75
miniprogram_npm/tdesign-miniprogram/sticky/README.md | 55
miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.js | 130
miniprogram_npm/tdesign-miniprogram/mixins/touch.js | 35
pages/mLedger/ledgerupload/ledgerupload.js | 191
miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxml | 6
miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.js | 1
miniprogram_npm/tdesign-miniprogram/side-bar/README.en-US.md | 26
miniprogram_npm/tdesign-miniprogram/icon/icon.js | 51
pages/mConsult/consultdetailqa/consultdetailqa.js | 3
pages/mSelfPatrol/components/self-patrol/index.wxss | 64
pages/mUser/baseC/template-inputcell.wxss | 77
miniprogram_npm/tdesign-miniprogram/icon/icon.json | 4
service/deviceservice.js | 72
miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml | 12
service/selfpatrolservice.js | 132
miniprogram_npm/tdesign-miniprogram/checkbox/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/common/style/mixins/_hairline.wxss | 0
miniprogram_npm/tdesign-miniprogram/common/utils.d.ts | 30
miniprogram_npm/tdesign-miniprogram/switch/props.js | 35
miniprogram_npm/tdesign-miniprogram/grid/type.d.ts | 38
pages/mLearn/baseC/cLearnItem/cLearnItem.wxss | 1
miniprogram_npm/tdesign-miniprogram/badge/index.d.ts | 3
miniprogram_npm/tdesign-miniprogram/switch/props.d.ts | 3
pages/mNotice/notice/notice.wxml | 66
res/icons/icon8.png | 0
miniprogram_npm/tdesign-miniprogram/side-bar/type.js | 1
miniprogram_npm/tdesign-miniprogram/dialog/README.md | 84
pages/mUser/sceneauthentication/industrial/index.wxml | 88
pages/mUser/sceneauthentication/sceneauthentication.js | 9
miniprogram_npm/tdesign-miniprogram/cell/README.md | 74
miniprogram_npm/tdesign-miniprogram/grid/grid.wxml | 16
pages/mPromise/promisefile/promisefile.wxml | 42
miniprogram_npm/tdesign-miniprogram/common/style/_variables.wxss | 0
miniprogram_npm/tdesign-miniprogram/grid/grid.d.ts | 23
utils/animation.js | 164
miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts | 69
pages/mConsult/consulthome/consulthome.wxml | 12
miniprogram_npm/tdesign-miniprogram/common/style/mixins/_index.wxss | 0
pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js | 199
pages/mExtra/pSupervisiontask/pSupervisiontask.wxml | 58
miniprogram_npm/tdesign-miniprogram/loading/type.js | 1
miniprogram_npm/tdesign-miniprogram/popup/popup.d.ts | 20
project.config.json | 19
miniprogram_npm/tdesign-miniprogram/popup/popup.wxml | 30
pages/mService/pServicehome/servicehome.wxml | 4
miniprogram_npm/tdesign-miniprogram/sticky/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/progress/progress.d.ts | 26
miniprogram_npm/tdesign-miniprogram/progress/progress.wxml | 101
pages/mConsult/consulthome/consulthome.js | 8
miniprogram_npm/tdesign-miniprogram/popup/README.md | 57
pages/mSelfPatrol/components/emergency-self-patrol/index.wxml | 64
pages/mLedger/behaviors/bUploadSelfPatrol.js | 79
miniprogram_npm/tdesign-miniprogram/grid/props.js | 29
miniprogram_npm/tdesign-miniprogram/common/template/image.wxml | 21
miniprogram_npm/tdesign-miniprogram/button/button.wxml | 59
miniprogram_npm/tdesign-miniprogram/badge/badge.wxml | 44
pages/mLearn/pLearnvideo/pLearnvideo.js | 3
pages/mSelfPatrol/components/emergency-self-patrol/index.js | 120
miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts | 21
model/ledger.js | 134
miniprogram_npm/tdesign-miniprogram/switch/type.js | 1
miniprogram_npm/tdesign-miniprogram/button/button.d.ts | 35
miniprogram_npm/tdesign-miniprogram/tabs/tabs.js | 260
miniprogram_npm/tdesign-miniprogram/loading/loading.js | 61
miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.json | 6
miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.js | 37
pages/mAssessment/gradereport/gradereport.js | 405
pages/mLearn/pLearnvideo/pLearnvideo.wxml | 67
miniprogram_npm/tdesign-miniprogram/tabs/type.js | 1
pages/mExtra/pSupervisiontask/pSupervisiontask.js | 3
miniprogram_npm/tdesign-miniprogram/sticky/sticky.js | 120
pages/mLearn/learn/learn.wxml | 4
miniprogram_npm/tdesign-miniprogram/common/component.d.ts | 3
miniprogram_npm/tdesign-miniprogram/progress/README.en-US.md | 15
miniprogram_npm/tdesign-miniprogram/badge/badge.json | 5
miniprogram_npm/tdesign-miniprogram/loading/type.d.ts | 58
miniprogram_npm/tdesign-miniprogram/loading/loading.json | 4
miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxml | 25
miniprogram_npm/tdesign-miniprogram/tab-panel/type.js | 1
pages/mSelfPatrol/components/self-patrol/index.wxml | 42
miniprogram_npm/tdesign-miniprogram/sticky/README.en-US.md | 19
miniprogram_npm/tdesign-miniprogram/badge/badge.wxss | 108
pages/mNotice/notice/notice.js | 153
miniprogram_npm/tdesign-miniprogram/overlay/README.md | 49
miniprogram_npm/tdesign-miniprogram/switch/type.d.ts | 39
miniprogram_npm/tdesign-miniprogram/common/version.js | 40
miniprogram_npm/tdesign-miniprogram/loading/loading.wxml | 39
miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts | 36
miniprogram_npm/tdesign-miniprogram/tabs/tabs.json | 8
miniprogram_npm/tdesign-miniprogram/grid-item/type.d.ts | 47
miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxml | 27
app.js | 38
miniprogram_npm/tdesign-miniprogram/badge/index.js | 3
data/sceneTypes.js | 57
miniprogram_npm/tdesign-miniprogram/switch/README.md | 59
miniprogram_npm/tdesign-miniprogram/cell/type.js | 1
miniprogram_npm/tdesign-miniprogram/checkbox/type.js | 1
service/scheduleservice.js | 57
miniprogram_npm/tdesign-miniprogram/popup/popup.json | 7
miniprogram_npm/tdesign-miniprogram/image/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/loading/index.js | 3
miniprogram_npm/tdesign-miniprogram/.wechatide.ib.json | 3895 ++++++++++
miniprogram_npm/tdesign-miniprogram/progress/progress.json | 6
miniprogram_npm/tdesign-miniprogram/cell/props.js | 51
miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss | 217
/dev/null | 0
miniprogram_npm/tdesign-miniprogram/button/README.en-US.md | 46
miniprogram_npm/tdesign-miniprogram/tabs/props.d.ts | 3
pages/mService/cSchedule/cSchedule.wxss | 43
miniprogram_npm/tdesign-miniprogram/common/style/mixins/_clearfix.wxss | 0
miniprogram_npm/tdesign-miniprogram/common/index.wxss | 27
miniprogram_npm/tdesign-miniprogram/tab-panel/props.d.ts | 3
miniprogram_npm/tdesign-miniprogram/popup/popup.wxss | 104
403 files changed, 21,168 insertions(+), 2,074 deletions(-)
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..fd3dbdb
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,4 @@
+miniprogram_npm
+package.json
+project.config.json
+settings.json
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..5ccb3ac
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,25 @@
+{
+ "useTabs": false,
+ "printWidth": 80,
+ "tabWidth": 2,
+ "singleQuote": true,
+ "trailingComma": "all",
+ "jsxBracketSameLine": false,
+ "semi": true,
+ "endOfLine": "auto",
+ "arrowParens": "avoid",
+ "overrides": [
+ {
+ "files": "*.wxml",
+ "options": {"parser": "html"}
+ },
+ {
+ "files": "*.wxss",
+ "options": {"parser": "css"}
+ },
+ {
+ "files": "*.wxs",
+ "options": {"parser": "babel"}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/app.js b/app.js
index 0372651..dd6e5ff 100644
--- a/app.js
+++ b/app.js
@@ -1,21 +1,19 @@
// app.js
-import moment from './utils/moment.min'
-import $f from "./service/baserequest"
+import moment from './utils/moment.min';
+import $f from './service/baserequest';
App({
onLaunch() {
- console.log('onLaunch');
-
moment.updateLocale('en', {
- weekdays: '鏄熸湡鏃鏄熸湡涓�_鏄熸湡浜宊鏄熸湡涓塤鏄熸湡鍥沖鏄熸湡浜擾鏄熸湡鍏�'.split('_')
+ weekdays: '鏄熸湡鏃鏄熸湡涓�_鏄熸湡浜宊鏄熸湡涓塤鏄熸湡鍥沖鏄熸湡浜擾鏄熸湡鍏�'.split('_'),
});
wx.getStorage({
key: 'userProfile',
- success: (res) => {
- this.globalData.userProfile = res.data
+ success: res => {
+ this.globalData.userProfile = res.data;
},
- })
+ });
},
globalData: {
perPage: 5,
@@ -23,28 +21,30 @@
accessToken: null,
isLogin: false,
version: '浣撻獙鐗� 1.0.0',
- agreement: $f.baseFileUrl + '/agreement/涓皬寰紒涓氱敓鎬佺幆澧冨畧娉曟櫤鑳芥湇鍔″井淇″皬绋嬪簭鏈嶅姟鍗忚.docx',
- newUser: false,//鏄惁涓烘敞鍐屼竴涓湀浠ュ唴鐨勬柊鐢ㄦ埛
+ agreement:
+ $f.baseFileUrl +
+ '/agreement/涓皬寰紒涓氱敓鎬佺幆澧冨畧娉曟櫤鑳芥湇鍔″井淇″皬绋嬪簭鏈嶅姟鍗忚.docx',
+ newUser: false, //鏄惁涓烘敞鍐屼竴涓湀浠ュ唴鐨勬柊鐢ㄦ埛
},
// 鏅鸿兘鍜ㄨ缁撴灉绫诲瀷鏂囨湰杞崲
- cosultTypeName: (typeId) => {
- let name = ''
+ cosultTypeName: typeId => {
+ let name = '';
switch (typeId) {
case 1:
- name = '鐩稿叧鏂囦欢'
+ name = '鐩稿叧鏂囦欢';
break;
case 2:
- name = '鐩稿叧鏉$洰'
+ name = '鐩稿叧鏉$洰';
break;
case 3:
- name = '鎵ф硶妗堜緥'
+ name = '鎵ф硶妗堜緥';
break;
case 4:
- name = '鐜繚闂'
+ name = '鐜繚闂';
break;
default:
break;
}
- return name
- }
-})
\ No newline at end of file
+ return name;
+ },
+});
diff --git a/app.json b/app.json
index a8c97df..1b79d85 100644
--- a/app.json
+++ b/app.json
@@ -55,7 +55,9 @@
"pages/mService/pDevicedata/pDevicedata",
"pages/mExtra/pSupervisiontask/pSupervisiontask",
"pages/mExtra/pSupervisionchange/pSupervisionchange",
- "pages/mExtra/pSupervisionchangeDetail/pSupervisionchangeDetail"
+ "pages/mExtra/pSupervisionchangeDetail/pSupervisionchangeDetail",
+ "pages/mSelfPatrol/patrolhome/index",
+ "pages/mUser/sceneauthentication/industrial/index"
],
"window": {
"backgroundTextStyle": "light",
@@ -86,8 +88,8 @@
"selectedIconPath": "res/icons/tab_5_select.png"
},
{
- "pagePath": "pages/mPromise/promisehome/promise",
- "text": "瀹堟硶鎵胯",
+ "pagePath": "pages/mSelfPatrol/patrolhome/index",
+ "text": "鑷贰鏌�",
"iconPath": "/res/icons/tab_3.png",
"selectedIconPath": "res/icons/tab_3_select.png"
},
@@ -101,5 +103,23 @@
},
"style": "v2",
"sitemapLocation": "sitemap.json",
- "lazyCodeLoading": "requiredComponents"
+ "lazyCodeLoading": "requiredComponents",
+ "usingComponents": {
+ "t-icon": "tdesign-miniprogram/icon/icon",
+ "t-button": "tdesign-miniprogram/button/button",
+ "t-tabs": "tdesign-miniprogram/tabs/tabs",
+ "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
+ "t-sticky": "tdesign-miniprogram/sticky/sticky",
+ "t-grid": "tdesign-miniprogram/grid/grid",
+ "t-grid-item": "tdesign-miniprogram/grid-item/grid-item",
+ "t-progress": "tdesign-miniprogram/progress/progress",
+ "t-side-bar": "tdesign-miniprogram/side-bar/side-bar",
+ "t-side-bar-item": "tdesign-miniprogram/side-bar-item/side-bar-item",
+ "t-loading": "tdesign-miniprogram/loading/loading",
+ "t-switch": "tdesign-miniprogram/switch/switch",
+ "t-cell": "tdesign-miniprogram/cell/cell",
+ "t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
+ "t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
+ }
}
\ No newline at end of file
diff --git a/app.wxss b/app.wxss
index 963d493..e2442f0 100644
--- a/app.wxss
+++ b/app.wxss
@@ -2,6 +2,7 @@
@import "/libs/weui.wxss";
page {
+ --td-brand-color: #59D5B3;
--fyui-primary-color: #59D5B3;
--fyui-primary-color-2: #6DF1A9;
/* --fyui-primary-color: #929292;
@@ -80,7 +81,9 @@
margin: 8px;
color: white;
padding: 8px;
- text-align: center;
+ justify-content: center;
+ align-items: center;
+ display: flex;
}
.submit:active {
@@ -232,14 +235,14 @@
background-color: white;
}
-.fyui-box:before{
+.fyui-box:before {
content: " ";
width: 90%;
height: 1px;
background-color: var(--fyui-BG_1);
top: -2px;
position: absolute;
-
+
}
.fyui-box:active {
diff --git a/base/behaviors/bInputCheck.js b/base/behaviors/bInputCheck.js
index 8a1a48c..c23799e 100644
--- a/base/behaviors/bInputCheck.js
+++ b/base/behaviors/bInputCheck.js
@@ -1,60 +1,76 @@
+import moment from '../../utils/moment.min';
+
/**
* 淇℃伅杈撳叆閫昏緫
* 鍖呮嫭杈撳叆淇℃伅瀛樺偍銆佽緭鍏ヨ鑼冩�ф娴嬨�侀敊璇彁绀虹瓑
* @see "/data/sceneInfo.js"
*/
module.exports = Behavior({
+ properties: {
+ form: {
+ type: Array,
+ observer(value) {
+ this.setData({ msg: value });
+ },
+ },
+ },
data: {
msg: [],
- info: {}
+ info: {},
+ start: moment().format('YYYY骞碝M鏈圖D鏃�'),
},
lifetimes: {
- attached: function () {}
+ attached: function () {},
},
methods: {
selectChange(e) {
- const index = e.currentTarget.dataset.index
- const options = e.detail.options
+ const index = e.currentTarget.dataset.index;
+ const options = e.detail.options;
this.setData({
- [`msg[${index}].options`]: options
- })
+ [`msg[${index}].options`]: options,
+ });
+ this.onItemChange();
},
pickerChange(e) {
console.log(e);
- const {
- index,
- mode
- } = e.currentTarget.dataset
+ const { index, mode } = e.currentTarget.dataset;
if (mode == 'region') {
- const i = e.detail.value.concat(e.detail.code)
+ const i = e.detail.value.concat(e.detail.code);
this.setData({
- [`msg[${index}].value`]: i
- })
+ [`msg[${index}].value`]: i,
+ });
} else if (mode == 'selector') {
- const i = e.detail.value
+ const i = e.detail.value;
this.setData({
[`msg[${index}].selectIndex`]: i,
- [`msg[${index}].value`]: this.data.msg[index].options[i].value
- })
+ [`msg[${index}].value`]: this.data.msg[index].options[i].value,
+ });
+ } else if (mode == 'date') {
+ const i = e.detail.value;
+ this.setData({
+ [`msg[${index}].value`]: i,
+ });
}
+ this.onItemChange();
},
changeMsg(e) {
- let id = e.detail.params.id
- let value = e.detail.params.value
- let msg = this.data.msg
- let msgLength = msg.length
+ let id = e.detail.params.id;
+ let value = e.detail.params.value;
+ let msg = this.data.msg;
+ let msgLength = msg.length;
for (let i = 0; i < msgLength; i++) {
if (msg[i].id === id) {
- let path = "msg[" + i + "].value"
- let nPath = "msg[" + i + "].noValue"
+ let path = 'msg[' + i + '].value';
+ let nPath = 'msg[' + i + '].noValue';
this.setData({
[path]: value,
- [nPath]: false
- })
+ [nPath]: false,
+ });
}
}
+ this.onItemChange();
},
/**
@@ -62,139 +78,149 @@
*/
submitCheck() {
//娓呯┖缂撳瓨鐨勫瘑鐮�
- this.lastPW = ''
+ this.lastPW = '';
- let msg = this.data.msg
+ let msg = this.data.msg;
//纭淇℃伅瀹屾暣搴�
for (let i = 0; i < msg.length; i++) {
- const m = msg[i]
+ const m = msg[i];
//閫夊~椤圭洿鎺ョ暐杩�
- if (m.required == false) continue
+ if (m.required == false) continue;
//澶嶉�夋鍜屽崟閫夋锛堝閫夋鐨勯�昏緫鍖呭惈浜嗗崟閫夋锛�
if (m.type == 'checkbox' || m.type == 'radio') {
// console.log('m.options', m.options);
- m.value = ''
+ m.value = '';
for (let t = 0; t < m.options.length; t++) {
const o = m.options[t];
if (o.checked) {
if (m.value != '') {
- m.value += ';'
+ m.value += ';';
}
if (o.hasRemark) {
// console.log('o.remark', o.remark);
if (o.remark == '') {
this.setData({
- [`msg[${i}].options[${t}].noValue`]: true
- })
- this.showErrorMsg(i, '澶囨敞淇℃伅涓嶈兘涓虹┖')
- return false
+ [`msg[${i}].options[${t}].noValue`]: true,
+ });
+ this.showErrorMsg(i, '澶囨敞淇℃伅涓嶈兘涓虹┖');
+ return false;
} else {
- m.value += o.remark
+ m.value += o.remark;
}
} else {
- m.value += o.name
+ m.value += o.name;
}
}
}
if (m.value == '') {
- this.showErrorMsg(i)
- return false
+ this.showErrorMsg(i);
+ return false;
}
}
//涓嬫媺閫夋嫨妗�
else if (m.type == 'picker') {
if (m.pickerMode == 'selector') {
if (m.selectIndex == 0) {
- this.showErrorMsg(i, `${this.data.msg[i].name}鏈�夋嫨`)
- return false
+ this.showErrorMsg(i, `${this.data.msg[i].name}鏈�夋嫨`);
+ return false;
} else {
- m.value = m.options[m.selectIndex].name
+ m.value = m.options[m.selectIndex].name;
}
} else if (m.pickerMode == 'region') {
if (m.value.length == 0) {
- this.showErrorMsg(i, `${this.data.msg[i].name}鏈�夋嫨`)
- return false
+ this.showErrorMsg(i, `${this.data.msg[i].name}鏈�夋嫨`);
+ return false;
}
}
}
//杈撳叆妗�
//蹇呭~椤圭┖鐧芥娴�
- else if (m.value === "" || m.value === null || m.value === undefined) {
- this.showErrorMsg(i)
- return false
- }
+ else if (m.value === '' || m.value === null || m.value === undefined) {
+ this.showErrorMsg(i);
+ return false;
+ }
//杈撳叆妗嗕笅鐨勫瘑鐮佺被鍨嬫娴�
else if (m.type == 'password') {
//瀵嗙爜涓�鑷存�х‘璁�
if (this.lastPW == '') {
- this.lastPW = m.value
+ this.lastPW = m.value;
} else if (this.lastPW != m.value) {
- let error = "涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鑷�"
+ let error = '涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鑷�';
this.setData({
errorMsg: error,
- })
- return false
+ });
+ return false;
}
//瀵嗙爜澶嶆潅搴︾‘璁�
- var pwError
- var pw = m.value
- var regex1 = /[a-zA-Z]/
- var regex2 = /[0-9]/
- var r = regex1.test(pw) && regex2.test(pw)
+ var pwError;
+ var pw = m.value;
+ var regex1 = /[a-zA-Z]/;
+ var regex2 = /[0-9]/;
+ var r = regex1.test(pw) && regex2.test(pw);
console.log('regex:' + r);
if (pw.length < 6) {
- pwError = '瀵嗙爜浣嶆暟鏈�灏�6浣�'
+ pwError = '瀵嗙爜浣嶆暟鏈�灏�6浣�';
} else if (!r) {
- pwError = '瀵嗙爜蹇呴』鍖呭惈瀛楁瘝鍜屾暟瀛�'
+ pwError = '瀵嗙爜蹇呴』鍖呭惈瀛楁瘝鍜屾暟瀛�';
}
if (pwError) {
this.setData({
errorMsg: pwError,
- })
- return false
+ });
+ return false;
}
-
}
}
- return true
+ return true;
},
showErrorMsg(index, err = `${this.data.msg[index].name}涓嶅彲涓虹┖`) {
this.setData({
errorMsg: err,
- [`msg[${index}].noValue`]: true
- })
- const id = "#" + this.data.msg[index].id
- wx.createSelectorQuery().select('.page').boundingClientRect(res1 => {
- const top1 = res1.top
- wx.createSelectorQuery().in(this).select(id).boundingClientRect(res => {
- const h = res.top - top1 - 60
- // console.log(h);
- wx.pageScrollTo({
- // duration: 300,
- scrollTop: h,
- // selector: id,
- // offsetTop: -60,
- })
- }).exec();
- }).exec();
+ [`msg[${index}].noValue`]: true,
+ });
+ const id = '#' + this.data.msg[index].id;
+ wx.createSelectorQuery()
+ .select('.page')
+ .boundingClientRect(res1 => {
+ const top1 = res1.top;
+ wx.createSelectorQuery()
+ .in(this)
+ .select(id)
+ .boundingClientRect(res => {
+ const h = res.top - top1 - 60;
+ // console.log(h);
+ wx.pageScrollTo({
+ // duration: 300,
+ scrollTop: h,
+ // selector: id,
+ // offsetTop: -60,
+ });
+ })
+ .exec();
+ })
+ .exec();
},
onSubmit: function () {
console.log('onSubmit');
- if (!this.submitCheck()) return
+ if (!this.submitCheck()) return;
- let msg = this.data.msg
+ let msg = this.data.msg;
if (msg) {
- const info = this.data.info
+ const info = this.data.info;
msg.forEach(m => {
- info[m.id] = m.value
+ info[m.id] = m.value;
});
- this.setData({info})
- this.triggerEvent('onSubmit', info)
- if (typeof this._submit === 'function') this._submit(info)
+ this.setData({ info });
+ this.triggerEvent('onSubmit', info);
+ if (typeof this._submit === 'function') this._submit(info);
}
},
- }
-})
\ No newline at end of file
+
+ onItemChange() {
+ this.triggerEvent('itemChange', this.data.msg);
+ },
+ },
+});
diff --git a/component/checkboxgroup/checkboxgroup.js b/component/checkboxgroup/checkboxgroup.js
index aaef940..9f186e7 100644
--- a/component/checkboxgroup/checkboxgroup.js
+++ b/component/checkboxgroup/checkboxgroup.js
@@ -39,7 +39,7 @@
},
checkboxChange(e) {
- // console.log('checkbox鍙戠敓change浜嬩欢锛屾惡甯alue鍊间负锛�', e.detail.value)
+ console.log('checkbox鍙戠敓change浜嬩欢锛屾惡甯alue鍊间负锛�', e.detail.value)
const options = this.data.options
const values = e.detail.value
diff --git a/component/form/index.js b/component/form/index.js
new file mode 100644
index 0000000..b20ed8c
--- /dev/null
+++ b/component/form/index.js
@@ -0,0 +1,22 @@
+import bInputCheck from '../../base/behaviors/bInputCheck';
+
+Component({
+ behaviors: [bInputCheck],
+ options: {
+ addGlobalClass: true,
+ },
+ /**
+ * 缁勪欢鐨勫睘鎬у垪琛�
+ */
+ properties: {},
+
+ /**
+ * 缁勪欢鐨勫垵濮嬫暟鎹�
+ */
+ data: {},
+
+ /**
+ * 缁勪欢鐨勬柟娉曞垪琛�
+ */
+ methods: {},
+});
diff --git a/component/form/index.json b/component/form/index.json
new file mode 100644
index 0000000..139f03e
--- /dev/null
+++ b/component/form/index.json
@@ -0,0 +1,10 @@
+{
+ "component": true,
+ "usingComponents": {
+ "mp-cells":"/component/cells/cells",
+ "input-cell":"/component/inputcell/inputcell",
+ "mp-icon": "/component/icon/icon",
+ "mp-checkboxgroup": "/component/checkboxgroup/checkboxgroup",
+ "mp-radiogroup": "/component/radiogroup/radiogroup"
+ }
+}
\ No newline at end of file
diff --git a/component/form/index.wxml b/component/form/index.wxml
new file mode 100644
index 0000000..19e7557
--- /dev/null
+++ b/component/form/index.wxml
@@ -0,0 +1,96 @@
+<view class="items">
+ <mp-cells>
+ <block wx:for="{{msg}}" wx:key="index">
+ <block wx:if="{{item.type == 'checkbox'}}">
+ <view class="hr-view"></view>
+ <view id="{{item.id}}" class="item-title"
+ ><text
+ class="{{item.required != false ? 'required' : 'not-required'}}"
+ >*</text
+ >{{item.name}}</view
+ >
+ <mp-checkboxgroup
+ options="{{item.options}}"
+ data-index="{{index}}"
+ bindchange="selectChange"
+ ></mp-checkboxgroup>
+ </block>
+ <block wx:elif="{{item.type == 'radio'}}">
+ <view class="hr-view"></view>
+ <view id="{{item.id}}" class="item-title"
+ ><text
+ class="{{item.required != false ? 'required' : 'not-required'}}"
+ >*</text
+ >{{item.name}}</view
+ >
+ <mp-radiogroup
+ options="{{item.options}}"
+ data-index="{{index}}"
+ bindchange="selectChange"
+ ></mp-radiogroup>
+ </block>
+ <block wx:elif="{{item.type == 'picker'}}">
+ <view class="hr-view"></view>
+ <view class="top-card">
+ <view id="{{item.id}}" class="tag"
+ ><text
+ class="{{item.required != false ? 'required' : 'not-required'}}"
+ >*</text
+ >{{item.name}}</view
+ >
+ <picker
+ wx:if="{{item.pickerMode == 'selector'}}"
+ mode="selector"
+ bindchange="pickerChange"
+ data-index="{{index}}"
+ data-mode="selector"
+ value="{{item.selectIndex}}"
+ range="{{item.options}}"
+ range-key="name"
+ class="value"
+ >
+ <view class="picker-text"
+ >{{item.options[item.selectIndex].name}}</view
+ >
+ </picker>
+ <picker
+ wx:elif="{{item.pickerMode == 'region'}}"
+ mode="region"
+ bindchange="pickerChange"
+ data-index="{{index}}"
+ data-mode="region"
+ value="{{item.displayValue}}"
+ class="value"
+ level="sub-district"
+ >
+ <view class="picker-text" wx:if="{{item.value.length > 0}}"
+ >{{item.value[0] + (item.value[1] == item.value[0] ? '' :
+ item.value[1]) + item.value[2] + item.value[3]}}</view
+ >
+ <view wx:else class="picker-text" style="color: #b2b2b2"
+ >璇烽�夋嫨琛楅晣</view
+ >
+ </picker>
+ <picker
+ wx:if="{{item.pickerMode == 'date'}}"
+ mode="date"
+ bindchange="pickerChange"
+ data-index="{{index}}"
+ data-mode="date"
+ value="{{item.value}}"
+ class="value"
+ >
+ <view class="picker-text">{{item.value}}</view>
+ </picker>
+ <mp-icon icon="arrow" color="black" size="{{10}}"></mp-icon>
+ </view>
+ </block>
+ <input-cell
+ id="{{item.id}}"
+ wx:else
+ item="{{item}}"
+ bindpassValue="changeMsg"
+ ></input-cell>
+ </block>
+ </mp-cells>
+</view>
diff --git a/component/form/index.wxss b/component/form/index.wxss
new file mode 100644
index 0000000..1f38f0a
--- /dev/null
+++ b/component/form/index.wxss
@@ -0,0 +1,68 @@
+.items {
+ position: relative;
+ padding: 0 10px;
+ background-color: white;
+}
+
+.hr-view {
+ height: 2rpx;
+ margin: 0 0rpx;
+ background-color: #f1f1f1;
+}
+
+.item-title {
+ white-space: nowrap;
+ display: inline-block;
+ font-size: 1rem;
+ width: 32vw;
+ margin-top: 8px;
+}
+
+.required {
+ color: red;
+ text-align: center;
+ vertical-align: middle;
+}
+
+.not-required {
+ color: transparent;
+}
+
+.top-card {
+ /* width: 100vw; */
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ /* justify-content: space-between; */
+ background-color: white;
+ padding: 10px 0px;
+ /* margin: 0 8px; */
+ font-size: 30rpx;
+ flex-wrap: nowrap;
+}
+
+.top-card .tag {
+ flex-shrink: 0;
+ width: 32vw;
+ white-space: nowrap;
+ /* background-color: seagreen; */
+}
+
+.top-card .value {
+ flex-grow: 1;
+}
+
+.top-card .value view {
+ /* white-space: nowrap; */
+ display: -webkit-box;
+ -webkit-line-clamp: 1;
+ -webkit-box-orient: vertical;
+ overflow-x: hidden;
+ text-overflow: ellipsis;
+ /* background-color: bisque; */
+}
+
+.picker-text {
+ /* color: var(--fyui-primary-color); */
+ color: var(--fyui-text-color_1);
+}
\ No newline at end of file
diff --git a/component/inputcell/inputcell.wxml b/component/inputcell/inputcell.wxml
index 0058427..b70eda8 100644
--- a/component/inputcell/inputcell.wxml
+++ b/component/inputcell/inputcell.wxml
@@ -1,13 +1,38 @@
<view wx:if="{{item.show != false}}">
<view class="hr-view"></view>
<mp-cell ext-class="ext-cell">
- <view slot="title" class="title-cell"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
- <image wx:if="{{item.src}}" slot="icon" class="header-img" src="{{item.src}}"></image>
+ <view slot="title" class="title-cell"
+ ><text class="{{item.required != false ? 'required' : 'not-required'}}"
+ >*</text
+ >{{item.name}}</view
+ >
+ <image
+ wx:if="{{item.src}}"
+ slot="icon"
+ class="header-img"
+ src="{{item.src}}"
+ ></image>
<view class="flexbox {{alignLeft?'':'flexbox-end'}}">
- <input wx:if="{{item.input}}" type="{{item.type?item.type:'text'}}" maxlength="{{item.maxLength?item.maxLength:'-1'}}" id="{{item.id?item.id:''}}" placeholder-style="color:{{item.noValue?'red':'#B2B2B2'}};" class="weui-up-input {{inputClass}} {{alignLeft?'':'input-right'}}" bindinput="changeV" value="{{item.value}}" placeholder="{{item.placeholder ? item.placeholder : '璇疯緭鍏�' + item.name}} " />
- <view wx:else="{{text}}" class="weui-up-input {{inputClass}} {{alignLeft?'':'input-right'}}">{{item.value}}</view>
+ <input
+ wx:if="{{item.input}}"
+ type="{{item.type?item.type:'text'}}"
+ maxlength="{{item.maxLength?item.maxLength:'-1'}}"
+ id="{{item.id?item.id:''}}"
+ placeholder-style="color:{{item.noValue?'red':'#B2B2B2'}};"
+ class="weui-up-input {{inputClass}} {{alignLeft?'':'input-right'}} {{item.disable ? 'input-disable':''}}"
+ bindinput="changeV"
+ value="{{item.value}}"
+ placeholder="{{item.placeholder ? item.placeholder : '璇疯緭鍏�' + item.name}} "
+ confirm-type="next"
+ disabled="{{item.disable}}"
+ />
+ <view
+ wx:else="{{text}}"
+ class="weui-up-input {{inputClass}} {{alignLeft?'':'input-right'}}"
+ >{{item.value}}</view
+ >
<view class="unit">{{item.unit}}</view>
</view>
</mp-cell>
-</view>
\ No newline at end of file
+</view>
diff --git a/component/inputcell/inputcell.wxss b/component/inputcell/inputcell.wxss
index 2bc3d90..01a126a 100644
--- a/component/inputcell/inputcell.wxss
+++ b/component/inputcell/inputcell.wxss
@@ -6,7 +6,7 @@
}
.weui-up-input{
color: black;
- font-size: 1rem;
+ font-size: 30rpx;
/* border-radius: 10rpx; */
width: 100%;
/* background-color: seagreen; */
@@ -16,6 +16,10 @@
.input-right {
text-align: end;
padding-right: 6px;
+}
+
+.input-disable {
+ color: #B2B2B2
}
.required {
@@ -31,7 +35,7 @@
.title-cell{
white-space: nowrap;
display: inline-block;
- font-size: 1rem;
+ font-size: 30rpx;
width: 32vw;
color:var(--fyui-text-color-1);
/* background-color: seagreen; */
@@ -45,7 +49,7 @@
.unit {
display: block;
/* background-color: rgb(46, 133, 139); */
- font-size: var(--ffui-font-size-2);
+ font-size: 30rpx;
color: var(--ffui-text-color-1);
margin-right: 10px;
line-height: 22px;
diff --git a/data/promise.js b/data/promise.js
index a6a0340..230da6a 100644
--- a/data/promise.js
+++ b/data/promise.js
@@ -1,13 +1,19 @@
-const text = "涓鸿返琛岀豢鑹插彂灞曠悊蹇碉紝鍔姏钀ラ�犺瘹瀹炲畧淇$殑绀句細鐜锛岃惤瀹炴柦宸ュ崟浣嶇幆淇濊矗浠伙紝闄嶄綆鍥犵幆澧冪瓑鍥犵礌閫犳垚鐨勬壃灏樻薄鏌撻殣鎮e拰灞呮皯绾犵悍锛岀‘淇濆缓绛戜笟鍋ュ悍鏈夊簭鍙戝睍锛屾湰鍗曚綅锛堟垨鏈汉锛夎嚜鎰夸綔鍑哄涓嬫壙璇猴細\n\n涓�銆佷弗鏍奸伒瀹堝浗瀹躲�佸競銆佸尯鏈夊叧鐜淇濇姢娉曞緥銆佹硶瑙勩�佽绔犮�佹爣鍑嗗拰鏀跨瓥瑙勫畾锛岀Н鏋佸饱琛岀幆澧冧繚鎶ょぞ浼氳矗浠汇�俓n\n浜屻�佷互銆婁笂娴峰競鐜淇濇姢鏉′緥銆嬨�併�婁笂娴峰競澶ф皵姹℃煋闃叉不鏉′緥銆嬨�併�婁笂娴峰競寤鸿宸ョ▼鏂囨槑鏂藉伐绠$悊瑙勫畾銆嬬瓑瑕佹眰涓轰緷鎹紝绉戝鍒跺畾寤鸿宸ュ湴鎵皹姹℃煋闃叉不鏂规骞跺叕绀猴紝寤虹珛鍋ュ叏浼佷笟鍐呴儴鎵皹闃叉不鏍告煡鏈哄埗锛屽畨鎺掍笓浜鸿礋璐f壃灏橀槻娌讳簨瀹滐紝鍙婃椂璁板綍銆佷繚瀛樿溅杈嗚繘鍑恒�佸啿娲椼�佹磼姘寸瓑鐜繚鍙拌处銆俓n\n涓夈�佸缓璁炬柦宸ュ簲绗﹀悎銆婃枃鏄庢柦宸ユ爣鍑嗐�嬶紙DG/TJ 08-2102-2019 )锛岀瀛﹂厤缃壃灏橀槻娌昏鏂借澶囷紙楂樺帇鍐叉礂璁惧銆佽嚜鍔ㄥ柗娣嬭缃�侀浘鐐溅銆佹磼姘磋溅绛夛級锛屼緷鎵樻妧闃叉帾鏂藉紑灞曠豢鑹叉柦宸ワ紝骞跺姞寮哄鍣0鎺у埗銆佸厜姹℃煋鎺у埗銆佸己鑵愯殌鎬у寲瀛﹀搧绛夊叾浠栨薄鏌撴帶鍒讹紝闃叉瀵瑰懆杈瑰眳姘戦�犳垚鐢熸椿鐜姹℃煋銆俓n\n鍥涖�佷弗鏍兼墽琛屾壃灏樻不鐞嗗叚涓櫨鍒嗙櫨瑕佹眰锛�1銆佹柦宸ュ伐鍦板懆杈�100%鍥存尅锛�2銆佸嚭鍏ヨ溅杈�100%鍐叉礂锛�3銆佹媶杩佸伐鍦�100%婀挎硶浣滀笟锛�4銆佹福鍦熻溅杈�100%瀵嗛棴杩愯緭锛�5銆佹柦宸ョ幇鍦哄湴闈�100%纭寲锛�6銆佺墿鏂欏爢鏀�100%瑕嗙洊銆俓n\n浜斻�侀伒瀹堝叧浜庡嵃鍙戙�婁笂娴峰競鎴垮眿寤虹瓚宸ュ湴鎵皹姹℃煋闃叉不宸ヤ綔鏂规銆嬬殑閫氱煡 锛堟勃寤鸿川瀹夎仈銆�2019銆�208 鍙� 锛夌浉鍏宠瀹氾紝瀹夎甯備綇鎴垮煄涔″缓璁剧鐞嗗鍜屽競鐢熸�佺幆澧冨眬瀹樻柟缃戠珯鍏ず鍏憡鏍忎腑鏈�鏂板叕甯冪殑鍚堟牸渚涘簲鍟嗘彁渚涚殑鎵皹鍦ㄧ嚎鐩戞祴璁惧锛岄』绗﹀悎銆婁笂娴峰競寤虹瓚鏂藉伐棰楃矑鐗╀笌鍣0鍦ㄧ嚎鐩戞祴鎶�鏈鑼冦�嬶紝濮旀墭瑙勮寖鏈嶅姟鍗曚綅瀹氭湡杩愮淮锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紱璁惧鎷嗛櫎銆佺Щ鍔ㄦ垨鍋滆繍椤绘彁鍓嶅悜涓荤閮ㄩ棬鐢宠鎴栧妗堛�俓n\n鍏�佹壃灏樺湪绾跨洃娴嬭澶囧畨瑁呭悗椤荤‘淇濈ǔ瀹氳繍琛岋紝骞跺強鏃朵笌鐢熸�佺幆澧冮儴闂ㄦ壃灏樼洃鎺х郴缁熻仈缃戯紝渚濇嵁銆婁笂娴峰競鎵皹鍦ㄧ嚎鐩戞祴鏁版嵁鎵ф硶搴旂敤瑙勫畾銆嬪畾鏈熷鏍哥洃娴嬫暟鎹紝涓嶈秴鏍囨帓鏀撅紱鎵皹鐩戞祴鏁版嵁鍧氬喅涓嶅紕铏氫綔鍋囷紝涓嶈Е鐘�婄幆澧冪洃娴嬫暟鎹紕铏氫綔鍋囪涓哄垽瀹氬強澶勭悊鍔炴硶銆嬨�俓n\n涓冦�佷笉浣跨敤鏈笂鐜繚鎷嶇収鐨勯潪閬撹矾鏈烘锛屼笉浣跨敤闈炴硶娓犻亾鎴栦笉杈炬爣鏌存补銆俓n\n鍏�侀伒瀹�2022骞�6鏈�5鏃ヨ捣鏂借鐨勩�婁腑鍗庝汉姘戝叡鍜屽浗鍣0姹℃煋闃叉不娉曘�嬶紝瑙勮寖寮�灞曞缓绛戞柦宸ュ櫔澹版薄鏌撻槻娌伙紱娑夊強澶滈棿鏂藉伐鐨勶紝搴旈伒瀹堛�婁笂娴峰競寤鸿宸ョ▼澶滈棿鏂藉伐璁稿彲鍜屽妗堝鏌ョ鐞嗗姙娉曘�嬶紝鏂藉伐杩囩▼涓簲閲囧彇鏈夋晥鐨勯檷鍣帾鏂斤紝閬垮厤鍣0鎵版皯銆俓n\n涔濄�佸悓鎰忔湰鎵胯鍚戠ぞ浼氬叕寮�锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�"
+const text =
+ '涓鸿返琛岀豢鑹插彂灞曠悊蹇碉紝鍔姏钀ラ�犺瘹瀹炲畧淇$殑绀句細鐜锛岃惤瀹炴柦宸ュ崟浣嶇幆淇濊矗浠伙紝闄嶄綆鍥犵幆澧冪瓑鍥犵礌閫犳垚鐨勬壃灏樻薄鏌撻殣鎮e拰灞呮皯绾犵悍锛岀‘淇濆缓绛戜笟鍋ュ悍鏈夊簭鍙戝睍锛屾湰鍗曚綅锛堟垨鏈汉锛夎嚜鎰夸綔鍑哄涓嬫壙璇猴細\n\n涓�銆佷弗鏍奸伒瀹堝浗瀹躲�佸競銆佸尯鏈夊叧鐜淇濇姢娉曞緥銆佹硶瑙勩�佽绔犮�佹爣鍑嗗拰鏀跨瓥瑙勫畾锛岀Н鏋佸饱琛岀幆澧冧繚鎶ょぞ浼氳矗浠汇�俓n\n浜屻�佷互銆婁笂娴峰競鐜淇濇姢鏉′緥銆嬨�併�婁笂娴峰競澶ф皵姹℃煋闃叉不鏉′緥銆嬨�併�婁笂娴峰競寤鸿宸ョ▼鏂囨槑鏂藉伐绠$悊瑙勫畾銆嬬瓑瑕佹眰涓轰緷鎹紝绉戝鍒跺畾寤鸿宸ュ湴鎵皹姹℃煋闃叉不鏂规骞跺叕绀猴紝寤虹珛鍋ュ叏浼佷笟鍐呴儴鎵皹闃叉不鏍告煡鏈哄埗锛屽畨鎺掍笓浜鸿礋璐f壃灏橀槻娌讳簨瀹滐紝鍙婃椂璁板綍銆佷繚瀛樿溅杈嗚繘鍑恒�佸啿娲椼�佹磼姘寸瓑鐜繚鍙拌处銆俓n\n涓夈�佸缓璁炬柦宸ュ簲绗﹀悎銆婃枃鏄庢柦宸ユ爣鍑嗐�嬶紙DG/TJ 08-2102-2019 )锛岀瀛﹂厤缃壃灏橀槻娌昏鏂借澶囷紙楂樺帇鍐叉礂璁惧銆佽嚜鍔ㄥ柗娣嬭缃�侀浘鐐溅銆佹磼姘磋溅绛夛級锛屼緷鎵樻妧闃叉帾鏂藉紑灞曠豢鑹叉柦宸ワ紝骞跺姞寮哄鍣0鎺у埗銆佸厜姹℃煋鎺у埗銆佸己鑵愯殌鎬у寲瀛﹀搧绛夊叾浠栨薄鏌撴帶鍒讹紝闃叉瀵瑰懆杈瑰眳姘戦�犳垚鐢熸椿鐜姹℃煋銆俓n\n鍥涖�佷弗鏍兼墽琛屾壃灏樻不鐞嗗叚涓櫨鍒嗙櫨瑕佹眰锛�1銆佹柦宸ュ伐鍦板懆杈�100%鍥存尅锛�2銆佸嚭鍏ヨ溅杈�100%鍐叉礂锛�3銆佹媶杩佸伐鍦�100%婀挎硶浣滀笟锛�4銆佹福鍦熻溅杈�100%瀵嗛棴杩愯緭锛�5銆佹柦宸ョ幇鍦哄湴闈�100%纭寲锛�6銆佺墿鏂欏爢鏀�100%瑕嗙洊銆俓n\n浜斻�侀伒瀹堝叧浜庡嵃鍙戙�婁笂娴峰競鎴垮眿寤虹瓚宸ュ湴鎵皹姹℃煋闃叉不宸ヤ綔鏂规銆嬬殑閫氱煡 锛堟勃寤鸿川瀹夎仈銆�2019銆�208 鍙� 锛夌浉鍏宠瀹氾紝瀹夎甯備綇鎴垮煄涔″缓璁剧鐞嗗鍜屽競鐢熸�佺幆澧冨眬瀹樻柟缃戠珯鍏ず鍏憡鏍忎腑鏈�鏂板叕甯冪殑鍚堟牸渚涘簲鍟嗘彁渚涚殑鎵皹鍦ㄧ嚎鐩戞祴璁惧锛岄』绗﹀悎銆婁笂娴峰競寤虹瓚鏂藉伐棰楃矑鐗╀笌鍣0鍦ㄧ嚎鐩戞祴鎶�鏈鑼冦�嬶紝濮旀墭瑙勮寖鏈嶅姟鍗曚綅瀹氭湡杩愮淮锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紱璁惧鎷嗛櫎銆佺Щ鍔ㄦ垨鍋滆繍椤绘彁鍓嶅悜涓荤閮ㄩ棬鐢宠鎴栧妗堛�俓n\n鍏�佹壃灏樺湪绾跨洃娴嬭澶囧畨瑁呭悗椤荤‘淇濈ǔ瀹氳繍琛岋紝骞跺強鏃朵笌鐢熸�佺幆澧冮儴闂ㄦ壃灏樼洃鎺х郴缁熻仈缃戯紝渚濇嵁銆婁笂娴峰競鎵皹鍦ㄧ嚎鐩戞祴鏁版嵁鎵ф硶搴旂敤瑙勫畾銆嬪畾鏈熷鏍哥洃娴嬫暟鎹紝涓嶈秴鏍囨帓鏀撅紱鎵皹鐩戞祴鏁版嵁鍧氬喅涓嶅紕铏氫綔鍋囷紝涓嶈Е鐘�婄幆澧冪洃娴嬫暟鎹紕铏氫綔鍋囪涓哄垽瀹氬強澶勭悊鍔炴硶銆嬨�俓n\n涓冦�佷笉浣跨敤鏈笂鐜繚鎷嶇収鐨勯潪閬撹矾鏈烘锛屼笉浣跨敤闈炴硶娓犻亾鎴栦笉杈炬爣鏌存补銆俓n\n鍏�侀伒瀹�2022骞�6鏈�5鏃ヨ捣鏂借鐨勩�婁腑鍗庝汉姘戝叡鍜屽浗鍣0姹℃煋闃叉不娉曘�嬶紝瑙勮寖寮�灞曞缓绛戞柦宸ュ櫔澹版薄鏌撻槻娌伙紱娑夊強澶滈棿鏂藉伐鐨勶紝搴旈伒瀹堛�婁笂娴峰競寤鸿宸ョ▼澶滈棿鏂藉伐璁稿彲鍜屽妗堝鏌ョ鐞嗗姙娉曘�嬶紝鏂藉伐杩囩▼涓簲閲囧彇鏈夋晥鐨勯檷鍣帾鏂斤紝閬垮厤鍣0鎵版皯銆俓n\n涔濄�佸悓鎰忔湰鎵胯鍚戠ぞ浼氬叕寮�锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�';
+
+const text6 =
+ '涓鸿返琛岀豢鑹插彂灞曠悊蹇碉紝鍔姏钀ラ�犺瘹瀹炲畧淇$殑绀句細鐜锛岃惤瀹炲伐涓氫紒涓氱幆淇濊矗浠伙紝闄嶄綆鍥犵幆澧冪瓑鍥犵礌閫犳垚鐨勫伐涓氫紒涓氬畨鍏ㄩ殣鎮e拰灞呮皯绾犵悍锛岀‘淇濆伐涓氫紒涓氬仴搴锋湁搴忓彂灞曪紝鏈崟浣嶏紙鎴栨湰浜猴級鑷効浣滃嚭濡備笅鎵胯锛歕n\n涓�銆佷弗鏍奸伒瀹堝浗瀹躲�佸競銆佸尯鏈夊叧鐜淇濇姢娉曞緥銆佹硶瑙勩�佽绔犮�佹爣鍑嗗拰鏀跨瓥瑙勫畾锛屽潥鎸佸畧娉曠敓浜х粡钀ワ紝绉瀬灞ヨ鐜淇濇姢绀句細璐d换銆俓n\n浜屻�佸缓绔嬪仴鍏ㄧ鐞嗗埗搴︼紝鍔犲己鏃ュ父绠$悊鍜岀幆淇濊鏂藉畨鍏ㄧ鐞嗭紝寤虹珛鍗遍櫓搴熺墿鍙拌处鍜岀鐞嗚鍒掋�佹薄鏌撻槻娌昏鏂借繍琛岀鐞嗗彴璐︼紝钀藉疄鐜鐩戞祴绛夊悇椤硅姹傦紝钀藉疄鍚勭被鐜椋庨櫓闃茶寖鎺柦銆俓n\n涓夈�佸伐涓氬簾姘村叏閮ㄦ敹闆嗭紝涓ユ牸鎸夌幆璇勬枃浠惰繘琛屽缃�俓n\n鍥涖�佹秹鍙奦OCs绛夊簾姘旀帓鏀剧殑锛岄』瀹夎搴熸皵鍑�鍖栬缃紝鎺掓斁鐨勫悇绫诲ぇ姘旀薄鏌撶墿搴旇揪鍒扮幆璇勬枃浠惰瀹氱殑鎺掓斁闄愬�艰姹傘�傚簾姘斿噣鍖栬缃畾鏈熺淮鎶わ紝骞跺畾鏈熸洿鎹㈢浉搴旇�楁潗锛堟椿鎬х偔绛夛級锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝闃叉瀵瑰懆杈瑰眳姘戦�犳垚鐢熸椿鐜姹℃煋銆俓n\n浼佷笟涓秹鍚玍OCs鍘熻緟鏂欎粨搴撱�佷骇鐢烿OCs宸ヨ壓鐜妭鎴栫敓浜х嚎銆佸嵄搴熶粨搴撶瓑鍖哄煙浜х敓鐨勫簾姘斿潎搴旂嫭绔嬫敹闆嗭紝骞剁粡娲绘�х偔鍚搁檮绛夋柟寮忓鐞嗗悗锛岄�氳繃鎺掓皵绛掗珮绌烘帓鏀俱�傛帓姘旂瓛楂樺害涓嶄綆浜�15绫筹紝鍏蜂綋楂樺害鎸夌幆澧冨奖鍝嶈瘎浠疯姹傜‘瀹氥�俓n\n浜斻�佷笌鍏锋湁銆婂嵄闄╁簾鐗╃粡钀ヨ鍙瘉銆嬭祫璐ㄥ崟浣嶇璁㈠嵄搴熷缃悎鍚岋紝骞剁‘淇濆悎鍚岀殑鏈夋晥鎬с�傛寜鏃剁紪鍒跺嵄闄╁簾鐗╃鐞嗭紙杞Щ锛夎鍒掑苟鍙婃椂鍚戠幆淇濅富绠¢儴闂ㄥ妗堬紝骞朵弗鏍艰惤瀹炲嵄闄╁簾鐗╄浆绉昏仈鍗曞埗搴︺�傚叾浠栦竴鑸浐浣撳簾鐗╂寜鐓ф湰甯傛湁鍏宠瀹氬Ε鍠勫缃�俓n\n搴熸椿鎬х偔銆佸簾婊よ姱绛変富瑕佸嵄搴熷簲绗﹀悎銆婂嵄闄╁簾鐗╄串瀛樻薄鏌撴帶鍒舵爣鍑嗐�嬶紙GB18597-2001锛夌殑鏈夊叧瑕佹眰锛岃串瀛樻恫鎬佹垨鍗婃恫鎬佸嵄搴熺殑搴旇缃硠闇叉恫浣撴敹闆嗚缃紝鍗遍櫓搴熺墿涓嶅緱娣峰叆闈炲嵄闄╁簾鐗╀腑璐瓨锛涙敹闆嗐�佽串瀛樸�佽繍杈撱�佸埄鐢ㄣ�佸缃嵄闄╁簾鐗╃殑璁炬柦銆佸満鎵�锛屽繀椤昏缃嵄闄╁簾鐗╄绀烘爣蹇楀拰璇嗗埆鏍囧織锛屾寜鐓у嵄闄╁簾鐗╃壒鎬у垎绫昏繘琛屾敹闆嗐�佽串瀛橈紝涓嶅悓绫诲簾鐗╅棿鏈夋槑鏄剧殑闂撮殧锛屽嵄闄╁簾鐗╂爣绛惧拰鐩稿叧鏍囧織绛夊簲绗﹀悎銆婂嵄闄╁簾鐗╄瘑鍒爣蹇楄缃妧鏈鑼冦�嬶紙HJ 1276-2022锛夌浉鍏宠姹傘�俓n\n鍚屾剰鏈壙璇哄悜绀句細鍏紑锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�';
const promise = {
- '1': "涓鸿返琛岀豢鑹插彂灞曠悊蹇碉紝鍔姏钀ラ�犺瘹瀹炲畧淇$殑绀句細鐜锛岃惤瀹為楗崟浣嶇幆淇濊矗浠�,闄嶄綆鍥犵幆澧冪瓑鍥犵礌閫犳垚鐨勯鍝佸畨鍏ㄩ殣鎮e拰灞呮皯绾犵悍锛岀‘淇濋楗笟鍋ュ悍鏈夊簭鍙戝睍锛屾湰鍗曚綅(鎴栨湰浜�)鑷効浣滃嚭濡備笅鎵胯: \n\n涓�銆佷弗鏍奸伒瀹堝浗瀹躲�佸競銆佸尯鏈夊叧鐜淇濇姢娉曞緥銆佹硶瑙勩�佽绔犮�佹爣鍑嗗拰鏀跨瓥瑙勫畾,鍧氭寔瀹堟硶鐢熶骇缁忚惀, 绉瀬灞ヨ鐜淇濇姢绀句細璐d换銆俓n\n浜屻�佸竷灞�鍜屽缓璁剧鍚堝煄甯傛�讳綋瑙勫垝銆佸競瀹圭殑鐩稿叧瑕佹眰锛屼笉鍦ㄤ互涓嬪尯鍩熸柊寤恒�佹敼寤恒�佹墿寤轰骇鐢熸补鐑熴�佸紓鍛炽�佸簾姘旂殑椁愰ギ鏈嶅姟椤圭洰:灞呮皯浣忓畢妤笺�佹湭閰嶅璁剧珛涓撶敤鐑熼亾鐨勫晢浣忔ゼ浠ュ強鍟嗕綇妤间笌灞呬綇灞傜浉閭荤殑妤煎眰銆俓n\n涓夈�佸畨瑁呮补鐑熷噣鍖栧拰寮傚懗澶勭悊璁炬柦锛屾补鐑熸帓鏀炬祿搴︾鍚堛�婁笂娴峰競椁愰ギ涓氭补鐑熸帓鏀炬爣鍑嗐��(DB 31/844-2014)锛屽苟濮旀墭瑙勮寖鏈嶅姟鍗曚綅鍙傜収銆婃帓娌圭儫璁炬柦娓呮礂鎶�鏈鑼冦��(T/SHXFXH 002-2021)瀹氭湡杩涜缁存姢娓呮礂锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝闃叉瀵瑰懆杈瑰眳姘戦�犳垚鐢熸椿鐜姹℃煋銆俓n\n鍥涖�佸畨瑁呯鍚堛�奀CAEPI-RG-Y-020-2011銆嬬殑娌圭儫鍦ㄧ嚎鐩戞祴瑁呯疆锛屾牴鎹�婇楗补鐑熷湪绾跨洃娴嬶紙鍏夋暎灏勬硶锛変笌鐩戞帶鎶�鏈鑼冦��(T/SHAEPI 003-2022)锛屽強鏃朵笌鐢熸�佺幆澧冮儴闂ㄦ补鐑熺洃鎺ф暟鎹钩鍙拌仈缃戯紝濮旀墭瑙勮寖鏈嶅姟鍗曚綅瀹氭湡杩愮淮锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝涓嶈秴鏍囨帓鏀俱�俓n\n浜斻�佸噣鍖栬缃鏈恒�佺┖璋冨鏈哄畨瑁呬綅缃敖閲忚繙绂讳綇鎴凤紝鍋氬ソ闅斿櫔銆侀檷鍣帾鏂斤紝鏄奸棿<60dB銆� 澶滈棿<50aB锛� 纭繚涓嶅櫔澹版壈姘戙�俓n\n鍏�佷笉鍦ㄧ姝㈢殑鍖哄煙(鍦ㄥ綋鍦颁汉姘戞斂搴滅姝㈢殑鏃舵鍜屽尯鍩�)鍐呴湶澶╃儳鐑ら鍝併�俓n\n涓冦�佸湪灞呮皯鍖哄唴浠庝簨椁愰ギ鏈嶅姟锛屼繚璇佷笉鍥犵幆澧冨洜绱犲奖鍝嶅懆鍥村眳姘戞甯哥敓娲伙紝涓�鏃﹀洜鎵版皯绛夐棶棰樺嚭鐜扮殑绾犵悍鐢辨湰鍗曚綅鑷璐熻矗鍗忓晢瑙h瘈骞剁珛鍗虫暣鏀广�俓n\n鍏�佸悓鎰忔湰鎵胯鍚戠ぞ浼氬叕寮�锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�",
- '2': text,
- '3': text,
- '4': text,
- '5': text,
- '6': text,
- '7': "涓鸿返琛岀豢鑹插彂灞曠悊蹇碉紝鍔姏钀ラ�犺瘹瀹炲畧淇$殑绀句細鐜锛岃惤瀹炴苯淇崟浣嶇幆淇濊矗浠伙紝闄嶄綆鍥犵幆澧冪瓑鍥犵礌閫犳垚鐨勬苯淇畨鍏ㄩ殣鎮e拰灞呮皯绾犵悍锛岀‘淇濇苯淇笟鍋ュ悍鏈夊簭鍙戝睍锛屾湰鍗曚綅锛堟垨鏈汉锛夎嚜鎰夸綔鍑哄涓嬫壙璇猴細\n\n涓�銆佷弗鏍奸伒瀹堝浗瀹躲�佸競銆佸尯鏈夊叧鐜淇濇姢娉曞緥銆佹硶瑙勩�佽绔犮�佹爣鍑嗗拰鏀跨瓥瑙勫畾锛屽潥鎸佸畧娉曠敓浜х粡钀ワ紝绉瀬灞ヨ鐜淇濇姢绀句細璐d换銆俓n\n浜屻�佸缓绔嬪仴鍏ㄧ鐞嗗埗搴︼紝鍔犲己鏃ュ父绠$悊锛屽缓绔嬪嵄闄╁簾鐗╁彴璐﹀拰绠$悊璁″垝銆佹薄鏌撻槻娌昏鏂借繍琛岀鐞嗗彴璐︼紝钀藉疄鐜鐩戞祴绛夊悇椤硅姹傦紝钀藉疄鍚勭被鐜椋庨櫓闃茶寖鎺柦銆俓n\n涓夈�佹礂杞﹀簾姘淬�佺淮淇尯鍩熷満鍦板啿娲楀簾姘村叏閮ㄦ敹闆嗭紝缁忎笁绾ф矇鐮傞殧娌规睜澶勭悊鍚庣撼绠℃帓鏀俱�傚簾娌广�佸喎鍐绘恫銆佹鼎婊戞补鍙婇浂閮ㄤ欢鐨勬竻娲楀簾娑层�佹矇娣�娌规偿绛夊崟鐙敹闆嗗洖鏀讹紝绂佹鎺掑叆涓嬫按绯荤粺銆俓n\n鍥涖�佹秹鍙婂柗娑傜瓑浜х敓搴熸皵鎺掓斁鐨勶紝椤诲畨瑁匳OCs澶勭悊璁炬柦锛屾帓鏀剧殑鍚勭被澶ф皵姹℃煋鐗╁簲杈惧埌銆婃苯杞︾淮淇涓氬ぇ姘旀薄鏌撶墿鎺掓斁鏍囧噯銆嬶紙DB31/1288-2021锛夎瀹氱殑鎺掓斁闄愬�艰姹傘�傚簾姘斿噣鍖栬缃畾鏈熺淮鎶わ紝骞跺畾鏈熸洿鎹㈢浉搴旇�楁潗锛堟椿鎬х偔銆佽繃婊ゆ绛夛級锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝闃叉瀵瑰懆杈瑰眳姘戦�犳垚鐢熸椿鐜姹℃煋銆俓n\n鎵撶(銆佸柗婕嗐�佺儰婕嗐�佺儤骞层�佽皟婕嗐�佸柗鏋竻娲楃瓑浜х敓搴熸皵鐨勫伐搴忓湪瀵嗛棴绌洪棿鍐呰繘琛岋紝鏀堕泦浜х敓鐨勫簾姘旓紝骞剁粡娲绘�х偔鍚搁檮绛夋柟寮忓鐞嗗悗锛岄�氳繃鎺掓皵绛掗珮绌烘帓鏀俱�傛帓姘旂瓛楂樺害涓嶄綆浜�15绫筹紝鍏蜂綋楂樺害鎸夌幆澧冨奖鍝嶈瘎浠疯姹傜‘瀹氥�傚惈VOCs鍘熻緟鏉愭枡锛堝娌规紗銆佹秱鏂欙級鍏ㄨ繃绋嬩繚鎸佸瘑闂紝浣跨敤杩囩▼闅忓彇闅忓紑銆俓n\n浜斻�佹秹鍙婂柗娑傜瓑浜х敓搴熸皵鎺掓斁鐨勶紝鑷効瀹夎绗﹀悎銆婁笂娴峰競鍥哄畾姹℃煋婧愰潪鐢茬兎鎬荤儍鍦ㄧ嚎鐩戞祴绯荤粺楠屾敹鍙婅繍琛屾妧鏈姹傦紙璇曡锛夈�嬫垨鐢熸�佺幆澧冧富绠¢儴闂ㄨ姹傜殑VOCs鍦ㄧ嚎鐩戞祴瑁呯疆浠ュ強宸ュ喌鐩戞帶妯″潡锛屽苟鍙婃椂涓庣敓鎬佺幆澧冮儴闂ㄧ浉鍏崇洃鎺х郴缁熻仈缃戯紝濮旀墭瑙勮寖鏈嶅姟鍗曚綅瀹氭湡杩愮淮锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝涓嶈秴鏍囨帓鏀俱�俓n\n鍏�佷笌鍏锋湁銆婂嵄闄╁簾鐗╃粡钀ヨ鍙瘉銆嬭祫璐ㄥ崟浣嶇璁㈠嵄搴熷缃悎鍚岋紝骞剁‘淇濆悎鍚岀殑鏈夋晥鎬с�傛寜鏃剁紪鍒跺嵄闄╁簾鐗╃鐞嗭紙杞Щ锛夎鍒掑苟鍙婃椂鍚戠幆淇濅富绠¢儴闂ㄥ妗堬紝骞朵弗鏍艰惤瀹炲嵄闄╁簾鐗╄浆绉昏仈鍗曞埗搴︺�傚叾浠栦竴鑸浐浣撳簾鐗╂寜鐓ф湰甯傛湁鍏宠瀹氬Ε鍠勫缃�俓n\n搴熺熆鐗╂补銆佸簾娌规紗娓c�佸簾娌规紗妗�/搴熸満娌规《銆佸簾娲绘�х偔銆佸簾鍚搁檮妫夌瓑杩囨护鍚搁檮浠嬭川銆佸簾鍌寲鍓傚拰搴熼搮閰歌搫鐢垫睜绛変富瑕佸嵄搴熷簲绗﹀悎銆婂嵄闄╁簾鐗╄串瀛樻薄鏌撴帶鍒舵爣鍑嗐�嬶紙GB18597-2001锛夌殑鏈夊叧瑕佹眰锛屾敹闆嗐�佽串瀛樸�佽繍杈撱�佸埄鐢ㄣ�佸缃嵄闄╁簾鐗╃殑璁炬柦銆佸満鎵�锛屽繀椤昏缃嵄闄╁簾鐗╄绀烘爣蹇楀拰璇嗗埆鏍囧織锛屾寜鐓у嵄闄╁簾鐗╃壒鎬у垎绫昏繘琛屾敹闆嗐�佽串瀛橈紝涓嶅悓绫诲簾鐗╅棿鏈夋槑鏄剧殑闂撮殧锛岃串瀛樻恫鎬佹垨鍗婃恫鎬佸嵄搴熺殑搴旇缃硠闇叉恫浣撴敹闆嗚缃紝鍗遍櫓搴熺墿涓嶅緱娣峰叆闈炲嵄闄╁簾鐗╀腑璐瓨銆俓n\n涓冦�侀噰鍙栫患鍚堥殧澹般�佸噺闇囨帾鏂斤紝纭繚鍘傜晫鍣0杈惧埌銆婂伐涓氫紒涓氬巶鐣岀幆澧冨櫔澹版帓鏀炬爣鍑嗐�嬶紙GB12348-2008锛夌浉搴斿0鍔熻兘鍖烘帓鏀鹃檺鍊艰姹傦紝纭繚涓嶅櫔澹版壈姘戙�俓n\n鍏�佸悓鎰忔湰鎵胯鍚戠ぞ浼氬叕寮�锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�",
-}
+ 1: '涓鸿返琛岀豢鑹插彂灞曠悊蹇碉紝鍔姏钀ラ�犺瘹瀹炲畧淇$殑绀句細鐜锛岃惤瀹為楗崟浣嶇幆淇濊矗浠�,闄嶄綆鍥犵幆澧冪瓑鍥犵礌閫犳垚鐨勯鍝佸畨鍏ㄩ殣鎮e拰灞呮皯绾犵悍锛岀‘淇濋楗笟鍋ュ悍鏈夊簭鍙戝睍锛屾湰鍗曚綅(鎴栨湰浜�)鑷効浣滃嚭濡備笅鎵胯: \n\n涓�銆佷弗鏍奸伒瀹堝浗瀹躲�佸競銆佸尯鏈夊叧鐜淇濇姢娉曞緥銆佹硶瑙勩�佽绔犮�佹爣鍑嗗拰鏀跨瓥瑙勫畾,鍧氭寔瀹堟硶鐢熶骇缁忚惀, 绉瀬灞ヨ鐜淇濇姢绀句細璐d换銆俓n\n浜屻�佸竷灞�鍜屽缓璁剧鍚堝煄甯傛�讳綋瑙勫垝銆佸競瀹圭殑鐩稿叧瑕佹眰锛屼笉鍦ㄤ互涓嬪尯鍩熸柊寤恒�佹敼寤恒�佹墿寤轰骇鐢熸补鐑熴�佸紓鍛炽�佸簾姘旂殑椁愰ギ鏈嶅姟椤圭洰:灞呮皯浣忓畢妤笺�佹湭閰嶅璁剧珛涓撶敤鐑熼亾鐨勫晢浣忔ゼ浠ュ強鍟嗕綇妤间笌灞呬綇灞傜浉閭荤殑妤煎眰銆俓n\n涓夈�佸畨瑁呮补鐑熷噣鍖栧拰寮傚懗澶勭悊璁炬柦锛屾补鐑熸帓鏀炬祿搴︾鍚堛�婁笂娴峰競椁愰ギ涓氭补鐑熸帓鏀炬爣鍑嗐��(DB 31/844-2014)锛屽苟濮旀墭瑙勮寖鏈嶅姟鍗曚綅鍙傜収銆婃帓娌圭儫璁炬柦娓呮礂鎶�鏈鑼冦��(T/SHXFXH 002-2021)瀹氭湡杩涜缁存姢娓呮礂锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝闃叉瀵瑰懆杈瑰眳姘戦�犳垚鐢熸椿鐜姹℃煋銆俓n\n鍥涖�佸畨瑁呯鍚堛�奀CAEPI-RG-Y-020-2011銆嬬殑娌圭儫鍦ㄧ嚎鐩戞祴瑁呯疆锛屾牴鎹�婇楗补鐑熷湪绾跨洃娴嬶紙鍏夋暎灏勬硶锛変笌鐩戞帶鎶�鏈鑼冦��(T/SHAEPI 003-2022)锛屽強鏃朵笌鐢熸�佺幆澧冮儴闂ㄦ补鐑熺洃鎺ф暟鎹钩鍙拌仈缃戯紝濮旀墭瑙勮寖鏈嶅姟鍗曚綅瀹氭湡杩愮淮锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝涓嶈秴鏍囨帓鏀俱�俓n\n浜斻�佸噣鍖栬缃鏈恒�佺┖璋冨鏈哄畨瑁呬綅缃敖閲忚繙绂讳綇鎴凤紝鍋氬ソ闅斿櫔銆侀檷鍣帾鏂斤紝鏄奸棿<60dB銆� 澶滈棿<50aB锛� 纭繚涓嶅櫔澹版壈姘戙�俓n\n鍏�佷笉鍦ㄧ姝㈢殑鍖哄煙(鍦ㄥ綋鍦颁汉姘戞斂搴滅姝㈢殑鏃舵鍜屽尯鍩�)鍐呴湶澶╃儳鐑ら鍝併�俓n\n涓冦�佸湪灞呮皯鍖哄唴浠庝簨椁愰ギ鏈嶅姟锛屼繚璇佷笉鍥犵幆澧冨洜绱犲奖鍝嶅懆鍥村眳姘戞甯哥敓娲伙紝涓�鏃﹀洜鎵版皯绛夐棶棰樺嚭鐜扮殑绾犵悍鐢辨湰鍗曚綅鑷璐熻矗鍗忓晢瑙h瘈骞剁珛鍗虫暣鏀广�俓n\n鍏�佸悓鎰忔湰鎵胯鍚戠ぞ浼氬叕寮�锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�',
+ 2: text,
+ 3: text,
+ 4: text,
+ 5: text,
+ 6: text6,
+ '-6': text6,
+ 7: '涓鸿返琛岀豢鑹插彂灞曠悊蹇碉紝鍔姏钀ラ�犺瘹瀹炲畧淇$殑绀句細鐜锛岃惤瀹炴苯淇崟浣嶇幆淇濊矗浠伙紝闄嶄綆鍥犵幆澧冪瓑鍥犵礌閫犳垚鐨勬苯淇畨鍏ㄩ殣鎮e拰灞呮皯绾犵悍锛岀‘淇濇苯淇笟鍋ュ悍鏈夊簭鍙戝睍锛屾湰鍗曚綅锛堟垨鏈汉锛夎嚜鎰夸綔鍑哄涓嬫壙璇猴細\n\n涓�銆佷弗鏍奸伒瀹堝浗瀹躲�佸競銆佸尯鏈夊叧鐜淇濇姢娉曞緥銆佹硶瑙勩�佽绔犮�佹爣鍑嗗拰鏀跨瓥瑙勫畾锛屽潥鎸佸畧娉曠敓浜х粡钀ワ紝绉瀬灞ヨ鐜淇濇姢绀句細璐d换銆俓n\n浜屻�佸缓绔嬪仴鍏ㄧ鐞嗗埗搴︼紝鍔犲己鏃ュ父绠$悊锛屽缓绔嬪嵄闄╁簾鐗╁彴璐﹀拰绠$悊璁″垝銆佹薄鏌撻槻娌昏鏂借繍琛岀鐞嗗彴璐︼紝钀藉疄鐜鐩戞祴绛夊悇椤硅姹傦紝钀藉疄鍚勭被鐜椋庨櫓闃茶寖鎺柦銆俓n\n涓夈�佹礂杞﹀簾姘淬�佺淮淇尯鍩熷満鍦板啿娲楀簾姘村叏閮ㄦ敹闆嗭紝缁忎笁绾ф矇鐮傞殧娌规睜澶勭悊鍚庣撼绠℃帓鏀俱�傚簾娌广�佸喎鍐绘恫銆佹鼎婊戞补鍙婇浂閮ㄤ欢鐨勬竻娲楀簾娑层�佹矇娣�娌规偿绛夊崟鐙敹闆嗗洖鏀讹紝绂佹鎺掑叆涓嬫按绯荤粺銆俓n\n鍥涖�佹秹鍙婂柗娑傜瓑浜х敓搴熸皵鎺掓斁鐨勶紝椤诲畨瑁匳OCs澶勭悊璁炬柦锛屾帓鏀剧殑鍚勭被澶ф皵姹℃煋鐗╁簲杈惧埌銆婃苯杞︾淮淇涓氬ぇ姘旀薄鏌撶墿鎺掓斁鏍囧噯銆嬶紙DB31/1288-2021锛夎瀹氱殑鎺掓斁闄愬�艰姹傘�傚簾姘斿噣鍖栬缃畾鏈熺淮鎶わ紝骞跺畾鏈熸洿鎹㈢浉搴旇�楁潗锛堟椿鎬х偔銆佽繃婊ゆ绛夛級锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝闃叉瀵瑰懆杈瑰眳姘戦�犳垚鐢熸椿鐜姹℃煋銆俓n\n鎵撶(銆佸柗婕嗐�佺儰婕嗐�佺儤骞层�佽皟婕嗐�佸柗鏋竻娲楃瓑浜х敓搴熸皵鐨勫伐搴忓湪瀵嗛棴绌洪棿鍐呰繘琛岋紝鏀堕泦浜х敓鐨勫簾姘旓紝骞剁粡娲绘�х偔鍚搁檮绛夋柟寮忓鐞嗗悗锛岄�氳繃鎺掓皵绛掗珮绌烘帓鏀俱�傛帓姘旂瓛楂樺害涓嶄綆浜�15绫筹紝鍏蜂綋楂樺害鎸夌幆澧冨奖鍝嶈瘎浠疯姹傜‘瀹氥�傚惈VOCs鍘熻緟鏉愭枡锛堝娌规紗銆佹秱鏂欙級鍏ㄨ繃绋嬩繚鎸佸瘑闂紝浣跨敤杩囩▼闅忓彇闅忓紑銆俓n\n浜斻�佹秹鍙婂柗娑傜瓑浜х敓搴熸皵鎺掓斁鐨勶紝鑷効瀹夎绗﹀悎銆婁笂娴峰競鍥哄畾姹℃煋婧愰潪鐢茬兎鎬荤儍鍦ㄧ嚎鐩戞祴绯荤粺楠屾敹鍙婅繍琛屾妧鏈姹傦紙璇曡锛夈�嬫垨鐢熸�佺幆澧冧富绠¢儴闂ㄨ姹傜殑VOCs鍦ㄧ嚎鐩戞祴瑁呯疆浠ュ強宸ュ喌鐩戞帶妯″潡锛屽苟鍙婃椂涓庣敓鎬佺幆澧冮儴闂ㄧ浉鍏崇洃鎺х郴缁熻仈缃戯紝濮旀墭瑙勮寖鏈嶅姟鍗曚綅瀹氭湡杩愮淮锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝涓嶈秴鏍囨帓鏀俱�俓n\n鍏�佷笌鍏锋湁銆婂嵄闄╁簾鐗╃粡钀ヨ鍙瘉銆嬭祫璐ㄥ崟浣嶇璁㈠嵄搴熷缃悎鍚岋紝骞剁‘淇濆悎鍚岀殑鏈夋晥鎬с�傛寜鏃剁紪鍒跺嵄闄╁簾鐗╃鐞嗭紙杞Щ锛夎鍒掑苟鍙婃椂鍚戠幆淇濅富绠¢儴闂ㄥ妗堬紝骞朵弗鏍艰惤瀹炲嵄闄╁簾鐗╄浆绉昏仈鍗曞埗搴︺�傚叾浠栦竴鑸浐浣撳簾鐗╂寜鐓ф湰甯傛湁鍏宠瀹氬Ε鍠勫缃�俓n\n搴熺熆鐗╂补銆佸簾娌规紗娓c�佸簾娌规紗妗�/搴熸満娌规《銆佸簾娲绘�х偔銆佸簾鍚搁檮妫夌瓑杩囨护鍚搁檮浠嬭川銆佸簾鍌寲鍓傚拰搴熼搮閰歌搫鐢垫睜绛変富瑕佸嵄搴熷簲绗﹀悎銆婂嵄闄╁簾鐗╄串瀛樻薄鏌撴帶鍒舵爣鍑嗐�嬶紙GB18597-2001锛夌殑鏈夊叧瑕佹眰锛屾敹闆嗐�佽串瀛樸�佽繍杈撱�佸埄鐢ㄣ�佸缃嵄闄╁簾鐗╃殑璁炬柦銆佸満鎵�锛屽繀椤昏缃嵄闄╁簾鐗╄绀烘爣蹇楀拰璇嗗埆鏍囧織锛屾寜鐓у嵄闄╁簾鐗╃壒鎬у垎绫昏繘琛屾敹闆嗐�佽串瀛橈紝涓嶅悓绫诲簾鐗╅棿鏈夋槑鏄剧殑闂撮殧锛岃串瀛樻恫鎬佹垨鍗婃恫鎬佸嵄搴熺殑搴旇缃硠闇叉恫浣撴敹闆嗚缃紝鍗遍櫓搴熺墿涓嶅緱娣峰叆闈炲嵄闄╁簾鐗╀腑璐瓨銆俓n\n涓冦�侀噰鍙栫患鍚堥殧澹般�佸噺闇囨帾鏂斤紝纭繚鍘傜晫鍣0杈惧埌銆婂伐涓氫紒涓氬巶鐣岀幆澧冨櫔澹版帓鏀炬爣鍑嗐�嬶紙GB12348-2008锛夌浉搴斿0鍔熻兘鍖烘帓鏀鹃檺鍊艰姹傦紝纭繚涓嶅櫔澹版壈姘戙�俓n\n鍏�佸悓鎰忔湰鎵胯鍚戠ぞ浼氬叕寮�锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�',
+ 8: '涓鸿返琛岀豢鑹插彂灞曠悊蹇碉紝鍔姏钀ラ�犺瘹瀹炲畧淇$殑绀句細鐜锛岃惤瀹炲疄楠屽鐜繚璐d换锛岄檷浣庡洜鐜绛夊洜绱犻�犳垚鐨勫疄楠屽瀹夊叏闅愭偅鍜屽眳姘戠籂绾凤紝纭繚瀹為獙瀹ゅ仴搴锋湁搴忓彂灞曪紝鏈崟浣嶏紙鎴栨湰浜猴級鑷効浣滃嚭濡備笅鎵胯锛歕n\n涓�銆佷弗鏍奸伒瀹堝浗瀹躲�佸競銆佸尯鏈夊叧鐜淇濇姢娉曞緥銆佹硶瑙勩�佽绔犮�佹爣鍑嗗拰鏀跨瓥瑙勫畾锛屽潥鎸佸畧娉曠敓浜х粡钀ワ紝绉瀬灞ヨ鐜淇濇姢绀句細璐d换銆俓n\n浜屻�佸缓绔嬪仴鍏ㄧ鐞嗗埗搴︼紝鍔犲己鏃ュ父绠$悊锛屽缓绔嬪嵄闄╁簾鐗╁彴璐﹀拰绠$悊璁″垝銆佹薄鏌撻槻娌昏鏂借繍琛岀鐞嗗彴璐︼紝钀藉疄鐜鐩戞祴绛夊悇椤硅姹傦紝钀藉疄鍚勭被鐜椋庨櫓闃茶寖鎺柦銆俓n\n涓夈�佸疄楠屽娓呮礂搴熸按鍏ㄩ儴鏀堕泦锛屼弗鏍兼寜鐜瘎鏂囦欢杩涜澶勭疆銆傚疄楠屽璇曞墏娈嬫恫銆佹湭鍑�鍖栧鐞嗗簾姘达紝绂佹鎺掑叆涓嬫按绯荤粺銆俓n\n鍥涖�佹秹鍙婁骇鐢熷簾姘旀帓鏀剧殑锛岄』瀹夎搴熸皵鍑�鍖栬缃紝鎺掓斁鐨勫悇绫诲ぇ姘旀薄鏌撶墿搴旇揪鍒扮幆璇勬枃浠惰瀹氱殑鎺掓斁闄愬�艰姹傘�傚簾姘斿噣鍖栬缃畾鏈熺淮鎶わ紝骞跺畾鏈熸洿鎹㈢浉搴旇�楁潗锛堟椿鎬х偔绛夛級锛屽強鏃惰褰曠浉鍏冲彴璐︼紝纭繚鍏舵甯镐娇鐢紝闃叉瀵瑰懆杈瑰眳姘戦�犳垚鐢熸椿鐜姹℃煋銆俓n\n瀹為獙瀹ゃ�侀泦涓竻娲楀尯銆佸嵄搴熶粨搴撶瓑鍖哄煙浜х敓鐨勫簾姘斿潎搴旂嫭绔嬫敹闆嗭紝骞剁粡娲绘�х偔鍚搁檮绛夋柟寮忓鐞嗗悗锛岄�氳繃鎺掓皵绛掗珮绌烘帓鏀俱�傛帓姘旂瓛楂樺害涓嶄綆浜�15绫筹紝鍏蜂綋楂樺害鎸夌幆澧冨奖鍝嶈瘎浠疯姹傜‘瀹氥�俓n\n浜斻�佷笌鍏锋湁銆婂嵄闄╁簾鐗╃粡钀ヨ鍙瘉銆嬭祫璐ㄥ崟浣嶇璁㈠嵄搴熷缃悎鍚岋紝骞剁‘淇濆悎鍚岀殑鏈夋晥鎬с�傛寜鏃剁紪鍒跺嵄闄╁簾鐗╃鐞嗭紙杞Щ锛夎鍒掑苟鍙婃椂鍚戠幆淇濅富绠¢儴闂ㄥ妗堬紝骞朵弗鏍艰惤瀹炲嵄闄╁簾鐗╄浆绉昏仈鍗曞埗搴︺�傚叾浠栦竴鑸浐浣撳簾鐗╂寜鐓ф湰甯傛湁鍏宠瀹氬Ε鍠勫缃�俓n\n瀹為獙瀹よ瘯鍓傛畫娑层�佸疄楠屾竻娲楀簾姘淬�佸寲瀛﹀搧瀹瑰櫒鎴栧皬鍖呰銆佸簾娲绘�х偔銆佸簾婊よ姱绛変富瑕佸嵄搴熷簲绗﹀悎銆婂嵄闄╁簾鐗╄串瀛樻薄鏌撴帶鍒舵爣鍑嗐�嬶紙GB18597-2001锛夌殑鏈夊叧瑕佹眰锛屾敹闆嗐�佽串瀛樸�佽繍杈撱�佸埄鐢ㄣ�佸缃嵄闄╁簾鐗╃殑璁炬柦銆佸満鎵�锛屽繀椤昏缃嵄闄╁簾鐗╄绀烘爣蹇楀拰璇嗗埆鏍囧織锛屾寜鐓у嵄闄╁簾鐗╃壒鎬у垎绫昏繘琛屾敹闆嗐�佽串瀛橈紝涓嶅悓绫诲簾鐗╅棿鏈夋槑鏄剧殑闂撮殧锛岃串瀛樻恫鎬佹垨鍗婃恫鎬佸嵄搴熺殑搴旇缃硠闇叉恫浣撴敹闆嗚缃紝鍗遍櫓搴熺墿涓嶅緱娣峰叆闈炲嵄闄╁簾鐗╀腑璐瓨銆俓n\n鍏�佸悓鎰忔湰鎵胯鍚戠ぞ浼氬叕寮�锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�',
+};
-export {promise}
\ No newline at end of file
+export { promise };
diff --git a/data/sceneInfo.js b/data/sceneInfo.js
index 18361f9..296eea9 100644
--- a/data/sceneInfo.js
+++ b/data/sceneInfo.js
@@ -2,12 +2,14 @@
const sceneInfo = ()=> {
const map = new Map()
//椁愰ギ**************************************************************************************************
- map.set('1', [{
+ map.set('1', [
+ {
name: "搴楅摵鍚嶇О",
id: "biName",
input: true,
value: '',
noValue: false,
+ disable: true
},
{
name: "搴楅摵绠�绉�",
@@ -314,41 +316,90 @@
])
//宸ヤ笟浼佷笟**************************************************************************************************
- map.set('6', [{
- name: "搴楅摵鍚嶇О",
- id: "sceneName",
+ map.set('6', [
+ {
+ name: "浼佷笟鍚嶇О",
+ id: "biName",
input: true,
value: '',
noValue: false,
+ disable: true
},
{
- name: "搴楅摵绠�绉�",
- id: "sceneNickName",
+ name: "浼佷笟绠�绉�",
+ id: "biNickName",
input: true,
value: '',
noValue: false,
+ required: false
},
{
name: "缁忚惀鍦板潃",
- id: "address",
+ id: "biAddress",
input: true,
value: '',
noValue: false,
},
{
name: "鑱旂郴浜�",
- id: "contract",
+ id: "biContact",
input: true,
value: '',
noValue: false,
},
{
name: "鑱旂郴鏂瑰紡",
- id: "telephone",
+ id: "biTelephone",
input: true,
value: '',
noValue: false,
},
+ {
+ name: "琛楅晣",
+ id: "biLocation",
+ type: 'picker',
+ pickerMode: 'region',
+ value: [],
+ displayValue: ['涓婃捣甯�', '涓婃捣甯�'],
+ noValue: false,
+ required: false
+ },
+ {
+ name: "鐢熶骇宸ヨ壓",
+ id: "ibProductionTechnique",
+ input: true,
+ value: '',
+ noValue: false,
+ },
+ {
+ name: "搴熸皵澶勭悊宸ヨ壓",
+ id: "ibWasteGasTechnique",
+ type: 'checkbox',
+ value: '0',
+ options: [
+ {name: '鏇存崲寮忔椿鎬х偔', value: '0', checked: true},
+ {name: '绛夌瀛�', value: '1', },
+ {name: '鍏夎В锛堝厜姘у寲锛�', value: '2', },
+ {name: '娲绘�х偔+鍏夎В', value: '3', },
+ {name: '娲绘�х偔+绛夌瀛�', value: '4', },
+ {name: '娲绘�х偔鍚歌劚闄�+鐑哀鍖�', value: '5', },
+ {name: '鍏朵粬', value: '99', hasRemark: true, remark: '', placeholder: '杈撳叆鍏朵粬宸ヨ壓'},
+ ]
+ },
+ {
+ name: "鐩戞帶鎺柦",
+ id: "ibWasteGasMeasure",
+ type: 'checkbox',
+ value: '0',
+ options: [
+ {name: '娴撳害鍦ㄧ嚎', value: '0', checked: true},
+ {name: '鍘嬪樊', value: '1', },
+ {name: '娓╁害', value: '2', },
+ {name: '鐢甸噺', value: '3', },
+ {name: '鏃堕棿鎺у埗', value: '4', },
+ {name: '鍏朵粬', value: '99', hasRemark: true, remark: '', placeholder: '杈撳叆鍏朵粬绫诲瀷'},
+ ]
+ },
])
//姹戒慨**************************************************************************************************
diff --git a/data/sceneTypes.js b/data/sceneTypes.js
index 2c8c259..469a1f2 100644
--- a/data/sceneTypes.js
+++ b/data/sceneTypes.js
@@ -1,24 +1,45 @@
//灏忕▼搴�
const sceneTypes1 = [
- {value: '1', name: '椁愰ギ'},
- {value: '2', name: '宸ュ湴'},
- {value: '3', name: '鐮佸ご'},
- {value: '4', name: '鍫嗗満'},
- {value: '5', name: '鎼呮媽绔�' },
- {value: '6', name: '宸ヤ笟浼佷笟' },
- {value: '7', name: '姹戒慨'},
-]
+ { value: '1', name: '椁愰ギ' },
+ { value: '2', name: '宸ュ湴' },
+ { value: '3', name: '鐮佸ご' },
+ { value: '4', name: '鍫嗗満' },
+ { value: '5', name: '鎼呮媽绔�' },
+ { value: '6', name: '宸ヤ笟浼佷笟' },
+ { value: '-6', name: '宸ヤ笟浼佷笟' },
+ { value: '7', name: '姹戒慨' },
+ { value: '8', name: '瀹為獙瀹�' },
+ { value: '9', name: '鍖荤枟鏈烘瀯' },
+];
+
+function getSceneName1(value) {
+ let r = sceneTypes1.find(v => {
+ if (v.value == value) {
+ return v;
+ }
+ });
+ return r.name;
+}
//椋炵窘鐩戠
const sceneTypes2 = [
- {value: '1', name: '宸ュ湴'},
- {value: '2', name: '鐮佸ご'},
- {value: '3', name: '鎼呮媽绔�'},
- {value: '4', name: '宸ヤ笟浼佷笟'},
- {value: '5', name: '椁愰ギ' },
- {value: '6', name: '姹戒慨' },
- {value: '10', name: '閬撹矾'},
- {value: '14', name: '鍫嗗満'},
-]
+ { value: '1', name: '宸ュ湴' },
+ { value: '2', name: '鐮佸ご' },
+ { value: '3', name: '鎼呮媽绔�' },
+ { value: '4', name: '宸ヤ笟浼佷笟' },
+ { value: '5', name: '椁愰ギ' },
+ { value: '6', name: '姹戒慨' },
+ { value: '10', name: '閬撹矾' },
+ { value: '14', name: '鍫嗗満' },
+];
-module.exports = {sceneTypes1, sceneTypes2}
\ No newline at end of file
+function getSceneName2(value) {
+ let r = sceneTypes2.find(v => {
+ if (v.value == value) {
+ return v;
+ }
+ });
+ return r.name;
+}
+
+module.exports = { sceneTypes1, getSceneName1, sceneTypes2, getSceneName2 };
diff --git a/data/schedules.js b/data/schedules.js
index 307518e..2bb36fb 100644
--- a/data/schedules.js
+++ b/data/schedules.js
@@ -14,7 +14,7 @@
type: 0,
events: [{
category: `${year}骞�${m}鏈堢幆淇濆伐浣滄棩绋媊,
- name: `鎻愪氦鐜繚鍙拌处`,
+ name: `鎻愪氦${m}鏈堢幆淇濆彴璐,
type: 1, //绯荤粺鏃ョ▼
steps: [{
index: '01',
@@ -37,7 +37,7 @@
type: 1,
events: [{
category: `${year}骞�${m}鏈堢幆淇濆伐浣滄棩绋媊,
- name: `瀹屾垚鑷祴鏅鸿瘎`,
+ name: `瀹屾垚${m}鏈堣嚜娴嬫櫤璇刞,
type: 1, //绯荤粺鏃ョ▼
steps: [{
index: '01',
diff --git a/miniprogram_npm/tdesign-miniprogram/.wechatide.ib.json b/miniprogram_npm/tdesign-miniprogram/.wechatide.ib.json
new file mode 100644
index 0000000..461d4e1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/.wechatide.ib.json
@@ -0,0 +1,3895 @@
+{
+ "key": "TDesign",
+ "label": "Tdesign",
+ "components": {
+ "t-action-sheet": {
+ "key": "t-action-sheet",
+ "label": "鍔ㄤ綔闈㈡澘",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-actionsheet.png",
+ "properties": [
+ {
+ "key": "cancelText",
+ "type": ["String"],
+ "desc": "璁剧疆鍙栨秷鎸夐挳鐨勬枃鏈�",
+ "label": ""
+ },
+ {
+ "key": "count",
+ "type": ["Number"],
+ "desc": "璁剧疆姣忛〉灞曠ず鑿滃崟鐨勬暟閲忥紝浠呭綋 type=grid 鏃舵湁鏁�",
+ "label": ""
+ },
+ {
+ "key": "items",
+ "type": ["Array"],
+ "desc": "鑿滃崟椤�",
+ "label": ""
+ },
+ {
+ "key": "showCancel",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず鍙栨秷鎸夐挳",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "灞曠ず绫诲瀷锛屽垪琛ㄥ拰琛ㄦ牸褰㈠紡灞曠ず",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "鏄剧ず涓庨殣钘�",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:cancel",
+ "desc": "鐐瑰嚮鍙栨秷鎸夐挳鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:close",
+ "desc": "鍏抽棴鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:selected",
+ "desc": "閫夋嫨鑿滃崟椤规椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-action-sheet id=\"t-action-sheet-imperative\" visible=\"{{false}}\"></t-action-sheet>",
+ "path": "./action-sheet/action-sheet"
+ },
+ "t-avatar-group": {
+ "key": "t-avatar-group",
+ "label": "澶村儚缁�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-avatar.png",
+ "properties": [
+ {
+ "key": "cascading",
+ "type": ["String"],
+ "desc": "鍥剧墖涔嬮棿鐨勫眰鍙犲叧绯伙紝鍙�夊�硷細宸︿晶鍥剧墖鍦ㄤ笂鍜屽彸渚у浘鐗囧湪涓�",
+ "label": ""
+ },
+ {
+ "key": "collapseAvatar",
+ "type": ["String"],
+ "desc": "澶村儚鏁伴噺瓒呭嚭鏃讹紝浼氬嚭鐜颁竴涓ご鍍忔姌鍙犲厓绱犮�傝鍏冪礌鍐呭鍙嚜瀹氫箟銆傞粯璁や负 `+N`銆傜ず渚嬶細`+5`锛宍...`, `鏇村`",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "鑳藉鍚屾椂鏄剧ず鐨勬渶澶氬ご鍍忔暟閲�",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "灏哄锛岀ず渚嬪�硷細small/medium/large/24px/38px 绛夈�備紭鍏堢骇浣庝簬 Avatar.size",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-image", "t-class-content"],
+ "tpl": "<t-avatar-group max=\"2\" collapseAvatar=\"+5\"><t-avatar wx:for=\"{{['https://cdn-we-retail.ym.tencent.com/retail-ui/components-exp/avatar/avatar-v2/1.png','https://cdn-we-retail.ym.tencent.com/retail-ui/components-exp/avatar/avatar-v2/2.png','https://cdn-we-retail.ym.tencent.com/retail-ui/components-exp/avatar/avatar-v2/3.png']}}\" wx:key=\"index\" image=\"{{item}}\" style=\"margin-right: -16rpx\" /></t-avatar-group>",
+ "require": {
+ "t-avatar": "./avatar/avatar"
+ },
+ "path": "./avatar/avatar-group"
+ },
+ "t-avatar": {
+ "key": "t-avatar",
+ "label": "澶村儚",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-avatar.png",
+ "properties": [
+ {
+ "key": "alt",
+ "type": ["String"],
+ "desc": "澶村儚鏇挎崲鏂囨湰锛屼粎褰撳浘鐗囧姞杞藉け璐ユ椂鏈夋晥",
+ "label": ""
+ },
+ {
+ "key": "badgeProps",
+ "type": ["Object"],
+ "desc": "澶村儚鍙充笂瑙掓彁绀轰俊鎭紝缁ф壙 Badge 缁勪欢鐨勫叏閮ㄧ壒鎬с�傚锛氬皬绾㈢偣锛屾垨鑰呮暟瀛�",
+ "label": ""
+ },
+ {
+ "key": "hideOnLoadFailed",
+ "type": ["Boolean"],
+ "desc": "鍔犺浇澶辫触鏃堕殣钘忓浘鐗�",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "image",
+ "type": ["String"],
+ "desc": "鍥剧墖鍦板潃",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "褰㈢姸",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "灏哄锛岀ず渚嬪�硷細small/medium/large/24px/38px 绛夛紝榛樿涓� large",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:error",
+ "desc": "鍥剧墖鍔犺浇澶辫触鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-avatar icon=\"user\" alt=\"avatar\"/>",
+ "path": "./avatar/avatar"
+ },
+ "t-back-top": {
+ "key": "t-back-top",
+ "label": "鍥炲埌椤堕儴",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-backtop.png",
+ "properties": [
+ {
+ "key": "fixed",
+ "type": ["Boolean"],
+ "desc": "鏄惁缁濆瀹氫綅鍥哄畾鍒板睆骞曞彸涓嬫柟",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "text",
+ "type": ["String"],
+ "desc": "鏂囨",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "棰勮鐨勬牱寮忕被鍨�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-icon", "t-class-text"],
+ "events": [
+ {
+ "key": "bind:to-top",
+ "desc": "鐐瑰嚮瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-back-top />",
+ "path": "./back-top/back-top"
+ },
+ "t-badge": {
+ "key": "t-badge",
+ "label": "寰芥爣鏁�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-badge.png",
+ "properties": [
+ {
+ "key": "color",
+ "type": ["String"],
+ "desc": "棰滆壊",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "寰芥爣鍐呭锛岀ず渚嬶細`content='鑷畾涔夊唴瀹�'`銆備篃鍙互浣跨敤榛樿鎻掓Ы瀹氫箟",
+ "label": ""
+ },
+ {
+ "key": "count",
+ "type": ["String", "Number"],
+ "desc": "寰芥爣鍙充笂瑙掑唴瀹广�傚彲浠ユ槸鏁板瓧锛屼篃鍙互鏄枃瀛椼�傚锛�'new'/3/99+銆傜壒娈婏細鍊间负绌鸿〃绀轰娇鐢ㄦ彃妲芥覆鏌�",
+ "label": ""
+ },
+ {
+ "key": "dot",
+ "type": ["Boolean"],
+ "desc": "鏄惁涓虹孩鐐�",
+ "label": ""
+ },
+ {
+ "key": "maxCount",
+ "type": ["Number"],
+ "desc": "灏侀《鐨勬暟瀛楀��",
+ "label": ""
+ },
+ {
+ "key": "offset",
+ "type": ["Array"],
+ "desc": "璁剧疆鐘舵�佺偣鐨勪綅缃亸绉伙紝绀轰緥锛歔-10, 20] 鎴� ['10em', '8rem']",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "褰㈢姸",
+ "label": ""
+ },
+ {
+ "key": "showZero",
+ "type": ["Boolean"],
+ "desc": "褰撴暟鍊间负 0 鏃讹紝鏄惁灞曠ず寰芥爣",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "灏哄",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-content", "t-class-count"],
+ "tpl": "<t-badge content=\"娑堟伅\" dot />",
+ "path": "./badge/badge"
+ },
+ "t-button": {
+ "key": "t-button",
+ "label": "鎸夐挳",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-button.png",
+ "properties": [
+ {
+ "key": "block",
+ "type": ["Boolean"],
+ "desc": "鏄惁涓哄潡绾у厓绱�",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "鎸夐挳鍐呭",
+ "label": ""
+ },
+ {
+ "key": "customDataset",
+ "type": ["Object"],
+ "desc": "鑷畾涔� dataset锛屽彲閫氳繃 event.currentTarget.dataset.custom 鑾峰彇",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤鎸夐挳",
+ "label": ""
+ },
+ {
+ "key": "ghost",
+ "type": ["Boolean"],
+ "desc": "鏄惁涓哄菇鐏垫寜閽紙闀傜┖鎸夐挳锛�",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鍥炬爣鍚嶇О",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず涓哄姞杞界姸鎬�",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "鎸夐挳褰㈢姸锛屾湁 4 绉嶏細闀挎柟褰€�佹鏂瑰舰銆佸渾瑙掗暱鏂瑰舰銆佸渾褰�",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "缁勪欢灏哄",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "缁勪欢椋庢牸锛屼緷娆′负鍝佺墝鑹层�佸嵄闄╄壊",
+ "label": ""
+ },
+ {
+ "key": "type",
+ "type": ["String"],
+ "desc": "鍚屽皬绋嬪簭鐨� formType",
+ "label": ""
+ },
+ {
+ "key": "variant",
+ "type": ["String"],
+ "desc": "鎸夐挳褰㈠紡锛屽熀纭�銆佺嚎妗嗐�佹枃瀛�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-icon"],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "鐐瑰嚮鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-button theme=\"primary\" block content=\"寮烘寜閽甛"></t-button>",
+ "path": "./button/button"
+ },
+ "t-cell-group": {
+ "key": "t-cell-group",
+ "label": "鍗曞厓鏍肩粍",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-cell.png",
+ "properties": [
+ {
+ "key": "bordered",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず缁勮竟妗�",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "鍗曞厓鏍肩粍鏍囬",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "tpl": "<t-cell-group title=\"01 鍩虹鐢ㄦ硶\"><t-cell title=\"鍗曡鏍囬\" required /><t-cell title=\"鍗曡鏍囬\" hover note=\"杈呭姪淇℃伅\" /><t-cell title=\"鍗曡鏍囬\" hover arrow /><t-cell title=\"鍗曡鏍囬\" hover note=\"杈呭姪淇℃伅\" arrow /></t-cell-group>",
+ "require": {
+ "t-cell": "./cell/cell"
+ },
+ "path": "./cell-group/cell-group"
+ },
+ "t-cell": {
+ "key": "t-cell",
+ "label": "鍗曞厓鏍�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-cell.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "鍐呭鐨勫榻愭柟寮忥紝榛樿灞呬腑瀵归綈",
+ "label": ""
+ },
+ {
+ "key": "arrow",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず鍙充晶绠ご",
+ "label": ""
+ },
+ {
+ "key": "bordered",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず涓嬭竟妗�",
+ "label": ""
+ },
+ {
+ "key": "description",
+ "type": ["String"],
+ "desc": "涓嬫柟鍐呭鎻忚堪",
+ "label": ""
+ },
+ {
+ "key": "hover",
+ "type": ["Boolean"],
+ "desc": "鏄惁寮�鍚偣鍑诲弽棣�",
+ "label": ""
+ },
+ {
+ "key": "image",
+ "type": ["String"],
+ "desc": "涓诲浘",
+ "label": ""
+ },
+ {
+ "key": "jumpType",
+ "type": ["String"],
+ "desc": "閾炬帴璺宠浆绫诲瀷",
+ "label": ""
+ },
+ {
+ "key": "leftIcon",
+ "type": ["String"],
+ "desc": "宸︿晶鍥炬爣锛屽嚭鐜板湪鍗曞厓鏍兼爣棰樼殑宸︿晶",
+ "label": ""
+ },
+ {
+ "key": "note",
+ "type": ["String"],
+ "desc": "鍜屾爣棰樺悓琛岀殑璇存槑鏂囧瓧",
+ "label": ""
+ },
+ {
+ "key": "required",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず琛ㄥ崟蹇呭~鏄熷彿",
+ "label": ""
+ },
+ {
+ "key": "rightIcon",
+ "type": ["String"],
+ "desc": "鏈�鍙充晶鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "鏍囬",
+ "label": ""
+ },
+ {
+ "key": "url",
+ "type": ["String"],
+ "desc": "鐐瑰嚮鍚庤烦杞摼鎺ュ湴鍧�銆傚鏋滃�间负绌猴紝鍒欒〃绀轰笉闇�瑕佽烦杞�",
+ "label": ""
+ }
+ ],
+ "externalClasses": [
+ "t-class",
+ "t-class-title",
+ "t-class-note",
+ "t-class-description",
+ "t-class-thumb",
+ "t-class-hover",
+ "t-class-left",
+ "t-class-right"
+ ],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "鍙充晶鍐呭",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-cell title=\"鍗曡鏍囬\" hover />",
+ "path": "./cell/cell"
+ },
+ "t-check-tag": {
+ "key": "t-check-tag",
+ "label": "鍙�夋爣绛�",
+ "icon": "",
+ "properties": [
+ {
+ "key": "checked",
+ "type": ["Boolean"],
+ "desc": "鏍囩閫変腑鐨勭姸鎬侊紝榛樿椋庢牸锛坱heme=default锛夋墠鏈夐�変腑鎬�",
+ "label": ""
+ },
+ {
+ "key": "closable",
+ "type": ["Boolean"],
+ "desc": "鏍囩鏄惁鍙叧闂�",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String", "Number"],
+ "desc": "缁勪欢瀛愬厓绱�",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏍囩绂佺敤鎬侊紝澶辨晥鏍囩涓嶈兘瑙﹀彂浜嬩欢銆傞粯璁ら鏍硷紙theme=default锛夋墠鏈夌鐢ㄦ��",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鏍囩涓殑鍥炬爣锛屽彲鑷畾涔夊浘鏍囧憟鐜�",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "鏍囩绫诲瀷锛屾湁涓夌锛氭柟褰€�佸渾瑙掓柟褰€�佹爣璁板瀷",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "鏍囩灏哄",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "缁勪欢瀛愬厓绱�",
+ "label": ""
+ },
+ {
+ "key": "bind:click",
+ "desc": "鐐瑰嚮鏍囩鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-check-tag>check tag</t-check-tag>",
+ "path": "./check-tag/check-tag"
+ },
+ "t-checkbox-group": {
+ "key": "t-checkbox-group",
+ "label": "澶氶�夋缁�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-checkbox.png",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤缁勪欢",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "鏀寔鏈�澶氶�変腑鐨勬暟閲�",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "缁熶竴璁剧疆鍐呴儴澶嶉�夋 HTML 灞炴��",
+ "label": ""
+ },
+ {
+ "key": "options",
+ "type": ["Array"],
+ "desc": "浠ラ厤缃舰寮忚缃瓙鍏冪礌銆傜ず渚�1锛歚['鍖椾含', '涓婃捣']` 锛岀ず渚�2: `[{ label: '鍏ㄩ��', checkAll: true }, { label: '涓婃捣', value: 'shanghai' }]`銆俢heckAll 鍊间负 true 琛ㄧず褰撳墠閫夐」涓恒�屽叏閫夐�夐」銆�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Array"],
+ "desc": "閫変腑鍊�",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "鍊煎彉鍖栨椂瑙﹀彂銆俙context.current` 琛ㄧず褰撳墠鍙樺寲鐨勬暟鎹」锛屽鏋滄槸鍏ㄩ�夊垯涓虹┖锛沗context.type` 琛ㄧず寮曡捣閫変腑鏁版嵁鍙樺寲鐨勬槸閫変腑鎴栨槸鍙栨秷閫変腑锛宍context.option` 琛ㄧず褰撳墠鍙樺寲鐨勬暟鎹」",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-checkbox-group value=\"{{['checkbox1']}}\"><t-checkbox value=\"checkbox1\" label=\"澶氶�塡" /><t-checkbox value=\"checkbox2\" label=\"澶氶�塡" /><t-checkbox value=\"checkbox3\" label=\"澶氶�塡" /></t-checkbox-group>",
+ "require": {
+ "t-checkbox": "./checkbox/checkbox"
+ },
+ "path": "./checkbox-group/checkbox-group"
+ },
+ "t-checkbox": {
+ "key": "t-checkbox",
+ "label": "澶氶�夋",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-checkbox.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "澶氶�夋鍜屽唴瀹圭浉瀵逛綅缃�",
+ "label": ""
+ },
+ {
+ "key": "checkAll",
+ "type": ["Boolean"],
+ "desc": "鐢ㄤ簬鏍囪瘑鏄惁涓恒�屽叏閫夐�夐」銆嶃�傚崟鐙娇鐢ㄦ棤鏁堬紝闇�鍦� CheckboxGroup 涓娇鐢�",
+ "label": ""
+ },
+ {
+ "key": "checked",
+ "type": ["Boolean"],
+ "desc": "鏄惁閫変腑",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["String"],
+ "desc": "澶氶�夋棰滆壊",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "澶氶�夋鍐呭",
+ "label": ""
+ },
+ {
+ "key": "contentDisabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤缁勪欢鍐呭锛坈ontent锛夎Е鍙戦�変腑",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤缁勪欢",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["Array"],
+ "desc": "鑷畾涔夐�変腑鍥炬爣鍜岄潪閫変腑鍥炬爣銆傜ず渚嬶細[閫変腑鎬佸浘鏍囧湴鍧�锛岄潪閫変腑鎬佸浘鏍囧湴鍧�]",
+ "label": ""
+ },
+ {
+ "key": "indeterminate",
+ "type": ["Boolean"],
+ "desc": "鏄惁涓哄崐閫�",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "涓绘枃妗�",
+ "label": ""
+ },
+ {
+ "key": "maxContentRow",
+ "type": ["Number"],
+ "desc": "鍐呭鏈�澶ц鏁伴檺鍒�",
+ "label": ""
+ },
+ {
+ "key": "maxLabelRow",
+ "type": ["Number"],
+ "desc": "涓绘枃妗堟渶澶ц鏁伴檺鍒�",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "HTML 鍏冪礌鍘熺敓灞炴��",
+ "label": ""
+ },
+ {
+ "key": "readonly",
+ "type": ["Boolean"],
+ "desc": "鍙鐘舵��",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "澶氶�夋鐨勫��",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-icon", "t-class-label", "t-class-content", "t-class-border"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "鍊煎彉鍖栨椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-checkbox label=\"澶氶�夋\" checked=\"{{true}}\"></t-checkbox>",
+ "path": "./checkbox/checkbox"
+ },
+ "t-collapse-panel": {
+ "key": "t-collapse-panel",
+ "label": "鎶樺彔闈㈡澘",
+ "icon": "",
+ "properties": [
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "鎶樺彔闈㈡澘鍐呭",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "绂佹褰撳墠闈㈡澘灞曞紑锛屼紭鍏堢骇澶т簬 Collapse 鐨勫悓鍚嶅睘鎬�",
+ "label": ""
+ },
+ {
+ "key": "expandIcon",
+ "type": ["Boolean"],
+ "desc": "褰撳墠鎶樺彔闈㈡澘灞曞紑鍥炬爣锛屼紭鍏堢骇澶т簬 Collapse 鐨勫悓鍚嶅睘鎬�",
+ "label": ""
+ },
+ {
+ "key": "header",
+ "type": ["String"],
+ "desc": "闈㈡澘澶村唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "headerRightContent",
+ "type": ["String"],
+ "desc": "闈㈡澘澶寸殑鍙充晶鍖哄煙锛屼竴鑸敤浜庡憟鐜伴潰鏉挎搷浣�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "褰撳墠闈㈡澘鍞竴鏍囪瘑锛屽鏋滃�间负绌哄垯鍙栧綋鍓嶉潰涓嬫爣鍏滃簳浣滀负鍞竴鏍囪瘑",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-collapse-panel header=\"鎶樺彔闈㈡澘鏍囬\" value=\"{{0}}\">姝ゅ鍙嚜瀹氫箟鍐呭</t-collapse-panel>",
+ "path": "./collapse/collapse-panel"
+ },
+ "t-collapse": {
+ "key": "t-collapse",
+ "label": "鎶樺彔",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-collapse.png",
+ "properties": [
+ {
+ "key": "defaultExpandAll",
+ "type": ["Boolean"],
+ "desc": "榛樿鏄惁灞曞紑鍏ㄩ儴",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤闈㈡澘灞曞紑/鏀惰捣鎿嶄綔",
+ "label": ""
+ },
+ {
+ "key": "expandIcon",
+ "type": ["Boolean"],
+ "desc": "灞曞紑鍥炬爣銆傚�间负 undefined 鎴� false 鍒欎笉鏄剧ず灞曞紑鍥炬爣锛涘�间负 true 鏄剧ず榛樿鍥炬爣锛涘�肩被鍨嬩负鍑芥暟锛屽垯琛ㄧず瀹屽叏鑷畾涔夊睍寮�鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "expandMutex",
+ "type": ["Boolean"],
+ "desc": "姣忎釜闈㈡澘浜掓枼灞曞紑锛屾瘡娆″彧灞曞紑涓�涓潰鏉�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Array"],
+ "desc": "灞曞紑鐨勯潰鏉块泦鍚�",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "鍒囨崲闈㈡澘鏃惰Е鍙戯紝杩斿洖鍙樺寲鐨勫��",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-collapse value=\"{{[0]}}\"><t-collapse-panel header=\"鎶樺彔闈㈡澘鏍囬\" value=\"{{0}}\">姝ゅ鍙嚜瀹氫箟鍐呭</t-collapse-panel></t-collapse>",
+ "require": {
+ "t-collapse-panel": "./collapse/collapse-panel"
+ },
+ "path": "./collapse/collapse"
+ },
+ "t-date-time-picker": {
+ "key": "t-date-time-picker",
+ "label": "鏃ユ湡鏃堕棿閫夋嫨鍣�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-datetimepicker.png",
+ "properties": [
+ {
+ "key": "cancelBtn",
+ "type": ["String"],
+ "desc": "鍙栨秷鎸夐挳鏂囧瓧",
+ "label": ""
+ },
+ {
+ "key": "confirmBtn",
+ "type": ["String"],
+ "desc": "纭畾鎸夐挳鏂囧瓧",
+ "label": ""
+ },
+ {
+ "key": "end",
+ "type": ["String", "Number"],
+ "desc": "閫夋嫨鍣ㄧ殑缁撴潫鏃堕棿",
+ "label": ""
+ },
+ {
+ "key": "footer",
+ "type": ["String"],
+ "desc": "搴曢儴鍐呭",
+ "label": ""
+ },
+ {
+ "key": "format",
+ "type": ["String"],
+ "desc": "鐢ㄤ簬鏍煎紡鍖栨棩鏈燂紝[璇︾粏鏂囨。](https://day.js.org/docs/en/display/format)",
+ "label": ""
+ },
+ {
+ "key": "header",
+ "type": ["Boolean"],
+ "desc": "澶撮儴鍐呭銆傚�间负 true 鏄剧ず绌虹櫧澶撮儴锛屽�间负 false 涓嶆樉绀轰换浣曞唴瀹癸紝鍊肩被鍨嬩负 TNode 琛ㄧず鑷畾涔夊ご閮ㄥ唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "mode",
+ "type": ["String", "Array"],
+ "desc": "閫夋嫨鍣ㄦā寮忥紝鐢ㄤ簬琛ㄧず鍙互閫夋嫨鍒板摢涓�涓眰绾с�傘�愮ず渚嬩竴銆憏ear 鎴栬�� ['year'] 琛ㄧず绾棩鏈熼�夋嫨鍣紝鍙兘閫夋嫨鍒板勾浠斤紝鍙樉绀哄勾浠姐�傘�愮ず渚嬩簩銆�'hour' 鎴� ['hour'] 琛ㄧず绾椂闂撮�夋嫨鍣紝鍙兘閫夋嫨鍒板皬鏃剁淮搴︺�傘�愮ず渚嬩笁銆慬'year', 'month', 'date', 'hour', 'minute'] 琛ㄧず锛屾棩鏈熷拰鏃堕棿 娣峰悎閫夋嫨鍣紝鍙互閫夋嫨鍒板叿浣撳摢涓�鍒嗛挓锛屾樉绀哄叏閮ㄦ椂闂达細骞�/鏈�/鏃�/鏃�/鍒�",
+ "label": ""
+ },
+ {
+ "key": "showWeek",
+ "type": ["Boolean"],
+ "desc": "銆愬紑鍙戜腑銆戞槸鍚﹀湪鏃ユ湡鏃佽竟鏄剧ず鍛ㄥ嚑锛堝鍛ㄤ竴锛屽懆浜岋紝鍛ㄦ棩绛夛級",
+ "label": ""
+ },
+ {
+ "key": "start",
+ "type": ["String", "Number"],
+ "desc": "閫夋嫨鍣ㄧ殑寮�濮嬫椂闂�",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "鏍囬",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "閫変腑鍊�",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-confirm", "t-class-cancel", "t-class-title"],
+ "events": [
+ {
+ "key": "bind:cancel",
+ "desc": "鍙栨秷鎸夐挳鐐瑰嚮鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "閫変腑鍊煎彂鐢熷彉鍖栨椂瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:column-change",
+ "desc": "姣忎竴鍒楅�変腑鏁版嵁鍙樺寲鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:confirm",
+ "desc": "纭鎸夐挳鐐瑰嚮鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-date-time-picker title=\"閫夋嫨鏃ユ湡\" visible=\"{{true}}\" mode=\"{{['date']}}\" format=\"YYYY-MM-DD\"></t-date-time-picker>",
+ "path": "./date-time-picker/date-time-picker"
+ },
+ "t-dialog": {
+ "key": "t-dialog",
+ "label": "瀵硅瘽妗�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dialog.png",
+ "properties": [
+ {
+ "key": "actions",
+ "type": ["Array"],
+ "desc": "鎿嶄綔鏍�",
+ "label": ""
+ },
+ {
+ "key": "buttonLayout",
+ "type": ["String"],
+ "desc": "澶氭寜閽帓鍒楁柟寮�",
+ "label": ""
+ },
+ {
+ "key": "cancelBtn",
+ "type": ["String", "Object"],
+ "desc": "鍙栨秷鎸夐挳锛屽彲鑷畾涔夈�傚�间负 null 鍒欎笉鏄剧ず鍙栨秷鎸夐挳銆傚�肩被鍨嬩负瀛楃涓诧紝鍒欒〃绀鸿嚜瀹氫箟鎸夐挳鏂囨湰锛屽�肩被鍨嬩负 Object 鍒欒〃绀洪�忎紶 Button 缁勪欢灞炴�с�備娇鐢� TNode 鑷畾涔夋寜閽椂锛岄渶鑷鎺у埗鍙栨秷浜嬩欢",
+ "label": ""
+ },
+ {
+ "key": "closeOnOverlayClick",
+ "type": ["Boolean"],
+ "desc": "鐐瑰嚮钂欏眰鏃舵槸鍚﹁Е鍙戝叧闂簨浠�",
+ "label": ""
+ },
+ {
+ "key": "confirmBtn",
+ "type": ["String", "Object"],
+ "desc": "纭鎸夐挳銆傚�间负 null 鍒欎笉鏄剧ず纭鎸夐挳銆傚�肩被鍨嬩负瀛楃涓诧紝鍒欒〃绀鸿嚜瀹氫箟鎸夐挳鏂囨湰锛屽�肩被鍨嬩负 Object 鍒欒〃绀洪�忎紶 Button 缁勪欢灞炴�с�備娇鐢� TNode 鑷畾涔夋寜閽椂锛岄渶鑷鎺у埗纭浜嬩欢",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "鍐呭",
+ "label": ""
+ },
+ {
+ "key": "preventScrollThrough",
+ "type": ["Boolean"],
+ "desc": "闃叉婊氬姩绌块��",
+ "label": ""
+ },
+ {
+ "key": "showInAttachedElement",
+ "type": ["Boolean"],
+ "desc": "銆愬紑鍙戜腑銆戜粎鍦ㄦ寕杞藉厓绱犱腑鏄剧ず鎶藉眽锛岄粯璁ゅ湪娴忚鍣ㄥ彲瑙嗗尯鍩熸樉绀恒�傜埗鍏冪礌闇�瑕佹湁瀹氫綅灞炴�э紝濡傦細position: relative",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず閬僵灞�",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "鏍囬",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "鎺у埗瀵硅瘽妗嗘槸鍚︽樉绀�",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "瀵硅瘽妗嗗眰绾э紝Web 渚ф牱寮忛粯璁や负 2500锛岀Щ鍔ㄧ鍜屽皬绋嬪簭鏍峰紡榛樿涓� 1500",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-content", "t-class-confirm", "t-class-cancel"],
+ "events": [
+ {
+ "key": "bind:cancel",
+ "desc": "濡傛灉鈥滃彇娑堚�濇寜閽瓨鍦紝鍒欑偣鍑烩�滃彇娑堚�濇寜閽椂瑙﹀彂锛屽悓鏃惰Е鍙戝叧闂簨浠�",
+ "label": ""
+ },
+ {
+ "key": "bind:close",
+ "desc": "鍏抽棴浜嬩欢锛岀偣鍑� 鍙栨秷鎸夐挳 鎴� 鐐瑰嚮钂欏眰 鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:overlay-click",
+ "desc": "濡傛灉钂欏眰瀛樺湪锛岀偣鍑昏挋灞傛椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-dialog visible=\"{{true}}\" title=\"瀵硅瘽妗嗘爣棰榎" content=\"鍛婄煡褰撳墠鐘舵�併�佷俊鎭拰瑙e喅鏂规硶锛岀瓑鍐呭銆傛弿杩版枃妗堝敖鍙兘鎺у埗鍦ㄤ笁琛屽唴\" confirm-btn=\"鎴戠煡閬撲簡\" />",
+ "path": "./dialog/dialog"
+ },
+ "t-divider": {
+ "key": "t-divider",
+ "label": "鍒嗗壊绾�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-divider.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "鏂囨湰浣嶇疆锛堜粎鍦ㄦ按骞冲垎鍓茬嚎鏈夋晥锛�",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "瀛愬厓绱�",
+ "label": ""
+ },
+ {
+ "key": "dashed",
+ "type": ["Boolean"],
+ "desc": "鏄惁铏氱嚎锛堜粎鍦ㄦ按骞冲垎鍓茬嚎鏈夋晥锛�",
+ "label": ""
+ },
+ {
+ "key": "layout",
+ "type": ["String"],
+ "desc": "鍒嗛殧绾跨被鍨嬫湁涓ょ锛氭按骞冲拰鍨傜洿",
+ "label": ""
+ },
+ {
+ "key": "lineColor",
+ "type": ["String"],
+ "desc": "鍒嗛殧绾块鑹�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-line", "t-class-content"],
+ "tpl": "<t-divider />",
+ "path": "./divider/divider"
+ },
+ "t-drawer": {
+ "key": "t-drawer",
+ "label": "妯℃�佹娊灞�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-drawer.png",
+ "properties": [
+ {
+ "key": "closeOnOverlayClick",
+ "type": ["Boolean"],
+ "desc": "鐐瑰嚮钂欏眰鏃舵槸鍚﹁Е鍙戞娊灞夊叧闂簨浠�",
+ "label": ""
+ },
+ {
+ "key": "destroyOnClose",
+ "type": ["Boolean"],
+ "desc": "鎶藉眽鍏抽棴鏃舵槸鍚﹂攢姣佽妭鐐�",
+ "label": ""
+ },
+ {
+ "key": "items",
+ "type": ["Array"],
+ "desc": "鎶藉眽閲岀殑鍒楄〃椤�",
+ "label": ""
+ },
+ {
+ "key": "placement",
+ "type": ["String"],
+ "desc": "鎶藉眽鏂瑰悜",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず閬僵灞�",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "缁勪欢鏄惁鍙",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "鎶藉眽灞傜骇锛屾牱寮忛粯璁や负 1500",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:close",
+ "desc": "鍏抽棴浜嬩欢锛屽彇娑堟寜閽偣鍑绘椂銆佸叧闂寜閽偣鍑绘椂銆佺偣鍑昏挋灞傛椂鍧囦細瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:item-click",
+ "desc": "鐐瑰嚮鎶藉眽閲岀殑鍒楄〃椤�",
+ "label": ""
+ },
+ {
+ "key": "bind:overlay-click",
+ "desc": "濡傛灉钂欏眰瀛樺湪锛岀偣鍑昏挋灞傛椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-drawer visible=\"{{true}}\" placement=\"left\" items=\"{{[{title: '鑿滃崟涓�'},{title: '鑿滃崟浜�'}]}}\"></t-drawer>",
+ "path": "./drawer/drawer"
+ },
+ "t-dropdown-item": {
+ "key": "t-dropdown-item",
+ "label": "涓嬫媺鑿滃崟瀛愰」",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dropdownmenu.png",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "鏍囬",
+ "label": ""
+ },
+ {
+ "key": "multiple",
+ "type": ["Boolean"],
+ "desc": "鏄惁澶氶��",
+ "label": ""
+ },
+ {
+ "key": "options",
+ "type": ["Array"],
+ "desc": "閫夐」鏁版嵁",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-dropdown-item label=\"鑿滃崟\" options=\"{{[{label:'閫夐」涓�',value:'option_1',disabled:false},{label:'閫夐」浜�',value:'option_2',disabled:false},{label:'閫夐」涓�',value:'option_3',disabled:false}]}}\" defaultValue=\"option_3\" /><t-dropdown-item label=\"鑿滃崟\" options=\"{{[{label:'閫夐」涓�',value:'option_1',disabled:false},{label:'閫夐」浜�',value:'option_2',disabled:false},{label:'閫夐」涓�',value:'option_3',disabled:false}]}}\" defaultValue=\"option_3\" />",
+ "path": "./dropdown-menu/dropdown-item"
+ },
+ "t-dropdown-menu": {
+ "key": "t-dropdown-menu",
+ "label": "涓嬫媺鑿滃崟",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dropdownmenu.png",
+ "properties": [
+ {
+ "key": "activeColor",
+ "type": ["String"],
+ "desc": "銆愯璁轰腑銆戣彍鍗曟爣棰樺拰閫夐」鐨勯�変腑鎬侀鑹�",
+ "label": ""
+ },
+ {
+ "key": "closeOnClickOverlay",
+ "type": ["Boolean"],
+ "desc": "鏄惁鍦ㄧ偣鍑婚伄缃╁眰鍚庡叧闂彍鍗�",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["String", "Number"],
+ "desc": "鍔ㄧ敾鏃堕暱",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず閬僵灞�",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "鑿滃崟鏍� z-index 灞傜骇",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-dropdown-menu><t-dropdown-item label=\"鑿滃崟\" options=\"{{[{label:'閫夐」涓�',value:'option_1',disabled:false},{label:'閫夐」浜�',value:'option_2',disabled:false},{label:'閫夐」涓�',value:'option_3',disabled:false}]}}\" defaultValue=\"option_3\" /><t-dropdown-item label=\"鑿滃崟\" options=\"{{[{label:'閫夐」涓�',value:'option_1',disabled:false},{label:'閫夐」浜�',value:'option_2',disabled:false},{label:'閫夐」涓�',value:'option_3',disabled:false}]}}\" defaultValue=\"option_3\" /></t-dropdown-menu>",
+ "require": {
+ "t-dropdown-item": "./dropdown-menu/dropdown-item"
+ },
+ "path": "./dropdown-menu/dropdown-menu"
+ },
+ "t-empty": {
+ "key": "t-empty",
+ "label": "绌虹姸鎬�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-empty.png",
+ "properties": [
+ {
+ "key": "action",
+ "type": ["String"],
+ "desc": "鎿嶄綔鎸夐挳",
+ "label": ""
+ },
+ {
+ "key": "description",
+ "type": ["String"],
+ "desc": "鎻忚堪鏂囧瓧",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鍥炬爣鍚嶇О",
+ "label": ""
+ },
+ {
+ "key": "image",
+ "type": ["String"],
+ "desc": "鍥剧墖鍦板潃",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-description", "t-class-image", "t-class-actions"],
+ "tpl": "<t-empty icon=\"info-circle-filled\" />",
+ "path": "./empty/empty"
+ },
+ "t-fab": {
+ "key": "t-fab",
+ "label": "鎮诞鎸夐挳",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-fab.png",
+ "properties": [
+ {
+ "key": "buttonProps",
+ "type": ["Object"],
+ "desc": "閫忎紶鑷� Button 缁勪欢",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "style",
+ "type": ["String"],
+ "desc": "鎮诞鎸夐挳鐨勬牱寮忥紝甯哥敤浜庤皟鏁翠綅缃�",
+ "label": ""
+ },
+ {
+ "key": "text",
+ "type": ["String"],
+ "desc": "鏂囨湰鍐呭",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "鎮诞鎸夐挳鐐瑰嚮浜嬩欢",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-fab icon=\"add\" />",
+ "path": "./fab/fab"
+ },
+ "t-footer": {
+ "key": "t-footer",
+ "label": "甯冨眬-搴曢儴鍐呭",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-footer.png",
+ "properties": [
+ {
+ "key": "copyright",
+ "type": ["String"],
+ "desc": "鐗堟潈淇℃伅锛宼ype 涓篳text`鐢熸晥",
+ "label": ""
+ },
+ {
+ "key": "logo",
+ "type": ["Object"],
+ "desc": "鍥炬爣閰嶇疆锛宼ype 涓篳logo`鐢熸晥銆俙logo.icon` 琛ㄧず鍥炬爣閾炬帴鍦板潃锛宍logo.title` 琛ㄧず鏍囬鏂囨湰锛宍logo.url` 琛ㄧず閾炬帴璺宠浆鍦板潃",
+ "label": ""
+ },
+ {
+ "key": "textLinkList",
+ "type": ["Array"],
+ "desc": "閾炬帴鍒楄〃锛宼ype 涓篳text`鐢熸晥銆俷ame 琛ㄧず閾炬帴鍚嶇О锛� url 琛ㄧず閾炬帴 page 璺緞锛岀洰鍓嶅彧鏀寔灏忕▼搴忓唴閮ㄨ烦杞紝openType 琛ㄧず璺宠浆鏂瑰紡",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "椤佃剼灞曠ず绫诲瀷",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-footer theme=\"text\" copyright=\"Copyright 漏 2021-2031 TD.All Rights Reserved.\" />",
+ "path": "./footer/footer"
+ },
+ "t-grid-item": {
+ "key": "t-grid-item",
+ "label": "瀹牸瀛愰」",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-grid.png",
+ "properties": [
+ {
+ "key": "badgeProps",
+ "type": ["Object"],
+ "desc": "澶村儚鍙充笂瑙掓彁绀轰俊鎭紝缁ф壙 Badge 缁勪欢鐨勫叏閮ㄧ壒鎬с�傚锛氬皬绾㈢偣锛屾垨鑰呮暟瀛�",
+ "label": ""
+ },
+ {
+ "key": "description",
+ "type": ["String"],
+ "desc": "鏂囨湰浠ュ鐨勬洿澶氭弿杩帮紝杈呭姪淇℃伅銆傚彲浠ラ�氳繃 Props 浼犲叆鏂囨湰锛屼篃鍙互鑷畾涔夋爣棰樿妭鐐�",
+ "label": ""
+ },
+ {
+ "key": "image",
+ "type": ["String"],
+ "desc": "鍥剧墖锛屽彲浠ユ槸鍥剧墖鍦板潃锛屼篃鍙互鑷畾涔夊浘鐗囪妭鐐�",
+ "label": ""
+ },
+ {
+ "key": "jumpType",
+ "type": ["String"],
+ "desc": "閾炬帴璺宠浆绫诲瀷",
+ "label": ""
+ },
+ {
+ "key": "layout",
+ "type": ["String"],
+ "desc": "鍐呭甯冨眬鏂瑰紡",
+ "label": ""
+ },
+ {
+ "key": "text",
+ "type": ["String"],
+ "desc": "鏂囨湰锛屽彲浠ラ�氳繃 Props 浼犲叆鏂囨湰锛屼篃鍙互鑷畾涔夋爣棰樿妭鐐�",
+ "label": ""
+ },
+ {
+ "key": "url",
+ "type": ["String"],
+ "desc": "鐐瑰嚮鍚庣殑璺宠浆閾炬帴",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-image", "t-class-text", "t-class-description"],
+ "tpl": "<t-grid-item text=\"鏍囬鏂囧瓧\"><image style=\"width: 96rpx; height: 96rpx\" src=\"https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png\" slot=\"image\" /></t-grid-item>",
+ "path": "./grid-item/grid-item"
+ },
+ "t-grid": {
+ "key": "t-grid",
+ "label": "鏍呮牸",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-grid.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "鍐呭瀵归綈鏂瑰紡",
+ "label": ""
+ },
+ {
+ "key": "border",
+ "type": ["Boolean", "Object"],
+ "desc": "杈规锛岄粯璁や笉鏄剧ず銆傚�间负 true 鍒欐樉绀洪粯璁よ竟妗嗭紝鍊肩被鍨嬩负 object 鍒欒〃绀鸿嚜瀹氫箟杈规鏍峰紡",
+ "label": ""
+ },
+ {
+ "key": "column",
+ "type": ["Number"],
+ "desc": "姣忎竴琛岀殑鍒楁暟閲�",
+ "label": ""
+ },
+ {
+ "key": "gutter",
+ "type": ["Number"],
+ "desc": "闂撮殧澶у皬",
+ "label": ""
+ },
+ {
+ "key": "hover",
+ "type": ["Boolean"],
+ "desc": "鏄惁寮�鍚偣鍑诲弽棣�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "tpl": "<t-grid column=\"{{2}}\"><t-grid-item text=\"鏍囬鏂囧瓧\"><image style=\"width: 96rpx; height: 96rpx\" src=\"https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png\" slot=\"image\" /></t-grid-item><t-grid-item text=\"鏍囬鏂囧瓧\"><image style=\"width: 96rpx; height: 96rpx\" src=\"https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png\" slot=\"image\" /></t-grid-item></t-grid>",
+ "require": {
+ "t-grid-item": "./grid-item/grid-item"
+ },
+ "path": "./grid/grid"
+ },
+ "t-icon": {
+ "key": "t-icon",
+ "label": "鍥炬爣",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-icon.png",
+ "properties": [
+ {
+ "key": "classPrefix",
+ "type": ["String"],
+ "desc": "鑷畾涔塱con鍓嶇紑",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["String"],
+ "desc": "鍥炬爣棰滆壊",
+ "label": ""
+ },
+ {
+ "key": "style",
+ "type": ["String"],
+ "desc": "鑷畾涔夋牱寮�",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "鍥炬爣鍚嶇О",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String", "Number"],
+ "desc": "鍥炬爣鍚嶇О",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-icon name=\"add-circle\" />",
+ "path": "./icon/icon"
+ },
+ "t-image": {
+ "key": "t-image",
+ "label": "鍥剧墖",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-image.png",
+ "properties": [
+ {
+ "key": "error",
+ "type": ["String"],
+ "desc": "鍔犺浇澶辫触鏃舵樉绀虹殑鍐呭銆傚�间负 `default` 鍒欒〃绀轰娇鐢ㄩ粯璁ゅ姞杞藉け璐ラ鏍硷紱鍊间负绌烘垨鑰� `slot` 琛ㄧず浣跨敤鎻掓Ы娓叉煋锛屾彃妲藉悕绉颁负 `error`锛涘�间负鍏朵粬鍒欒〃绀烘櫘閫氭枃鏈唴瀹癸紝濡傗�滃姞杞藉け璐モ��",
+ "label": ""
+ },
+ {
+ "key": "lazy",
+ "type": ["Boolean"],
+ "desc": "鏄惁寮�鍚浘鐗囨噿鍔犺浇",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["String"],
+ "desc": "鍔犺浇鎬佸唴瀹广�傚�间负 `default` 鍒欒〃绀轰娇鐢ㄩ粯璁ゅ姞杞戒腑椋庢牸锛涘�间负绌烘垨鑰� `slot` 琛ㄧず浣跨敤鎻掓Ы娓叉煋锛屾彃妲藉悕绉颁负 `loading`锛涘�间负鍏朵粬鍒欒〃绀烘櫘閫氭枃鏈唴瀹癸紝濡傗�滃姞杞戒腑鈥�",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "鍥剧墖鍦嗚绫诲瀷",
+ "label": ""
+ },
+ {
+ "key": "src",
+ "type": ["String"],
+ "desc": "鍥剧墖閾炬帴",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-load"],
+ "events": [
+ {
+ "key": "bind:error",
+ "desc": "鍥剧墖鍔犺浇澶辫触鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:load",
+ "desc": "鍥剧墖鍔犺浇瀹屾垚鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-image src=\"https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png\" mode=\"aspectFill\"></t-image>",
+ "path": "./image/image"
+ },
+ "t-indexes": {
+ "key": "t-indexes",
+ "label": "绱㈠紩",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-indexes.png",
+ "properties": [
+ {
+ "key": "height",
+ "type": ["Number"],
+ "desc": "鍒楄〃楂樺害锛屾湭璁剧疆榛樿鍗犳弧璁惧楂樺害",
+ "label": ""
+ },
+ {
+ "key": "list",
+ "type": ["Array"],
+ "desc": "绱㈠紩鍒楄〃鐨勫垪琛ㄦ暟鎹�傛瘡涓厓绱犲寘鍚笁涓瓙鍏冪礌锛宨ndex(string)锛氱储寮曞�硷紝渚嬪1锛�2锛�3锛�...鎴朅锛孊锛孋绛夛紱title(string): 绱㈠紩鏍囬锛屽彲涓嶅~灏嗛粯璁よ涓虹储寮曞�硷紱children(Array<{title: string}>): 瀛愬厓绱犲垪琛紝title涓哄瓙鍏冪礌鐨勫睍绀烘枃妗堛��",
+ "label": ""
+ },
+ {
+ "key": "sticky",
+ "type": ["Boolean"],
+ "desc": "绱㈠紩鏄惁鍚搁《锛岄粯璁や负true",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:select",
+ "desc": "鐐瑰嚮琛屽厓绱犳椂瑙﹀彂浜嬩欢",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-indexes id=\"bar\" list=\"{{ [{ title: 'A寮�澶�', index: 'A', children: [{ title: '闃垮潩' }]},{ title: 'B寮�澶�', index: 'B', children: [{ title: '鍖椾含' }]}] }}\" />",
+ "path": "./indexes/indexes"
+ },
+ "t-input": {
+ "key": "t-input",
+ "label": "杈撳叆妗�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-input.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "鏂囨湰鍐呭浣嶇疆锛屽眳宸�/灞呬腑/灞呭彸",
+ "label": ""
+ },
+ {
+ "key": "borderless",
+ "type": ["Boolean"],
+ "desc": "銆愯璁轰腑銆戞槸鍚﹀紑鍚棤杈规妯″紡",
+ "label": ""
+ },
+ {
+ "key": "clearable",
+ "type": ["Boolean"],
+ "desc": "鏄惁鍙竻绌�",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤杈撳叆妗�",
+ "label": ""
+ },
+ {
+ "key": "errorMessage",
+ "type": ["String"],
+ "desc": "閿欒鎻愮ず鏂囨湰锛屽�间负绌轰笉鏄剧ず锛堝簾寮冨睘鎬э紝濡傛灉闇�瑕侊紝璇锋洿涓轰娇鐢� status 鍜� tips锛�",
+ "label": ""
+ },
+ {
+ "key": "format",
+ "type": ["String"],
+ "desc": "銆愬紑鍙戜腑銆戞寚瀹氳緭鍏ユ灞曠ず鍊肩殑鏍煎紡",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "宸︿晶鏂囨湰",
+ "label": ""
+ },
+ {
+ "key": "maxcharacter",
+ "type": ["Number"],
+ "desc": "鐢ㄦ埛鏈�澶氬彲浠ヨ緭鍏ョ殑瀛楃涓暟锛屼竴涓腑鏂囨眽瀛楄〃绀轰袱涓瓧绗﹂暱搴︺�俙maxcharacter` 鍜� `maxlength` 浜岄�変竴浣跨敤",
+ "label": ""
+ },
+ {
+ "key": "maxlength",
+ "type": ["Number"],
+ "desc": "鐢ㄦ埛鏈�澶氬彲浠ヨ緭鍏ョ殑鏂囨湰闀垮害锛屼竴涓腑鏂囩瓑浜庝竴涓鏁伴暱搴︺�傚�煎皬浜庣瓑浜� 0 鐨勬椂鍊欙紝鍒欒〃绀轰笉闄愬埗杈撳叆闀垮害銆俙maxcharacter` 鍜� `maxlength` 浜岄�変竴浣跨敤",
+ "label": ""
+ },
+ {
+ "key": "placeholder",
+ "type": ["String"],
+ "desc": "鍗犱綅绗�",
+ "label": ""
+ },
+ {
+ "key": "prefixIcon",
+ "type": ["String"],
+ "desc": "缁勪欢鍓嶇疆鍥炬爣锛屽�间负瀛楃涓插垯琛ㄧず鍥炬爣鍚嶇О",
+ "label": ""
+ },
+ {
+ "key": "readonly",
+ "type": ["Boolean"],
+ "desc": "鍙鐘舵��",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "杈撳叆妗嗗昂瀵�",
+ "label": ""
+ },
+ {
+ "key": "status",
+ "type": ["String"],
+ "desc": "杈撳叆妗嗙姸鎬�",
+ "label": ""
+ },
+ {
+ "key": "suffix",
+ "type": ["String"],
+ "desc": "鍚庣疆鍥炬爣鍓嶇殑鍚庣疆鍐呭",
+ "label": ""
+ },
+ {
+ "key": "suffixIcon",
+ "type": ["String"],
+ "desc": "鍚庣疆鏂囨湰鍐呭锛屽�间负瀛楃涓插垯琛ㄧず鍥炬爣鍚嶇О",
+ "label": ""
+ },
+ {
+ "key": "tips",
+ "type": ["String"],
+ "desc": "杈撳叆妗嗕笅鏂规彁绀烘枃鏈紝浼氭牴鎹笉鍚岀殑 `status` 鍛堢幇涓嶅悓鐨勬牱寮�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "杈撳叆妗嗙殑鍊�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-input", "t-class-placeholder", "t-class-error-msg"],
+ "events": [
+ {
+ "key": "bind:blur",
+ "desc": "澶卞幓鐒︾偣鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "杈撳叆妗嗗�煎彂鐢熷彉鍖栨椂瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:clear",
+ "desc": "娓呯┖鎸夐挳鐐瑰嚮鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:enter",
+ "desc": "鍥炶溅閿寜涓嬫椂瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:focus",
+ "desc": "鑾峰緱鐒︾偣鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-input placeholder=\"璇疯緭鍏ユ枃瀛梊" />",
+ "path": "./input/input"
+ },
+ "t-loading": {
+ "key": "t-loading",
+ "label": "鍔犺浇涓�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-loading.png",
+ "properties": [
+ {
+ "key": "delay",
+ "type": ["Number"],
+ "desc": "寤惰繜鏄剧ず鍔犺浇鏁堟灉鐨勬椂闂达紝鐢ㄤ簬闃叉璇锋眰閫熷害杩囧揩寮曡捣鐨勫姞杞介棯鐑侊紝鍗曚綅锛氭绉�",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "鍔犺浇鍔ㄧ敾鎵ц瀹屾垚涓�娆$殑鏃堕棿锛屽崟浣嶏細姣",
+ "label": ""
+ },
+ {
+ "key": "indicator",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず鍔犺浇鎸囩ず绗�",
+ "label": ""
+ },
+ {
+ "key": "inheritColor",
+ "type": ["Boolean"],
+ "desc": "鏄惁缁ф壙鐖跺厓绱犻鑹�",
+ "label": ""
+ },
+ {
+ "key": "layout",
+ "type": ["String"],
+ "desc": "瀵归綈鏂瑰紡",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["Boolean"],
+ "desc": "鏄惁澶勪簬鍔犺浇鐘舵��",
+ "label": ""
+ },
+ {
+ "key": "pause",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏆傚仠鍔ㄧ敾",
+ "label": ""
+ },
+ {
+ "key": "progress",
+ "type": ["Number"],
+ "desc": "鍔犺浇杩涘害",
+ "label": ""
+ },
+ {
+ "key": "reverse",
+ "type": ["Boolean"],
+ "desc": "鍔犺浇鍔ㄧ敾鏄惁鍙嶅悜",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "灏哄锛岀ず渚嬶細40rpx/20px",
+ "label": ""
+ },
+ {
+ "key": "text",
+ "type": ["String"],
+ "desc": "鍔犺浇鎻愮ず鏂囨",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "鍔犺浇缁勪欢绫诲瀷",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-text", "t-class-indicator"],
+ "tpl": "<t-loading theme=\"circular\" size=\"40rpx\"></t-loading>",
+ "path": "./loading/loading"
+ },
+ "t-message": {
+ "key": "t-message",
+ "label": "鍏ㄥ眬鎻愰啋",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-message.png",
+ "properties": [
+ {
+ "key": "action",
+ "type": ["String"],
+ "desc": "鎿嶄綔",
+ "label": ""
+ },
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "鏂囨湰瀵归綈鏂瑰紡",
+ "label": ""
+ },
+ {
+ "key": "closeBtn",
+ "type": ["String", "Boolean"],
+ "desc": "鍏抽棴鎸夐挳锛屽彲浠ヨ嚜瀹氫箟銆傚�间负 true 鏄剧ず榛樿鍏抽棴鎸夐挳锛屽�间负 false 涓嶆樉绀哄叧闂寜閽�傚�肩被鍨嬩负 string 鍒欑洿鎺ユ樉绀哄�硷紝濡傦細鈥滃叧闂�濄�備篃鍙互瀹屽叏鑷畾涔夋寜閽�",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "鐢ㄤ簬鑷畾涔夋秷鎭脊鍑哄唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "娑堟伅鍐呯疆璁℃椂鍣紝璁℃椂鍒拌揪鏃朵細瑙﹀彂 duration-end 浜嬩欢銆傚崟浣嶏細姣銆傚�间负 0 鍒欒〃绀烘病鏈夎鏃跺櫒銆�",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String", "Boolean"],
+ "desc": "娑堟伅鎻愰啋鍓嶉潰鐨勫浘鏍囥�傚�间负 true 鍒欐牴鎹� theme 鏄剧ず瀵瑰簲鐨勫浘鏍囷紝鍊间负 false 鍒欎笉鏄剧ず鍥炬爣銆傚�间负 'info' 鎴� 'bell' 鍒欐樉绀虹粍浠跺唴缃浘鏍囥�備篃鍙互瀹屽叏鑷畾涔夊浘鏍囪妭鐐�",
+ "label": ""
+ },
+ {
+ "key": "marquee",
+ "type": ["Boolean", "Object"],
+ "desc": "璺戦┈鐏晥鏋溿�俿peed 鎸囬�熷害鎺у埗锛沴oop 鎸囧惊鐜挱鏀炬鏁帮紝鍊间负 -1 琛ㄧず寰幆鎾斁锛屽�间负 0 琛ㄧず涓嶅惊鐜挱鏀撅紱delay 琛ㄧず寤惰繜澶氫箙寮�濮嬫挱鏀�",
+ "label": ""
+ },
+ {
+ "key": "offset",
+ "type": ["Array"],
+ "desc": "鐩稿浜� placement 鐨勫亸绉婚噺锛岀ず渚嬶細[-10, 20] 鎴� ['10rpx', '8rpx']",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "娑堟伅缁勪欢椋庢牸",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず锛岄殣钘忔椂榛樿閿�姣佺粍浠�",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "鍏冪礌灞傜骇锛屾牱寮忛粯璁や负 5000",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-content", "t-class-icon", "t-class-action", "t-class-close-btn"],
+ "events": [
+ {
+ "key": "bind:action-btn-click",
+ "desc": "褰撴搷浣滄寜閽瓨鍦ㄦ椂锛岀敤鎴风偣鍑绘搷浣滄寜閽椂瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:close-btn-click",
+ "desc": "褰撳叧闂寜閽瓨鍦ㄦ椂锛岀敤鎴风偣鍑诲叧闂寜閽Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:duration-end",
+ "desc": "璁℃椂缁撴潫鍚庤Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-message id=\"t-message\" />",
+ "path": "./message/message"
+ },
+ "t-navbar": {
+ "key": "t-navbar",
+ "label": "瀵艰埅鏉�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-navbar.png",
+ "properties": [
+ {
+ "key": "animation",
+ "type": ["Boolean"],
+ "desc": "鏄惁娣诲姞鍔ㄧ敾鏁堟灉",
+ "label": ""
+ },
+ {
+ "key": "background",
+ "type": ["String"],
+ "desc": "鑳屾櫙",
+ "label": ""
+ },
+ {
+ "key": "delta",
+ "type": ["Number"],
+ "desc": "鍚庨��鎸夐挳鍚庨��灞傛暟锛屽惈涔夊弬鑰� [wx.navigateBack](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html)锛岀壒娈婄殑锛屼紶鍏� 0 涓嶄細鍙戠敓鎵ц wx.navigateBack锛屽彧浼氳Е鍙戜竴涓� goback 浜嬩欢渚涜嚜琛屽鐞嗐��",
+ "label": ""
+ },
+ {
+ "key": "fixed",
+ "type": ["Boolean"],
+ "desc": "鏄惁鍥哄畾鍦ㄩ《閮�",
+ "label": ""
+ },
+ {
+ "key": "homeIcon",
+ "type": ["String"],
+ "desc": "棣栭〉鍥炬爣鍦板潃銆傚�间负 '' 鎴栬�� undefiend 鍒欒〃绀轰笉鏄剧ず杩斿洖鍥炬爣锛屽�间负 'circle' 琛ㄧず鏄剧ず榛樿鍥炬爣锛屽�间负 'slot' 琛ㄧず浣跨敤鎻掓Ы娓叉煋锛屽�间负鍏朵粬鍒欒〃绀哄浘鏍囧湴鍧�",
+ "label": ""
+ },
+ {
+ "key": "leftIcon",
+ "type": ["String"],
+ "desc": "宸︿晶鍥炬爣鍦板潃锛屽�间负 '' 鎴栬�� undefiend 鍒欒〃绀轰笉鏄剧ず杩斿洖鍥炬爣锛屽�间负 'arrow-left' 琛ㄧず鏄剧ず杩斿洖鍥炬爣锛屽�间负 'slot' 琛ㄧず浣跨敤鎻掓Ы娓叉煋锛屽�间负鍏朵粬鍒欒〃绀哄浘鏍囧湴鍧�",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "椤甸潰鏍囬",
+ "label": ""
+ },
+ {
+ "key": "titleMaxLength",
+ "type": ["Number"],
+ "desc": "鏍囬鏂囧瓧鏈�澶ч暱搴︼紝瓒呭嚭鐨勮寖鍥翠娇鐢� `...` 琛ㄧず",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-title", "t-class-left-icon", "t-class-home-icon", "t-class-capsule"],
+ "events": [
+ {
+ "key": "bind:complete",
+ "desc": "navigateBack 鎵ц瀹屾垚鍚庤Е鍙戯紙澶辫触鎴栨垚鍔熷潎浼氳Е鍙戯級",
+ "label": ""
+ },
+ {
+ "key": "bind:fail",
+ "desc": "navigateBack 鎵ц澶辫触鍚庤Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:go-back",
+ "desc": "delta 鍊间负 0 鏃讹紝鐐瑰嚮杩斿洖锛岃Е鍙戣浜嬩欢",
+ "label": ""
+ },
+ {
+ "key": "bind:go-home",
+ "desc": "鐐瑰嚮 Home 瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:success",
+ "desc": "navigateBack 鎵ц鎴愬姛鍚庤Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-navbar title=\"鏍囬\" />",
+ "path": "./navbar/navbar"
+ },
+ "t-picker-item": {
+ "key": "t-picker-item",
+ "label": "閫夋嫨鍣ㄥ瓙椤�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-picker.png",
+ "properties": [
+ {
+ "key": "format",
+ "type": ["String"],
+ "desc": "鏍煎紡鍖栨爣绛�",
+ "label": ""
+ },
+ {
+ "key": "options",
+ "type": ["Array"],
+ "desc": "鏁版嵁婧�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-picker-item options=\"{{[{ label: '涓婃捣', value: '涓婃捣' },{ label: '骞垮窞', value: '骞垮窞' },{ label: '娣卞湷', value: '娣卞湷' }]}}\" value=\"骞垮窞\"></t-picker-item>",
+ "path": "./picker-item/picker-item"
+ },
+ "t-picker": {
+ "key": "t-picker",
+ "label": "閫夋嫨鍣�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-picker.png",
+ "properties": [
+ {
+ "key": "cancelBtn",
+ "type": ["String", "Object"],
+ "desc": "鍙栨秷鎸夐挳鏂囧瓧",
+ "label": ""
+ },
+ {
+ "key": "confirmBtn",
+ "type": ["String", "Object"],
+ "desc": "纭畾鎸夐挳鏂囧瓧",
+ "label": ""
+ },
+ {
+ "key": "footer",
+ "type": ["String"],
+ "desc": "搴曢儴鍐呭",
+ "label": ""
+ },
+ {
+ "key": "header",
+ "type": ["Boolean"],
+ "desc": "澶撮儴鍐呭銆傚�间负 true 鏄剧ず绌虹櫧澶撮儴锛屽�间负 false 涓嶆樉绀轰换浣曞唴瀹癸紝鍊肩被鍨嬩负 TNode 琛ㄧず鑷畾涔夊ご閮ㄥ唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "鏍囬",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Array"],
+ "desc": "閫変腑鍊�",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:cancel",
+ "desc": "鐐瑰嚮鍙栨秷鎸夐挳鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "閫変腑鍙樺寲鏃跺�欒Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:pick",
+ "desc": "浠讳綍涓�鍒楅�変腑閮戒細瑙﹀彂锛屼笉鍚岀殑鍒楀弬鏁颁笉鍚屻�俙context.column` 琛ㄧず绗嚑鍒楀彉鍖栵紝`context.index` 琛ㄧず鍙樺寲閭d竴鍒楃殑閫変腑椤逛笅鏍�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-picker visible=\"{{true}}\" cancelBtn=\"鍙栨秷\" confirmBtn=\"纭\"><t-picker-item options=\"{{[{ label: '涓婃捣', value: '涓婃捣' },{ label: '骞垮窞', value: '骞垮窞' },{ label: '娣卞湷', value: '娣卞湷' }]}}\" value=\"骞垮窞\"></t-picker-item></t-picker>",
+ "require": {
+ "t-picker-item": "./picker-item/picker-item"
+ },
+ "path": "./picker/picker"
+ },
+ "t-popup": {
+ "key": "t-popup",
+ "label": "姘旀场妗�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-popup.png",
+ "properties": [
+ {
+ "key": "closeBtn",
+ "type": ["Boolean"],
+ "desc": "鍏抽棴鎸夐挳锛屽�肩被鍨嬩负 Boolean 鏃惰〃绀烘槸鍚︽樉绀哄叧闂寜閽�備篃鍙互鑷畾涔夊叧闂寜閽�",
+ "label": ""
+ },
+ {
+ "key": "closeOnOverlayClick",
+ "type": ["Boolean"],
+ "desc": "鐐瑰嚮閬僵灞傛槸鍚﹀叧闂�",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "娴眰閲岄潰鐨勫唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "placement",
+ "type": ["String"],
+ "desc": "娴眰鍑虹幇浣嶇疆",
+ "label": ""
+ },
+ {
+ "key": "preventScrollThrough",
+ "type": ["Boolean"],
+ "desc": "闃叉婊氬姩绌块��",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず閬僵灞�",
+ "label": ""
+ },
+ {
+ "key": "transitionProps",
+ "type": ["Object"],
+ "desc": "鍔ㄧ敾鏁堟灉瀹氫箟",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず娴眰",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "缁勪欢灞傜骇锛學eb 渚ф牱寮忛粯璁や负 5500锛岀Щ鍔ㄧ鍜屽皬绋嬪簭鏍峰紡榛樿涓� 1500",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-overlay", "t-class-content"],
+ "events": [
+ {
+ "key": "bind:visible-change",
+ "desc": "褰撴诞灞傞殣钘忔垨鏄剧ず鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-popup visible=\"{{true}}\" placement=\"top\"><view style=\"width: 100vw; height: 35vh; background: #fff\" /></t-popup>",
+ "path": "./popup/popup"
+ },
+ "t-progress": {
+ "key": "t-progress",
+ "label": "杩涘害鏉�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-progress.png",
+ "properties": [
+ {
+ "key": "color",
+ "type": ["String", "Object", "Array"],
+ "desc": "杩涘害鏉¢鑹层�傜ず渚嬶細'#ED7B2F' 鎴� 'orange' 鎴� `['#f00', '#0ff', '#f0f']` 鎴� `{ '0%': '#f00', '100%': '#0ff' }` 鎴� `{ from: '#000', to: '#000' }` 绛�",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String", "Boolean"],
+ "desc": "杩涘害鐧惧垎姣旓紝鍙嚜瀹氫箟",
+ "label": ""
+ },
+ {
+ "key": "percentage",
+ "type": ["Number"],
+ "desc": "杩涘害鏉$櫨鍒嗘瘮",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String", "Number"],
+ "desc": "杩涘害鏉″昂瀵革紝绀轰緥锛歴mall/medium/large/240銆俿mall 鍊间负 72锛� medium 鍊间负 112锛沴arge 鍊间负 160",
+ "label": ""
+ },
+ {
+ "key": "status",
+ "type": ["String"],
+ "desc": "杩涘害鏉$姸鎬�",
+ "label": ""
+ },
+ {
+ "key": "strokeWidth",
+ "type": ["String", "Number"],
+ "desc": "杩涘害鏉$嚎瀹姐�傚搴︽暟鍊间笉鑳借秴杩� size 鐨勪竴鍗婏紝鍚﹀垯涓嶈兘杈撳嚭鐜舰杩涘害",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "杩涘害鏉¢鏍笺�傚�间负 line锛屾爣绛撅紙label锛夋樉绀哄湪杩涘害鏉″彸渚э紱鍊间负 plump锛屾爣绛撅紙label锛夋樉绀哄湪杩涘害鏉¢噷闈紱鍊间负 circle锛屾爣绛撅紙label锛夋樉绀哄湪杩涘害鏉℃涓棿",
+ "label": ""
+ },
+ {
+ "key": "trackColor",
+ "type": ["String"],
+ "desc": "杩涘害鏉℃湭瀹屾垚閮ㄥ垎棰滆壊",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-progress></t-progress>",
+ "path": "./progress/progress"
+ },
+ "t-pull-down-refresh": {
+ "key": "t-pull-down-refresh",
+ "label": "涓嬫媺鍒锋柊",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-pulldownrefresh.png",
+ "properties": [
+ {
+ "key": "loadingBarHeight",
+ "type": ["String", "Number"],
+ "desc": "鍔犺浇涓笅鎷夐珮搴︼紝濡傛灉鍊间负鏁板瓧鍒欏崟浣嶆槸锛�'px'",
+ "label": ""
+ },
+ {
+ "key": "loadingProps",
+ "type": ["Object"],
+ "desc": "鍔犺浇loading鏍峰紡",
+ "label": ""
+ },
+ {
+ "key": "loadingTexts",
+ "type": ["Array"],
+ "desc": "鎻愮ず璇紝缁勪欢鍐呴儴榛樿鍊间负 ['涓嬫媺鍒锋柊', '鏉炬墜鍒锋柊', '姝e湪鍒锋柊', '鍒锋柊瀹屾垚']",
+ "label": ""
+ },
+ {
+ "key": "maxBarHeight",
+ "type": ["String", "Number"],
+ "desc": "鏈�澶т笅鎷夐珮搴︼紝濡傛灉鍊间负鏁板瓧鍒欏崟浣嶆槸锛�'px'",
+ "label": ""
+ },
+ {
+ "key": "refreshTimeout",
+ "type": ["Number"],
+ "desc": "鍒锋柊瓒呮椂鏃堕棿",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Boolean"],
+ "desc": "缁勪欢鐘舵�侊紝鍊间负 `true` 琛ㄧず涓嬫媺鐘舵�侊紝鍊间负 `false` 琛ㄧず鏀惰捣鐘舵��",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-loading", "t-class-text", "t-class-indicator"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "涓嬫媺鎴栨敹璧锋椂瑙﹀彂锛岀敤鎴锋墜鍔垮線涓嬫粦鍔ㄨЕ鍙戜笅鎷夌姸鎬侊紝鎵嬪娍鏉惧紑瑙﹀彂鏀惰捣鐘舵��",
+ "label": ""
+ },
+ {
+ "key": "bind:refresh",
+ "desc": "缁撴潫涓嬫媺鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:timeout",
+ "desc": "鍒锋柊瓒呮椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-pull-down-refresh id=\"pull-down-refresh\" loadingTexts=\"{{['缁х画鎷夊摝', '璇ユ澗鎵嬪暒', '鍔姏鍒锋柊涓�', '瀹屾垚~']}}\"><view style=\"height: 300rpx; background: #fff; text-align: center\">鎷栨嫿璇ュ尯鍩熸紨绀� 涓棿涓嬫媺鍒锋柊</view></t-pull-down-refresh>",
+ "path": "./pull-down-refresh/pull-down-refresh"
+ },
+ "t-radio-group": {
+ "key": "t-radio-group",
+ "label": "鍗曢�夋缁�",
+ "icon": "",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤鍏ㄩ儴瀛愬崟閫夋",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "HTML 鍏冪礌鍘熺敓灞炴��",
+ "label": ""
+ },
+ {
+ "key": "options",
+ "type": ["Array"],
+ "desc": "鍗曢�夌粍浠舵寜閽舰寮忋�俁adioOption 鏁版嵁绫诲瀷涓� string 鎴� number 鏃讹紝琛ㄧず label 鍜� value 鍊肩浉鍚�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number", "Boolean"],
+ "desc": "閫変腑鐨勫��",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "閫変腑鍊煎彂鐢熷彉鍖栨椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-radio-group defaultValue=\"radio1\"><t-radio value=\"radio1\" label=\"鍗曢�塡" /><t-radio value=\"radio2\" label=\"鍗曢�塡" /></t-radio-group>",
+ "require": {
+ "t-radio": "./radio/radio"
+ },
+ "path": "./radio-group/radio-group"
+ },
+ "t-radio": {
+ "key": "t-radio",
+ "label": "鍗曢�夋",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-radio.png",
+ "properties": [
+ {
+ "key": "align",
+ "type": ["String"],
+ "desc": "澶嶉�夋鍜屽唴瀹圭浉瀵逛綅缃�",
+ "label": ""
+ },
+ {
+ "key": "allowUncheck",
+ "type": ["Boolean"],
+ "desc": "鏄惁鍏佽鍙栨秷閫変腑",
+ "label": ""
+ },
+ {
+ "key": "checked",
+ "type": ["Boolean"],
+ "desc": "鏄惁閫変腑",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["String"],
+ "desc": "鍗曢�夋寜閽鑹�",
+ "label": ""
+ },
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "鍗曢�夊唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "contentDisabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤缁勪欢鍐呭锛坈ontent锛夎Е鍙戦�変腑",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁涓虹鐢ㄦ��",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String", "Array"],
+ "desc": "鑷畾涔夐�変腑鍥炬爣鍜岄潪閫変腑鍥炬爣銆傜ず渚嬶細[閫変腑鎬佸浘鏍囷紝闈為�変腑鎬佸浘鏍嘳銆傚�间负 fill-circle 琛ㄧず鍥炬爣涓哄~鍏呭瀷鍥炬爣锛屽�间负 stroke-line 琛ㄧず鍥炬爣涓烘弿杈瑰瀷鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "涓绘枃妗�",
+ "label": ""
+ },
+ {
+ "key": "maxContentRow",
+ "type": ["Number"],
+ "desc": "鍐呭鏈�澶ц鏁伴檺鍒�",
+ "label": ""
+ },
+ {
+ "key": "maxLabelRow",
+ "type": ["Number"],
+ "desc": "涓绘枃妗堟渶澶ц鏁伴檺鍒�",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "HTML 鍏冪礌鍘熺敓灞炴��",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number", "Boolean"],
+ "desc": "鍗曢�夋寜閽殑鍊�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-icon", "t-class-label", "t-class-content", "t-class-border"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "鍊煎彉鍖栨椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-radio value=\"radio\" label=\"鍗曢�塡" />",
+ "path": "./radio/radio"
+ },
+ "t-rate": {
+ "key": "t-rate",
+ "label": "璇勫垎",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-rate.png",
+ "properties": [
+ {
+ "key": "allowHalf",
+ "type": ["Boolean"],
+ "desc": "鏄惁鍏佽鍗婇��",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["String", "Array"],
+ "desc": "璇勫垎鍥炬爣鐨勯鑹诧紝鏍峰紡涓粯璁や负 #ED7B2F銆備竴涓�艰〃绀鸿缃�変腑楂樹寒鐨勪簲瑙掓槦棰滆壊锛岀ず渚嬶細[閫変腑棰滆壊]銆傛暟缁勫垯琛ㄧず鍒嗗埆璁剧疆 閫変腑楂樹寒鐨勪簲瑙掓槦棰滆壊 鍜� 鏈�変腑鏆楃伆鐨勪簲瑙掓槦棰滆壊锛孾閫変腑棰滆壊锛屾湭閫変腑棰滆壊]銆傜ず渚嬶細['#ED7B2F', '#E3E6EB']",
+ "label": ""
+ },
+ {
+ "key": "count",
+ "type": ["Number"],
+ "desc": "璇勫垎鐨勬暟閲�",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤璇勫垎",
+ "label": ""
+ },
+ {
+ "key": "gap",
+ "type": ["Number"],
+ "desc": "璇勫垎鍥炬爣鐨勯棿璺�",
+ "label": ""
+ },
+ {
+ "key": "showText",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず瀵瑰簲鐨勮緟鍔╂枃瀛�",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "璇勫垎鍥炬爣鐨勫ぇ灏忥紝绀轰緥锛歚20`",
+ "label": ""
+ },
+ {
+ "key": "texts",
+ "type": ["Array"],
+ "desc": "璇勫垎绛夌骇瀵瑰簲鐨勮緟鍔╂枃瀛椼�傜粍浠跺唴缃粯璁ゅ�间负锛歔'鏋佸樊', '澶辨湜', '涓�鑸�', '婊℃剰', '鎯婂枩']銆傝嚜瀹氫箟鍊肩ず渚嬶細['1鍒�', '2鍒�', '3鍒�', '4鍒�', '5鍒�']",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Number"],
+ "desc": "閫夋嫨璇勫垎鐨勫��",
+ "label": ""
+ },
+ {
+ "key": "variant",
+ "type": ["String"],
+ "desc": "褰㈢姸绫诲瀷锛屾湁鎻忚竟绫诲瀷鍜屽~鍏呯被鍨嬩袱绉�",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "璇勫垎鏁版敼鍙樻椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-rate defaultValue=\"{{4}}\" variant=\"filled\"></t-rate>",
+ "path": "./rate/rate"
+ },
+ "t-search": {
+ "key": "t-search",
+ "label": "鎼滅储",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-search.png",
+ "properties": [
+ {
+ "key": "action",
+ "type": ["String"],
+ "desc": "鑷畾涔夊彸渚ф搷浣滄寜閽枃瀛�",
+ "label": ""
+ },
+ {
+ "key": "center",
+ "type": ["Boolean"],
+ "desc": "鏄惁灞呬腑",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤",
+ "label": ""
+ },
+ {
+ "key": "focus",
+ "type": ["Boolean"],
+ "desc": "鏄惁鑱氱劍",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "宸︿晶鏂囨湰",
+ "label": ""
+ },
+ {
+ "key": "leftIcon",
+ "type": ["String"],
+ "desc": "宸︿晶鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "placeholder",
+ "type": ["String"],
+ "desc": "鍗犱綅绗�",
+ "label": ""
+ },
+ {
+ "key": "rightIcon",
+ "type": ["String"],
+ "desc": "鍙充晶鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "鎼滅储妗嗗舰鐘�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String"],
+ "desc": "鍊�",
+ "label": ""
+ }
+ ],
+ "externalClasses": [
+ "t-class",
+ "t-class-input",
+ "t-class-input-container",
+ "t-class-cancel",
+ "t-class-left",
+ "t-class-right"
+ ],
+ "events": [
+ {
+ "key": "bind:action-click",
+ "desc": "鐐瑰嚮鍙充晶鎿嶄綔鎸夐挳鏂囧瓧鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:blur",
+ "desc": "澶卞幓鐒︾偣鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "鍊煎彂鐢熷彉鍖栨椂瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:clear",
+ "desc": "鐐瑰嚮娓呴櫎鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:focus",
+ "desc": "鑱氱劍鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:submit",
+ "desc": "鎻愪氦鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-search></t-search>",
+ "path": "./search/search"
+ },
+ "t-skeleton": {
+ "key": "t-skeleton",
+ "label": "楠ㄦ灦灞�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-skeleton.png",
+ "properties": [
+ {
+ "key": "animation",
+ "type": ["String"],
+ "desc": "鍔ㄧ敾鏁堟灉锛屾湁銆屾笎鍙樺姞杞藉姩鐢汇�嶅拰銆岄棯鐑佸姞杞藉姩鐢汇�嶄袱绉嶃�傚�间负 'none' 鍒欒〃绀烘病鏈夊姩鐢�",
+ "label": ""
+ },
+ {
+ "key": "delay",
+ "type": ["Number"],
+ "desc": "銆愬紑鍙戜腑銆戝欢杩熸樉绀哄姞杞芥晥鏋滅殑鏃堕棿锛岀敤浜庨槻姝㈣姹傞�熷害杩囧揩寮曡捣鐨勫姞杞介棯鐑侊紝鍗曚綅锛氭绉�",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["Boolean"],
+ "desc": "鏄惁涓哄姞杞界姸鎬侊紝濡傛灉鏄垯鏄剧ず楠ㄦ灦鍥撅紝濡傛灉涓嶆槸鍒欐樉绀哄姞杞藉畬鎴愮殑鍐呭",
+ "label": ""
+ },
+ {
+ "key": "rowCol",
+ "type": ["Array"],
+ "desc": "鐢ㄤ簬璁剧疆琛屽垪鏁伴噺銆佸搴﹂珮搴︺�侀棿璺濈瓑銆傘�愮ず渚嬩竴銆戯紝`[1, 1, 2]` 琛ㄧず杈撳嚭涓夎楠ㄦ灦鍥撅紝绗竴琛屼竴鍒楋紝绗簩琛屼竴鍒楋紝绗笁琛屼袱鍒椼�傘�愮ず渚嬩簩銆戯紝`[1, 1, { width: '100px' }]` 琛ㄧず鑷畾涔夌涓夎鐨勫搴︿负 `100px`銆傘�愮ず渚嬩笁銆戯紝`[1, 2, [{ width, height }, { width, height, marginLeft }]]` 琛ㄧず绗笁琛屾湁涓ゅ垪锛屼笖鑷畾涔夊搴︺�侀珮搴﹀拰闂磋窛",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "楠ㄦ灦鍥鹃鏍硷紝鏈夊熀纭�銆佸ご鍍忕粍鍚堢瓑涓ゅぇ绫�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-avatar", "t-class-image", "t-class-text"],
+ "tpl": "<t-skeleton rowCol=\"{{ [{ width: '686rpx', height: '32rpx' }, 1, 1, { width: '380rpx', height: '32rpx' }]}}\" loading></t-skeleton>",
+ "path": "./skeleton/skeleton"
+ },
+ "t-slider": {
+ "key": "t-slider",
+ "label": "婊戝潡",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-slider.png",
+ "properties": [
+ {
+ "key": "colors",
+ "type": ["Array"],
+ "desc": "棰滆壊锛孾宸查�夋嫨, 鏈�夋嫨]",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤缁勪欢",
+ "label": ""
+ },
+ {
+ "key": "disabledColor",
+ "type": ["Array"],
+ "desc": "绂佺敤鐘舵�佹粦鍔ㄦ潯鐨勯鑹诧紝[宸查��, 鏈�塢",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String", "Boolean"],
+ "desc": "婊戝潡褰撳墠鍊兼枃鏈��<br />鍊间负 true 鏄剧ず榛樿鏂囨锛涘�间负 false 涓嶆樉绀烘粦鍧楀綋鍓嶅�兼枃鏈紱<br />鍊间负 `${value}%` 鍒欒〃绀虹粍浠朵細鏍规嵁鍗犱綅绗︽覆鏌撴枃妗堬紱<br />鍊肩被鍨嬩负鍑芥暟鏃讹紝鍙傛暟 `value` 鏍囪瘑婊戝潡鍊硷紝鍙傛暟 `position=start` 琛ㄧず鑼冨洿婊戝潡鐨勮捣濮嬪�硷紝鍙傛暟 `position=end` 琛ㄧず鑼冨洿婊戝潡鐨勭粓鐐瑰��",
+ "label": ""
+ },
+ {
+ "key": "marks",
+ "type": ["Object", "Array"],
+ "desc": "鍒诲害鏍囪锛岀ず渚嬶細`[0, 10, 40, 200]` 鎴栬�� `{ 5: '5楼', 10: '10%' }`",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "婊戝潡鑼冨洿鏈�澶у��",
+ "label": ""
+ },
+ {
+ "key": "min",
+ "type": ["Number"],
+ "desc": "婊戝潡鑼冨洿鏈�灏忓��",
+ "label": ""
+ },
+ {
+ "key": "range",
+ "type": ["Boolean"],
+ "desc": "鍙屾父鏍囨粦鍧�",
+ "label": ""
+ },
+ {
+ "key": "showExtremeValue",
+ "type": ["Boolean"],
+ "desc": "鏄惁杈圭晫鍊�",
+ "label": ""
+ },
+ {
+ "key": "step",
+ "type": ["Number"],
+ "desc": "姝ラ暱",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["Number", "Array"],
+ "desc": "婊戝潡鍊�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-bar", "t-class-bar-active", "t-class-bar-disabled", "t-class-cursor"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "婊戝潡鍊煎彉鍖栨椂瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:dragend",
+ "desc": "缁撴潫鎷栧姩鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:dragstart",
+ "desc": "寮�濮嬫嫋鍔ㄦ椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-slider />",
+ "path": "./slider/slider"
+ },
+ "t-step-item": {
+ "key": "t-step-item",
+ "label": "姝ラ",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-steps.png",
+ "properties": [
+ {
+ "key": "content",
+ "type": ["String"],
+ "desc": "姝ラ鎻忚堪",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鍥炬爣銆備紶鍏� slot 浠h〃浣跨敤鎻掓Ы锛屽叾浠栧瓧绗︿覆浠h〃浣跨敤鍐呯疆鍥炬爣",
+ "label": ""
+ },
+ {
+ "key": "status",
+ "type": ["String"],
+ "desc": "褰撳墠姝ラ鐨勭姸鎬�",
+ "label": ""
+ },
+ {
+ "key": "subStepItems",
+ "type": ["Array"],
+ "desc": "瀛愭楠ゆ潯锛屼粎鏀寔 layout = 'vertical' 鏃�",
+ "label": ""
+ },
+ {
+ "key": "title",
+ "type": ["String"],
+ "desc": "鏍囬",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-content", "t-class-title", "t-class-description", "t-class-extra"],
+ "tpl": "<t-step-item title=\"姝ラ鎻忚堪\"></t-step-item>",
+ "path": "./step-item/step-item"
+ },
+ "t-stepper": {
+ "key": "t-stepper",
+ "label": "姝ヨ繘鍣�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-stepper.png",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "绂佺敤鍏ㄩ儴鎿嶄綔",
+ "label": ""
+ },
+ {
+ "key": "disableInput",
+ "type": ["Boolean"],
+ "desc": "绂佺敤杈撳叆妗�",
+ "label": ""
+ },
+ {
+ "key": "inputWidth",
+ "type": ["Number"],
+ "desc": "杈撳叆妗嗗搴�",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "鏈�澶у��",
+ "label": ""
+ },
+ {
+ "key": "min",
+ "type": ["Number"],
+ "desc": "鏈�灏忓��",
+ "label": ""
+ },
+ {
+ "key": "step",
+ "type": ["Number"],
+ "desc": "姝ラ暱",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "缁勪欢椋庢牸",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "鍊�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-input", "t-class-add", "t-class-minus"],
+ "events": [
+ {
+ "key": "bind:blur",
+ "desc": "杈撳叆妗嗗け鍘荤劍鐐规椂瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "鏁板�煎彂鐢熷彉鏇存椂瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:overlimit",
+ "desc": "鏁板�艰秴鍑洪檺鍒舵椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-stepper />",
+ "path": "./stepper/stepper"
+ },
+ "t-steps": {
+ "key": "t-steps",
+ "label": "姝ラ鏉�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-steps.png",
+ "properties": [
+ {
+ "key": "current",
+ "type": ["String", "Number"],
+ "desc": "褰撳墠姝ラ锛屽嵆鏁翠釜姝ラ鏉¤繘搴︺�傞粯璁ゆ牴鎹楠や笅鏍囧垽鏂楠ょ殑瀹屾垚鐘舵�侊紝褰撳墠姝ラ涓鸿繘琛屼腑锛屽綋鍓嶆楠や箣鍓嶇殑姝ラ涓哄凡瀹屾垚锛屽綋鍓嶆楠や箣鍚庣殑姝ラ涓烘湭寮�濮嬨�傚鏋滄瘡涓楠ゆ病鏈夎缃� value锛宑urrent 鍊间负姝ラ闀垮害鍒欒〃绀烘墍鏈夋楠ゅ凡瀹屾垚銆傚鏋滄瘡涓楠よ缃簡鑷畾涔� value锛屽垯 current = 'FINISH' 琛ㄧず鎵�鏈夌姸鎬佸畬鎴�",
+ "label": ""
+ },
+ {
+ "key": "currentStatus",
+ "type": ["String"],
+ "desc": "鐢ㄤ簬鎺у埗 current 鎸囧悜鐨勬楠ゆ潯鐨勭姸鎬�",
+ "label": ""
+ },
+ {
+ "key": "layout",
+ "type": ["String"],
+ "desc": "姝ラ鏉℃柟鍚戯紝鏈変袱绉嶏細妯悜鍜岀旱鍚�",
+ "label": ""
+ },
+ {
+ "key": "readonly",
+ "type": ["Boolean"],
+ "desc": "鍙鐘舵��",
+ "label": ""
+ },
+ {
+ "key": "separator",
+ "type": ["String"],
+ "desc": "姝ラ鏉″垎鍓茬",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "姝ラ鏉¢鏍�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "褰撳墠姝ラ鍙戠敓鍙樺寲鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-steps><t-step-item title=\"姝ラ鎻忚堪1\" /><t-step-item title=\"姝ラ鎻忚堪2\" /></t-steps>",
+ "require": {
+ "t-step-item": "./step-item/step-item"
+ },
+ "path": "./steps/steps"
+ },
+ "t-sticky": {
+ "key": "t-sticky",
+ "label": "鍚搁《瀹瑰櫒",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-sticky.png",
+ "properties": [
+ {
+ "key": "container",
+ "type": ["String"],
+ "desc": "鍑芥暟杩斿洖瀹瑰櫒瀵瑰簲鐨� NodesRef 鑺傜偣锛屽皢瀵瑰簲鑺傜偣鎸囧畾涓虹粍浠剁殑澶栭儴瀹瑰櫒锛屾粴鍔ㄦ椂缁勪欢浼氬缁堜繚鎸佸湪瀹瑰櫒鑼冨洿鍐咃紝褰撶粍浠跺嵆灏嗚秴鍑哄鍣ㄥ簳閮ㄦ椂锛屼細杩斿洖鍘熶綅缃��",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤缁勪欢",
+ "label": ""
+ },
+ {
+ "key": "offsetTop",
+ "type": ["String", "Number"],
+ "desc": "鍚搁《鏃朵笌椤堕儴鐨勮窛绂伙紝鍗曚綅`px`",
+ "label": ""
+ },
+ {
+ "key": "zIndex",
+ "type": ["Number"],
+ "desc": "鍚搁《鏃剁殑 z-index",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:scroll",
+ "desc": "婊氬姩鏃惰Е鍙戯紝scrollTop: 璺濈椤堕儴浣嶇疆锛宨sFixed: 鏄惁鍚搁《",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-sticky></t-sticky>",
+ "path": "./sticky/sticky"
+ },
+ "t-swipe-cell": {
+ "key": "t-swipe-cell",
+ "label": "婊戝姩鎿嶄綔",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-swipecell.png",
+ "properties": [
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤婊戝姩",
+ "label": ""
+ },
+ {
+ "key": "expanded",
+ "type": ["String"],
+ "desc": "鎿嶄綔椤规槸鍚﹀憟鐜颁负鎵撳紑鎬�",
+ "label": ""
+ },
+ {
+ "key": "left",
+ "type": ["Array"],
+ "desc": "宸︿晶婊戝姩鎿嶄綔椤广�傛墍鏈夎涓哄悓 `right`",
+ "label": ""
+ },
+ {
+ "key": "right",
+ "type": ["Array"],
+ "desc": "鍙充晶婊戝姩鎿嶄綔椤广�傛湁涓ょ瀹氫箟鏂瑰紡锛屼竴绉嶆槸浣跨敤鏁扮粍锛屼簩绉嶆槸浣跨敤鎻掓Ы銆俙right.text` 琛ㄧず鎿嶄綔鏂囨湰锛宍right.className` 琛ㄧず鎿嶄綔椤圭被鍚嶏紝`right.style` 琛ㄧず鎿嶄綔椤规牱寮忥紝`right.onClick` 琛ㄧず鐐瑰嚮鎿嶄綔椤瑰悗鎵ц鐨勫洖璋冨嚱鏁般�傜ず渚嬶細`[{ text: '鍒犻櫎', style: 'background-color: red', onClick: () => {} }]`",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "鎿嶄綔椤圭偣鍑绘椂瑙﹀彂锛堟彃妲藉啓娉曠粍浠朵笉瑙﹀彂锛屼笟鍔′晶鑷畾涔夊唴瀹瑰拰浜嬩欢锛�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-swipe-cell><t-cell title=\"鍒楄〃-宸︽粦鍗曟搷浣淺" note=\"杈呭姪淇℃伅\" /><view slot=\"right\">鍒犻櫎</view></t-swipe-cell>",
+ "require": {
+ "t-cell": "./cell/cell"
+ },
+ "path": "./swipe-cell/swipe-cell"
+ },
+ "t-swiper": {
+ "key": "t-swiper",
+ "label": "杞挱",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-swiper.png",
+ "properties": [
+ {
+ "key": "animation",
+ "type": ["String"],
+ "desc": "杞挱鍒囨崲鍔ㄧ敾鏁堟灉绫诲瀷",
+ "label": ""
+ },
+ {
+ "key": "autoplay",
+ "type": ["Boolean"],
+ "desc": "鏄惁鑷姩鎾斁",
+ "label": ""
+ },
+ {
+ "key": "current",
+ "type": ["Number"],
+ "desc": "褰撳墠杞挱鍦ㄥ摢涓�椤癸紙涓嬫爣锛�",
+ "label": ""
+ },
+ {
+ "key": "direction",
+ "type": ["String"],
+ "desc": "杞挱婊戝姩鏂瑰悜锛屽寘鎷í鍚戞粦鍔ㄥ拰绾靛悜婊戝姩涓や釜鏂瑰悜",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "婊戝姩鍔ㄧ敾鏃堕暱",
+ "label": ""
+ },
+ {
+ "key": "height",
+ "type": ["Number"],
+ "desc": "褰撲娇鐢ㄥ瀭鐩存柟鍚戞粴鍔ㄦ椂鐨勯珮搴�",
+ "label": ""
+ },
+ {
+ "key": "interval",
+ "type": ["Number"],
+ "desc": "杞挱闂撮殧鏃堕棿",
+ "label": ""
+ },
+ {
+ "key": "loop",
+ "type": ["Boolean"],
+ "desc": "鏄惁寰幆鎾斁",
+ "label": ""
+ },
+ {
+ "key": "navigation",
+ "type": ["Object"],
+ "desc": "瀵艰埅鍣ㄥ叏閮ㄩ厤缃�",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "杞挱鍒囨崲鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-swiper current=\"{{1}}\" autoplay=\"{{true}}\" duration=\"{{500}}\" interval=\"{{5000}}\" navigation><t-swiper-item wx:for=\"{{[{image: 'https://tdesign.gtimg.com/site/swiper/01.png'},{image: 'https://tdesign.gtimg.com/site/swiper/02.png'}]}}\" wx:key=\"index\"><image src=\"{{item.image}}\" style=\"width: 100%; height: 100%\" /></t-swiper-item></t-swiper>",
+ "require": {
+ "t-swiper-item": "./swiper/swiper-item"
+ },
+ "path": "./swiper/swiper"
+ },
+ "t-switch": {
+ "key": "t-switch",
+ "label": "寮�鍏�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-switch.png",
+ "properties": [
+ {
+ "key": "colors",
+ "type": ["Array"],
+ "desc": "鑷畾涔夐鑹诧紝[鎵撳紑鏃剁殑棰滆壊锛屽叧闂椂鐨勯鑹瞉銆傜粍浠堕粯璁ら鑹蹭负 ['#0052d9', 'rgba(0, 0, 0, .26']銆傜ず渚嬶細[blue, gray]",
+ "label": ""
+ },
+ {
+ "key": "customValue",
+ "type": ["Array"],
+ "desc": "寮�鍏冲唴瀹癸紝[鎵撳紑鏃剁殑鍊硷紝鍏抽棴鏃剁殑鍊糫銆傞粯璁や负 [true, false]銆傜ず渚嬶細[1, 0]",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤缁勪欢",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "寮�鍏崇殑鏍囩",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["Boolean"],
+ "desc": "鏄惁澶勪簬鍔犺浇涓姸鎬�",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "寮�鍏冲昂瀵�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number", "Boolean"],
+ "desc": "寮�鍏冲��",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "鏁版嵁鍙戠敓鍙樺寲鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-switch defaultValue=\"{{true}}\" />",
+ "path": "./switch/switch"
+ },
+ "t-tab-bar-item": {
+ "key": "t-tab-bar-item",
+ "label": "鏍囩鏍忛�夐」",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabbar.png",
+ "properties": [
+ {
+ "key": "badgeProps",
+ "type": ["Object"],
+ "desc": "鍥炬爣鍙充笂瑙掓彁绀轰俊鎭�",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鍥炬爣鍚嶇О",
+ "label": ""
+ },
+ {
+ "key": "subTabBar",
+ "type": ["Array"],
+ "desc": "浜岀骇鑿滃崟",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "鏍囪瘑绗�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-tab-bar-item wx:for=\"{{[{value: 'label_1',label: '鏍囩鏍忎竴',icon: 'app'},{value: 'label_2',label: '鏍囩鏍忎簩',icon: 'app'}]}}\" wx:for-item=\"item\" wx:for-index=\"index\" wx:key=\"index\" value=\"{{item.value}}\">{{item.label}}</t-tab-bar-item>",
+ "path": "./tab-bar-item/tab-bar-item"
+ },
+ "t-tab-bar": {
+ "key": "t-tab-bar",
+ "label": "鏍囩鏍�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabbar.png",
+ "properties": [
+ {
+ "key": "bordered",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず澶栬竟妗�",
+ "label": ""
+ },
+ {
+ "key": "color",
+ "type": ["Array"],
+ "desc": "鏍囩棰滆壊璁剧疆銆傜ず渚嬶細[閫変腑鏍囩鐨勯鑹�, 鏈�変腑鐨勬爣绛鹃鑹瞉",
+ "label": ""
+ },
+ {
+ "key": "fixed",
+ "type": ["Boolean"],
+ "desc": "鏄惁鍥哄畾鍦ㄥ簳閮�",
+ "label": ""
+ },
+ {
+ "key": "safeAreaInsetBottom",
+ "type": ["Boolean"],
+ "desc": "鏄惁涓� iPhoneX 鐣欏嚭搴曢儴瀹夊叏璺濈",
+ "label": ""
+ },
+ {
+ "key": "split",
+ "type": ["Boolean"],
+ "desc": "鏄惁闇�瑕佸垎鍓茬嚎",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number", "Array"],
+ "desc": "褰撳墠閫変腑鏍囩鐨勭储寮�",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "閫変腑鏍囩鍒囨崲鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-tab-bar value=\"label_1\"><t-tab-bar-item wx:for=\"{{[{value: 'label_1',label: '鏍囩鏍忎竴',icon: 'app'},{value: 'label_2',label: '鏍囩鏍忎簩',icon: 'app'}]}}\" wx:for-item=\"item\" wx:for-index=\"index\" wx:key=\"index\" value=\"{{item.value}}\">{{item.label}}</t-tab-bar-item></t-tab-bar>",
+ "require": {
+ "t-tab-bar-item": "./tab-bar-item/tab-bar-item"
+ },
+ "path": "./tab-bar/tab-bar"
+ },
+ "t-tab-panel": {
+ "key": "t-tab-panel",
+ "label": "閫夐」鍗¢潰鏉�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabs.png",
+ "properties": [
+ {
+ "key": "destroyOnHide",
+ "type": ["Boolean"],
+ "desc": "閫夐」鍗″唴瀹归殣钘忔椂鏄惁閿�姣�",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤褰撳墠閫夐」鍗�",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "閫夐」鍗″悕绉�",
+ "label": ""
+ },
+ {
+ "key": "panel",
+ "type": ["String"],
+ "desc": "鐢ㄤ簬鑷畾涔夐�夐」鍗¢潰鏉垮唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "閫夐」鍗$殑鍊硷紝鍞竴鏍囪瘑",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-tab-panel label=\"鏍囩椤典竴\" value=\"0\">鏍囩涓�鍐呭</t-tab-panel>",
+ "path": "./tab-panel/tab-panel"
+ },
+ "t-tabs": {
+ "key": "t-tabs",
+ "label": "閫夐」鍗�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabs.png",
+ "properties": [
+ {
+ "key": "animation",
+ "type": ["Object"],
+ "desc": "鍔ㄧ敾鏁堟灉璁剧疆銆傚叾涓� duration 琛ㄧず鍔ㄧ敾鏃堕暱",
+ "label": ""
+ },
+ {
+ "key": "placement",
+ "type": ["String"],
+ "desc": "閫夐」鍗′綅缃�",
+ "label": ""
+ },
+ {
+ "key": "showBottomLine",
+ "type": ["Boolean"],
+ "desc": "鏄惁灞曠ず搴曢儴婵�娲荤嚎鏉�",
+ "label": ""
+ },
+ {
+ "key": "stickyProps",
+ "type": ["Object"],
+ "desc": "鏄惁鏀寔鍚搁《",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String", "Number"],
+ "desc": "婵�娲荤殑閫夐」鍗″��",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-item", "t-class-active", "t-class-track"],
+ "events": [
+ {
+ "key": "bind:change",
+ "desc": "婵�娲荤殑閫夐」鍗″彂鐢熷彉鍖栨椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-tabs defaultValue=\"{{0}}\"><t-tab-panel label=\"鏍囩椤典竴\" value=\"0\">鏍囩涓�鍐呭</t-tab-panel><t-tab-panel label=\"鏍囩椤典簩\" value=\"1\">鏍囩浜屽唴瀹�</t-tab-panel></t-tabs>",
+ "require": {
+ "t-tab-panel": "./tab-panel/tab-panel"
+ },
+ "path": "./tabs/tabs"
+ },
+ "t-tag": {
+ "key": "t-tag",
+ "label": "鏍囩",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tag.png",
+ "properties": [
+ {
+ "key": "closable",
+ "type": ["Boolean"],
+ "desc": "鏍囩鏄惁鍙叧闂�",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏍囩绂佺敤鎬侊紝澶辨晥鏍囩涓嶈兘瑙﹀彂浜嬩欢銆傞粯璁ら鏍硷紙theme=default锛夋墠鏈夌鐢ㄦ��",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鏍囩涓殑鍥炬爣锛屽彲鑷畾涔夊浘鏍囧憟鐜�",
+ "label": ""
+ },
+ {
+ "key": "maxWidth",
+ "type": ["String", "Number"],
+ "desc": "鏍囩鏈�澶у搴︼紝瀹藉害瓒呭嚭鍚庝細鍑虹幇鐪佺暐鍙枫�傜ず渚嬶細'50px' / 80",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "desc": "鏍囩绫诲瀷锛屾湁涓夌锛氭柟褰€�佸渾瑙掓柟褰€�佹爣璁板瀷",
+ "label": ""
+ },
+ {
+ "key": "size",
+ "type": ["String"],
+ "desc": "鏍囩灏哄",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "缁勪欢椋庢牸锛岀敤浜庢弿杩扮粍浠朵笉鍚岀殑搴旂敤鍦烘櫙",
+ "label": ""
+ },
+ {
+ "key": "variant",
+ "type": ["String"],
+ "desc": "鏍囩椋庢牸鍙樹綋",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "events": [
+ {
+ "key": "bind:click",
+ "desc": "鐐瑰嚮鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:close",
+ "desc": "濡傛灉鍏抽棴鎸夐挳瀛樺湪锛岀偣鍑诲叧闂寜閽椂瑙﹀彂",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-tag theme=\"primary\">閲嶈</t-tag>",
+ "path": "./tag/tag"
+ },
+ "t-textarea": {
+ "key": "t-textarea",
+ "label": "鏂囨湰杈撳叆妗�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-textarea.png",
+ "properties": [
+ {
+ "key": "adjustPosition",
+ "type": ["Boolean"],
+ "desc": "閿洏寮硅捣鏃讹紝鏄惁鑷姩涓婃帹椤甸潰",
+ "label": ""
+ },
+ {
+ "key": "autofocus",
+ "type": ["Boolean"],
+ "desc": "鑷姩鑱氱劍锛屾媺璧烽敭鐩�",
+ "label": ""
+ },
+ {
+ "key": "autosize",
+ "type": ["Boolean"],
+ "desc": "鏄惁鑷姩澧為珮锛屽�间负 autosize 鏃讹紝style.height 涓嶇敓鏁�",
+ "label": ""
+ },
+ {
+ "key": "confirmHold",
+ "type": ["Boolean"],
+ "desc": "鐐瑰嚮閿洏鍙充笅瑙掓寜閽椂鏄惁淇濇寔閿洏涓嶆敹璧风偣",
+ "label": ""
+ },
+ {
+ "key": "confirmType",
+ "type": ["String"],
+ "desc": "璁剧疆閿洏鍙充笅瑙掓寜閽殑鏂囧瓧锛屼粎鍦� type='text'鏃剁敓鏁�",
+ "label": ""
+ },
+ {
+ "key": "disabled",
+ "type": ["Boolean"],
+ "desc": "鏄惁绂佺敤鏂囨湰妗�",
+ "label": ""
+ },
+ {
+ "key": "focus",
+ "type": ["Boolean"],
+ "desc": "鑷姩鑱氱劍",
+ "label": ""
+ },
+ {
+ "key": "label",
+ "type": ["String"],
+ "desc": "宸︿晶鏂囨湰",
+ "label": ""
+ },
+ {
+ "key": "maxcharacter",
+ "type": ["Number"],
+ "desc": "鐢ㄦ埛鏈�澶氬彲浠ヨ緭鍏ョ殑瀛楃涓暟锛屼竴涓腑鏂囨眽瀛楄〃绀轰袱涓瓧绗﹂暱搴�",
+ "label": ""
+ },
+ {
+ "key": "maxlength",
+ "type": ["Number"],
+ "desc": "鐢ㄦ埛鏈�澶氬彲浠ヨ緭鍏ョ殑瀛楃涓暟",
+ "label": ""
+ },
+ {
+ "key": "placeholder",
+ "type": ["String"],
+ "desc": "鍗犱綅绗�",
+ "label": ""
+ },
+ {
+ "key": "value",
+ "type": ["String"],
+ "desc": "鏂囨湰妗嗗��",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class", "t-class-textarea", "t-class-placeholder", "t-class-name"],
+ "events": [
+ {
+ "key": "bind:blur",
+ "desc": "澶卞幓鐒︾偣鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:change",
+ "desc": "杈撳叆鍐呭鍙樺寲鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:enter",
+ "desc": "鐐瑰嚮瀹屾垚鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:focus",
+ "desc": "鑾峰緱鐒︾偣鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:line-change",
+ "desc": "琛岄珮鍙戠敓鍙樺寲鏃惰Е鍙�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-textarea />",
+ "path": "./textarea/textarea"
+ },
+ "t-toast": {
+ "key": "t-toast",
+ "label": "杞绘彁绀�",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-toast.png",
+ "properties": [
+ {
+ "key": "direction",
+ "type": ["String"],
+ "desc": "鍥炬爣鎺掑垪鏂瑰紡",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "寮圭獥鏄剧ず姣鏁�",
+ "label": ""
+ },
+ {
+ "key": "icon",
+ "type": ["String"],
+ "desc": "鑷畾涔夊浘鏍�",
+ "label": ""
+ },
+ {
+ "key": "message",
+ "type": ["String"],
+ "desc": "寮圭獥鏄剧ず鏂囧瓧",
+ "label": ""
+ },
+ {
+ "key": "overlayProps",
+ "type": ["Object"],
+ "desc": "閬僵灞傚睘鎬э紝閫忎紶鑷� Overlay",
+ "label": ""
+ },
+ {
+ "key": "placement",
+ "type": ["String"],
+ "desc": "寮圭獥灞曠ず浣嶇疆",
+ "label": ""
+ },
+ {
+ "key": "preventScrollThrough",
+ "type": ["Boolean"],
+ "desc": "闃叉婊氬姩绌块�忥紝鍗充笉鍏佽鐐瑰嚮鍜屾粴鍔�",
+ "label": ""
+ },
+ {
+ "key": "showOverlay",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず閬僵灞�",
+ "label": ""
+ },
+ {
+ "key": "theme",
+ "type": ["String"],
+ "desc": "鎻愮ず绫诲瀷",
+ "label": ""
+ }
+ ],
+ "externalClasses": ["t-class"],
+ "tpl": "<t-toast id=\"t-toast\" />",
+ "path": "./toast/toast"
+ },
+ "t-transition": {
+ "key": "t-transition",
+ "label": "鍔ㄧ敾",
+ "icon": "",
+ "properties": [
+ {
+ "key": "appear",
+ "type": ["Boolean"],
+ "desc": "棣栨鍑虹幇鏄惁灞曠ず鍔ㄧ敾",
+ "label": ""
+ },
+ {
+ "key": "customClass",
+ "type": ["String"],
+ "desc": "鑷畾涔夊鍣ㄧ被鍚�",
+ "label": ""
+ },
+ {
+ "key": "destoryOnClose",
+ "type": ["Boolean"],
+ "desc": "闅愯棌鏃舵槸鍚﹂攢姣佸唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "duration",
+ "type": ["Number"],
+ "desc": "鎸囧畾杩囨浮鏃堕棿",
+ "label": ""
+ },
+ {
+ "key": "name",
+ "type": ["String"],
+ "desc": "杩囨浮绫诲悕",
+ "label": ""
+ },
+ {
+ "key": "visible",
+ "type": ["Boolean"],
+ "desc": "鏄惁鏄剧ず",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-transition visible appear></t-transition>",
+ "path": "./transition/transition"
+ },
+ "t-upload": {
+ "key": "t-upload",
+ "label": "涓婁紶",
+ "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-upload.png",
+ "properties": [
+ {
+ "key": "addContent",
+ "type": ["String"],
+ "desc": "娣诲姞鎸夐挳鍐呭銆傚�间负绌猴紝浣跨敤榛樿鍥炬爣娓叉煋锛涘�间负 slot 鍒欒〃绀轰娇鐢ㄦ彃妲芥覆鏌擄紱鍏朵粬鍊兼棤鏁堛��",
+ "label": ""
+ },
+ {
+ "key": "allowUploadDuplicateFile",
+ "type": ["Boolean"],
+ "desc": "鏄惁鍏佽閲嶅涓婁紶鐩稿悓鏂囦欢鍚嶇殑鏂囦欢",
+ "label": ""
+ },
+ {
+ "key": "config",
+ "type": ["Object"],
+ "desc": "鍥剧墖涓婁紶閰嶇疆锛岃棰戜笂浼犻厤缃紝鏂囦欢涓婁紶閰嶇疆绛夛紝鍖呭惈鍥剧墖灏哄銆佸浘鐗囨潵婧愩�佽棰戞潵婧愩�佽棰戞媿鎽勬渶闀挎椂闂寸瓑銆傛洿澶氱粏鑺傛煡鐪嬪皬绋嬪簭瀹樼綉銆俒鍥剧墖涓婁紶](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html)銆俒瑙嗛涓婁紶](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html)",
+ "label": ""
+ },
+ {
+ "key": "deleteBtn",
+ "type": ["String"],
+ "desc": "鍒犻櫎鍥炬爣銆傚�间负绌猴紝浣跨敤榛樿鍥炬爣娓叉煋锛涘�间负 slot 鍒欒〃绀轰娇鐢ㄦ彃妲芥覆鏌擄紱鍏朵粬鍊兼棤鏁堛��",
+ "label": ""
+ },
+ {
+ "key": "fileListDisplay",
+ "type": ["String"],
+ "desc": "鐢ㄤ簬瀹屽叏鑷畾涔夋枃浠跺垪琛ㄥ唴瀹�",
+ "label": ""
+ },
+ {
+ "key": "files",
+ "type": ["Array"],
+ "desc": "宸蹭笂浼犳枃浠跺垪琛�",
+ "label": ""
+ },
+ {
+ "key": "gridConfig",
+ "type": ["Object"],
+ "desc": "upload缁勪欢姣忚涓婁紶鍥剧墖鍒楁暟浠ュ強鍥剧墖鐨勫搴﹀拰楂樺害",
+ "label": ""
+ },
+ {
+ "key": "gutter",
+ "type": ["Number"],
+ "desc": "棰勮绐楁牸鐨� `gutter` 澶у皬锛屽崟浣� rpx",
+ "label": ""
+ },
+ {
+ "key": "imageProps",
+ "type": ["Object"],
+ "desc": "閫忎紶 Image 缁勪欢鍏ㄩ儴灞炴��",
+ "label": ""
+ },
+ {
+ "key": "max",
+ "type": ["Number"],
+ "desc": "鐢ㄤ簬鎺у埗鏂囦欢涓婁紶鏁伴噺锛屽�间负 0 鍒欎笉闄愬埗",
+ "label": ""
+ },
+ {
+ "key": "mediaType",
+ "type": ["Array"],
+ "desc": "鏀寔涓婁紶鐨勬枃浠剁被鍨嬶紝鍥剧墖鎴栬棰�",
+ "label": ""
+ },
+ {
+ "key": "requestMethod",
+ "type": ["String"],
+ "desc": "鑷畾涔変笂浼犳柟娉�",
+ "label": ""
+ },
+ {
+ "key": "sizeLimit",
+ "type": ["Number", "Object"],
+ "desc": "鍥剧墖鏂囦欢澶у皬闄愬埗锛屽崟浣� KB銆傚彲閫夊崟浣嶆湁锛歚'B' | 'KB' | 'MB' | 'GB'`銆傜ず渚嬩竴锛歚1000`銆傜ず渚嬩簩锛歚{ size: 2, unit: 'MB', message: '鍥剧墖澶у皬涓嶈秴杩� {sizeLimit} MB' }`",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "bind:add",
+ "desc": "涓婁紶鎴愬姛鍚庤Е鍙戯紝浠呭寘鍚湰娆¢�夋嫨鐨勭収鐗囷紱`url` 琛ㄧず閫夊畾瑙嗛鐨勪复鏃舵枃浠惰矾寰� (鏈湴璺緞)銆俙duration` 琛ㄧず閫夊畾瑙嗛鐨勬椂闂撮暱搴︺�俙size`閫夊畾瑙嗛鐨勬暟鎹噺澶у皬銆傛洿澶氭弿杩板弬鑰� wx.chooseMedia 灏忕▼搴忓畼缃戞弿杩�",
+ "label": ""
+ },
+ {
+ "key": "bind:complete",
+ "desc": "涓婁紶鎴愬姛鎴栧け璐ュ悗瑙﹀彂",
+ "label": ""
+ },
+ {
+ "key": "bind:fail",
+ "desc": "涓婁紶澶辫触鍚庤Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:remove",
+ "desc": "绉婚櫎鏂囦欢鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "bind:select-change",
+ "desc": "閫夋嫨鏂囦欢鎴栧浘鐗囦箣鍚庯紝涓婁紶涔嬪墠锛岃Е鍙戣浜嬩欢銆�<br />`files` 琛ㄧず涔嬪墠宸茬粡涓婁紶瀹屾垚鐨勬枃浠跺垪琛ㄣ��<br />`currentSelectedFiles` 琛ㄧず鏈涓婁紶閫変腑鐨勬枃浠跺垪琛�",
+ "label": ""
+ },
+ {
+ "key": "bind:success",
+ "desc": "涓婁紶鎴愬姛鍚庤Е鍙戯紝鍖呭惈鎵�鏈変笂浼犵殑鏂囦欢锛沗url` 琛ㄧず閫夊畾瑙嗛鐨勪复鏃舵枃浠惰矾寰� (鏈湴璺緞)銆俙duration` 琛ㄧず閫夊畾瑙嗛鐨勬椂闂撮暱搴︺�俙size`閫夊畾瑙嗛鐨勬暟鎹噺澶у皬銆傛洿澶氭弿杩板弬鑰� wx.chooseMedia 灏忕▼搴忓畼缃戞弿杩�",
+ "label": ""
+ }
+ ],
+ "tpl": "<t-upload />",
+ "path": "./upload/upload"
+ }
+ },
+ "common": {
+ "properties": {},
+ "events": {}
+ },
+ "menu": [
+ {
+ "key": "menu-basic",
+ "label": "鍩虹",
+ "submenu": [
+ {
+ "key": "subMenu-button",
+ "label": "Button 鎸夐挳",
+ "components": ["t-button"]
+ },
+ {
+ "key": "subMenu-divider",
+ "label": "Divider 鍒嗗壊绾�",
+ "components": ["t-divider"]
+ },
+ {
+ "key": "subMenu-fab",
+ "label": "Fab 鎮诞鎸夐挳",
+ "components": ["t-fab"]
+ },
+ {
+ "key": "subMenu-icon",
+ "label": "Icon 鍥炬爣",
+ "components": ["t-icon"]
+ }
+ ]
+ },
+ {
+ "key": "menu-nav",
+ "label": "瀵艰埅",
+ "submenu": [
+ {
+ "key": "subMenu-drawer",
+ "label": "Drawer 鎶藉眽",
+ "components": ["t-drawer"]
+ },
+ {
+ "key": "subMenu-indexes",
+ "label": "Indexes 绱㈠紩",
+ "components": ["t-indexes"]
+ },
+ {
+ "key": "subMenu-navbar",
+ "label": "Navbar 瀵艰埅鏉�",
+ "components": ["t-navbar"]
+ },
+ {
+ "key": "subMenu-steps",
+ "label": "Steps 姝ラ鏉�",
+ "components": ["t-steps"]
+ },
+ {
+ "key": "subMenu-tabbar",
+ "label": "TabBar 鏍囩鏍�",
+ "components": ["t-tab-bar"]
+ },
+ {
+ "key": "subMenu-tabs",
+ "label": "Tabs 閫夐」鍗�",
+ "components": ["t-tabs"]
+ }
+ ]
+ },
+ {
+ "key": "menu-input",
+ "label": "杈撳叆",
+ "submenu": [
+ {
+ "key": "subMenu-checkbox",
+ "label": "CheckBox 澶嶉�夋",
+ "components": ["t-checkbox"]
+ },
+ {
+ "key": "subMenu-dateTimePicker",
+ "label": "DateTimePicker 鏃堕棿閫夋嫨鍣�",
+ "components": ["t-date-time-picker"]
+ },
+ {
+ "key": "subMenu-input",
+ "label": "Input 杈撳叆妗�",
+ "components": ["t-input"]
+ },
+ {
+ "key": "subMenu-picker",
+ "label": "Picker 閫夋嫨鍣�",
+ "components": ["t-picker"]
+ },
+ {
+ "key": "subMenu-radio",
+ "label": "Radio 鍗曢�夋",
+ "components": ["t-radio"]
+ },
+ {
+ "key": "subMenu-rate",
+ "label": "Rate 璇勫垎",
+ "components": ["t-rate"]
+ },
+ {
+ "key": "subMenu-search",
+ "label": "Search 鎼滅储妗�",
+ "components": ["t-search"]
+ },
+ {
+ "key": "subMenu-slider",
+ "label": "Slider 婊戝姩閫夋嫨鍣�",
+ "components": ["t-slider"]
+ },
+ {
+ "key": "subMenu-stepper",
+ "label": "Stepper 姝ヨ繘鍣�",
+ "components": ["t-stepper"]
+ },
+ {
+ "key": "subMenu-switch",
+ "label": "Switch 寮�鍏�",
+ "components": ["t-switch"]
+ },
+ {
+ "key": "subMenu-textarea",
+ "label": "Textarea 澶氳鏂囨湰妗�",
+ "components": ["t-textarea"]
+ },
+ {
+ "key": "subMenu-upload",
+ "label": "UpLoad 涓婁紶",
+ "components": ["t-upload"]
+ }
+ ]
+ },
+ {
+ "key": "menu-data",
+ "label": "鏁版嵁灞曠ず",
+ "submenu": [
+ {
+ "key": "subMenu-avatar",
+ "label": "Avatar 澶村儚",
+ "components": ["t-avatar"]
+ },
+ {
+ "key": "subMenu-badge",
+ "label": "Badge 寰芥爣",
+ "components": ["t-badge"]
+ },
+ {
+ "key": "subMenu-cell",
+ "label": "Cell 鍗曞厓鏍�",
+ "components": ["t-cell"]
+ },
+ {
+ "key": "subMenu-collapse",
+ "label": "Collapse 鎶樺彔闈㈡澘",
+ "components": ["t-collapse"]
+ },
+ {
+ "key": "subMenu-dropdown-menu",
+ "label": "DropdownMenu 涓嬫媺鑿滃崟",
+ "components": ["t-dropdown-menu"]
+ },
+ {
+ "key": "subMenu-empty",
+ "label": "Empty 绌虹姸鎬�",
+ "components": ["t-empty"]
+ },
+ {
+ "key": "subMenu-footer",
+ "label": "Footer 椤佃剼",
+ "components": ["t-footer"]
+ },
+ {
+ "key": "subMenu-grid",
+ "label": "Grid 瀹牸",
+ "components": ["t-grid"]
+ },
+ {
+ "key": "subMenu-image",
+ "label": "Image 鍥剧墖",
+ "components": ["t-image"]
+ },
+ {
+ "key": "subMenu-skeleton",
+ "label": "Skeleton 楠ㄦ灦灞�",
+ "components": ["t-skeleton"]
+ },
+ {
+ "key": "subMenu-sticky",
+ "label": "Sticky 鍚搁《瀹瑰櫒",
+ "components": ["t-sticky"]
+ },
+ {
+ "key": "subMenu-swiper",
+ "label": "Swiper 杞挱鍥�",
+ "components": ["t-swiper"]
+ },
+ {
+ "key": "subMenu-tag",
+ "label": "Tag 鏍囩",
+ "components": ["t-tag"]
+ }
+ ]
+ },
+ {
+ "key": "menu-info",
+ "label": "娑堟伅鎻愰啋",
+ "submenu": [
+ {
+ "key": "subMenu-actionsheet",
+ "label": "ActionSheet 鍔ㄤ綔闈㈡澘",
+ "components": ["t-action-sheet"]
+ },
+ {
+ "key": "subMenu-back-top",
+ "label": "BackTop 杩斿洖椤堕儴",
+ "components": ["t-back-top"]
+ },
+ {
+ "key": "subMenu-dialog",
+ "label": "Dialog 寮瑰嚭妗�",
+ "components": ["t-dialog"]
+ },
+ {
+ "key": "subMenu-loading",
+ "label": "Loading 鍔犺浇",
+ "components": ["t-loading"]
+ },
+ {
+ "key": "subMenu-message",
+ "label": "Message 娑堟伅閫氱煡",
+ "components": ["t-message"]
+ },
+ {
+ "key": "subMenu-popup",
+ "label": "Popup 寮瑰嚭灞�",
+ "components": ["t-popup"]
+ },
+ {
+ "key": "subMenu-progress",
+ "label": "Progress 杩涘害鏉�",
+ "components": ["t-progress"]
+ },
+ {
+ "key": "subMenu-pullDownRefresh",
+ "label": "PullDownRefresh 涓嬫媺鍒锋柊",
+ "components": ["t-pull-down-refresh"]
+ },
+ {
+ "key": "subMenu-swipeCell",
+ "label": "SwipeCell 婊戝姩鎿嶄綔",
+ "components": ["t-swipe-cell"]
+ },
+ {
+ "key": "subMenu-toast",
+ "label": "Toast 杞绘彁绀�",
+ "components": ["t-toast"]
+ }
+ ]
+ }
+ ]
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/badge/README.en-US.md
new file mode 100644
index 0000000..f592805
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/README.en-US.md
@@ -0,0 +1,17 @@
+:: BASE_DOC ::
+
+## API
+### Badge Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+color | String | - | \- | N
+content | String | - | \- | N
+count | String / Number / Slot | 0 | \- | N
+dot | Boolean | false | \- | N
+external-classes | Array | - | `['t-class', 't-class-content', 't-class-count']` | N
+max-count | Number | 99 | \- | N
+offset | Array | - | Typescript锛歚Array<string \| number>` | N
+shape | String | circle | options锛歝ircle/round/ribbon/bubble | N
+show-zero | Boolean | false | \- | N
+size | String | medium | options锛歴mall/medium | N
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/README.md b/miniprogram_npm/tdesign-miniprogram/badge/README.md
new file mode 100644
index 0000000..7d1bf08
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/README.md
@@ -0,0 +1,47 @@
+---
+title: Badge 寰芥爣
+description: 鐢ㄤ簬鍛婄煡鐢ㄦ埛锛岃鍖哄煙鐨勭姸鎬佸彉鍖栨垨鑰呭緟澶勭悊浠诲姟鐨勬暟閲忋��
+spline: data
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-100%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-badge": "tdesign-miniprogram/badge/badge"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 缁勪欢绫诲瀷
+
+{{ base }}
+
+### 缁勪欢鏍峰紡
+
+{{ theme }}
+
+### 缁勪欢灏哄
+
+{{ size }}
+
+## API
+### Badge Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+color | String | - | 棰滆壊 | N
+content | String | - | 寰芥爣鍐呭锛岀ず渚嬶細`content='鑷畾涔夊唴瀹�'`銆備篃鍙互浣跨敤榛樿鎻掓Ы瀹氫箟 | N
+count | String / Number / Slot | 0 | 寰芥爣鍙充笂瑙掑唴瀹广�傚彲浠ユ槸鏁板瓧锛屼篃鍙互鏄枃瀛椼�傚锛�'new'/3/99+銆傜壒娈婏細鍊间负绌鸿〃绀轰娇鐢ㄦ彃妲芥覆鏌� | N
+dot | Boolean | false | 鏄惁涓虹孩鐐� | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃灞傚厓绱犮�侀粯璁ゅ唴瀹广�佸彸涓婅鍐呭绛夊厓绱犵被鍚嶃�俙['t-class', 't-class-content', 't-class-count']` | N
+max-count | Number | 99 | 灏侀《鐨勬暟瀛楀�� | N
+offset | Array | - | 璁剧疆鐘舵�佺偣鐨勪綅缃亸绉伙紝绀轰緥锛歔-10, 20] 鎴� ['10em', '8rem']銆俆S 绫诲瀷锛歚Array<string \| number>` | N
+shape | String | circle | 褰㈢姸銆傚彲閫夐」锛歝ircle/round/ribbon/bubble | N
+show-zero | Boolean | false | 褰撴暟鍊间负 0 鏃讹紝鏄惁灞曠ず寰芥爣 | N
+size | String | medium | 灏哄銆傚彲閫夐」锛歴mall/medium | N
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts b/miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts
new file mode 100644
index 0000000..2680a17
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts
@@ -0,0 +1,21 @@
+import { SuperComponent } from '../common/src/index';
+import type { TdBadgeProps } from './type';
+export interface BadgeProps extends TdBadgeProps {
+}
+export default class Badge extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ };
+ externalClasses: string[];
+ properties: TdBadgeProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ value: string;
+ labelID: string;
+ descriptionID: string;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.js b/miniprogram_npm/tdesign-miniprogram/badge/badge.js
new file mode 100644
index 0000000..370a57e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.js
@@ -0,0 +1,43 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { uniqueFactory } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-badge`;
+const getUniqueID = uniqueFactory('badge');
+let Badge = class Badge extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ };
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-count`, `${prefix}-class-content`];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ value: '',
+ labelID: '',
+ descriptionID: '',
+ };
+ this.lifetimes = {
+ ready() {
+ const uniqueID = getUniqueID();
+ this.setData({
+ labelID: `${uniqueID}_label`,
+ descriptionID: `${uniqueID}_description`,
+ });
+ },
+ };
+ }
+};
+Badge = __decorate([
+ wxComponent()
+], Badge);
+export default Badge;
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.json b/miniprogram_npm/tdesign-miniprogram/badge/badge.json
new file mode 100644
index 0000000..a7a3e7a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
+
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.wxml b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxml
new file mode 100644
index 0000000..f669d65
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxml
@@ -0,0 +1,44 @@
+<wxs src="./badge.wxs" module="this" />
+<wxs src="../common/utils.wxs" module="_" />
+
+<!--
+ 1. labelID 鐢ㄤ簬鎻忚堪褰撳墠鍏冪礌鐨勬枃鏈�
+ 2. descriptionID 鐢ㄤ簬鎻忚堪badge娑堟伅鐨勬枃鏈�
+ 3. role=option涓�鑸敤浜庡涓唴瀹瑰悎骞剁劍鐐硅繛缁湕璇�
+-->
+
+<view
+ style="{{_._style([style, customStyle])}}"
+ class="{{this.getBadgeOuterClass({shape})}} class {{prefix}}-class"
+ aria-labelledby="{{labelID}}"
+ aria-describedby="{{descriptionID}}"
+ aria-role="{{ ariaRole || 'option'}}"
+>
+ <view id="{{labelID}}" class="{{classPrefix}}__content {{prefix}}-class-content" aria-hidden="true">
+ <slot wx:if="{{!content}}" class="{{classPrefix}}__content-slot" />
+ <text wx:else class="{{classPrefix}}__content-text">{{content}}</text>
+ </view>
+ <view
+ aria-hidden="true"
+ aria-label="{{ ariaLabel || _.getBadgeAriaLabel({dot, count, maxCount}) }}"
+ wx:if="{{this.isShowBadge({dot,count,showZero})}}"
+ id="{{descriptionID}}"
+ class="{{this.getBadgeInnerClass({dot, size, shape, count})}} {{prefix}}-has-count {{prefix}}-class-count"
+ style="{{this.getBadgeStyles({color, offset})}}"
+ aria-hidden="true"
+ aria-label="{{ ariaLabel || _.getBadgeAriaLabel({dot, count, maxCount}) }}"
+ >
+ <view
+ wx:if="{{shape == 'ribbon'}}"
+ class="t-badge__ribbon--before"
+ style="{{color ? 'border-color: ' + color : ''}}"
+ />
+ {{ this.getBadgeValue({dot, count, maxCount}) }}
+ <view
+ wx:if="{{shape == 'ribbon'}}"
+ class="t-badge__ribbon--after"
+ style="{{color ? 'border-color: ' + color : ''}}"
+ />
+ </view>
+ <slot name="count" />
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.wxs b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxs
new file mode 100644
index 0000000..08db60d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxs
@@ -0,0 +1,70 @@
+var getBadgeValue = function (props) {
+ if (props.dot) {
+ return '';
+ }
+ if (isNaN(props.count) || isNaN(props.maxCount)) {
+ return props.count;
+ }
+ return parseInt(props.count) > props.maxCount ? props.maxCount + '+' : props.count;
+};
+
+var hasUnit = function (unit) {
+ return (
+ unit.indexOf('px') > 0 ||
+ unit.indexOf('rpx') > 0 ||
+ unit.indexOf('em') > 0 ||
+ unit.indexOf('rem') > 0 ||
+ unit.indexOf('%') > 0 ||
+ unit.indexOf('vh') > 0 ||
+ unit.indexOf('vm') > 0
+ );
+};
+
+var getBadgeStyles = function (props) {
+ var styleStr = '';
+ if (props.color) {
+ styleStr += 'background:' + props.color + ';';
+ }
+ if (props.offset[0]) {
+ styleStr += 'right:' + (hasUnit(props.offset[0].toString()) ? props.offset[0] : props.offset[0] + 'px') + ';';
+ }
+ if (props.offset[1]) {
+ styleStr += 'top:' + (hasUnit(props.offset[1].toString()) ? props.offset[1] : props.offset[1] + 'px') + ';';
+ }
+ return styleStr;
+};
+
+var getBadgeOuterClass = function (props) {
+ var baseClass = 't-badge';
+ var classNames = [baseClass, props.shape === 'ribbon' ? baseClass + '__ribbon-outer' : ''];
+ return classNames.join(' ');
+};
+
+var getBadgeInnerClass = function (props) {
+ var baseClass = 't-badge';
+ var classNames = [
+ baseClass + '--basic',
+ props.dot ? baseClass + '--dot' : '',
+ baseClass + '--' + props.size,
+ baseClass + '--' + props.shape,
+ !props.dot && props.count ? baseClass + '--count' : '',
+ ];
+ return classNames.join(' ');
+};
+
+var isShowBadge = function (props) {
+ if (props.dot) {
+ return true;
+ }
+ if (!props.showZero && !isNaN(props.count) && parseInt(props.count) === 0) {
+ return false;
+ }
+ if (props.count == null) return false;
+ return true;
+};
+
+module.exports.getBadgeValue = getBadgeValue;
+module.exports.getBadgeStyles = getBadgeStyles;
+module.exports.getBadgeOuterClass = getBadgeOuterClass;
+module.exports.getBadgeInnerClass = getBadgeInnerClass;
+module.exports.isShowBadge = isShowBadge;
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/badge.wxss b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxss
new file mode 100644
index 0000000..66de8a0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/badge.wxss
@@ -0,0 +1,108 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-badge {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+}
+.t-badge--basic {
+ z-index: 100;
+ padding: 0 var(--td-badge-basic-padding, 8rpx);
+ font-size: var(--td-badge-font-size, var(--td-font-size-xs, var(--td-font-size, 20rpx)));
+ color: var(--td-badge-text-color, var(--td-font-white-1, #ffffff));
+ background-color: var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ text-align: center;
+ height: var(--td-badge-basic-height, 32rpx);
+ line-height: var(--td-badge-basic-height, 32rpx);
+ font-weight: var(--td-badge-font-weight, 600);
+ border-radius: var(--td-badge-border-radius, 4rpx);
+}
+.t-badge--dot {
+ height: var(--td-badge-dot-size, 16rpx);
+ border-radius: 50%;
+ min-width: var(--td-badge-dot-size, 16rpx);
+ padding: 0;
+}
+.t-badge--count {
+ min-width: var(--td-badge-basic-width, 32rpx);
+ white-space: nowrap;
+ box-sizing: border-box;
+}
+.t-badge--circle {
+ border-radius: calc(var(--td-badge-basic-height, 32rpx) / 2);
+}
+.t-badge__ribbon-outer {
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+.t-badge__ribbon--before,
+.t-badge__ribbon--after {
+ content: '';
+ position: absolute;
+ width: 0;
+ height: 0;
+ bottom: 0;
+ border-bottom: var(--td-badge-basic-height, 32rpx) solid var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-badge__ribbon--before {
+ left: calc(-1 * var(--td-badge-basic-height, 32rpx) + 1rpx);
+ border-left: var(--td-badge-basic-height, 32rpx) solid transparent;
+}
+.t-badge__ribbon--after {
+ right: calc(-1 * var(--td-badge-basic-height, 32rpx) + 1rpx);
+ border-right: var(--td-badge-basic-height, 32rpx) solid transparent;
+}
+.t-badge--ribbon {
+ display: inline-block;
+ transform: rotate(45deg);
+ border-radius: 0;
+}
+.t-badge--bubble {
+ border-radius: var(--td-badge-bubble-border-radius, 20rpx 20rpx 20rpx 1px);
+}
+.t-badge--large {
+ font-size: var(--td-badge-large-font-size, var(--td-font-size-s, 24rpx));
+ height: var(--td-badge-large-height, 40rpx);
+ min-width: var(--td-badge-large-height, 40rpx);
+ line-height: var(--td-badge-large-height, 40rpx);
+ padding: 0 var(--td-badge-large-padding, 10rpx);
+}
+.t-badge--large.t-badge--circle {
+ border-radius: calc(var(--td-badge-large-height, 40rpx) / 2);
+}
+.t-badge__content:not(:empty) + .t-has-count {
+ transform: translate(50%, -50%);
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+.t-badge__content-text {
+ display: block;
+ line-height: 48rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/index.d.ts b/miniprogram_npm/tdesign-miniprogram/badge/index.d.ts
new file mode 100644
index 0000000..85b119a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/index.d.ts
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './badge';
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/index.js b/miniprogram_npm/tdesign-miniprogram/badge/index.js
new file mode 100644
index 0000000..85b119a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/index.js
@@ -0,0 +1,3 @@
+export * from './type';
+export * from './props';
+export * from './badge';
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/props.d.ts b/miniprogram_npm/tdesign-miniprogram/badge/props.d.ts
new file mode 100644
index 0000000..e1702ff
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/props.d.ts
@@ -0,0 +1,3 @@
+import { TdBadgeProps } from './type';
+declare const props: TdBadgeProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/props.js b/miniprogram_npm/tdesign-miniprogram/badge/props.js
new file mode 100644
index 0000000..095f798
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/props.js
@@ -0,0 +1,41 @@
+const props = {
+ color: {
+ type: String,
+ value: '',
+ },
+ content: {
+ type: String,
+ value: '',
+ },
+ count: {
+ type: null,
+ value: 0,
+ },
+ dot: {
+ type: Boolean,
+ value: false,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ maxCount: {
+ type: Number,
+ value: 99,
+ },
+ offset: {
+ type: Array,
+ },
+ shape: {
+ type: String,
+ value: 'circle',
+ },
+ showZero: {
+ type: Boolean,
+ value: false,
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/type.d.ts b/miniprogram_npm/tdesign-miniprogram/badge/type.d.ts
new file mode 100644
index 0000000..30f00d0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/type.d.ts
@@ -0,0 +1,46 @@
+export interface TdBadgeProps {
+ color?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ count?: {
+ type: null;
+ value?: string | number;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ dot?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-content', 't-class-count'];
+ };
+ maxCount?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ offset?: {
+ type: ArrayConstructor;
+ value?: Array<string | number>;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'circle' | 'round' | 'ribbon' | 'bubble';
+ };
+ showZero?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: 'small' | 'medium';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/badge/type.js b/miniprogram_npm/tdesign-miniprogram/badge/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/badge/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/button/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/button/README.en-US.md
new file mode 100644
index 0000000..ee2b1d7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/README.en-US.md
@@ -0,0 +1,46 @@
+:: BASE_DOC ::
+
+## API
+### Button Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+block | Boolean | false | make button to be a block-level element | N
+content | String / Slot | - | button's children elements | N
+custom-dataset | Object | - | Typescript锛歚any` | N
+disabled | Boolean | false | disable the button, make it can not be clicked | N
+external-classes | Array | - | `['t-class', 't-class-icon', 't-class-loading']` | N
+ghost | Boolean | false | make background-color to be transparent | N
+icon | String / Object | - | icon name | N
+loading | Boolean | false | set button to be loading state | N
+loading-props | Object | - | Typescript锛歚LoadingProps`锛孾Loading API Documents](./loading?tab=api)銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/button/type.ts) | N
+shape | String | rectangle | button shape銆俹ptions锛歳ectangle/square/round/circle | N
+size | String | medium | a button has three size銆俹ptions锛歴mall/medium/large銆俆ypescript锛歚SizeEnum` | N
+suffix | Slot | - | \- | N
+theme | String | default | button theme銆俹ptions锛歞efault/primary/danger | N
+type | String | - | type of button element, same as formType of Miniprogram銆俹ptions锛歴ubmit/reset | N
+variant | String | base | button variant銆俹ptions锛歜ase/outline/text | N
+open-type | String | - | options锛歝ontact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar | N
+hover-stop-propagation | Boolean | false | \- | N
+hover-start-time | Number | 20 | \- | N
+hover-stay-time | Number | 70 | \- | N
+lang | String | en | options锛歟n/zh_CN/zh_TW | N
+session-from | String | - | \- | N
+send-message-title | String | 褰撳墠鏍囬 | \- | N
+send-message-path | String | 褰撳墠鍒嗕韩璺緞 | \- | N
+send-message-img | String | 鎴浘 | \- | N
+app-parameter | String | - | \- | N
+show-message-card | Boolean | false | \- | N
+bindgetuserinfo | Eventhandle | - | \- | N
+bindcontact | Eventhandle | - | \- | N
+bindgetphonenumber | Eventhandle | - | \- | N
+binderror | Eventhandle | - | \- | N
+bindopensetting | Eventhandle | - | \- | N
+bindlaunchapp | Eventhandle | - | \- | N
+bindchooseavatar | Eventhandle | - | \- | N
+
+### Button Events
+
+name | params | description
+-- | -- | --
+tap | `(e: MouseEvent)` | trigger on click
diff --git a/miniprogram_npm/tdesign-miniprogram/button/README.md b/miniprogram_npm/tdesign-miniprogram/button/README.md
new file mode 100644
index 0000000..937e340
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/README.md
@@ -0,0 +1,107 @@
+---
+title: Button 鎸夐挳
+description: 鐢ㄤ簬寮�鍚竴涓棴鐜殑鎿嶄綔浠诲姟锛屽鈥滃垹闄も�濆璞°�佲�滆喘涔扳�濆晢鍝佺瓑銆�
+spline: base
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-83%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-button": "tdesign-miniprogram/button/button"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 01 缁勪欢绫诲瀷
+
+鍩虹鎸夐挳
+
+{{ base }}
+
+鍥炬爣鎸夐挳
+
+{{ icon-btn }}
+
+骞界伒鎸夐挳
+
+{{ ghost-btn }}
+
+缁勫悎鎸夐挳
+
+{{ group-btn }}
+
+閫氭爮鎸夐挳
+
+{{ block-btn }}
+
+### 02 缁勪欢鐘舵��
+
+鎸夐挳绂佺敤鎬�
+
+{{ disabled }}
+
+### 03 缁勪欢鏍峰紡
+
+鎸夐挳灏哄
+
+{{ size }}
+
+鎸夐挳褰㈢姸
+
+{{ shape }}
+
+鎸夐挳涓婚
+
+{{ theme }}
+
+## API
+### Button Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+block | Boolean | false | 鏄惁涓哄潡绾у厓绱� | N
+content | String / Slot | - | 鎸夐挳鍐呭 | N
+custom-dataset | Object | - | 鑷畾涔� dataset锛屽彲閫氳繃 event.currentTarget.dataset.custom 鑾峰彇銆俆S 绫诲瀷锛歚any` | N
+disabled | Boolean | false | 绂佺敤鐘舵�� | N
+external-classes | Array | - | 缁勪欢绫诲悕銆俙['t-class', 't-class-icon', 't-class-loading']` | N
+ghost | Boolean | false | 鏄惁涓哄菇鐏垫寜閽紙闀傜┖鎸夐挳锛� | N
+icon | String / Object | - | 鍥炬爣鍚嶇О銆傚�间负瀛楃涓茶〃绀哄浘鏍囧悕绉帮紝鍊间负 `Object` 绫诲瀷锛岃〃绀洪�忎紶鑷� `icon`銆� | N
+loading | Boolean | false | 鏄惁鏄剧ず涓哄姞杞界姸鎬� | N
+loading-props | Object | - | 閫忎紶鑷� Loading 缁勪欢銆俆S 绫诲瀷锛歚LoadingProps`锛孾Loading API Documents](./loading?tab=api)銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/button/type.ts) | N
+shape | String | rectangle | 鎸夐挳褰㈢姸锛屾湁 4 绉嶏細闀挎柟褰€�佹鏂瑰舰銆佸渾瑙掗暱鏂瑰舰銆佸渾褰€�傚彲閫夐」锛歳ectangle/square/round/circle | N
+size | String | medium | 缁勪欢灏哄銆傚彲閫夐」锛歟xtra-small/small/medium/large銆俆S 绫诲瀷锛歚SizeEnum` | N
+suffix | Slot | - | 鍙充晶鍐呭锛屽彲鐢ㄤ簬瀹氫箟鍙充晶鍥炬爣 | N
+theme | String | default | 缁勪欢椋庢牸锛屼緷娆′负鍝佺墝鑹层�佸嵄闄╄壊銆傚彲閫夐」锛歞efault/primary/danger/light | N
+type | String | - | 鍚屽皬绋嬪簭鐨� formType銆傚彲閫夐」锛歴ubmit/reset | N
+variant | String | base | 鎸夐挳褰㈠紡锛屽熀纭�銆佺嚎妗嗐�佹枃瀛椼�傚彲閫夐」锛歜ase/outline/dashed/text | N
+open-type | String | - | 寰俊寮�鏀捐兘鍔涖��<br />鍏蜂綋閲婁箟锛�<br />`contact` 鎵撳紑瀹㈡湇浼氳瘽锛屽鏋滅敤鎴峰湪浼氳瘽涓偣鍑绘秷鎭崱鐗囧悗杩斿洖灏忕▼搴忥紝鍙互浠� bindcontact 鍥炶皟涓幏寰楀叿浣撲俊鎭紝<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html">鍏蜂綋璇存槑</a> 锛�*灏忕▼搴忔彃浠朵腑涓嶈兘浣跨敤*锛夛紱<br />`share` 瑙﹀彂鐢ㄦ埛杞彂锛屼娇鐢ㄥ墠寤鸿鍏堥槄璇�<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#浣跨敤鎸囧紩">浣跨敤鎸囧紩</a>锛�<br />`getPhoneNumber` 鑾峰彇鐢ㄦ埛鎵嬫満鍙凤紝鍙互浠� bindgetphonenumber 鍥炶皟涓幏鍙栧埌鐢ㄦ埛淇℃伅锛�<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">鍏蜂綋璇存槑</a> 锛�*灏忕▼搴忔彃浠朵腑涓嶈兘浣跨敤*锛夛紱<br />`getUserInfo` 鑾峰彇鐢ㄦ埛淇℃伅锛屽彲浠ヤ粠 bindgetuserinfo 鍥炶皟涓幏鍙栧埌鐢ㄦ埛淇℃伅 锛�*灏忕▼搴忔彃浠朵腑涓嶈兘浣跨敤*锛夛紱<br />`launchApp` 鎵撳紑APP锛屽彲浠ラ�氳繃 app-parameter 灞炴�ц瀹氬悜 APP 浼犵殑鍙傛暟<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html">鍏蜂綋璇存槑</a>锛�<br />`openSetting` 鎵撳紑鎺堟潈璁剧疆椤碉紱<br />`feedback` 鎵撳紑鈥滄剰瑙佸弽棣堚�濋〉闈紝鐢ㄦ埛鍙彁浜ゅ弽棣堝唴瀹瑰苟涓婁紶<a href="https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html">鏃ュ織</a>锛屽紑鍙戣�呭彲浠ョ櫥褰�<a href="https://mp.weixin.qq.com/">灏忕▼搴忕鐞嗗悗鍙�</a>鍚庤繘鍏ュ乏渚ц彍鍗曗�滃鏈嶅弽棣堚�濋〉闈㈣幏鍙栧埌鍙嶉鍐呭锛�<br />`chooseAvatar` 鑾峰彇鐢ㄦ埛澶村儚锛屽彲浠ヤ粠 bindchooseavatar 鍥炶皟涓幏鍙栧埌澶村儚淇℃伅銆�<br />[灏忕▼搴忓畼鏂规枃妗(https://developers.weixin.qq.com/miniprogram/dev/component/button.html)銆傚彲閫夐」锛歝ontact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar | N
+hover-class | String | '' | 鎸囧畾鎸夐挳鎸変笅鍘荤殑鏍峰紡绫伙紝鎸夐挳涓嶄负鍔犺浇鎴栫鐢ㄧ姸鎬佹椂鏈夋晥銆傚綋 `hover-class="none"` 鏃讹紝娌℃湁鐐瑰嚮鎬佹晥鏋� | N
+hover-stop-propagation | Boolean | false | 鎸囧畾鏄惁闃绘鏈妭鐐圭殑绁栧厛鑺傜偣鍑虹幇鐐瑰嚮鎬� | N
+hover-start-time | Number | 20 | 鎸変綇鍚庡涔呭嚭鐜扮偣鍑绘�侊紝鍗曚綅姣 | N
+hover-stay-time | Number | 70 | 鎵嬫寚鏉惧紑鍚庣偣鍑绘�佷繚鐣欐椂闂达紝鍗曚綅姣 | N
+lang | String | en | 鎸囧畾杩斿洖鐢ㄦ埛淇℃伅鐨勮瑷�锛寊h_CN 绠�浣撲腑鏂囷紝zh_TW 绻佷綋涓枃锛宔n 鑻辨枃銆傘��<br />鍏蜂綋閲婁箟锛�<br />`en` 鑻辨枃锛�<br />`zh_CN` 绠�浣撲腑鏂囷紱<br />`zh_TW` 绻佷綋涓枃銆�<br />[灏忕▼搴忓畼鏂规枃妗(https://developers.weixin.qq.com/miniprogram/dev/component/button.html)銆傚彲閫夐」锛歟n/zh_CN/zh_TW | N
+session-from | String | - | 浼氳瘽鏉ユ簮锛宱pen-type="contact"鏃舵湁鏁� | N
+send-message-title | String | 褰撳墠鏍囬 | 浼氳瘽鍐呮秷鎭崱鐗囨爣棰橈紝open-type="contact"鏃舵湁鏁� | N
+send-message-path | String | 褰撳墠鍒嗕韩璺緞 | 浼氳瘽鍐呮秷鎭崱鐗囩偣鍑昏烦杞皬绋嬪簭璺緞锛宱pen-type="contact"鏃舵湁鏁� | N
+send-message-img | String | 鎴浘 | 浼氳瘽鍐呮秷鎭崱鐗囧浘鐗囷紝open-type="contact"鏃舵湁鏁� | N
+app-parameter | String | - | 鎵撳紑 APP 鏃讹紝鍚� APP 浼犻�掔殑鍙傛暟锛宱pen-type=launchApp鏃舵湁鏁� | N
+show-message-card | Boolean | false | 鏄惁鏄剧ず浼氳瘽鍐呮秷鎭崱鐗囷紝璁剧疆姝ゅ弬鏁颁负 true锛岀敤鎴疯繘鍏ュ鏈嶄細璇濅細鍦ㄥ彸涓嬭鏄剧ず"鍙兘瑕佸彂閫佺殑灏忕▼搴�"鎻愮ず锛岀敤鎴风偣鍑诲悗鍙互蹇�熷彂閫佸皬绋嬪簭娑堟伅锛宱pen-type="contact"鏃舵湁鏁� | N
+bindgetuserinfo | Eventhandle | - | 鐢ㄦ埛鐐瑰嚮璇ユ寜閽椂锛屼細杩斿洖鑾峰彇鍒扮殑鐢ㄦ埛淇℃伅锛屽洖璋冪殑 detail 鏁版嵁涓�<a href="https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html">wx.getUserInfo</a>杩斿洖鐨勪竴鑷达紝open-type="getUserInfo"鏃舵湁鏁� | N
+bindcontact | Eventhandle | - | 瀹㈡湇娑堟伅鍥炶皟锛宱pen-type="contact"鏃舵湁鏁� | N
+bindgetphonenumber | Eventhandle | - | 鑾峰彇鐢ㄦ埛鎵嬫満鍙峰洖璋冿紝open-type=getPhoneNumber鏃舵湁鏁� | N
+binderror | Eventhandle | - | 褰撲娇鐢ㄥ紑鏀捐兘鍔涙椂锛屽彂鐢熼敊璇殑鍥炶皟锛宱pen-type=launchApp鏃舵湁鏁� | N
+bindopensetting | Eventhandle | - | 鍦ㄦ墦寮�鎺堟潈璁剧疆椤靛悗鍥炶皟锛宱pen-type=openSetting鏃舵湁鏁� | N
+bindlaunchapp | Eventhandle | - | 鎵撳紑 APP 鎴愬姛鐨勫洖璋冿紝open-type=launchApp鏃舵湁鏁� | N
+bindchooseavatar | Eventhandle | - | 鑾峰彇鐢ㄦ埛澶村儚鍥炶皟锛宱pen-type=chooseAvatar鏃舵湁鏁� | N
+
+### Button Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+tap | `event` | 鐐瑰嚮鎸夐挳锛屽綋鎸夐挳涓嶄负鍔犺浇鎴栫鐢ㄧ姸鎬佹椂瑙﹀彂
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.d.ts b/miniprogram_npm/tdesign-miniprogram/button/button.d.ts
new file mode 100644
index 0000000..64c6cbe
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.d.ts
@@ -0,0 +1,35 @@
+import { SuperComponent } from '../common/src/index';
+import type { TdButtonProps } from './type';
+export interface ButtonProps extends TdButtonProps {
+}
+export default class Button extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ properties: TdButtonProps;
+ options: {
+ multipleSlots: boolean;
+ };
+ data: {
+ prefix: string;
+ className: string;
+ classPrefix: string;
+ };
+ observers: {
+ 'theme, size, plain, block, shape, disabled, loading'(): void;
+ icon(icon: any): void;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ methods: {
+ setClass(): void;
+ getuserinfo(e: any): void;
+ contact(e: any): void;
+ getphonenumber(e: any): void;
+ error(e: any): void;
+ opensetting(e: any): void;
+ launchapp(e: any): void;
+ chooseavatar(e: any): void;
+ handleTap(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.js b/miniprogram_npm/tdesign-miniprogram/button/button.js
new file mode 100644
index 0000000..c33131a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.js
@@ -0,0 +1,97 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { canIUseFormFieldButton } from '../common/version';
+import { setIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-button`;
+let Button = class Button extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-icon`, `${prefix}-class-loading`];
+ this.behaviors = canIUseFormFieldButton() ? ['wx://form-field-button'] : [];
+ this.properties = props;
+ this.options = {
+ multipleSlots: true,
+ };
+ this.data = {
+ prefix,
+ className: '',
+ classPrefix: name,
+ };
+ this.observers = {
+ 'theme, size, plain, block, shape, disabled, loading'() {
+ this.setClass();
+ },
+ icon(icon) {
+ const obj = setIcon('icon', icon, '');
+ this.setData(Object.assign({}, obj));
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ this.setClass();
+ },
+ };
+ this.methods = {
+ setClass() {
+ const classList = [
+ name,
+ `${prefix}-class`,
+ `${name}--${this.data.variant || 'base'}`,
+ `${name}--${this.data.theme || 'default'}`,
+ `${name}--${this.data.shape || 'rectangle'}`,
+ `${name}--size-${this.data.size || 'medium'}`,
+ ];
+ if (this.data.block) {
+ classList.push(`${name}--block`);
+ }
+ if (this.data.disabled) {
+ classList.push(`${name}--disabled`);
+ }
+ if (this.data.ghost) {
+ classList.push(`${name}--ghost`);
+ }
+ this.setData({
+ className: classList.join(' '),
+ });
+ },
+ getuserinfo(e) {
+ this.triggerEvent('getuserinfo', e.detail);
+ },
+ contact(e) {
+ this.triggerEvent('contact', e.detail);
+ },
+ getphonenumber(e) {
+ this.triggerEvent('getphonenumber', e.detail);
+ },
+ error(e) {
+ this.triggerEvent('error', e.detail);
+ },
+ opensetting(e) {
+ this.triggerEvent('opensetting', e.detail);
+ },
+ launchapp(e) {
+ this.triggerEvent('launchapp', e.detail);
+ },
+ chooseavatar(e) {
+ this.triggerEvent('chooseavatar', e.detail);
+ },
+ handleTap(e) {
+ if (this.data.disabled || this.data.loading)
+ return;
+ this.triggerEvent('tap', e);
+ },
+ };
+ }
+};
+Button = __decorate([
+ wxComponent()
+], Button);
+export default Button;
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.json b/miniprogram_npm/tdesign-miniprogram/button/button.json
new file mode 100644
index 0000000..708bd1b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-loading": "../loading/loading"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.wxml b/miniprogram_npm/tdesign-miniprogram/button/button.wxml
new file mode 100644
index 0000000..eefa0f3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.wxml
@@ -0,0 +1,59 @@
+<import src="../common/template/icon.wxml" />
+<wxs src="../common/utils.wxs" module="_" />
+
+<button
+ style="{{_._style([style, customStyle])}}"
+ data-custom="{{ customDataset }}"
+ class="class {{className}}"
+ form-type="{{type}}"
+ open-type="{{disabled || loading ? '' : openType}}"
+ hover-stop-propagation="{{hoverStopPropagation}}"
+ hover-start-time="{{hoverStartTime}}"
+ hover-stay-time="{{hoverStayTime}}"
+ lang="{{lang}}"
+ session-from="{{sessionFrom}}"
+ hover-class="{{disabled || loading ? '' : (hoverClass || classPrefix + '--hover')}}"
+ send-message-title="{{sendMessageTitle}}"
+ send-message-path="{{sendMessagePath}}"
+ send-message-img="{{sendMessageImg}}"
+ app-parameter="{{appParameter}}"
+ show-message-card="{{showMessageCard}}"
+ catch:tap="handleTap"
+ bind:getuserinfo="getuserinfo"
+ bind:contact="contact"
+ bind:getphonenumber="getphonenumber"
+ bind:error="error"
+ bind:opensetting="opensetting"
+ bind:launchapp="launchapp"
+ bind:chooseavatar="chooseavatar"
+ aria-label="{{ariaLabel}}"
+>
+ <template
+ wx:if="{{iconName || _.isNoEmptyObj(iconData)}}"
+ is="icon"
+ data="{{class: classPrefix + '__icon', tClass: prefix + '-class-icon', ariaHidden: true, name: iconName, ...iconData}}"
+ />
+ <t-loading
+ wx:if="{{loading}}"
+ delay="{{loadingProps.delay || 0}}"
+ duration="{{loadingProps.duration || 800}}"
+ indicator="{{loadingProps.indicator || true}}"
+ inheritColor="{{loadingProps.indicator || false}}"
+ layout="{{loadingProps.layout || 'horizontal'}}"
+ pause="{{loadingProps.pause || false}}"
+ progress="{{loadingProps.progress || 0}}"
+ reverse="{{loadingProps.reverse || false}}"
+ size="{{loadingProps.size || '40rpx'}}"
+ text="{{loadingProps.text || '' }}"
+ theme="{{loadingProps.theme || 'circular'}}"
+ loading
+ t-class="{{classPrefix}}__loading {{classPrefix}}__loading--wrapper"
+ t-class-indicator="{{classPrefix}}__loading--indicator {{prefix}}-class-loading"
+ />
+ <view class="{{classPrefix}}__content">
+ <slot name="content" />
+ <block>{{content}}</block>
+ <slot />
+ </view>
+ <slot name="suffix" />
+</button>
diff --git a/miniprogram_npm/tdesign-miniprogram/button/button.wxss b/miniprogram_npm/tdesign-miniprogram/button/button.wxss
new file mode 100644
index 0000000..3628ff8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/button.wxss
@@ -0,0 +1,451 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-button--size-extra-small {
+ font-size: var(--td-button-extra-small-font-size, var(--td-font-size-base, 28rpx));
+ padding-left: var(--td-button-extra-small-padding-horizontal, 16rpx);
+ padding-right: var(--td-button-extra-small-padding-horizontal, 16rpx);
+ height: var(--td-button-extra-small-height, 56rpx);
+ line-height: var(--td-button-extra-small-height, 56rpx);
+}
+.t-button--size-extra-small .t-button__icon {
+ font-size: var(--td-button-extra-small-icon-font-size, 36rpx);
+}
+.t-button--size-small {
+ font-size: var(--td-button-small-font-size, var(--td-font-size-base, 28rpx));
+ padding-left: var(--td-button-small-padding-horizontal, 24rpx);
+ padding-right: var(--td-button-small-padding-horizontal, 24rpx);
+ height: var(--td-button-small-height, 64rpx);
+ line-height: var(--td-button-small-height, 64rpx);
+}
+.t-button--size-small .t-button__icon {
+ font-size: var(--td-button-small-icon-font-size, 36rpx);
+}
+.t-button--size-medium {
+ font-size: var(--td-button-medium-font-size, var(--td-font-size-m, 32rpx));
+ padding-left: var(--td-button-medium-padding-horizontal, 32rpx);
+ padding-right: var(--td-button-medium-padding-horizontal, 32rpx);
+ height: var(--td-button-medium-height, 80rpx);
+ line-height: var(--td-button-medium-height, 80rpx);
+}
+.t-button--size-medium .t-button__icon {
+ font-size: var(--td-button-medium-icon-font-size, 40rpx);
+}
+.t-button--size-large {
+ font-size: var(--td-button-large-font-size, var(--td-font-size-m, 32rpx));
+ padding-left: var(--td-button-large-padding-horizontal, 40rpx);
+ padding-right: var(--td-button-large-padding-horizontal, 40rpx);
+ height: var(--td-button-large-height, 96rpx);
+ line-height: var(--td-button-large-height, 96rpx);
+}
+.t-button--size-large .t-button__icon {
+ font-size: var(--td-button-large-icon-font-size, 48rpx);
+}
+.t-button--default {
+ color: var(--td-button-default-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ background-color: var(--td-button-default-bg-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--default::after {
+ border-width: var(--td-button-border-width, 4rpx);
+ border-color: var(--td-button-default-border-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--default.t-button--hover {
+ z-index: 0;
+}
+.t-button--default.t-button--hover::after {
+ background-color: var(--td-button-default-active-bg-color, var(--td-bg-color-component-active, var(--td-gray-color-6, #a6a6a6)));
+ border-color: var(--td-button-default-active-border-color, var(--td-bg-color-component-active, var(--td-gray-color-6, #a6a6a6)));
+}
+.t-button--default.t-button--disabled {
+ color: var(--td-button-default-disabled-color, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+ background-color: var(--td-button-default-disabled-bg, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-button--default.t-button--disabled::after {
+ border-color: var(--td-button-default-disabled-border-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-button--primary {
+ color: var(--td-button-primary-color, var(--td-font-white-1, #ffffff));
+ background-color: var(--td-button-primary-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--primary::after {
+ border-width: var(--td-button-border-width, 4rpx);
+ border-color: var(--td-button-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--primary.t-button--hover {
+ z-index: 0;
+}
+.t-button--primary.t-button--hover::after {
+ background-color: var(--td-button-primary-active-bg-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+ border-color: var(--td-button-primary-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--primary.t-button--disabled {
+ color: var(--td-button-primary-disabled-color, var(--td-font-white-1, #ffffff));
+ background-color: var(--td-button-primary-disabled-bg, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--primary.t-button--disabled::after {
+ border-color: var(--td-button-primary-disabled-border-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--light {
+ color: var(--td-button-light-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-button-light-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--light::after {
+ border-width: var(--td-button-border-width, 4rpx);
+ border-color: var(--td-button-light-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--light.t-button--hover {
+ z-index: 0;
+}
+.t-button--light.t-button--hover::after {
+ background-color: var(--td-button-light-active-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
+ border-color: var(--td-button-light-active-border-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
+}
+.t-button--light.t-button--disabled {
+ color: var(--td-button-light-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+ background-color: var(--td-button-light-disabled-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--light.t-button--disabled::after {
+ border-color: var(--td-button-light-disabled-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--danger {
+ color: var(--td-button-danger-color, var(--td-font-white-1, #ffffff));
+ background-color: var(--td-button-danger-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--danger::after {
+ border-width: var(--td-button-border-width, 4rpx);
+ border-color: var(--td-button-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--danger.t-button--hover {
+ z-index: 0;
+}
+.t-button--danger.t-button--hover::after {
+ background-color: var(--td-button-danger-active-bg-color, var(--td-error-color-7, #ad352f));
+ border-color: var(--td-button-danger-active-border-color, var(--td-error-color-7, #ad352f));
+}
+.t-button--danger.t-button--disabled {
+ color: var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff));
+ background-color: var(--td-button-danger-disabled-bg, var(--td-error-color-3, #ffb9b0));
+}
+.t-button--danger.t-button--disabled::after {
+ border-color: var(--td-button-danger-disabled-border-color, var(--td-error-color-3, #ffb9b0));
+}
+.t-button {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+ white-space: nowrap;
+ text-align: center;
+ background-image: none;
+ transition: all 0.3s;
+ touch-action: manipulation;
+ border-radius: var(--td-button-border-radius, var(--td-radius-default, 12rpx));
+ outline: none;
+ font-family: PingFang SC, Microsoft YaHei, Arial Regular;
+ font-weight: var(--td-button-font-weight, 600);
+ vertical-align: top;
+ cursor: pointer;
+ -webkit-tap-highlight-color: transparent;
+ -webkit-user-select: none;
+ user-select: none;
+ /* stylelint-disable-next-line */
+ -webkit-appearance: none;
+}
+.t-button::after {
+ border-radius: calc(var(--td-button-border-radius, var(--td-radius-default, 12rpx)) * 2);
+}
+.t-button--text {
+ color: var(--td-button-default-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ background: none;
+}
+.t-button--text::after {
+ border: 0;
+}
+.t-button--text.t-button--hover::after {
+ background-color: var(--td-button-default-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--text.t-button--primary {
+ color: var(--td-button-primary-text-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background: none;
+}
+.t-button--text.t-button--primary.t-button--hover::after {
+ background-color: var(--td-button-primary-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--text.t-button--primary.t-button--disabled {
+ color: var(--td-button-primary-text-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+ background: none;
+}
+.t-button--text.t-button--danger {
+ color: var(--td-button-danger-text-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+ background: none;
+}
+.t-button--text.t-button--danger.t-button--hover::after {
+ background-color: var(--td-button-danger-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--text.t-button--danger.t-button--disabled {
+ color: var(--td-button-danger-text-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
+ background: none;
+}
+.t-button--text.t-button--light {
+ color: var(--td-button-light-text-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background: none;
+}
+.t-button--text.t-button--light.t-button--hover::after {
+ background-color: var(--td-button-light-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-button--text.t-button--disabled {
+ color: var(--td-button-default-disabled-color, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
+.t-button--ghost {
+ background-color: transparent;
+ color: var(--td-button-ghost-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-button--ghost::after {
+ border-color: var(--td-button-ghost-border-color, var(--td-button-ghost-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))));
+}
+.t-button--ghost.t-button--hover::after {
+ background: none;
+}
+.t-button--ghost.t-button--primary {
+ color: var(--td-button-ghost-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--ghost.t-button--primary::after {
+ border-color: var(--td-button-ghost-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--ghost.t-button--danger {
+ color: var(--td-button-ghost-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--ghost.t-button--danger::after {
+ border-color: var(--td-button-ghost-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--ghost.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-ghost-disabled-color, rgba(255, 255, 255, 0.35));
+}
+.t-button--ghost.t-button--disabled::after {
+ border-color: var(--td-button-ghost-disabled-color, rgba(255, 255, 255, 0.35));
+}
+.t-button--outline {
+ color: var(--td-button-default-outline-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ background-color: transparent;
+}
+.t-button--outline::after {
+ border-color: var(--td-button-default-outline-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--outline.t-button--hover::after {
+ background-color: var(--td-button-default-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-button-default-outline-active-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--outline.t-button--disabled {
+ color: var(--td-button-default-outline-disabled-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--outline.t-button--disabled::after {
+ border-color: var(--td-button-default-outline-disabled-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
+}
+.t-button--outline.t-button--primary {
+ color: var(--td-button-primary-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--outline.t-button--primary::after {
+ border-color: var(--td-button-primary-outline-border-color, var(--td-button-primary-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-button--outline.t-button--primary.t-button--hover {
+ color: var(--td-button-primary-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--outline.t-button--primary.t-button--hover::after {
+ background-color: var(--td-button-primary-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-button-primary-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--outline.t-button--primary.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-primary-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--outline.t-button--primary.t-button--disabled::after {
+ border-color: var(--td-button-primary-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--outline.t-button--danger {
+ color: var(--td-button-danger-outline-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--outline.t-button--danger::after {
+ border-color: var(--td-button-danger-outline-border-color, var(--td-button-danger-outline-color, var(--td-error-color, var(--td-error-color-6, #d54941))));
+}
+.t-button--outline.t-button--danger.t-button--hover {
+ color: var(--td-button-danger-outline-active-border-color, var(--td-error-color-7, #ad352f));
+}
+.t-button--outline.t-button--danger.t-button--hover::after {
+ background-color: var(--td-button-danger-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
+ border-color: var(--td-button-danger-outline-active-border-color, var(--td-error-color-7, #ad352f));
+}
+.t-button--outline.t-button--danger.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-danger-outline-disabled-color, var(--td-error-color-3, #ffb9b0));
+}
+.t-button--outline.t-button--danger.t-button--disabled::after {
+ border-color: var(--td-button-danger-outline-disabled-color, var(--td-error-color-3, #ffb9b0));
+}
+.t-button--outline.t-button--light {
+ color: var(--td-button-light-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-button-light-outline-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-button--outline.t-button--light::after {
+ border-color: var(--td-button-light-outline-border-color, var(--td-button-light-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-button--outline.t-button--light.t-button--hover {
+ color: var(--td-button-light-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--outline.t-button--light.t-button--hover::after {
+ background-color: var(--td-button-light-outline-active-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
+ border-color: var(--td-button-light-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
+}
+.t-button--outline.t-button--light.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-light-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--outline.t-button--light.t-button--disabled::after {
+ border-color: var(--td-button-light-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--dashed {
+ background-color: transparent;
+ border-style: dashed;
+}
+.t-button--dashed.t-button--primary {
+ color: var(--td-button-primary-dashed-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-button--dashed.t-button--primary::after {
+ border-color: var(--td-button-primary-dashed-border-color, var(--td-button-primary-dashed-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-button--dashed.t-button--primary.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-primary-dashed-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--dashed.t-button--primary.t-button--disabled::after {
+ border-color: var(--td-button-primary-dashed-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-button--dashed.t-button--danger {
+ color: var(--td-button-danger-dashed-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-button--dashed.t-button--danger::after {
+ border-color: var(--td-button-danger-dashed-border-color, var(--td-button-danger-dashed-color, var(--td-error-color, var(--td-error-color-6, #d54941))));
+}
+.t-button--dashed.t-button--danger.t-button--disabled {
+ background-color: transparent;
+ color: var(--td-button-danger-dashed-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
+}
+.t-button--dashed.t-button--danger.t-button--disabled::after {
+ border-color: var(--td-button-danger-dashed-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
+}
+.t-button__loading + .t-button__content:not(:empty),
+.t-button__icon + .t-button__content:not(:empty) {
+ margin-left: 8rpx;
+}
+.t-button__icon {
+ border-radius: var(--td-button-icon-border-radius, 8rpx);
+}
+.t-button--round.t-button--size-large {
+ border-radius: calc(var(--td-button-large-height, 96rpx) / 2);
+}
+.t-button--round.t-button--size-large::after {
+ border-radius: var(--td-button-large-height, 96rpx);
+}
+.t-button--round.t-button--size-medium {
+ border-radius: calc(var(--td-button-medium-height, 80rpx) / 2);
+}
+.t-button--round.t-button--size-medium::after {
+ border-radius: var(--td-button-medium-height, 80rpx);
+}
+.t-button--round.t-button--size-small {
+ border-radius: calc(var(--td-button-small-height, 64rpx) / 2);
+}
+.t-button--round.t-button--size-small::after {
+ border-radius: var(--td-button-small-height, 64rpx);
+}
+.t-button--round.t-button--size-extra-small {
+ border-radius: calc(var(--td-button-extra-small-height, 56rpx) / 2);
+}
+.t-button--round.t-button--size-extra-small::after {
+ border-radius: var(--td-button-extra-small-height, 56rpx);
+}
+.t-button--square {
+ padding: 0;
+}
+.t-button--square.t-button--size-large {
+ width: var(--td-button-large-height, 96rpx);
+}
+.t-button--square.t-button--size-medium {
+ width: var(--td-button-medium-height, 80rpx);
+}
+.t-button--square.t-button--size-small {
+ width: var(--td-button-small-height, 64rpx);
+}
+.t-button--square.t-button--size-extra-small {
+ width: var(--td-button-extra-small-height, 56rpx);
+}
+.t-button--circle {
+ padding: 0;
+ border-radius: 50%;
+}
+.t-button--circle.t-button--size-large {
+ width: var(--td-button-large-height, 96rpx);
+}
+.t-button--circle.t-button--size-large::after {
+ border-radius: 50%;
+}
+.t-button--circle.t-button--size-medium {
+ width: var(--td-button-medium-height, 80rpx);
+}
+.t-button--circle.t-button--size-medium::after {
+ border-radius: 50%;
+}
+.t-button--circle.t-button--size-small {
+ width: var(--td-button-small-height, 64rpx);
+}
+.t-button--circle.t-button--size-small::after {
+ border-radius: 50%;
+}
+.t-button--circle.t-button--size-extra-small {
+ width: var(--td-button-extra-small-height, 56rpx);
+}
+.t-button--circle.t-button--size-extra-small::after {
+ border-radius: 50%;
+}
+.t-button--block {
+ display: flex;
+ width: 100%;
+}
+.t-button--disabled {
+ cursor: not-allowed;
+}
+.t-button__loading--wrapper {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-button__loading--indicator {
+ color: var(--td-font-white-1, #ffffff);
+}
+.t-button.t-button--hover::after {
+ z-index: -1;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/button/index.d.ts b/miniprogram_npm/tdesign-miniprogram/button/index.d.ts
new file mode 100644
index 0000000..beb0ad5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './button';
diff --git a/miniprogram_npm/tdesign-miniprogram/button/index.js b/miniprogram_npm/tdesign-miniprogram/button/index.js
new file mode 100644
index 0000000..beb0ad5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './button';
diff --git a/miniprogram_npm/tdesign-miniprogram/button/props.d.ts b/miniprogram_npm/tdesign-miniprogram/button/props.d.ts
new file mode 100644
index 0000000..00dc5fb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/props.d.ts
@@ -0,0 +1,3 @@
+import { TdButtonProps } from './type';
+declare const props: TdButtonProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/button/props.js b/miniprogram_npm/tdesign-miniprogram/button/props.js
new file mode 100644
index 0000000..211af35
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/props.js
@@ -0,0 +1,100 @@
+const props = {
+ block: {
+ type: Boolean,
+ value: false,
+ },
+ content: {
+ type: String,
+ },
+ customDataset: {
+ type: null,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ ghost: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: null,
+ },
+ loading: {
+ type: Boolean,
+ value: false,
+ },
+ loadingProps: {
+ type: Object,
+ },
+ shape: {
+ type: String,
+ value: 'rectangle',
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+ type: {
+ type: String,
+ },
+ variant: {
+ type: String,
+ value: 'base',
+ },
+ openType: {
+ type: String,
+ },
+ hoverClass: {
+ type: String,
+ value: '',
+ },
+ hoverStopPropagation: {
+ type: Boolean,
+ value: false,
+ },
+ hoverStartTime: {
+ type: Number,
+ value: 20,
+ },
+ hoverStayTime: {
+ type: Number,
+ value: 70,
+ },
+ lang: {
+ type: String,
+ value: 'en',
+ },
+ sessionFrom: {
+ type: String,
+ value: '',
+ },
+ sendMessageTitle: {
+ type: String,
+ value: '',
+ },
+ sendMessagePath: {
+ type: String,
+ value: '',
+ },
+ sendMessageImg: {
+ type: String,
+ value: '',
+ },
+ appParameter: {
+ type: String,
+ value: '',
+ },
+ showMessageCard: {
+ type: Boolean,
+ value: false,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/button/type.d.ts b/miniprogram_npm/tdesign-miniprogram/button/type.d.ts
new file mode 100644
index 0000000..884b01f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/type.d.ts
@@ -0,0 +1,108 @@
+import { LoadingProps } from '../loading/index';
+import { SizeEnum } from '../common/common';
+export interface TdButtonProps {
+ block?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ customDataset?: {
+ type: ObjectConstructor;
+ value?: any;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-icon', 't-class-loading'];
+ };
+ ghost?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ loading?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ loadingProps?: {
+ type: ObjectConstructor;
+ value?: LoadingProps;
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'rectangle' | 'square' | 'round' | 'circle';
+ };
+ size?: {
+ type: StringConstructor;
+ value?: SizeEnum;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'primary' | 'danger';
+ };
+ type?: {
+ type: StringConstructor;
+ value?: 'submit' | 'reset';
+ };
+ variant?: {
+ type: StringConstructor;
+ value?: 'base' | 'outline' | 'text';
+ };
+ openType?: {
+ type: StringConstructor;
+ value?: 'contact' | 'share' | 'getPhoneNumber' | 'getUserInfo' | 'launchApp' | 'openSetting' | 'feedback' | 'chooseAvatar';
+ };
+ hoverClass?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ hoverStopPropagation?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ hoverStartTime?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ hoverStayTime?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ lang?: {
+ type: StringConstructor;
+ value?: 'en' | 'zh_CN' | 'zh_TW';
+ };
+ sessionFrom?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ sendMessageTitle?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ sendMessagePath?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ sendMessageImg?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ appParameter?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ showMessageCard?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/button/type.js b/miniprogram_npm/tdesign-miniprogram/button/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/button/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/cell/README.en-US.md
new file mode 100644
index 0000000..ed037d1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/README.en-US.md
@@ -0,0 +1,27 @@
+:: BASE_DOC ::
+
+## API
+### Cell Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+align | String | middle | options锛歵op/middle/bottom | N
+arrow | Boolean | false | \- | N
+bordered | Boolean | true | \- | N
+description | String / Slot | - | \- | N
+external-classes | Array | - | `['t-class', 't-class-title', 't-class-note', 't-class-description', 't-class-thumb', 't-class-hover', 't-class-left', 't-class-right']` | N
+hover | Boolean | - | \- | N
+image | String / Slot | - | \- | N
+jump-type | String | navigateTo | options锛歴witchTab/reLaunch/redirectTo/navigateTo | N
+left-icon | String / Slot | - | \- | N
+note | String / Slot | - | \- | N
+required | Boolean | false | \- | N
+right-icon | String / Slot | - | \- | N
+title | String / Slot | - | \- | N
+url | String | - | \- | N
+
+### Cell Events
+
+name | params | description
+-- | -- | --
+click | - | \-
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/README.md b/miniprogram_npm/tdesign-miniprogram/cell/README.md
new file mode 100644
index 0000000..fda3de0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/README.md
@@ -0,0 +1,74 @@
+---
+title: Cell 鍗曞厓鏍�
+description: 鐢ㄤ簬鍚勪釜绫诲埆琛岀殑淇℃伅灞曠ず銆�
+spline: data
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-100%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-cell": "tdesign-miniprogram/cell/cell"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 绫诲瀷
+
+鍗曡鍗曞厓鏍�
+
+<img src="https://tdesign.gtimg.com/miniprogram/readme/cell-1.png" width="375px" height="50%">
+
+{{ base }}
+
+澶氳鍗曞厓鏍�
+
+<img src="https://tdesign.gtimg.com/miniprogram/readme/cell-2.png" width="375px" height="50%">
+
+{{ multiple }}
+
+### 鏍峰紡
+
+鍗$墖鍗曞厓鏍�
+
+{{ theme }}
+
+## API
+### Cell Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+align | String | middle | 鍐呭鐨勫榻愭柟寮忥紝榛樿灞呬腑瀵归綈銆傚彲閫夐」锛歵op/middle/bottom | N
+arrow | Boolean | false | 鏄惁鏄剧ず鍙充晶绠ご | N
+bordered | Boolean | true | 鏄惁鏄剧ず涓嬭竟妗� | N
+description | String / Slot | - | 涓嬫柟鍐呭鎻忚堪 | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃� 缁勪欢澶栧眰绫诲悕銆佹爣棰樼被鍚嶃�佷笅鏂规弿杩板唴瀹圭被鍚嶃�佸彸渚ц鏄庢枃瀛楃被鍚嶃�佹縺娲绘�佺被鍚嶃�佸浘鐗囩被鍚嶃�佸乏渚у唴瀹广�佸乏渚у浘鏍囩被鍚嶃�佸彸渚у唴瀹广�佸彸渚у浘鏍囩被鍚� 绛夈�俙['t-class', 't-class-title', 't-class-description', 't-class-note', 't-class-hover', 't-class-image', 't-class-left', 't-class-left-icon', 't-class-right', 't-class-right-icon']` | N
+hover | Boolean | - | 鏄惁寮�鍚偣鍑诲弽棣� | N
+image | String / Slot | - | 涓诲浘 | N
+jump-type | String | navigateTo | 閾炬帴璺宠浆绫诲瀷銆傚彲閫夐」锛歴witchTab/reLaunch/redirectTo/navigateTo | N
+left-icon | String / Slot | - | 宸︿晶鍥炬爣锛屽嚭鐜板湪鍗曞厓鏍兼爣棰樼殑宸︿晶 | N
+note | String / Slot | - | 鍜屾爣棰樺悓琛岀殑璇存槑鏂囧瓧 | N
+required | Boolean | false | 鏄惁鏄剧ず琛ㄥ崟蹇呭~鏄熷彿 | N
+right-icon | String / Slot | - | 鏈�鍙充晶鍥炬爣 | N
+title | String / Slot | - | 鏍囬 | N
+url | String | - | 鐐瑰嚮鍚庤烦杞摼鎺ュ湴鍧�銆傚鏋滃�间负绌猴紝鍒欒〃绀轰笉闇�瑕佽烦杞� | N
+
+### Cell Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+click | - | 鍙充晶鍐呭
+
+### CellGroup Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+bordered | Boolean | - | 鏄惁鏄剧ず缁勮竟妗� | N
+external-classes | Array | - | 缁勪欢绫诲悕銆俙['t-class']` | N
+theme | String | default | 鍗曞厓鏍奸鏍笺�傚彲閫夐」锛歞efault/card | N
+title | String | - | 鍗曞厓鏍肩粍鏍囬 | N
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.d.ts b/miniprogram_npm/tdesign-miniprogram/cell/cell.d.ts
new file mode 100644
index 0000000..192b303
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.d.ts
@@ -0,0 +1,16 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Cell extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdCellProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ isLastChild: boolean;
+ };
+ onClick(e: any): void;
+ jumpLink(urlKey?: string, link?: string): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.js b/miniprogram_npm/tdesign-miniprogram/cell/cell.js
new file mode 100644
index 0000000..940b3d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.js
@@ -0,0 +1,57 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-cell`;
+let Cell = class Cell extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-title`,
+ `${prefix}-class-description`,
+ `${prefix}-class-note`,
+ `${prefix}-class-hover`,
+ `${prefix}-class-image`,
+ `${prefix}-class-left`,
+ `${prefix}-class-left-icon`,
+ `${prefix}-class-right`,
+ `${prefix}-class-right-icon`,
+ ];
+ this.relations = {
+ '../cell-group/cell-group': {
+ type: 'parent',
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ isLastChild: false,
+ };
+ }
+ onClick(e) {
+ this.triggerEvent('click', e.detail);
+ this.jumpLink();
+ }
+ jumpLink(urlKey = 'url', link = 'jumpType') {
+ const url = this.data[urlKey];
+ const jumpType = this.data[link];
+ if (url) {
+ wx[jumpType]({ url });
+ }
+ }
+};
+Cell = __decorate([
+ wxComponent()
+], Cell);
+export default Cell;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.json b/miniprogram_npm/tdesign-miniprogram/cell/cell.json
new file mode 100644
index 0000000..9a40e60
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-image": "../image/image"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.wxml b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxml
new file mode 100644
index 0000000..e154869
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxml
@@ -0,0 +1,58 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ style="{{_._style([style, customStyle])}}"
+ class="class {{prefix}}-class {{classPrefix}} {{ !bordered || isLastChild ? classPrefix + '--borderless' : ''}} {{classPrefix}}--{{align}}"
+ hover-class="{{ hover ? classPrefix + '--hover' : ''}}"
+ hover-stay-time="70"
+ bind:tap="onClick"
+ aria-role="{{ariaRole || (arrow ? 'button' : '')}}"
+ aria-label="{{ariaLabel}}"
+>
+ <view class="{{classPrefix}}__left {{prefix}}-class-left">
+ <t-icon
+ wx:if="{{ leftIcon }}"
+ name="{{leftIcon}}"
+ t-class="{{classPrefix}}__left-icon {{prefix}}-class-left-icon"
+ />
+ <slot name="left-icon" />
+ <t-image
+ wx:if="{{ image }}"
+ shape="round"
+ t-class="{{classPrefix}}__left-image {{prefix}}-class-image"
+ src="{{ image }}"
+ />
+ <slot name="image" />
+ </view>
+ <view class="{{classPrefix}}__title">
+ <view class="{{classPrefix}}__title-text {{prefix}}-class-title">
+ <block wx:if="{{ title }}"> {{ title}} </block>
+ <slot name="title" />
+ <block wx:if="{{required}}">
+ <text decode class="{{classPrefix}}--required"> *</text>
+ </block>
+ </view>
+
+ <view class="{{classPrefix}}__description {{prefix}}-class-description">
+ <view wx:if="{{ description }}" class="{{classPrefix}}__description-text">{{description}}</view>
+ <slot name="description" />
+ </view>
+ </view>
+
+ <view class="{{classPrefix}}__note {{prefix}}-class-note">
+ <text wx:if="{{ note }}">{{note}}</text>
+ <slot name="note" />
+ </view>
+
+ <view class="{{classPrefix}}__right {{prefix}}-class-right">
+ <t-icon
+ wx:if="{{ arrow }}"
+ name="chevron-right"
+ t-class="{{classPrefix}}__right-icon {{prefix}}-class-right-icon"
+ />
+ <block wx:else>
+ <t-icon name="{{rightIcon}}" t-class="{{classPrefix}}__right-icon {{prefix}}-class-right-icon" />
+ <slot name="right-icon" />
+ </block>
+ </view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss
new file mode 100644
index 0000000..c094df7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss
@@ -0,0 +1,122 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-cell {
+ position: relative;
+ display: flex;
+ box-sizing: border-box;
+ width: 100%;
+ overflow: hidden;
+ padding: var(--td-cell-vertical-padding, 32rpx) var(--td-cell-horizontal-padding, 32rpx);
+ line-height: var(--td-cell-line-height, 48rpx);
+ height: var(--td-cell-height, auto);
+ background-color: var(--td-cell-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-cell::after {
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ border-bottom: 1px solid var(--td-cell-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+ transform: scaleY(0.5);
+ left: var(--td-border-left-space, var(--td-cell-horizontal-padding, 32rpx));
+ right: var(--td-border-right-space, 0);
+}
+.t-cell--borderless::after {
+ display: none;
+}
+.t-cell__description {
+ font-size: var(--td-cell-description-font-size, var(--td-font-size-base, 28rpx));
+ line-height: var(--td-cell-description-line-height, 44rpx);
+ color: var(--td-cell-description-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
+}
+.t-cell__description-text {
+ margin-top: calc(var(--td-spacer, 16rpx) / 2);
+}
+.t-cell__note {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ color: var(--td-cell-note-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+ font-size: var(--td-cell-note-font-size, var(--td-font-size-m, 32rpx));
+}
+.t-cell__title,
+.t-cell__note {
+ flex: 1 1 auto;
+}
+.t-cell__title:empty,
+.t-cell__note:empty {
+ display: none;
+}
+.t-cell__title-text {
+ display: flex;
+ font-size: var(--td-cell-title-font-size, var(--td-font-size-m, 32rpx));
+ color: var(--td-cell-title-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ font-weight: 400;
+}
+.t-cell__left,
+.t-cell__right {
+ display: flex;
+ align-items: center;
+}
+.t-cell__left:not(:empty) {
+ margin-right: var(--td-spacer, 16rpx);
+}
+.t-cell__left-icon {
+ color: var(--td-cell-left-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ font-size: var(--td-cell-left-icon-font-size, 48rpx);
+}
+.t-cell__left-image {
+ height: var(--td-cell-image-height, 96rpx);
+ width: var(--td-cell-image-width, 96rpx);
+}
+.t-cell__right {
+ margin-left: calc(var(--td-spacer, 16rpx) / 2);
+}
+.t-cell__right-icon {
+ color: var(--td-cell-right-icon-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+ font-size: var(--td-cell-right-icon-font-size, 48rpx);
+}
+.t-cell--hover {
+ background-color: var(--td-cell-hover-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-cell--required {
+ font-size: var(--td-cell-required-font-size, var(--td-font-size-m, 32rpx));
+ color: var(--td-cell-required-color, var(--td-error-color-6, #d54941));
+}
+.t-cell--middle {
+ align-items: center;
+}
+.t-cell--top {
+ align-items: flex-start;
+}
+.t-cell--bottom {
+ align-items: flex-end;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/props.d.ts b/miniprogram_npm/tdesign-miniprogram/cell/props.d.ts
new file mode 100644
index 0000000..ad657e5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCellProps } from './type';
+declare const props: TdCellProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/props.js b/miniprogram_npm/tdesign-miniprogram/cell/props.js
new file mode 100644
index 0000000..8e741e8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/props.js
@@ -0,0 +1,51 @@
+const props = {
+ align: {
+ type: String,
+ value: 'middle',
+ },
+ arrow: {
+ type: Boolean,
+ value: false,
+ },
+ bordered: {
+ type: Boolean,
+ value: true,
+ },
+ description: {
+ type: String,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ hover: {
+ type: Boolean,
+ },
+ image: {
+ type: String,
+ },
+ jumpType: {
+ type: String,
+ value: 'navigateTo',
+ },
+ leftIcon: {
+ type: String,
+ },
+ note: {
+ type: String,
+ },
+ required: {
+ type: Boolean,
+ value: false,
+ },
+ rightIcon: {
+ type: String,
+ },
+ title: {
+ type: String,
+ },
+ url: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/type.d.ts b/miniprogram_npm/tdesign-miniprogram/cell/type.d.ts
new file mode 100644
index 0000000..4dccb9d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/type.d.ts
@@ -0,0 +1,71 @@
+export interface TdCellProps {
+ align?: {
+ type: StringConstructor;
+ value?: 'top' | 'middle' | 'bottom';
+ };
+ arrow?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ bordered?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ description?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: [
+ 't-class',
+ 't-class-title',
+ 't-class-note',
+ 't-class-description',
+ 't-class-thumb',
+ 't-class-hover',
+ 't-class-left',
+ 't-class-right'
+ ];
+ };
+ hover?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ image?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ jumpType?: {
+ type: StringConstructor;
+ value?: 'switchTab' | 'reLaunch' | 'redirectTo' | 'navigateTo';
+ };
+ leftIcon?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ note?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ required?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ rightIcon?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ url?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/type.js b/miniprogram_npm/tdesign-miniprogram/cell/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/cell/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts
new file mode 100644
index 0000000..ab803a6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts
@@ -0,0 +1,69 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class CheckBoxGroup extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ checkboxOptions: any[];
+ };
+ properties: {
+ borderless: {
+ type: BooleanConstructor;
+ value: boolean;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ max?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: import("./type").CheckboxOption[];
+ };
+ value?: {
+ type: ArrayConstructor;
+ value?: import("./type").CheckboxGroupValue;
+ };
+ defaultValue?: {
+ type: ArrayConstructor;
+ value?: import("./type").CheckboxGroupValue;
+ };
+ };
+ observers: {
+ value(): void;
+ options(): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ $checkAll: any;
+ methods: {
+ getChilds(): any;
+ updateChildren(): void;
+ updateValue({ value, checked, checkAll, indeterminate }: {
+ value: any;
+ checked: any;
+ checkAll: any;
+ indeterminate: any;
+ }): void;
+ initWithOptions(): void;
+ handleInnerChildChange(e: any): void;
+ setCheckall(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.js b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.js
new file mode 100644
index 0000000..9d76a0c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.js
@@ -0,0 +1,154 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-checkbox-group`;
+let CheckBoxGroup = class CheckBoxGroup extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.relations = {
+ '../checkbox/checkbox': {
+ type: 'descendant',
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ checkboxOptions: [],
+ };
+ this.properties = Object.assign(Object.assign({}, props), { borderless: {
+ type: Boolean,
+ value: false,
+ } });
+ this.observers = {
+ value() {
+ this.updateChildren();
+ },
+ options() {
+ this.initWithOptions();
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.setCheckall();
+ },
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.$checkAll = null;
+ this.methods = {
+ getChilds() {
+ let items = this.$children;
+ if (!items.length) {
+ items = this.selectAllComponents(`.${prefix}-checkbox-option`);
+ }
+ return items || [];
+ },
+ updateChildren() {
+ const items = this.getChilds();
+ const { value } = this.data;
+ if (items.length > 0) {
+ items.forEach((item) => {
+ !item.data.checkAll &&
+ item.setData({
+ checked: value === null || value === void 0 ? void 0 : value.includes(item.data.value),
+ });
+ });
+ if (items.some((item) => item.data.checkAll)) {
+ this.setCheckall();
+ }
+ }
+ },
+ updateValue({ value, checked, checkAll, indeterminate }) {
+ let { value: newValue } = this.data;
+ const { max } = this.data;
+ const keySet = new Set(this.getChilds().map((item) => item.data.value));
+ newValue = newValue.filter((value) => keySet.has(value));
+ if (max && checked && newValue.length === max)
+ return;
+ if (checkAll) {
+ const items = this.getChilds();
+ newValue =
+ !checked && indeterminate
+ ? items
+ .filter(({ data }) => !(data.disabled && !newValue.includes(data.value)))
+ .map((item) => item.data.value)
+ : items
+ .filter(({ data }) => {
+ if (data.disabled) {
+ return newValue.includes(data.value);
+ }
+ return checked && !data.checkAll;
+ })
+ .map(({ data }) => data.value);
+ }
+ else if (checked) {
+ newValue = newValue.concat(value);
+ }
+ else {
+ const index = newValue.findIndex((v) => v === value);
+ newValue.splice(index, 1);
+ }
+ this._trigger('change', { value: newValue });
+ },
+ initWithOptions() {
+ const { options, value } = this.data;
+ if (!(options === null || options === void 0 ? void 0 : options.length) || !Array.isArray(options))
+ return;
+ const checkboxOptions = options.map((item) => {
+ const isLabel = ['number', 'string'].includes(typeof item);
+ return isLabel
+ ? {
+ label: `${item}`,
+ value: item,
+ checked: value === null || value === void 0 ? void 0 : value.includes(item),
+ }
+ : Object.assign(Object.assign({}, item), { checked: value === null || value === void 0 ? void 0 : value.includes(item.value) });
+ });
+ this.setData({
+ checkboxOptions,
+ });
+ },
+ handleInnerChildChange(e) {
+ var _a;
+ const { item } = e.target.dataset;
+ const { checked } = e.detail;
+ const rect = {};
+ if (item.checkAll) {
+ rect.indeterminate = (_a = this.$checkAll) === null || _a === void 0 ? void 0 : _a.data.indeterminate;
+ }
+ this.updateValue(Object.assign(Object.assign(Object.assign({}, item), { checked }), rect));
+ },
+ setCheckall() {
+ const items = this.getChilds();
+ if (!this.$checkAll) {
+ this.$checkAll = items.find((item) => item.data.checkAll);
+ }
+ if (!this.$checkAll)
+ return;
+ const { value } = this.data;
+ const valueSet = new Set(value.filter((val) => val !== this.$checkAll.data.value));
+ const isCheckall = items.every((item) => (item.data.checkAll ? true : valueSet.has(item.data.value)));
+ this.$checkAll.setData({
+ checked: valueSet.size > 0,
+ indeterminate: !isCheckall,
+ });
+ },
+ };
+ }
+};
+CheckBoxGroup = __decorate([
+ wxComponent()
+], CheckBoxGroup);
+export default CheckBoxGroup;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.json b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.json
new file mode 100644
index 0000000..dc01ceb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-checkbox": "../checkbox/checkbox"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxml b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxml
new file mode 100644
index 0000000..cf9aae8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxml
@@ -0,0 +1,27 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view class="{{ classPrefix }} class {{prefix}}-class" style="{{_._style([style, customStyle])}}">
+ <slot />
+ <block wx:for="{{checkboxOptions}}" wx:key="value">
+ <t-checkbox
+ class="{{prefix}}-checkbox-option"
+ data-item="{{item}}"
+ label="{{item.label || item.text || ''}}"
+ value="{{item.value || ''}}"
+ block="{{item.block || true}}"
+ check-all="{{item.checkAll || false}}"
+ checked="{{item.checked || false}}"
+ content="{{item.content || ''}}"
+ content-disabled="{{item.contentDisabled || false}}"
+ icon="{{item.icon || 'circle'}}"
+ indeterminate="{{item.indeterminate || false}}"
+ disabled="{{item.disabled}}"
+ max-content-row="{{item.maxContentRow || 5}}"
+ max-label-row="{{item.maxLabelRow || 3}}"
+ name="{{item.name || ''}}"
+ readonly="{{item.readonly || false}}"
+ bind:change="handleInnerChildChange"
+ placement="{{item.placement || 'left'}}"
+ />
+ </block>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxss b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/checkbox-group.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.d.ts
new file mode 100644
index 0000000..f6e5bf5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCheckboxGroupProps } from './type';
+declare const props: TdCheckboxGroupProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.js b/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.js
new file mode 100644
index 0000000..9092042
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/props.js
@@ -0,0 +1,31 @@
+const props = {
+ style: {
+ type: String,
+ value: '',
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ max: {
+ type: Number,
+ value: undefined,
+ },
+ name: {
+ type: String,
+ value: '',
+ },
+ options: {
+ type: Array,
+ value: [],
+ },
+ value: {
+ type: Array,
+ value: null,
+ },
+ defaultValue: {
+ type: Array,
+ value: [],
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.d.ts
new file mode 100644
index 0000000..641deb5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.d.ts
@@ -0,0 +1,38 @@
+export interface TdCheckboxGroupProps {
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ max?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ options?: {
+ type: ArrayConstructor;
+ value?: Array<CheckboxOption>;
+ };
+ value?: {
+ type: ArrayConstructor;
+ value?: CheckboxGroupValue;
+ };
+ defaultValue?: {
+ type: ArrayConstructor;
+ value?: CheckboxGroupValue;
+ };
+}
+export declare type CheckboxOption = string | number | CheckboxOptionObj;
+export interface CheckboxOptionObj {
+ label?: string;
+ value?: string | number;
+ disabled?: boolean;
+ checkAll?: true;
+}
+export declare type CheckboxGroupValue = Array<string | number>;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.js b/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox-group/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/checkbox/README.en-US.md
new file mode 100644
index 0000000..9f79403
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/README.en-US.md
@@ -0,0 +1,47 @@
+:: BASE_DOC ::
+
+## API
+### Checkbox Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+placement | String | left | options锛歭eft/right | N
+block | Boolean | true | \- | N
+check-all | Boolean | false | \- | N
+checked | Boolean | false | \- | N
+default-checked | Boolean | undefined | uncontrolled property | N
+content | String / Slot | - | \- | N
+content-disabled | Boolean | - | \- | N
+disabled | Boolean | undefined | \- | N
+external-classes | Array | - | `['t-class', 't-class-icon', 't-class-label', 't-class-content', 't-class-border']` | N
+icon | String / Array | 'circle' | Typescript锛歚'circle' \| 'line' \| 'rectangle' \| string[]` | N
+indeterminate | Boolean | false | \- | N
+label | String / Slot | - | \- | N
+max-content-row | Number | 5 | \- | N
+max-label-row | Number | 3 | \- | N
+name | String | - | \- | N
+readonly | Boolean | false | \- | N
+value | String / Number | - | Typescript锛歚string \| number \| boolean` | N
+
+### Checkbox Events
+
+name | params | description
+-- | -- | --
+change | `(checked: boolean)` | \-
+
+### CheckboxGroup Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+disabled | Boolean | false | \- | N
+max | Number | undefined | \- | N
+name | String | - | \- | N
+options | Array | [] | Typescript锛歚Array<CheckboxOption>` `type CheckboxOption = string \| number \| CheckboxOptionObj` `interface CheckboxOptionObj { label?: string; value?: string \| number; disabled?: boolean; checkAll?: true }`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+value | Array | [] | Typescript锛歚CheckboxGroupValue` `type CheckboxGroupValue = Array<string \| number>`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+default-value | Array | undefined | uncontrolled property銆俆ypescript锛歚CheckboxGroupValue` `type CheckboxGroupValue = Array<string \| number>`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+
+### CheckboxGroup Events
+
+name | params | description
+-- | -- | --
+change | `(value: CheckboxGroupValue, context: CheckboxGroupChangeContext)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts)銆�<br/>`interface CheckboxGroupChangeContext { e: Event; current: string \| number; option: CheckboxOption \| TdCheckboxProps; type: 'check' \| 'uncheck' }`<br/>
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/README.md b/miniprogram_npm/tdesign-miniprogram/checkbox/README.md
new file mode 100644
index 0000000..b046eec
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/README.md
@@ -0,0 +1,106 @@
+---
+title: Checkbox 澶氶�夋
+description: 鐢ㄤ簬棰勮鐨勪竴缁勯�夐」涓墽琛屽椤归�夋嫨锛屽苟鍛堢幇閫夋嫨缁撴灉銆�
+spline: form
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-85%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-87%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-86%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-76%25-red" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
+ "t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 缁勪欢绫诲瀷
+
+绾靛悜澶氶�夋
+
+{{ base }}
+
+妯悜澶氶�夋
+
+{{ horizontal }}
+
+甯﹀叏閫夊閫夋
+
+{{ all }}
+
+### 缁勪欢鐘舵��
+
+澶氶�夋鐘舵��
+
+{{ status }}
+
+### 缁勪欢鏍峰紡
+
+鍕鹃�夋牱寮�
+
+{{ type }}
+
+鍕鹃�夋樉绀轰綅缃�
+
+{{ right }}
+
+闈為�氭爮澶氶�夋牱寮�
+
+{{ card }}
+
+### 缁勪欢瑙勬牸
+
+澶氶�夋灏哄瑙勬牸
+
+{{ special }}
+
+## API
+### Checkbox Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+placement | String | left | 澶氶�夋鍜屽唴瀹圭浉瀵逛綅缃�傚彲閫夐」锛歭eft/right | N
+block | Boolean | true | 鏄惁涓哄潡绾у厓绱� | N
+check-all | Boolean | false | 鐢ㄤ簬鏍囪瘑鏄惁涓恒�屽叏閫夐�夐」銆嶃�傚崟鐙娇鐢ㄦ棤鏁堬紝闇�鍦� CheckboxGroup 涓娇鐢� | N
+checked | Boolean | false | 鏄惁閫変腑 | N
+default-checked | Boolean | undefined | 鏄惁閫変腑銆傞潪鍙楁帶灞炴�� | N
+content | String / Slot | - | 澶氶�夋鍐呭 | N
+content-disabled | Boolean | - | 鏄惁绂佺敤缁勪欢鍐呭锛坈ontent锛夎Е鍙戦�変腑 | N
+disabled | Boolean | undefined | 鏄惁绂佺敤缁勪欢 | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃� 缁勪欢澶栧眰銆佸閫夋鍥炬爣銆佷富鏂囨銆佸唴瀹� 绛夊厓绱犵被鍚嶃�俙['t-class', 't-class-icon', 't-class-label', 't-class-content', 't-class-border']` | N
+icon | String / Array | 'circle' | 鑷畾涔夐�変腑鍥炬爣鍜岄潪閫変腑鍥炬爣銆備娇鐢� Array 鏃惰〃绀猴細`[閫変腑鎬佸浘鏍囷紝闈為�変腑鎬佸浘鏍嘳`銆備娇鐢� String 鏃讹紝鍊间负 circle 琛ㄧず濉厖鍦嗗舰鍥炬爣銆佸�间负 line 琛ㄧず鎻忚竟鍨嬪浘鏍囥�佸�间负 rectangle 琛ㄧず濉厖鐭╁舰鍥炬爣銆俆S 绫诲瀷锛歚'circle' \| 'line' \| 'rectangle' \| string[]` | N
+indeterminate | Boolean | false | 鏄惁涓哄崐閫� | N
+label | String / Slot | - | 涓绘枃妗� | N
+max-content-row | Number | 5 | 鍐呭鏈�澶ц鏁伴檺鍒� | N
+max-label-row | Number | 3 | 涓绘枃妗堟渶澶ц鏁伴檺鍒� | N
+name | String | - | HTML 鍏冪礌鍘熺敓灞炴�� | N
+readonly | Boolean | false | 鍙鐘舵�� | N
+value | String / Number | - | 澶氶�夋鐨勫�笺�俆S 绫诲瀷锛歚string \| number` | N
+
+### Checkbox Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+change | `(checked: boolean)` | 鍊煎彉鍖栨椂瑙﹀彂
+
+### CheckboxGroup Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+disabled | Boolean | false | 鏄惁绂佺敤缁勪欢 | N
+max | Number | undefined | 鏀寔鏈�澶氶�変腑鐨勬暟閲� | N
+name | String | - | 缁熶竴璁剧疆鍐呴儴澶嶉�夋 HTML 灞炴�� | N
+options | Array | [] | 浠ラ厤缃舰寮忚缃瓙鍏冪礌銆傜ず渚�1锛歚['鍖椾含', '涓婃捣']` 锛岀ず渚�2: `[{ label: '鍏ㄩ��', checkAll: true }, { label: '涓婃捣', value: 'shanghai' }]`銆俢heckAll 鍊间负 true 琛ㄧず褰撳墠閫夐」涓恒�屽叏閫夐�夐」銆嶃�俆S 绫诲瀷锛歚Array<CheckboxOption>` `type CheckboxOption = string \| number \| CheckboxOptionObj` `interface CheckboxOptionObj { label?: string; value?: string \| number; disabled?: boolean; checkAll?: true }`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+value | Array | [] | 閫変腑鍊笺�俆S 绫诲瀷锛歚CheckboxGroupValue` `type CheckboxGroupValue = Array<string \| number>`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+default-value | Array | undefined | 閫変腑鍊笺�傞潪鍙楁帶灞炴�с�俆S 绫诲瀷锛歚CheckboxGroupValue` `type CheckboxGroupValue = Array<string \| number>`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
+
+### CheckboxGroup Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+change | `(value: CheckboxGroupValue, context: CheckboxGroupChangeContext)` | 鍊煎彉鍖栨椂瑙﹀彂銆俙context.current` 琛ㄧず褰撳墠鍙樺寲鐨勬暟鎹」锛屽鏋滄槸鍏ㄩ�夊垯涓虹┖锛沗context.type` 琛ㄧず寮曡捣閫変腑鏁版嵁鍙樺寲鐨勬槸閫変腑鎴栨槸鍙栨秷閫変腑锛宍context.option` 琛ㄧず褰撳墠鍙樺寲鐨勬暟鎹」銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts)銆�<br/>`interface CheckboxGroupChangeContext { e: Event; current: string \| number; option: CheckboxOption \| TdCheckboxProps; type: 'check' \| 'uncheck' }`<br/>
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.d.ts
new file mode 100644
index 0000000..8f41b2b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.d.ts
@@ -0,0 +1,100 @@
+import { SuperComponent, ComponentsOptionsType, RelationsOptions } from '../common/src/index';
+export default class CheckBox extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ relations: RelationsOptions;
+ options: ComponentsOptionsType;
+ properties: {
+ theme: {
+ type: StringConstructor;
+ value: string;
+ };
+ borderless: {
+ type: BooleanConstructor;
+ value: boolean;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: "left" | "right";
+ };
+ block?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checkAll?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultChecked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ contentDisabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ["t-class", "t-class-icon", "t-class-label", "t-class-content", "t-class-border"];
+ };
+ icon?: {
+ type: null;
+ value?: string[] | "circle" | "rectangle" | "line";
+ };
+ indeterminate?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ maxContentRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ maxLabelRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: string | number | boolean;
+ };
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ methods: {
+ onChange(e: WechatMiniprogram.TouchEvent): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.js b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.js
new file mode 100644
index 0000000..0494989
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.js
@@ -0,0 +1,88 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import Props from './props';
+const { prefix } = config;
+const name = `${prefix}-checkbox`;
+let CheckBox = class CheckBox extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-label`,
+ `${prefix}-class-icon`,
+ `${prefix}-class-content`,
+ `${prefix}-class-border`,
+ ];
+ this.behaviors = ['wx://form-field'];
+ this.relations = {
+ '../checkbox-group/checkbox-group': {
+ type: 'ancestor',
+ linked(parent) {
+ const { value, disabled, borderless } = parent.data;
+ const valueSet = new Set(value);
+ const data = {
+ disabled: disabled || this.data.disabled,
+ };
+ if (borderless) {
+ data.borderless = true;
+ }
+ data.checked = valueSet.has(this.data.value);
+ if (this.data.checkAll) {
+ data.checked = valueSet.size > 0;
+ }
+ this.setData(data);
+ },
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = Object.assign(Object.assign({}, Props), { theme: {
+ type: String,
+ value: 'default',
+ }, borderless: {
+ type: Boolean,
+ value: false,
+ } });
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.controlledProps = [
+ {
+ key: 'checked',
+ event: 'change',
+ },
+ ];
+ this.methods = {
+ onChange(e) {
+ const { disabled, readonly } = this.data;
+ if (disabled || readonly)
+ return;
+ const { target } = e.currentTarget.dataset;
+ const { contentDisabled } = this.data;
+ if (target === 'text' && contentDisabled) {
+ return;
+ }
+ const checked = !this.data.checked;
+ const parent = this.$parent;
+ if (parent) {
+ parent.updateValue(Object.assign(Object.assign({}, this.data), { checked }));
+ }
+ else {
+ this._trigger('change', { checked });
+ }
+ },
+ };
+ }
+};
+CheckBox = __decorate([
+ wxComponent()
+], CheckBox);
+export default CheckBox;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.json b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.json
new file mode 100644
index 0000000..dfd59ed
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-cell": "../cell/cell",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxml b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxml
new file mode 100644
index 0000000..9feb113
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxml
@@ -0,0 +1,56 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ style="{{_._style([style, customStyle])}}"
+ class="{{_.cls(classPrefix, [placement, theme, ['checked', checked], ['block', block]])}} class {{prefix}}-class"
+ aria-role="checkbox"
+ aria-checked="{{checked ? (indeterminate ? 'mixed' : true) : false}}"
+ aria-disabled="{{disabled ? true : false}}"
+ bind:tap="onChange"
+ tabindex="{{tabindex}}"
+>
+ <view
+ wx:if="{{theme == 'default'}}"
+ class="{{_.cls(classPrefix + '__icon', [placement, ['checked', checked], ['disabled', disabled]])}} {{prefix}}-class-icon"
+ >
+ <view wx:if="{{_.isArray(icon)}}" class="{{classPrefix}}__icon">
+ <image src="{{checked ? icon[0] : icon[1]}}" class="{{classPrefix}}__icon-image" webp />
+ </view>
+ <block wx:else>
+ <t-icon
+ wx:if="{{checked && (icon == 'circle' || icon == 'rectangle')}}"
+ name="{{indeterminate ? ('minus-' + icon + '-filled') : ('check-' + icon + '-filled')}}"
+ class="{{_.cls(classPrefix + '__icon-wrapper', [])}}"
+ />
+ <t-icon
+ wx:if="{{checked && icon == 'line'}}"
+ name="{{indeterminate ? ('minus-' + icon + '-filled') : 'check'}}"
+ class="{{_.cls(classPrefix + '__icon-wrapper', [])}}"
+ />
+ <view
+ wx:elif="{{!checked && (icon == 'circle' || icon == 'rectangle')}}"
+ class="{{_.cls(classPrefix + '__icon-' + icon, [['disabled', disabled]])}}"
+ />
+ <view wx:if="{{!checked && icon == 'line'}}" class="placeholder"></view>
+ </block>
+ </view>
+ <view class="{{classPrefix}}__content" data-target="text" catch:tap="onChange">
+ <view
+ class="{{_.cls(classPrefix + '__title', [['disabled', disabled], ['checked', checked]])}} {{prefix}}-class-label"
+ style="-webkit-line-clamp:{{maxLabelRow}}"
+ >
+ {{label}}
+ <slot />
+ <slot name="label" />
+ </view>
+ <view
+ class="{{_.cls(classPrefix + '__description', [['disabled', disabled]])}} {{prefix}}-class-content "
+ style="-webkit-line-clamp:{{maxContentRow}}"
+ >{{content}}<slot name="content"
+ /></view>
+ </view>
+ <view
+ wx:if="{{theme == 'default' && !borderless}}"
+ class="{{_.cls(classPrefix + '__border', [placement])}} {{prefix}}-class-border"
+ />
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxss b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxss
new file mode 100644
index 0000000..c57eb8e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/checkbox.wxss
@@ -0,0 +1,202 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-checkbox {
+ display: inline-flex;
+ vertical-align: middle;
+ position: relative;
+ font-size: var(--td-checkbox-font-size, 32rpx);
+ background: var(--td-checkbox-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-checkbox:focus {
+ outline: 0;
+}
+.t-checkbox--block {
+ display: flex;
+ padding: var(--td-checkbox-vertical-padding, 32rpx);
+}
+.t-checkbox--right {
+ flex-direction: row-reverse;
+}
+.t-checkbox .limit-title-row {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+.t-checkbox .image-center {
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+}
+.t-checkbox__icon-left {
+ margin-right: 20rpx;
+ width: 40rpx;
+}
+.t-checkbox__icon-right {
+ right: 0px;
+ display: contents;
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+}
+.t-checkbox__icon-image {
+ width: var(--td-checkbox-icon-size, 48rpx);
+ height: var(--td-checkbox-icon-size, 48rpx);
+ vertical-align: top;
+}
+.t-checkbox__icon {
+ position: relative;
+ display: block;
+ width: var(--td-checkbox-icon-size, 48rpx);
+ height: var(--td-checkbox-icon-size, 48rpx);
+ color: var(--td-checkbox-icon-color, var(--td-gray-color-4, #dcdcdc));
+ font-size: var(--td-checkbox-icon-size, 48rpx);
+}
+.t-checkbox__icon:empty {
+ display: none;
+}
+.t-checkbox__icon--checked {
+ color: var(--td-checkbox-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-checkbox__icon--disabled {
+ cursor: not-allowed;
+ color: var(--td-checkbox-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-checkbox__icon--left {
+ margin-right: 16rpx;
+}
+.t-checkbox__icon-circle {
+ width: calc((var(--td-checkbox-icon-size, 48rpx) - 6rpx) * 2);
+ height: calc((var(--td-checkbox-icon-size, 48rpx) - 6rpx) * 2);
+ border: 6rpx solid var(--td-checkbox-icon-color, var(--td-gray-color-4, #dcdcdc));
+ border-radius: 50%;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) scale(0.5);
+ box-sizing: border-box;
+}
+.t-checkbox__icon-circle--disabled {
+ background: var(--td-checkbox-icon-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-checkbox__icon-rectangle {
+ width: calc((var(--td-checkbox-icon-size, 48rpx) - 6rpx * 2) * 2);
+ height: calc((var(--td-checkbox-icon-size, 48rpx) - 6rpx * 2) * 2);
+ border: 6rpx solid var(--td-checkbox-icon-color, var(--td-gray-color-4, #dcdcdc));
+ border-radius: 4rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) scale(0.5);
+ box-sizing: border-box;
+}
+.t-checkbox__icon-rectangle--disabled {
+ background: var(--td-checkbox-icon-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-checkbox__icon-line:before,
+.t-checkbox__icon-line:after {
+ content: '';
+ display: block;
+ position: absolute;
+ width: 5rpx;
+ border-radius: 2rpx;
+ background: var(--td-checkbox-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ transform-origin: top center;
+}
+.t-checkbox__icon-line:before {
+ height: 16rpx;
+ left: 8rpx;
+ top: 22rpx;
+ transform: rotate(-45deg);
+}
+.t-checkbox__icon-line::after {
+ height: 26rpx;
+ right: 8rpx;
+ top: 14rpx;
+ transform: rotate(45deg);
+}
+.t-checkbox__icon-line--disabled::before,
+.t-checkbox__icon-line--disabled::after {
+ background: var(--td-checkbox-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-checkbox__content {
+ flex: 1;
+}
+.t-checkbox__title {
+ color: var(--td-checkbox-title-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ line-height: var(--td-checkbox-title-line-height, 48rpx);
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+.t-checkbox__title--disabled {
+ color: var(--td-checkbox-title-disabled-color, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
+.t-checkbox__description {
+ color: var(--td-checkbox-description-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ font-size: 28rpx;
+ line-height: var(--td-checkbox-description-line-height, 44rpx);
+}
+.t-checkbox__description--disabled {
+ color: var(--td-checkbox-description-disabled-color, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
+.t-checkbox__title + .t-checkbox__description:not(:empty) {
+ margin-top: 8rpx;
+}
+.t-checkbox__border {
+ position: absolute;
+ bottom: 0;
+ left: 96rpx;
+ right: 0;
+ height: 1px;
+ background: var(--td-checkbox-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+ transform: scaleY(0.5);
+}
+.t-checkbox__border--right {
+ left: 32rpx;
+}
+.t-checkbox--tag {
+ font-size: 28rpx;
+ padding-top: 16rpx;
+ padding-bottom: 16rpx;
+ text-align: center;
+ background-color: #f3f3f3;
+ border-radius: 12rpx;
+}
+.t-checkbox--tag.t-checkbox--checked {
+ color: var(--td-checkbox-tag-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ background-color: var(--td-checkbox-tag-active-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-checkbox--tag .t-checkbox__title--checked {
+ color: var(--td-checkbox-tag-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-checkbox--tag .t-checkbox__content {
+ margin-right: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/props.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox/props.d.ts
new file mode 100644
index 0000000..81c619e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/props.d.ts
@@ -0,0 +1,3 @@
+import { TdCheckboxProps } from './type';
+declare const props: TdCheckboxProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/props.js b/miniprogram_npm/tdesign-miniprogram/checkbox/props.js
new file mode 100644
index 0000000..79c2ada
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/props.js
@@ -0,0 +1,66 @@
+const props = {
+ placement: {
+ type: String,
+ value: 'left',
+ },
+ block: {
+ type: Boolean,
+ value: true,
+ },
+ checkAll: {
+ type: Boolean,
+ value: false,
+ },
+ checked: {
+ type: Boolean,
+ value: null,
+ },
+ defaultChecked: {
+ type: Boolean,
+ value: false,
+ },
+ content: {
+ type: String,
+ },
+ contentDisabled: {
+ type: Boolean,
+ },
+ disabled: {
+ type: Boolean,
+ value: undefined,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ icon: {
+ type: null,
+ value: 'circle',
+ },
+ indeterminate: {
+ type: Boolean,
+ value: false,
+ },
+ label: {
+ type: String,
+ },
+ maxContentRow: {
+ type: Number,
+ value: 5,
+ },
+ maxLabelRow: {
+ type: Number,
+ value: 3,
+ },
+ name: {
+ type: String,
+ value: '',
+ },
+ readonly: {
+ type: Boolean,
+ value: false,
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/type.d.ts b/miniprogram_npm/tdesign-miniprogram/checkbox/type.d.ts
new file mode 100644
index 0000000..c795c54
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/type.d.ts
@@ -0,0 +1,74 @@
+export interface TdCheckboxProps {
+ placement?: {
+ type: StringConstructor;
+ value?: 'left' | 'right';
+ };
+ block?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checkAll?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ checked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultChecked?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ contentDisabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-icon', 't-class-label', 't-class-content', 't-class-border'];
+ };
+ icon?: {
+ type: null;
+ value?: 'circle' | 'line' | 'rectangle' | string[];
+ };
+ indeterminate?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ maxContentRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ maxLabelRow?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ name?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ readonly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ value?: {
+ type: null;
+ value?: string | number | boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/checkbox/type.js b/miniprogram_npm/tdesign-miniprogram/checkbox/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/checkbox/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/bus.d.ts b/miniprogram_npm/tdesign-miniprogram/common/bus.d.ts
new file mode 100644
index 0000000..0ed92bb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/bus.d.ts
@@ -0,0 +1,6 @@
+export default class Bus {
+ listeners: Map<string, any>;
+ constructor();
+ on(evtName: string, listener: any): void;
+ emit(evtName: string): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/bus.js b/miniprogram_npm/tdesign-miniprogram/common/bus.js
new file mode 100644
index 0000000..5626d27
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/bus.js
@@ -0,0 +1,16 @@
+export default class Bus {
+ constructor() {
+ this.listeners = new Map();
+ }
+ on(evtName, listener) {
+ const target = this.listeners.get(evtName) || [];
+ target.push(listener);
+ this.listeners.set(evtName, target);
+ }
+ emit(evtName) {
+ const listeners = this.listeners.get(evtName);
+ if (listeners) {
+ listeners.forEach((func) => func());
+ }
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/common.d.ts b/miniprogram_npm/tdesign-miniprogram/common/common.d.ts
new file mode 100644
index 0000000..44a4e72
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/common.d.ts
@@ -0,0 +1,35 @@
+export declare type Classes = Array<string>;
+export interface Styles {
+ [css: string]: string | number;
+}
+export declare type OptionData = {
+ label?: string;
+ value?: string | number;
+} & {
+ [key: string]: any;
+};
+export declare type TreeOptionData = {
+ children?: Array<TreeOptionData>;
+} & OptionData;
+export declare type SizeEnum = 'small' | 'medium' | 'large';
+export declare type HorizontalAlignEnum = 'left' | 'center' | 'right';
+export declare type VerticalAlignEnum = 'top' | 'middle' | 'bottom';
+export declare type ClassName = {
+ [className: string]: any;
+} | ClassName[] | string;
+export declare type CSSSelector = string;
+export interface KeysType {
+ value?: string;
+ label?: string;
+}
+export interface HTMLElementAttributes {
+ [css: string]: string;
+}
+export interface InfinityScroll {
+ bufferSize?: number;
+ isFixedRowHeight?: boolean;
+ rowHeight?: number;
+ threshold?: number;
+ type: 'lazy' | 'virtual';
+}
+export declare type TScroll = InfinityScroll;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/common.js b/miniprogram_npm/tdesign-miniprogram/common/common.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/common.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/component.d.ts b/miniprogram_npm/tdesign-miniprogram/common/component.d.ts
new file mode 100644
index 0000000..a8d86ae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/component.d.ts
@@ -0,0 +1,3 @@
+/// <reference types="miniprogram-api-typings" />
+declare const TComponent: typeof Component;
+export default TComponent;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/component.js b/miniprogram_npm/tdesign-miniprogram/common/component.js
new file mode 100644
index 0000000..4e01a69
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/component.js
@@ -0,0 +1,5 @@
+const TComponent = (options) => {
+ options.options = Object.assign({ multipleSlots: true, addGlobalClass: true }, options.options);
+ return Component(options);
+};
+export default TComponent;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/config.d.ts b/miniprogram_npm/tdesign-miniprogram/common/config.d.ts
new file mode 100644
index 0000000..68879b4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/config.d.ts
@@ -0,0 +1,5 @@
+declare const _default: {
+ prefix: string;
+};
+export default _default;
+export declare const prefix = "t";
diff --git a/miniprogram_npm/tdesign-miniprogram/common/config.js b/miniprogram_npm/tdesign-miniprogram/common/config.js
new file mode 100644
index 0000000..c0dfab2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/config.js
@@ -0,0 +1,4 @@
+export default {
+ prefix: "t",
+};
+export const prefix = "t";
diff --git a/miniprogram_npm/tdesign-miniprogram/common/index.wxss b/miniprogram_npm/tdesign-miniprogram/common/index.wxss
new file mode 100644
index 0000000..1d532d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/index.wxss
@@ -0,0 +1,27 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.d.ts
new file mode 100644
index 0000000..2a119d1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.d.ts
@@ -0,0 +1,19 @@
+import type { TDate, TCalendarType, TCalendarValue } from './type';
+export default class TCalendar {
+ firstDayOfWeek: number;
+ value: TCalendarValue | TCalendarValue[];
+ type: TCalendarType;
+ minDate: Date;
+ maxDate: Date;
+ format: (day: TDate) => TDate;
+ constructor(options: any);
+ getTrimValue(): Date | Date[];
+ getDays(): any[];
+ getMonths(): any[];
+ select({ cellType, year, month, date }: {
+ cellType: any;
+ year: any;
+ month: any;
+ date: any;
+ }): Date | TCalendarValue[];
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.js b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.js
new file mode 100644
index 0000000..9de8d65
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/index.js
@@ -0,0 +1,128 @@
+import { getDateRect, isSameDate, getMonthDateRect, isValidDate, getDate } from '../date';
+export default class TCalendar {
+ constructor(options) {
+ this.type = 'single';
+ Object.assign(this, options);
+ if (!this.minDate)
+ this.minDate = getDate();
+ if (!this.maxDate)
+ this.maxDate = getDate(6);
+ }
+ getTrimValue() {
+ const { value, type } = this;
+ const format = (val) => {
+ if (val instanceof Date)
+ return val;
+ if (typeof val === 'number')
+ return new Date(val);
+ return new Date();
+ };
+ if (type === 'single' && isValidDate(value))
+ return format(value);
+ if (type === 'multiple' || type === 'range') {
+ if (Array.isArray(value)) {
+ const isValid = value.every((item) => isValidDate(item));
+ return isValid ? value.map((item) => format(item)) : [];
+ }
+ return [];
+ }
+ }
+ getDays() {
+ const raw = '鏃ヤ竴浜屼笁鍥涗簲鍏�';
+ const ans = [];
+ let i = this.firstDayOfWeek % 7;
+ while (ans.length < 7) {
+ ans.push(raw[i]);
+ i = (i + 1) % 7;
+ }
+ return ans;
+ }
+ getMonths() {
+ const ans = [];
+ const selectedDate = this.getTrimValue();
+ const { minDate, maxDate, type, format } = this;
+ let { year: minYear, month: minMonth, time: minTime } = getDateRect(minDate);
+ const { year: maxYear, month: maxMonth, time: maxTime } = getDateRect(maxDate);
+ const calcType = (year, month, date) => {
+ const curDate = new Date(year, month, date, 23, 59, 59);
+ if (type === 'single' && selectedDate) {
+ if (isSameDate({ year, month, date }, selectedDate))
+ return 'selected';
+ }
+ if (type === 'multiple' && selectedDate) {
+ const hit = selectedDate.some((item) => isSameDate({ year, month, date }, item));
+ if (hit) {
+ return 'selected';
+ }
+ }
+ if (type === 'range' && selectedDate) {
+ if (Array.isArray(selectedDate)) {
+ const [startDate, endDate] = selectedDate;
+ if (startDate && isSameDate({ year, month, date }, startDate))
+ return 'start';
+ if (endDate && isSameDate({ year, month, date }, endDate))
+ return 'end';
+ if (startDate && endDate && curDate.getTime() > startDate.getTime() && curDate.getTime() < endDate.getTime())
+ return 'centre';
+ }
+ }
+ const minCurDate = new Date(year, month, date, 0, 0, 0);
+ if (curDate.getTime() < minTime || minCurDate.getTime() > maxTime) {
+ return 'disabled';
+ }
+ return '';
+ };
+ while (minYear < maxYear || (minYear === maxYear && minMonth <= maxMonth)) {
+ const target = getMonthDateRect(new Date(minYear, minMonth, 1));
+ const months = [];
+ for (let i = 1; i <= 31; i++) {
+ if (i > target.lastDate)
+ break;
+ const dateObj = {
+ date: new Date(minYear, minMonth, i),
+ day: i,
+ type: calcType(minYear, minMonth, i),
+ };
+ months.push(format ? format(dateObj) : dateObj);
+ }
+ ans.push({
+ year: minYear,
+ month: minMonth,
+ months,
+ weekdayOfFirstDay: target.weekdayOfFirstDay,
+ });
+ const curDate = getDateRect(new Date(minYear, minMonth + 1, 1));
+ minYear = curDate.year;
+ minMonth = curDate.month;
+ }
+ return ans;
+ }
+ select({ cellType, year, month, date }) {
+ const { type } = this;
+ const selectedDate = this.getTrimValue();
+ if (cellType === 'disabled')
+ return;
+ const selected = new Date(year, month, date);
+ this.value = selected;
+ if (type === 'range' && Array.isArray(selectedDate)) {
+ if (selectedDate.length === 1 && selected > selectedDate[0]) {
+ this.value = [selectedDate[0], selected];
+ }
+ else {
+ this.value = [selected];
+ }
+ }
+ else if (type === 'multiple' && Array.isArray(selectedDate)) {
+ const newVal = [...selectedDate];
+ const index = selectedDate.findIndex((item) => isSameDate(item, selected));
+ if (index > -1) {
+ newVal.splice(index, 1);
+ }
+ else {
+ newVal.push(selected);
+ }
+ this.value = newVal;
+ }
+ return this.value;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.d.ts
new file mode 100644
index 0000000..621b949
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.d.ts
@@ -0,0 +1,11 @@
+export interface TDate {
+ date: Date;
+ day: number;
+ type: TDateType;
+ className?: string;
+ prefix?: string;
+ suffix?: string;
+}
+export declare type TCalendarValue = number | Date;
+export declare type TDateType = 'selected' | 'disabled' | 'start' | 'centre' | 'end' | '';
+export declare type TCalendarType = 'single' | 'multiple' | 'range';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.js b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/calendar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/date.d.ts b/miniprogram_npm/tdesign-miniprogram/common/shared/date.d.ts
new file mode 100644
index 0000000..e123831
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/date.d.ts
@@ -0,0 +1,21 @@
+export declare type CompareDate = Date | number | {
+ year: number;
+ month: number;
+ date: number;
+};
+export declare const getDateRect: (date: Date | number) => {
+ year: number;
+ month: number;
+ date: number;
+ day: number;
+ time: number;
+};
+export declare const isSameDate: (date1: CompareDate, date2: CompareDate) => boolean;
+export declare const getMonthDateRect: (date: Date | number) => {
+ year: number;
+ month: number;
+ weekdayOfFirstDay: number;
+ lastDate: number;
+};
+export declare const isValidDate: (val: any) => boolean;
+export declare const getDate: (...args: any[]) => any;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/shared/date.js b/miniprogram_npm/tdesign-miniprogram/common/shared/date.js
new file mode 100644
index 0000000..3ac46b3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/shared/date.js
@@ -0,0 +1,41 @@
+export const getDateRect = (date) => {
+ const _date = new Date(date);
+ return {
+ year: _date.getFullYear(),
+ month: _date.getMonth(),
+ date: _date.getDate(),
+ day: _date.getDay(),
+ time: _date.getTime(),
+ };
+};
+export const isSameDate = (date1, date2) => {
+ if (date1 instanceof Date || typeof date1 === 'number')
+ date1 = getDateRect(date1);
+ if (date2 instanceof Date || typeof date2 === 'number')
+ date2 = getDateRect(date2);
+ const keys = ['year', 'month', 'date'];
+ return keys.every((key) => date1[key] === date2[key]);
+};
+export const getMonthDateRect = (date) => {
+ const { year, month } = getDateRect(date);
+ const firstDay = new Date(year, month, 1);
+ const weekdayOfFirstDay = firstDay.getDay();
+ const lastDate = new Date(+new Date(year, month + 1, 1) - 24 * 3600 * 1000).getDate();
+ return {
+ year,
+ month,
+ weekdayOfFirstDay,
+ lastDate,
+ };
+};
+export const isValidDate = (val) => typeof val === 'number' || val instanceof Date;
+export const getDate = (...args) => {
+ const now = new Date();
+ if (args.length === 0)
+ return now;
+ if (args.length === 1 && args[0] <= 1000) {
+ const { year, month, date } = getDateRect(now);
+ return new Date(year, month + args[0], date);
+ }
+ return Date.apply(null, args);
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/control.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/control.d.ts
new file mode 100644
index 0000000..ed3f4a0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/control.d.ts
@@ -0,0 +1,15 @@
+declare type ControlInstance = {
+ controlled: boolean;
+ initValue: any;
+ set(newVal: any, extObj?: Object, fn?: any): void;
+ get(): any;
+ change(newVal: any, customChangeData?: any, customUpdateFn?: any): void;
+};
+declare type ControlOption = {
+ valueKey?: string;
+ defaultValueKey?: string;
+ changeEventName?: string;
+ strict?: boolean;
+};
+declare function useControl(this: any, option?: ControlOption): ControlInstance;
+export { ControlOption, ControlInstance, useControl };
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/control.js b/miniprogram_npm/tdesign-miniprogram/common/src/control.js
new file mode 100644
index 0000000..03c9e77
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/control.js
@@ -0,0 +1,40 @@
+const defaultOption = {
+ valueKey: 'value',
+ defaultValueKey: 'defaultValue',
+ changeEventName: 'change',
+ strict: true,
+};
+function useControl(option = {}) {
+ const { valueKey, defaultValueKey, changeEventName, strict } = Object.assign(Object.assign({}, defaultOption), option);
+ const props = this.properties || {};
+ const value = props[valueKey];
+ const defaultValue = props[strict ? defaultValueKey : valueKey];
+ let controlled = false;
+ if (strict && typeof value !== 'undefined' && value !== null) {
+ controlled = true;
+ }
+ const set = (newVal, extObj, fn) => {
+ this.setData(Object.assign({ [`_${valueKey}`]: newVal }, extObj), fn);
+ };
+ return {
+ controlled,
+ initValue: controlled ? value : defaultValue,
+ set,
+ get: () => {
+ return this.data[`_${valueKey}`];
+ },
+ change: (newVal, customChangeData, customUpdateFn) => {
+ this.triggerEvent(changeEventName, typeof customChangeData !== 'undefined' ? customChangeData : newVal);
+ if (controlled) {
+ return;
+ }
+ if (typeof customUpdateFn === 'function') {
+ customUpdateFn();
+ }
+ else {
+ set(newVal);
+ }
+ },
+ };
+}
+export { useControl };
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.d.ts
new file mode 100644
index 0000000..4183d79
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.d.ts
@@ -0,0 +1,15 @@
+export declare const getPrototypeOf: (obj: any) => any;
+export declare const isObject: (something: any) => boolean;
+export declare const iterateInheritedPrototype: (callback: (proto: Record<string, any>) => boolean | void, fromCtor: any, toCtor: any, includeToCtor?: boolean) => void;
+export interface ClassInstanceToObjectOptions {
+ bindTo?: any;
+ excludes?: string[];
+ till?: any;
+ enumerable?: 0 | boolean;
+ configurable?: 0 | boolean;
+ writable?: 0 | boolean;
+}
+export declare const toObject: (something: any, options?: ClassInstanceToObjectOptions) => {
+ [key: string]: any;
+};
+export declare const isPlainObject: (something: any) => boolean;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.js b/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.js
new file mode 100644
index 0000000..045abd7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/flatTool.js
@@ -0,0 +1,57 @@
+export const getPrototypeOf = function (obj) {
+ return Object.getPrototypeOf ? Object.getPrototypeOf(obj) : obj.__proto__;
+};
+export const isObject = function isObject(something) {
+ const type = typeof something;
+ return something !== null && (type === 'function' || type === 'object');
+};
+export const iterateInheritedPrototype = function iterateInheritedPrototype(callback, fromCtor, toCtor, includeToCtor = true) {
+ let proto = fromCtor.prototype || fromCtor;
+ const toProto = toCtor.prototype || toCtor;
+ while (proto) {
+ if (!includeToCtor && proto === toProto)
+ break;
+ if (callback(proto) === false)
+ break;
+ if (proto === toProto)
+ break;
+ proto = getPrototypeOf(proto);
+ }
+};
+export const toObject = function toObject(something, options = {}) {
+ const obj = {};
+ if (!isObject(something))
+ return obj;
+ const excludes = options.excludes || ['constructor'];
+ const { enumerable = true, configurable = 0, writable = 0 } = options;
+ const defaultDesc = {};
+ if (enumerable !== 0)
+ defaultDesc.enumerable = enumerable;
+ if (configurable !== 0)
+ defaultDesc.configurable = configurable;
+ if (writable !== 0)
+ defaultDesc.writable = writable;
+ iterateInheritedPrototype((proto) => {
+ Object.getOwnPropertyNames(proto).forEach((key) => {
+ if (excludes.indexOf(key) >= 0)
+ return;
+ if (Object.prototype.hasOwnProperty.call(obj, key))
+ return;
+ const desc = Object.getOwnPropertyDescriptor(proto, key);
+ const fnKeys = ['get', 'set', 'value'];
+ fnKeys.forEach((k) => {
+ if (typeof desc[k] === 'function') {
+ const oldFn = desc[k];
+ desc[k] = function (...args) {
+ return oldFn.apply(Object.prototype.hasOwnProperty.call(options, 'bindTo') ? options.bindTo : this, args);
+ };
+ }
+ });
+ Object.defineProperty(obj, key, Object.assign(Object.assign({}, desc), defaultDesc));
+ });
+ }, something, options.till || Object, false);
+ return obj;
+};
+export const isPlainObject = function isPlainObject(something) {
+ return Object.prototype.toString.call(something) === '[object Object]';
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/index.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/index.d.ts
new file mode 100644
index 0000000..94e7ce1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/index.d.ts
@@ -0,0 +1,4 @@
+export * from './superComponent';
+export * from './flatTool';
+export * from './instantiationDecorator';
+export * from './control';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/index.js b/miniprogram_npm/tdesign-miniprogram/common/src/index.js
new file mode 100644
index 0000000..94e7ce1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/index.js
@@ -0,0 +1,4 @@
+export * from './superComponent';
+export * from './flatTool';
+export * from './instantiationDecorator';
+export * from './control';
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.d.ts
new file mode 100644
index 0000000..3a06f2c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.d.ts
@@ -0,0 +1,3 @@
+import { SuperComponent } from './superComponent';
+export declare const toComponent: (options: Record<string, any>) => Record<string, any>;
+export declare const wxComponent: () => (constructor: new () => SuperComponent) => void;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.js b/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.js
new file mode 100644
index 0000000..0e5c3d3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/instantiationDecorator.js
@@ -0,0 +1,142 @@
+import { isPlainObject, toObject } from './flatTool';
+import { canUseVirtualHost } from '../version';
+const RawLifeCycles = ['Created', 'Attached', 'Ready', 'Moved', 'Detached', 'Error'];
+const NativeLifeCycles = RawLifeCycles.map((k) => k.toLowerCase());
+const ComponentNativeProps = [
+ 'properties',
+ 'data',
+ 'observers',
+ 'methods',
+ 'behaviors',
+ ...NativeLifeCycles,
+ 'relations',
+ 'externalClasses',
+ 'options',
+ 'lifetimes',
+ 'pageLifeTimes',
+ 'definitionFilter',
+];
+export const toComponent = function toComponent(options) {
+ const { relations, behaviors = [], properties, externalClasses = [] } = options;
+ if (options.properties) {
+ Object.keys(options.properties).forEach((k) => {
+ let opt = options.properties[k];
+ if (!isPlainObject(opt)) {
+ opt = { type: opt };
+ }
+ options.properties[k] = opt;
+ });
+ const ariaProps = [
+ { key: 'ariaHidden', type: Boolean },
+ { key: 'ariaRole', type: String },
+ { key: 'ariaLabel', type: String },
+ { key: 'ariaLabelledby', type: String },
+ { key: 'ariaDescribedby', type: String },
+ { key: 'ariaBusy', type: Boolean },
+ ];
+ ariaProps.forEach(({ key, type }) => {
+ options.properties[key] = {
+ type,
+ };
+ });
+ options.properties.style = { type: String, value: '' };
+ options.properties.customStyle = { type: String, value: '' };
+ }
+ if (!options.methods)
+ options.methods = {};
+ if (!options.lifetimes)
+ options.lifetimes = {};
+ const inits = {};
+ if (relations) {
+ const getRelations = (relation, path) => Behavior({
+ created() {
+ Object.defineProperty(this, `$${relation}`, {
+ get: () => {
+ const nodes = this.getRelationNodes(path) || [];
+ return relation === 'parent' ? nodes[0] : nodes;
+ },
+ });
+ },
+ });
+ const map = {};
+ Object.keys(relations).forEach((path) => {
+ const comp = relations[path];
+ const relation = ['parent', 'ancestor'].includes(comp.type) ? 'parent' : 'children';
+ const mixin = getRelations(relation, path);
+ map[relation] = mixin;
+ });
+ behaviors.push(...Object.keys(map).map((key) => map[key]));
+ }
+ options.behaviors = [...behaviors];
+ options.externalClasses = ['class', ...externalClasses];
+ Object.getOwnPropertyNames(options).forEach((k) => {
+ const desc = Object.getOwnPropertyDescriptor(options, k);
+ if (!desc)
+ return;
+ if (NativeLifeCycles.indexOf(k) < 0 && typeof desc.value === 'function') {
+ Object.defineProperty(options.methods, k, desc);
+ delete options[k];
+ }
+ else if (ComponentNativeProps.indexOf(k) < 0) {
+ inits[k] = desc;
+ }
+ else if (NativeLifeCycles.indexOf(k) >= 0) {
+ options.lifetimes[k] = options[k];
+ }
+ });
+ if (Object.keys(inits).length) {
+ const oldCreated = options.lifetimes.created;
+ const oldAttached = options.lifetimes.attached;
+ const { controlledProps = [] } = options;
+ options.lifetimes.created = function (...args) {
+ Object.defineProperties(this, inits);
+ if (oldCreated)
+ oldCreated.apply(this, args);
+ };
+ options.lifetimes.attached = function (...args) {
+ if (oldAttached)
+ oldAttached.apply(this, args);
+ controlledProps.forEach(({ key }) => {
+ const defaultKey = `default${key.replace(/^(\w)/, (m, m1) => m1.toUpperCase())}`;
+ const props = this.properties;
+ if (props[key] == null) {
+ this._selfControlled = true;
+ }
+ if (props[key] == null && props[defaultKey] != null) {
+ this.setData({
+ [key]: props[defaultKey],
+ });
+ }
+ });
+ };
+ options.methods._trigger = function (evtName, detail, opts) {
+ const target = controlledProps.find((item) => item.event == evtName);
+ if (target) {
+ const { key } = target;
+ if (this._selfControlled) {
+ this.setData({
+ [key]: detail[key],
+ });
+ }
+ }
+ this.triggerEvent(evtName, detail, opts);
+ };
+ }
+ return options;
+};
+export const wxComponent = function wxComponent() {
+ return function (constructor) {
+ class WxComponent extends constructor {
+ }
+ const current = new WxComponent();
+ current.options = current.options || {};
+ if (current.options.addGlobalClass === undefined) {
+ current.options.addGlobalClass = true;
+ }
+ if (canUseVirtualHost()) {
+ current.options.virtualHost = true;
+ }
+ const obj = toComponent(toObject(current));
+ Component(obj);
+ };
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.d.ts b/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.d.ts
new file mode 100644
index 0000000..4455e19
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.d.ts
@@ -0,0 +1,19 @@
+/// <reference types="miniprogram-api-typings" />
+export interface ComponentsOptionsType extends WechatMiniprogram.Component.ComponentOptions {
+ styleIsolation?: 'isolated' | 'apply-shared' | 'shared' | 'page-isolated' | 'page-apply-shared' | 'page-shared';
+}
+export interface RelationsOptions {
+ [componentName: string]: WechatMiniprogram.Component.RelationOption;
+}
+export interface SuperComponent<D = {}, P = {}, M = {}> extends WechatMiniprogram.Component.Lifetimes, WechatMiniprogram.Component.OtherOption, WechatMiniprogram.Component.InstanceMethods<D> {
+ properties: P;
+ data: D;
+ options: ComponentsOptionsType;
+ methods: M | Record<string, (...args: any[]) => any>;
+ $global: Function;
+ [x: string]: any;
+}
+export declare class SuperComponent<D = {}, P = {}, M = {}> {
+ readonly app: any;
+ constructor();
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.js b/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.js
new file mode 100644
index 0000000..3cb17dc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/superComponent.js
@@ -0,0 +1,5 @@
+export class SuperComponent {
+ constructor() {
+ this.app = getApp();
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/_variables.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/_variables.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/_variables.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/base.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/base.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/base.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/index.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/index.wxss
new file mode 100644
index 0000000..1d532d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/index.wxss
@@ -0,0 +1,27 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_clearfix.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_clearfix.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_clearfix.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_cursor.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_cursor.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_cursor.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_hairline.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_hairline.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_hairline.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_index.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_index.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/mixins/_index.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_animation.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_animation.wxss
new file mode 100644
index 0000000..a04e7c5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_animation.wxss
@@ -0,0 +1,8 @@
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_float.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_float.wxss
new file mode 100644
index 0000000..e88ef0e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_float.wxss
@@ -0,0 +1,6 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_index.wxss b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_index.wxss
new file mode 100644
index 0000000..1d532d2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/style/utilities/_index.wxss
@@ -0,0 +1,27 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/common/template/badge.wxml b/miniprogram_npm/tdesign-miniprogram/common/template/badge.wxml
new file mode 100644
index 0000000..df8c717
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/template/badge.wxml
@@ -0,0 +1,16 @@
+<template name="badge">
+ <t-badge
+ color="{{color || ''}}"
+ content="{{content || ''}}"
+ count="{{count || 0}}"
+ dot="{{dot || false}}"
+ max-count="{{maxCount || 99}}"
+ offset="{{offset || []}}"
+ shape="{{shape || 'circle'}}"
+ show-zero="{{showZero || false}}"
+ size="{{size || 'medium'}}"
+ t-class="{{class}} {{tClass}}"
+ t-class-content="{{tClassContent}}"
+ t-class-count="{{tClassCount}}"
+ />
+</template>
diff --git a/miniprogram_npm/tdesign-miniprogram/common/template/button.wxml b/miniprogram_npm/tdesign-miniprogram/common/template/button.wxml
new file mode 100644
index 0000000..173e8bb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/template/button.wxml
@@ -0,0 +1,37 @@
+<template name="button">
+ <t-button
+ block="{{block || false}}"
+ class="{{class || ''}}"
+ t-class="{{externalClass}}"
+ disabled="{{disabled || false}}"
+ data-type="{{type}}"
+ data-extra="{{extra}}"
+ icon="{{icon || ''}}"
+ loading="{{loading || false}}"
+ theme="{{theme || 'default'}}"
+ ghost="{{ghost || false}}"
+ shape="{{shape || 'rectangle'}}"
+ size="{{size || 'medium'}}"
+ variant="{{variant || 'base'}}"
+ open-type="{{openType || ''}}"
+ hover-stop-propagation="{{hoverStopPropagation || false}}"
+ hover-start-time="{{hoverStartTime || 20}}"
+ hover-stay-time="{{hoverStayTime || 70}}"
+ lang="{{lang || 'en'}}"
+ session-from="{{sessionFrom || ''}}"
+ send-message-title="{{sendMessageTitle || ''}}"
+ send-message-path="{{sendMessagePath || ''}}"
+ send-message-img="{{sendMessageImg || ''}}"
+ app-parameter="{{appParameter || ''}}"
+ show-message-card="{{showMessageCard || false}}"
+ bind:tap="onTplButtonTap"
+ bind:getuserinfo="onTplButtonTap"
+ bind:contact="onTplButtonTap"
+ bind:getphonenumber="onTplButtonTap"
+ bind:error="onTplButtonTap"
+ bind:opensetting="onTplButtonTap"
+ bind:launchapp="onTplButtonTap"
+ aria-label="{{ariaLabel || ''}}"
+ >{{content}}</t-button
+ >
+</template>
diff --git a/miniprogram_npm/tdesign-miniprogram/common/template/icon.wxml b/miniprogram_npm/tdesign-miniprogram/common/template/icon.wxml
new file mode 100644
index 0000000..0fafa2c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/template/icon.wxml
@@ -0,0 +1,15 @@
+<template name="icon">
+ <t-icon
+ style="{{style || ''}}"
+ class="{{class}}"
+ t-class="{{tClass}}"
+ prefix="{{prefix || ''}}"
+ name="{{name || ''}}"
+ size="{{size || ''}}"
+ color="{{color || ''}}"
+ aria-hidden="{{ariaHidden || '' }}"
+ aria-label="{{ariaLabel || ''}}"
+ aria-role="{{ariaRole || ''}}"
+ bind:click="{{bindclick || ''}}"
+ />
+</template>
diff --git a/miniprogram_npm/tdesign-miniprogram/common/template/image.wxml b/miniprogram_npm/tdesign-miniprogram/common/template/image.wxml
new file mode 100644
index 0000000..7c78c4a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/template/image.wxml
@@ -0,0 +1,21 @@
+<template name="image">
+ <t-image
+ class="{{class}}"
+ t-class="{{tClass}}"
+ t-class-load="{{tClassLoad}}"
+ style="{{style || ''}}"
+ customStyle="{{customStyle || ''}}"
+ height="{{height || ''}}"
+ width="{{width || ''}}"
+ error="{{error || 'default'}}"
+ lazy="{{lazy || false}}"
+ loading="{{count || 'default'}}"
+ shape="{{shape || 'square'}}"
+ src="{{src || ''}}"
+ mode="{{mode || 'scaleToFill'}}"
+ webp="{{webp || false}}"
+ showMenuByLongpress="{{showMenuByLongpress || false}}"
+ bind:error="{{binderror}}"
+ bind:load="{{bindload}}"
+ />
+</template>
diff --git a/miniprogram_npm/tdesign-miniprogram/common/utils.d.ts b/miniprogram_npm/tdesign-miniprogram/common/utils.d.ts
new file mode 100644
index 0000000..ebab160
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/utils.d.ts
@@ -0,0 +1,30 @@
+/// <reference types="miniprogram-api-typings" />
+/// <reference types="miniprogram-api-typings" />
+declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+export declare const debounce: (func: any, wait?: number) => (...rest: any[]) => void;
+export declare const throttle: (func: any, wait?: number, options?: any) => (...args: any[]) => void;
+export declare const classNames: (...args: any[]) => string;
+export declare const styles: (styleObj: any) => string;
+export declare const getAnimationFrame: (context: any, cb: Function) => WechatMiniprogram.NodesRef;
+export declare const getRect: (context: any, selector: string, needAll?: boolean) => Promise<any>;
+export declare const isNumber: (value: any) => boolean;
+export declare const addUnit: (value?: string | number) => string | undefined;
+export declare const getCharacterLength: (type: string, str: string, max?: number) => {
+ length: number;
+ characters: string;
+};
+export declare const chunk: (arr: any[], size: number) => any[][];
+export declare const getInstance: (context?: Context, selector?: string) => WechatMiniprogram.Component.TrivialInstance;
+export declare const unitConvert: (value: number | string) => number;
+export declare const setIcon: (iconName: any, icon: any, defaultIcon: any) => {
+ [x: string]: any;
+};
+export declare const isBool: (val: any) => boolean;
+export declare const isObject: (val: any) => boolean;
+export declare const isString: (val: any) => boolean;
+export declare const toCamel: (str: any) => any;
+export declare const getCurrentPage: <T>() => T & WechatMiniprogram.OptionalInterface<WechatMiniprogram.Page.ILifetime> & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods<WechatMiniprogram.IAnyObject> & WechatMiniprogram.Page.Data<WechatMiniprogram.IAnyObject> & WechatMiniprogram.IAnyObject;
+export declare const uniqueFactory: (compName: any) => () => string;
+export declare const calcIcon: (icon: string | Record<string, any>, defaultIcon?: string) => string | Record<string, any>;
+export declare const isOverSize: (size: any, sizeLimit: any) => boolean;
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/utils.js b/miniprogram_npm/tdesign-miniprogram/common/utils.js
new file mode 100644
index 0000000..2d6daef
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/utils.js
@@ -0,0 +1,233 @@
+import { prefix } from './config';
+const systemInfo = wx.getSystemInfoSync();
+export const debounce = function (func, wait = 500) {
+ let timerId;
+ return function (...rest) {
+ if (timerId) {
+ clearTimeout(timerId);
+ }
+ timerId = setTimeout(() => {
+ func.apply(this, rest);
+ }, wait);
+ };
+};
+export const throttle = (func, wait = 100, options = null) => {
+ let previous = 0;
+ let timerid = null;
+ if (!options) {
+ options = {
+ leading: true,
+ };
+ }
+ return function (...args) {
+ const now = Date.now();
+ if (!previous && !options.leading)
+ previous = now;
+ const remaining = wait - (now - previous);
+ const context = this;
+ if (remaining <= 0) {
+ if (timerid) {
+ clearTimeout(timerid);
+ timerid = null;
+ }
+ previous = now;
+ func.apply(context, args);
+ }
+ };
+};
+export const classNames = function (...args) {
+ const hasOwn = {}.hasOwnProperty;
+ const classes = [];
+ args.forEach((arg) => {
+ if (!arg)
+ return;
+ const argType = typeof arg;
+ if (argType === 'string' || argType === 'number') {
+ classes.push(arg);
+ }
+ else if (Array.isArray(arg) && arg.length) {
+ const inner = classNames(...arg);
+ if (inner) {
+ classes.push(inner);
+ }
+ }
+ else if (argType === 'object') {
+ for (const key in arg) {
+ if (hasOwn.call(arg, key) && arg[key]) {
+ classes.push(key);
+ }
+ }
+ }
+ });
+ return classes.join(' ');
+};
+export const styles = function (styleObj) {
+ return Object.keys(styleObj)
+ .map((styleKey) => `${styleKey}: ${styleObj[styleKey]}`)
+ .join('; ');
+};
+export const getAnimationFrame = function (context, cb) {
+ return wx
+ .createSelectorQuery()
+ .in(context)
+ .selectViewport()
+ .boundingClientRect()
+ .exec(() => {
+ cb();
+ });
+};
+export const getRect = function (context, selector, needAll = false) {
+ return new Promise((resolve, reject) => {
+ wx.createSelectorQuery()
+ .in(context)[needAll ? 'selectAll' : 'select'](selector)
+ .boundingClientRect((rect) => {
+ if (rect) {
+ resolve(rect);
+ }
+ else {
+ reject(rect);
+ }
+ })
+ .exec();
+ });
+};
+const isDef = function (value) {
+ return value !== undefined && value !== null;
+};
+export const isNumber = function (value) {
+ return /^\d+(\.\d+)?$/.test(value);
+};
+export const addUnit = function (value) {
+ if (!isDef(value)) {
+ return undefined;
+ }
+ value = String(value);
+ return isNumber(value) ? `${value}px` : value;
+};
+export const getCharacterLength = (type, str, max) => {
+ if (!str || str.length === 0) {
+ return {
+ length: 0,
+ characters: '',
+ };
+ }
+ if (type === 'maxcharacter') {
+ let len = 0;
+ for (let i = 0; i < str.length; i += 1) {
+ let currentStringLength = 0;
+ if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+ currentStringLength = 2;
+ }
+ else {
+ currentStringLength = 1;
+ }
+ if (len + currentStringLength > max) {
+ return {
+ length: len,
+ characters: str.slice(0, i),
+ };
+ }
+ len += currentStringLength;
+ }
+ return {
+ length: len,
+ characters: str,
+ };
+ }
+ else if (type === 'maxlength') {
+ const length = str.length > max ? max : str.length;
+ return {
+ length,
+ characters: str.slice(0, length),
+ };
+ }
+ return {
+ length: str.length,
+ characters: str,
+ };
+};
+export const chunk = (arr, size) => Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size));
+export const getInstance = function (context, selector) {
+ if (!context) {
+ const pages = getCurrentPages();
+ const page = pages[pages.length - 1];
+ context = page.$$basePage || page;
+ }
+ const instance = context ? context.selectComponent(selector) : null;
+ if (!instance) {
+ console.warn('鏈壘鍒扮粍浠�,璇锋鏌elector鏄惁姝g‘');
+ return null;
+ }
+ return instance;
+};
+export const unitConvert = (value) => {
+ var _a;
+ if (typeof value === 'string') {
+ if (value.includes('rpx')) {
+ return (parseInt(value, 10) * ((_a = systemInfo === null || systemInfo === void 0 ? void 0 : systemInfo.screenWidth) !== null && _a !== void 0 ? _a : 750)) / 750;
+ }
+ return parseInt(value, 10);
+ }
+ return value;
+};
+export const setIcon = (iconName, icon, defaultIcon) => {
+ if (icon) {
+ if (typeof icon === 'string') {
+ return {
+ [`${iconName}Name`]: icon,
+ [`${iconName}Data`]: {},
+ };
+ }
+ else if (typeof icon === 'object') {
+ return {
+ [`${iconName}Name`]: '',
+ [`${iconName}Data`]: icon,
+ };
+ }
+ else {
+ return {
+ [`${iconName}Name`]: defaultIcon,
+ [`${iconName}Data`]: {},
+ };
+ }
+ }
+ return {
+ [`${iconName}Name`]: '',
+ [`${iconName}Data`]: {},
+ };
+};
+export const isBool = (val) => typeof val === 'boolean';
+export const isObject = (val) => typeof val === 'object' && val != null;
+export const isString = (val) => typeof val === 'string';
+export const toCamel = (str) => str.replace(/-(\w)/g, (match, m1) => m1.toUpperCase());
+export const getCurrentPage = function () {
+ const pages = getCurrentPages();
+ return pages[pages.length - 1];
+};
+export const uniqueFactory = (compName) => {
+ let number = 0;
+ return () => `${prefix}_${compName}_${number++}`;
+};
+export const calcIcon = (icon, defaultIcon) => {
+ if ((isBool(icon) && icon && defaultIcon) || isString(icon)) {
+ return { name: isBool(icon) ? defaultIcon : icon };
+ }
+ if (isObject(icon)) {
+ return icon;
+ }
+ return null;
+};
+export const isOverSize = (size, sizeLimit) => {
+ var _a;
+ if (!sizeLimit)
+ return false;
+ const base = 1000;
+ const unitMap = {
+ B: 1,
+ KB: base,
+ MB: base * base,
+ GB: base * base * base,
+ };
+ const computedSize = typeof sizeLimit === 'number' ? sizeLimit * base : (sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.size) * unitMap[(_a = sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.unit) !== null && _a !== void 0 ? _a : 'KB'];
+ return size > computedSize;
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/utils.wxs b/miniprogram_npm/tdesign-miniprogram/common/utils.wxs
new file mode 100644
index 0000000..be97e3d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/utils.wxs
@@ -0,0 +1,137 @@
+/* utils */
+
+/**
+ * addUnit */
+// 涓� css 娣诲姞鍗曚綅
+function addUnit(value) {
+ var REGEXP = getRegExp('^-?\d+(.\d+)?$');
+ if (value == null) {
+ return undefined;
+ }
+ return REGEXP.test('' + value) ? value + 'px' : value;
+}
+
+function isString(string) {
+ return string && string.constructor === 'String';
+}
+
+function isArray(array) {
+ return array && array.constructor === 'Array';
+}
+
+function isObject(obj) {
+ return obj && obj.constructor === 'Object';
+}
+
+var isNoEmptyObj = function (obj) {
+ return isObject(obj) && JSON.stringify(obj) !== '{}';
+};
+
+function includes(arr, value) {
+ if (!arr || !isArray(arr)) return false;
+
+ var i = 0;
+ var len = arr.length;
+
+ for (; i < len; i++) {
+ if (arr[i] === value) return true;
+ }
+ return false;
+}
+
+function cls(base, arr) {
+ var res = [base];
+ var i = 0;
+ for (size = arr.length; i < size; i++) {
+ var item = arr[i];
+
+ if (item && item.constructor === 'Array') {
+ var key = arr[i][0];
+ var value = arr[i][1];
+
+ if (value) {
+ res.push(base + '--' + key);
+ }
+ } else if (typeof item === 'string' || typeof item === 'number') {
+ if (item) {
+ res.push(base + '--' + item);
+ }
+ }
+ }
+ return res.join(' ');
+}
+
+function getBadgeAriaLabel(options) {
+ var maxCount = options.maxCount || 99;
+ if (options.dot) {
+ return '鏈夋柊鐨勬秷鎭�';
+ }
+ if (options.count === '...') {
+ return '鏈夊緢澶氭秷鎭�';
+ }
+ if (isNaN(options.count)) {
+ return options.count;
+ }
+ var str1 = '鏈�' + maxCount + '+鏉℃秷鎭�';
+ var str2 = '鏈�' + options.count + '鏉℃秷鎭�';
+ return Number(options.count) > maxCount ? str1 : str2;
+}
+
+function endsWith(str, endStr) {
+ return str.slice(-endStr.length) === endStr ? str : str + endStr;
+}
+
+function keys(obj) {
+ return JSON.stringify(obj)
+ .replace(getRegExp('{|}|"', 'g'), '')
+ .split(',')
+ .map(function (item) {
+ return item.split(':')[0];
+ });
+}
+
+function kebabCase(str) {
+ return str
+ .replace(getRegExp('[A-Z]', 'g'), function (ele) {
+ return '-' + ele;
+ })
+ .toLowerCase();
+}
+
+function _style(styles) {
+ if (isArray(styles)) {
+ return styles
+ .filter(function (item) {
+ return item != null && item !== '';
+ })
+ .map(function (item) {
+ return isArray(item) ? style(item) : endsWith(item, ';');
+ })
+ .join(' ');
+ }
+
+ if (isObject(styles)) {
+ return keys(styles)
+ .filter(function (key) {
+ return styles[key] != null && styles[key] !== '';
+ })
+ .map(function (key) {
+ return [kebabCase(key), [styles[key]]].join(':');
+ })
+ .join(';');
+ }
+
+ return styles;
+}
+
+module.exports = {
+ addUnit: addUnit,
+ isString: isString,
+ isArray: isArray,
+ isObject: isObject,
+ isNoEmptyObj: isNoEmptyObj,
+ includes: includes,
+ cls: cls,
+ getBadgeAriaLabel: getBadgeAriaLabel,
+ _style: _style,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/common/version.d.ts b/miniprogram_npm/tdesign-miniprogram/common/version.d.ts
new file mode 100644
index 0000000..a492558
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/version.d.ts
@@ -0,0 +1,2 @@
+export declare function canIUseFormFieldButton(): boolean;
+export declare function canUseVirtualHost(): boolean;
diff --git a/miniprogram_npm/tdesign-miniprogram/common/version.js b/miniprogram_npm/tdesign-miniprogram/common/version.js
new file mode 100644
index 0000000..a4e7619
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/common/version.js
@@ -0,0 +1,40 @@
+let systemInfo;
+function getSystemInfo() {
+ if (systemInfo == null) {
+ systemInfo = wx.getSystemInfoSync();
+ }
+ return systemInfo;
+}
+function compareVersion(v1, v2) {
+ v1 = v1.split('.');
+ v2 = v2.split('.');
+ const len = Math.max(v1.length, v2.length);
+ while (v1.length < len) {
+ v1.push('0');
+ }
+ while (v2.length < len) {
+ v2.push('0');
+ }
+ for (let i = 0; i < len; i++) {
+ const num1 = parseInt(v1[i]);
+ const num2 = parseInt(v2[i]);
+ if (num1 > num2) {
+ return 1;
+ }
+ else if (num1 < num2) {
+ return -1;
+ }
+ }
+ return 0;
+}
+function judgeByVersion(version) {
+ const currentSDKVersion = getSystemInfo().SDKVersion;
+ return compareVersion(currentSDKVersion, version) >= 0;
+}
+export function canIUseFormFieldButton() {
+ const version = '2.10.3';
+ return judgeByVersion(version);
+}
+export function canUseVirtualHost() {
+ return judgeByVersion('2.19.2');
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/dialog/README.en-US.md
new file mode 100644
index 0000000..2afa1bf
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/README.en-US.md
@@ -0,0 +1,30 @@
+:: BASE_DOC ::
+
+## API
+### Dialog Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+actions | Array / Slot | - | Typescript锛歚Array<ButtonProps>`锛孾Button API Documents](./button?tab=api)銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+button-layout | String | horizontal | options锛歨orizontal/vertical | N
+cancel-btn | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+close-btn | Boolean / Object | false | `0.31.0` | N
+close-on-overlay-click | Boolean | undefined | \- | N
+confirm-btn | String / Object / Slot | - | \- | N
+content | String / Slot | - | \- | N
+external-classes | Array | - | `['t-class', 't-class-content', 't-class-confirm', 't-class-cancel']` | N
+overlay-props | Object | {} | \- | N
+prevent-scroll-through | Boolean | true | \- | N
+show-overlay | Boolean | true | \- | N
+title | String / Slot | - | \- | N
+visible | Boolean | - | \- | N
+z-index | Number | 11500 | \- | N
+
+### Dialog Events
+
+name | params | description
+-- | -- | --
+cancel | - | \-
+close | `(trigger: DialogEventSource)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts)銆�<br/>`type DialogEventSource = 'cancel' \| 'overlay' \| 'close-btn'`<br/>
+confirm | - | \-
+overlay-click | - | \-
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/README.md b/miniprogram_npm/tdesign-miniprogram/dialog/README.md
new file mode 100644
index 0000000..f0192d4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/README.md
@@ -0,0 +1,84 @@
+---
+title: Dialog 瀵硅瘽妗�
+description: 鐢ㄤ簬鏄剧ず閲嶈鎻愮ず鎴栬姹傜敤鎴疯繘琛岄噸瑕佹搷浣滐紝涓�绉嶆墦鏂綋鍓嶆搷浣滅殑妯℃�佽鍥俱��
+spline: message
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-97%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-94%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-82%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
+}
+```
+
+## 浠g爜婕旂ず
+
+鎸夐挳鐨勬牱寮忥紝榛樿浣跨敤 `variant = text`锛屽鏋滀换鎰忔寜閽敼鍙樹簡 `variant`锛岄偅涔堝叏閮ㄦ寜閽兘鏀瑰彉鎴愯繖涓��
+
+### 缁勪欢绫诲瀷
+#### 鍙嶉绫诲璇濇
+
+{{ base }}
+
+> 浣跨敤杩欑鏂瑰紡锛屽璇濇鐨� `visible` 鏄彈鎺х殑锛岄渶瑕佹墜鍔ㄨ缃 `visible` 涓� `false` 鎵嶄細鍏抽棴瀵硅瘽妗嗐��
+
+#### 纭绫诲璇濇
+
+{{ confirm }}
+
+#### 杈撳叆绫诲璇濇
+
+{{ with-input }}
+
+#### 甯﹀浘鐗囧璇濇
+
+{{ with-image }}
+
+### 缁勪欢鐘舵��
+
+{{ status }}
+
+### 缁勪欢鐢ㄦ硶
+#### 鍛戒护璋冪敤
+
+{{ command }}
+
+#### 寮�鍙戣兘鍔涙寜閽�
+
+褰撲紶鍏ョ殑鎸夐挳绫诲瀷涓哄璞℃椂锛屾暣涓璞¢兘灏嗛�忎紶鑷� `t-button`锛屽洜姝ゆ寜閽彲浠ョ洿鎺ヤ娇鐢ㄥ紑鏀捐兘鍔�
+
+{{ button }}
+
+## API
+### Dialog Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+actions | Array / Slot | - | 鎿嶄綔鏍忋�俆S 绫诲瀷锛歚Array<ButtonProps>`锛孾Button API Documents](./button?tab=api)銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+button-layout | String | horizontal | 澶氭寜閽帓鍒楁柟寮忋�傚彲閫夐」锛歨orizontal/vertical | N
+cancel-btn | String / Object / Slot | - | 鍙栨秷鎸夐挳锛屽彲鑷畾涔夈�傚�间负 null 鍒欎笉鏄剧ず鍙栨秷鎸夐挳銆傚�肩被鍨嬩负瀛楃涓诧紝鍒欒〃绀鸿嚜瀹氫箟鎸夐挳鏂囨湰锛屽�肩被鍨嬩负 Object 鍒欒〃绀洪�忎紶 Button 缁勪欢灞炴�с�備娇鐢� Slot 鑷畾涔夋寜閽椂锛岄渶鑷鎺у埗鍙栨秷浜嬩欢銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts) | N
+close-btn | Boolean / Object | false | `0.31.0`銆傛槸鍚﹀睍绀哄叧闂寜閽紝鍊间负 `true` 鏄剧ず榛樿鍏抽棴鎸夐挳锛涘�间负 `false` 鍒欎笉鏄剧ず鍏抽棴鎸夐挳锛涗娇鐢� Object 鏃堕�忎紶鑷冲浘鏍囩粍浠� | N
+close-on-overlay-click | Boolean | undefined | 鐐瑰嚮钂欏眰鏃舵槸鍚﹁Е鍙戝叧闂簨浠� | N
+confirm-btn | String / Object / Slot | - | 纭鎸夐挳銆傚�间负 null 鍒欎笉鏄剧ず纭鎸夐挳銆傚�肩被鍨嬩负瀛楃涓诧紝鍒欒〃绀鸿嚜瀹氫箟鎸夐挳鏂囨湰锛屽�肩被鍨嬩负 Object 鍒欒〃绀洪�忎紶 Button 缁勪欢灞炴�с�備娇鐢� Slot 鑷畾涔夋寜閽椂锛岄渶鑷鎺у埗纭浜嬩欢 | N
+content | String / Slot | - | 鍐呭 | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃� 缁勪欢澶栧眰鍏冪礌銆佺粍浠跺唴瀹归儴鍒嗐�佺‘璁ゆ寜閽�佸彇娑堟寜閽� 绛夊厓绱犵被鍚嶃�俙['t-class', 't-class-content', 't-class-confirm', 't-class-cancel']` | N
+overlay-props | Object | {} | 閫忎紶鑷� Overlay 缁勪欢 | N
+prevent-scroll-through | Boolean | true | 闃叉婊氬姩绌块�� | N
+show-overlay | Boolean | true | 鏄惁鏄剧ず閬僵灞� | N
+title | String / Slot | - | 鏍囬 | N
+visible | Boolean | - | 鎺у埗瀵硅瘽妗嗘槸鍚︽樉绀� | N
+z-index | Number | 11500 | 瀵硅瘽妗嗗眰绾э紝Web 渚ф牱寮忛粯璁や负 2500锛岀Щ鍔ㄧ鏍峰紡榛樿 2500锛屽皬绋嬪簭鏍峰紡榛樿涓� 11500 | N
+
+### Dialog Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+cancel | - | 濡傛灉鈥滃彇娑堚�濇寜閽瓨鍦紝鍒欑偣鍑烩�滃彇娑堚�濇寜閽椂瑙﹀彂锛屽悓鏃惰Е鍙戝叧闂簨浠�
+close | `(trigger: DialogEventSource)` | 鍏抽棴浜嬩欢锛岀偣鍑� 鍙栨秷鎸夐挳 鎴� 鐐瑰嚮钂欏眰 鏃惰Е鍙戙�俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/dialog/type.ts)銆�<br/>`type DialogEventSource = 'cancel' \| 'overlay' \| 'close-btn'`<br/>
+confirm | - | 濡傛灉鈥滅‘璁も�濇寜閽瓨鍦紝鍒欑偣鍑烩�滅‘璁も�濇寜閽椂瑙﹀彂
+overlay-click | - | 濡傛灉钂欏眰瀛樺湪锛岀偣鍑昏挋灞傛椂瑙﹀彂
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.d.ts b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.d.ts
new file mode 100644
index 0000000..b2771b4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.d.ts
@@ -0,0 +1,28 @@
+import { SuperComponent } from '../common/src/index';
+export default class Dialog extends SuperComponent {
+ options: {
+ multipleSlots: boolean;
+ addGlobalClass: boolean;
+ };
+ externalClasses: string[];
+ properties: import("./type").TdDialogProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ buttonVariant: string;
+ };
+ observers: {
+ 'confirmBtn, cancelBtn'(confirm: any, cancel: any): void;
+ };
+ methods: {
+ onTplButtonTap(e: any): void;
+ onConfirm(): void;
+ onCancel(): void;
+ onClose(): void;
+ close(): void;
+ overlayClick(): void;
+ onActionTap(index: number): void;
+ openValueCBHandle(e: any): void;
+ openValueErrCBHandle(e: any): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.js b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.js
new file mode 100644
index 0000000..2ce509c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.js
@@ -0,0 +1,146 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { isObject, toCamel } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-dialog`;
+let Dialog = class Dialog extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.options = {
+ multipleSlots: true,
+ addGlobalClass: true,
+ };
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-content`,
+ `${prefix}-class-confirm`,
+ `${prefix}-class-cancel`,
+ `${prefix}-class-action`,
+ ];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ buttonVariant: 'text',
+ };
+ this.observers = {
+ 'confirmBtn, cancelBtn'(confirm, cancel) {
+ const { prefix, classPrefix, buttonLayout } = this.data;
+ const rect = { buttonVariant: 'text' };
+ const useBaseVariant = [confirm, cancel].some((item) => isObject(item) && item.variant && item.variant !== 'text');
+ const buttonMap = { confirm, cancel };
+ const cls = [`${classPrefix}__button`];
+ const externalCls = [];
+ if (useBaseVariant) {
+ rect.buttonVariant = 'base';
+ cls.push(`${classPrefix}__button--${buttonLayout}`);
+ }
+ else {
+ cls.push(`${classPrefix}__button--text`);
+ externalCls.push(`${classPrefix}-button`);
+ }
+ Object.keys(buttonMap).forEach((key) => {
+ const btn = buttonMap[key];
+ const base = {
+ block: true,
+ class: [...cls, `${classPrefix}__button--${key}`],
+ externalClass: [...externalCls, `${prefix}-class-${key}`],
+ variant: rect.buttonVariant,
+ };
+ if (key === 'cancel' && rect.buttonVariant === 'base') {
+ base.theme = 'light';
+ }
+ if (typeof btn === 'string') {
+ rect[`_${key}`] = Object.assign(Object.assign({}, base), { content: btn });
+ }
+ else if (btn && typeof btn === 'object') {
+ rect[`_${key}`] = Object.assign(Object.assign({}, base), btn);
+ }
+ else {
+ rect[`_${key}`] = null;
+ }
+ });
+ this.setData(Object.assign({}, rect));
+ },
+ };
+ this.methods = {
+ onTplButtonTap(e) {
+ var _a, _b;
+ const evtType = e.type;
+ const { type, extra } = e.target.dataset;
+ const button = this.data[`_${type}`];
+ const cbName = `bind${evtType}`;
+ if (type === 'action') {
+ this.onActionTap(extra);
+ return;
+ }
+ if (typeof button[cbName] === 'function') {
+ const closeFlag = button[cbName](e);
+ if (closeFlag) {
+ this.close();
+ }
+ }
+ const hasOpenType = 'openType' in button;
+ if (!hasOpenType && ['confirm', 'cancel'].includes(type)) {
+ (_a = this[toCamel(`on-${type}`)]) === null || _a === void 0 ? void 0 : _a.call(this, type);
+ }
+ if (evtType !== 'tap') {
+ const success = ((_b = e.detail) === null || _b === void 0 ? void 0 : _b.errMsg.indexOf('ok')) > -1;
+ this.triggerEvent(success ? 'open-type-event' : 'open-type-error-event', e.detail);
+ }
+ },
+ onConfirm() {
+ this.triggerEvent('confirm');
+ if (this._onConfirm) {
+ this._onConfirm();
+ this.close();
+ }
+ },
+ onCancel() {
+ this.triggerEvent('close', { trigger: 'cancel' });
+ this.triggerEvent('cancel');
+ if (this._onCancel) {
+ this._onCancel();
+ this.close();
+ }
+ },
+ onClose() {
+ this.triggerEvent('close', { trigger: 'close-btn' });
+ this.close();
+ },
+ close() {
+ this.setData({ visible: false });
+ },
+ overlayClick() {
+ if (this.properties.closeOnOverlayClick) {
+ this.triggerEvent('close', { trigger: 'overlay' });
+ }
+ this.triggerEvent('overlay-click');
+ },
+ onActionTap(index) {
+ this.triggerEvent('action', { index });
+ if (this._onAction) {
+ this._onAction({ index });
+ this.close();
+ }
+ },
+ openValueCBHandle(e) {
+ this.triggerEvent('open-type-event', e.detail);
+ },
+ openValueErrCBHandle(e) {
+ this.triggerEvent('open-type-error-event', e.detail);
+ },
+ };
+ }
+};
+Dialog = __decorate([
+ wxComponent()
+], Dialog);
+export default Dialog;
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.json b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.json
new file mode 100644
index 0000000..5cfe889
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-popup": "../popup/popup",
+ "t-icon": "../icon/icon",
+ "t-button": "../button/button"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxml b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxml
new file mode 100644
index 0000000..5609dde
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxml
@@ -0,0 +1,57 @@
+<import src="../common/template/button.wxml" />
+<import src="../common/template/icon.wxml" />
+<wxs src="../common/utils.wxs" module="_" />
+<wxs src="./dialog.wxs" module="this" />
+
+<t-popup
+ name="dialog"
+ style="{{_._style([style, customStyle])}}"
+ class="class"
+ t-class="{{classPrefix}}__wrapper"
+ visible="{{visible}}"
+ showOverlay="{{showOverlay}}"
+ closeOnOverlayClick="{{closeOnOverlayClick}}"
+ preventScrollThrough="{{preventScrollThrough}}"
+ overlayProps="{{overlayProps}}"
+ zIndex="{{zIndex}}"
+ placement="center"
+ bind:visible-change="overlayClick"
+>
+ <view slot="content" class="{{classPrefix}} {{prefix}}-class">
+ <slot name="top" />
+ <view wx:if="{{closeBtn}}" class="{{classPrefix}}__close-btn" bind:tap="onClose">
+ <template wx:if="{{_.isObject(closeBtn)}}" is="icon" data="{{ name: 'close', size: 22, ...closeBtn }}" />
+ <t-icon wx:else name="close" size="22" />
+ </view>
+ <view class="{{classPrefix}}__content {{prefix}}-class-content">
+ <view wx:if="{{title}}" class="{{classPrefix}}__header">{{title}}</view>
+ <slot name="title" />
+ <view wx:if="{{content}}" class="{{classPrefix}}__body">
+ <text class="{{classPrefix}}__body-text">{{content}}</text>
+ </view>
+ <slot name="content" />
+ </view>
+ <slot name="middle" />
+ <view
+ class="{{_.cls(classPrefix + '__footer', [['column', buttonLayout === 'vertical'], ['full', buttonVariant == 'text' && actions.length == 0]])}}"
+ >
+ <block wx:if="{{actions}}">
+ <block wx:for="{{actions}}" wx:key="index">
+ <template
+ is="button"
+ data="{{block: true, type: 'action', extra: index, externalClass: prefix + '-class-action', class: this.getActionClass(classPrefix, buttonLayout), ...item }}"
+ />
+ </block>
+ </block>
+ <slot name="actions" />
+ <block wx:if="{{_cancel}}">
+ <template is="button" data="{{type: 'cancel', ..._cancel }}" />
+ </block>
+ <slot name="cancel-btn" />
+ <block wx:if="{{_confirm}}">
+ <template is="button" data="{{type: 'confirm', theme: 'primary', ..._confirm}}" />
+ </block>
+ <slot name="confirm-btn" />
+ </view>
+ </view>
+</t-popup>
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxs b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxs
new file mode 100644
index 0000000..8f70e47
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxs
@@ -0,0 +1,13 @@
+module.exports.getTypeof = function (obj) {
+ return typeof obj;
+};
+
+module.exports.getActionClass = function (prefix, buttonLayout) {
+ var cls = [prefix + '__button', prefix + '__button--action'];
+
+ if (buttonLayout) {
+ cls.push(prefix + '__button--' + buttonLayout);
+ }
+
+ return cls.join(' ');
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxss b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxss
new file mode 100644
index 0000000..b38380d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/dialog.wxss
@@ -0,0 +1,121 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-dialog {
+ overflow: hidden;
+ width: var(--td-dialog-width, 622rpx);
+ border-radius: var(--td-radius-default, 12rpx);
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+}
+.t-dialog__close-btn {
+ position: absolute;
+ top: 16rpx;
+ right: 16rpx;
+ color: var(--td-dialog-close-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+}
+.t-dialog__content {
+ padding: var(--td-spacer-4, 64rpx) var(--td-spacer-3, 48rpx) 0;
+ max-height: var(--td-dialog-body-max-height, 912rpx);
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ font-size: var(--td-font-size-m, 32rpx);
+}
+.t-dialog__header {
+ text-align: center;
+ font-weight: bold;
+ font-size: var(--td-dialog-title-font-size, 36rpx);
+ line-height: var(--td-dialog-title-line-height, 52rpx);
+ color: var(--td-dialog-title-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+}
+.t-dialog__header + .t-dialog__body {
+ margin-top: 16rpx;
+}
+.t-dialog__body {
+ overflow-y: scroll;
+ text-align: center;
+ -webkit-overflow-scrolling: touch;
+ font-size: var(--td-dialog-content-font-size, 32rpx);
+ color: var(--td-dialog-content-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
+ line-height: var(--td-dialog-content-line-height, 48rpx);
+}
+.t-dialog__body-text {
+ word-wrap: break-word;
+}
+.t-dialog__body--left {
+ text-align: left;
+}
+.t-dialog__body--right {
+ text-align: right;
+}
+.t-dialog__footer {
+ display: flex;
+ padding: 48rpx;
+}
+.t-dialog__footer--column {
+ flex-flow: column-reverse;
+}
+.t-dialog__footer--column .t-dialog__button {
+ width: 100%;
+}
+.t-dialog__footer--full {
+ padding: 64rpx 0 0;
+}
+.t-dialog__button {
+ position: relative;
+ flex: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.t-dialog__button--horizontal + .t-dialog__button--horizontal {
+ margin-left: 24rpx;
+}
+.t-dialog__button--vertical + .t-dialog__button--vertical {
+ margin-bottom: 24rpx;
+}
+.t-dialog__button--text {
+ flex: 1;
+ --td-button-border-radius: 0;
+ --td-button-medium-height: 112rpx;
+ border-radius: 0;
+}
+.t-dialog__button--text:before {
+ content: ' ';
+ position: absolute;
+ box-sizing: border-box;
+ top: 0;
+ left: 0;
+ border-top: 1px solid var(--td-border-color, var(--td-gray-color-3, #e7e7e7));
+ border-left: 1px solid var(--td-border-color, var(--td-gray-color-3, #e7e7e7));
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ width: 200%;
+ height: 200%;
+ border-radius: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/index.d.ts b/miniprogram_npm/tdesign-miniprogram/dialog/index.d.ts
new file mode 100644
index 0000000..f0bacf1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/index.d.ts
@@ -0,0 +1,41 @@
+/// <reference types="miniprogram-api-typings" />
+/// <reference types="miniprogram-api-typings" />
+declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+interface DialogAlertOptionsType {
+ context?: Context;
+ selector?: string;
+ title?: string;
+ content: string;
+ zIndex?: number;
+ asyncClose?: boolean;
+ confirmButtonText?: string;
+ textAlign?: string;
+ cancelBtn?: string | object;
+ confirmBtn?: string | object;
+}
+interface DialogConfirmOptionsType extends DialogAlertOptionsType {
+ cancelButtonText?: string;
+}
+interface Action {
+ content: string;
+ theme?: 'default' | 'primary' | 'danger' | 'light';
+}
+interface DialogActionOptionsType {
+ context?: Context;
+ selector?: string;
+ title?: string;
+ content: string;
+ zIndex?: number;
+ asyncClose?: boolean;
+ actions?: Action[];
+ buttonLayout?: 'vertical' | 'horizontal';
+}
+declare const _default: {
+ alert(options: DialogAlertOptionsType): Promise<unknown>;
+ confirm(options: DialogConfirmOptionsType): Promise<unknown>;
+ close(options: DialogConfirmOptionsType): Promise<void>;
+ action(options: DialogActionOptionsType): Promise<{
+ index: number;
+ }>;
+};
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/index.js b/miniprogram_npm/tdesign-miniprogram/dialog/index.js
new file mode 100644
index 0000000..36ccf63
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/index.js
@@ -0,0 +1,72 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+import props from './props';
+import { getInstance } from '../common/utils';
+const defaultOptions = {
+ actions: false,
+ buttonLayout: props.buttonLayout.value,
+ cancelBtn: props.cancelBtn.value,
+ closeOnOverlayClick: props.closeOnOverlayClick.value,
+ confirmBtn: props.confirmBtn.value,
+ content: '',
+ preventScrollThrough: props.preventScrollThrough.value,
+ showOverlay: props.showOverlay.value,
+ title: '',
+ visible: props.visible.value,
+};
+export default {
+ alert(options) {
+ const _a = Object.assign(Object.assign({}, defaultOptions), options), { context, selector = '#t-dialog' } = _a, otherOptions = __rest(_a, ["context", "selector"]);
+ const instance = getInstance(context, selector);
+ if (!instance)
+ return Promise.reject();
+ return new Promise((resolve) => {
+ instance.setData(Object.assign(Object.assign({ cancelBtn: '' }, otherOptions), { visible: true }));
+ instance._onConfirm = resolve;
+ });
+ },
+ confirm(options) {
+ const _a = Object.assign(Object.assign({}, defaultOptions), options), { context, selector = '#t-dialog' } = _a, otherOptions = __rest(_a, ["context", "selector"]);
+ const instance = getInstance(context, selector);
+ if (!instance)
+ return Promise.reject();
+ return new Promise((resolve, reject) => {
+ instance.setData(Object.assign(Object.assign({}, otherOptions), { visible: true }));
+ instance._onConfirm = resolve;
+ instance._onCancel = reject;
+ });
+ },
+ close(options) {
+ const { context, selector = '#t-dialog' } = Object.assign({}, options);
+ const instance = getInstance(context, selector);
+ if (instance) {
+ instance.close();
+ return Promise.resolve();
+ }
+ return Promise.reject();
+ },
+ action(options) {
+ const _a = Object.assign(Object.assign({}, defaultOptions), options), { context, selector = '#t-dialog', actions } = _a, otherOptions = __rest(_a, ["context", "selector", "actions"]);
+ const instance = getInstance(context, selector);
+ if (!instance)
+ return Promise.reject();
+ const { buttonLayout = 'vertical' } = options;
+ const maxLengthSuggestion = buttonLayout === 'vertical' ? 7 : 3;
+ if (!actions || (typeof actions === 'object' && (actions.length === 0 || actions.length > maxLengthSuggestion))) {
+ console.warn(`action 鏁伴噺寤鸿鎺у埗鍦�1鑷�${maxLengthSuggestion}涓猔);
+ }
+ return new Promise((resolve) => {
+ instance.setData(Object.assign(Object.assign({ actions }, otherOptions), { buttonLayout, visible: true }));
+ instance._onAction = resolve;
+ });
+ },
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/props.d.ts b/miniprogram_npm/tdesign-miniprogram/dialog/props.d.ts
new file mode 100644
index 0000000..15d9d87
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/props.d.ts
@@ -0,0 +1,3 @@
+import { TdDialogProps } from './type';
+declare const props: TdDialogProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/props.js b/miniprogram_npm/tdesign-miniprogram/dialog/props.js
new file mode 100644
index 0000000..656bbad
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/props.js
@@ -0,0 +1,52 @@
+const props = {
+ actions: {
+ type: Array,
+ },
+ buttonLayout: {
+ type: String,
+ value: 'horizontal',
+ },
+ cancelBtn: {
+ type: null,
+ },
+ closeBtn: {
+ type: null,
+ value: false,
+ },
+ closeOnOverlayClick: {
+ type: Boolean,
+ value: undefined,
+ },
+ confirmBtn: {
+ type: null,
+ },
+ content: {
+ type: String,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ overlayProps: {
+ type: Object,
+ value: {},
+ },
+ preventScrollThrough: {
+ type: Boolean,
+ value: true,
+ },
+ showOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ title: {
+ type: String,
+ },
+ visible: {
+ type: Boolean,
+ },
+ zIndex: {
+ type: Number,
+ value: 11500,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/type.d.ts b/miniprogram_npm/tdesign-miniprogram/dialog/type.d.ts
new file mode 100644
index 0000000..cb8107f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/type.d.ts
@@ -0,0 +1,63 @@
+import { ButtonProps } from '../button/index';
+export interface TdDialogProps {
+ actions?: {
+ type: ArrayConstructor;
+ value?: Array<ButtonProps>;
+ };
+ buttonLayout?: {
+ type: StringConstructor;
+ value?: 'horizontal' | 'vertical';
+ };
+ cancelBtn?: {
+ type: null;
+ value?: string | ButtonProps | null;
+ };
+ closeBtn?: {
+ type: null;
+ value?: boolean | object;
+ };
+ closeOnOverlayClick?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ confirmBtn?: {
+ type: null;
+ value?: string | ButtonProps | null;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-content', 't-class-confirm', 't-class-cancel'];
+ };
+ overlayProps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ preventScrollThrough?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ title?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/dialog/type.js b/miniprogram_npm/tdesign-miniprogram/dialog/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/dialog/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.d.ts b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.d.ts
new file mode 100644
index 0000000..4c43196
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.d.ts
@@ -0,0 +1,31 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class GridItem extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ relations: RelationsOptions;
+ properties: import("./type").TdGridItemProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ gridItemStyle: string;
+ gridItemWrapperStyle: string;
+ gridItemContentStyle: string;
+ align: string;
+ column: number;
+ describedbyID: string;
+ };
+ observers: {
+ icon(icon: any): void;
+ };
+ lifetimes: {
+ ready(): void;
+ };
+ updateStyle(): void;
+ getWidthStyle(): string;
+ getPaddingStyle(): string;
+ getBorderStyle(): string;
+ onClick(e: any): void;
+ jumpLink(): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.js b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.js
new file mode 100644
index 0000000..33397e9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.js
@@ -0,0 +1,130 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent, isObject } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { uniqueFactory, setIcon } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-grid-item`;
+const getUniqueID = uniqueFactory('grid_item');
+var LinkTypes;
+(function (LinkTypes) {
+ LinkTypes["redirect-to"] = "redirectTo";
+ LinkTypes["switch-tab"] = "switchTab";
+ LinkTypes["relaunch"] = "reLaunch";
+ LinkTypes["navigate-to"] = "navigateTo";
+})(LinkTypes || (LinkTypes = {}));
+let GridItem = class GridItem extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [
+ `${prefix}-class`,
+ `${prefix}-class-content`,
+ `${prefix}-class-image`,
+ `${prefix}-class-text`,
+ `${prefix}-class-description`,
+ ];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.relations = {
+ '../grid/grid': {
+ type: 'ancestor',
+ linked(target) {
+ this.parent = target;
+ this.updateStyle();
+ this.setData({
+ column: target.data.column,
+ });
+ },
+ },
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ gridItemStyle: '',
+ gridItemWrapperStyle: '',
+ gridItemContentStyle: '',
+ align: 'center',
+ column: 0,
+ describedbyID: '',
+ };
+ this.observers = {
+ icon(icon) {
+ const obj = setIcon('icon', icon, '');
+ this.setData(Object.assign({}, obj));
+ },
+ };
+ this.lifetimes = {
+ ready() {
+ this.setData({
+ describedbyID: getUniqueID(),
+ });
+ },
+ };
+ }
+ updateStyle() {
+ const { hover, align } = this.parent.properties;
+ const gridItemStyles = [];
+ const gridItemWrapperStyles = [];
+ const gridItemContentStyles = [];
+ const widthStyle = this.getWidthStyle();
+ const paddingStyle = this.getPaddingStyle();
+ const borderStyle = this.getBorderStyle();
+ widthStyle && gridItemStyles.push(widthStyle);
+ paddingStyle && gridItemWrapperStyles.push(paddingStyle);
+ borderStyle && gridItemContentStyles.push(borderStyle);
+ this.setData({
+ gridItemStyle: `${gridItemStyles.join(';')}`,
+ gridItemWrapperStyle: gridItemWrapperStyles.join(';'),
+ gridItemContentStyle: gridItemContentStyles.join(';'),
+ hover,
+ layout: this.properties.layout,
+ align: align,
+ });
+ }
+ getWidthStyle() {
+ const { column } = this.parent.properties;
+ return column > 0 ? `width:${(1 / column) * 100}%` : '';
+ }
+ getPaddingStyle() {
+ const { gutter } = this.parent.properties;
+ if (gutter)
+ return `padding-left:${gutter}rpx;padding-top:${gutter}rpx`;
+ return '';
+ }
+ getBorderStyle() {
+ const { gutter } = this.parent.properties;
+ let { border } = this.parent.properties;
+ if (!border)
+ return '';
+ if (!isObject(border))
+ border = {};
+ const { color = '#266FE8', width = 2, style = 'solid' } = border;
+ if (gutter)
+ return `border:${width}rpx ${style} ${color}`;
+ return `border-top:${width}rpx ${style} ${color};border-left:${width}rpx ${style} ${color}`;
+ }
+ onClick(e) {
+ const { item } = e.currentTarget.dataset;
+ this.triggerEvent('click', item);
+ this.jumpLink();
+ }
+ jumpLink() {
+ const { url, jumpType } = this.properties;
+ if (url && jumpType) {
+ if (LinkTypes[jumpType]) {
+ wx[LinkTypes[jumpType]]({ url });
+ }
+ }
+ }
+};
+GridItem = __decorate([
+ wxComponent()
+], GridItem);
+export default GridItem;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.json b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.json
new file mode 100644
index 0000000..26991b4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-image": "../image/image",
+ "t-icon": "../icon/icon",
+ "t-badge": "../badge/badge"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxml b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxml
new file mode 100644
index 0000000..e0bb953
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxml
@@ -0,0 +1,79 @@
+<import src="../common/template/image.wxml" />
+<import src="../common/template/icon.wxml" />
+<wxs module="util">
+ module.exports.getImageSize = function(column) { if (column >= 5) return 'small'; if (column == 4) return 'middle';
+ return 'large'; }
+</wxs>
+<wxs module="_" src="../common/utils.wxs" />
+
+<view
+ class="{{_.cls(classPrefix, [['auto-size', column == 0]])}} class {{prefix}}-class"
+ style="{{_._style([gridItemStyle, style, customStyle])}}"
+ hover-class="{{hover ? classPrefix + '--hover':''}}"
+ hover-stay-time="{{200}}"
+ bindtap="onClick"
+ aria-role="{{ariaRole || 'button'}}"
+ aria-label="{{ariaLabel}}"
+ aria-describedby="{{describedbyID}}"
+>
+ <view class="{{_.cls(classPrefix + '__wrapper', [layout])}}" style="{{gridItemWrapperStyle}}">
+ <view
+ class="{{_.cls(classPrefix + '__content', [align, layout])}} {{prefix}}-class-content"
+ style="{{gridItemContentStyle}}"
+ >
+ <slot />
+ <t-badge
+ wx:if="{{image || icon}}"
+ color="{{badgeProps.color || ''}}"
+ content="{{badgeProps.content || ''}}"
+ count="{{badgeProps.count || 0}}"
+ dot="{{badgeProps.dot || false}}"
+ max-count="{{badgeProps.maxCount || 99}}"
+ offset="{{badgeProps.offset || []}}"
+ shape="{{badgeProps.shape || 'circle'}}"
+ show-zero="{{badgeProps.showZero || false}}"
+ size="{{badgeProps.size || 'medium'}}"
+ t-class="{{badgeProps.tClass}}"
+ t-class-content="{{badgeProps.tClassContent}}"
+ t-class-count="{{badgeProps.tClassCount}}"
+ >
+ <view
+ class="{{_.cls(classPrefix + '__image', [util.getImageSize(column), ['icon', icon]])}} {{prefix}}-class-image"
+ >
+ <block wx:if="{{image && image != 'slot'}}">
+ <template
+ is="image"
+ data="{{ src: image, shape: 'round', mode: 'widthFix', tClass: _.cls(classPrefix + '__image', [util.getImageSize(column)]) + ' ' + prefix + '-class-image', ...imageProps }}"
+ />
+ </block>
+ <slot name="image" />
+ <template
+ wx:if="{{iconName || _.isNoEmptyObj(iconData)}}"
+ is="icon"
+ data="{{class: classPrefix + '__icon', name: iconName, ...iconData}}"
+ />
+ </view>
+ </t-badge>
+ <view
+ class="{{_.cls(classPrefix + '__words', [layout])}}"
+ id="{{describedbyID}}"
+ aria-label="{{ ariaLabel || (badgeProps.dot || badgeProps.count ? text + ',' + description + ',' + _.getBadgeAriaLabel({ ...badgeProps }) : '') }}"
+ >
+ <view
+ wx:if="{{text}}"
+ class="{{_.cls(classPrefix + '__text', [util.getImageSize(column), layout])}} {{prefix}}-class-text"
+ >
+ {{text}}
+ </view>
+ <slot name="text" />
+ <view
+ wx:if="{{description}}"
+ class="{{_.cls(classPrefix + '__description', [util.getImageSize(column), layout])}} {{prefix}}-class-description"
+ >
+ {{description}}
+ </view>
+ <slot name="description" />
+ </view>
+ </view>
+ </view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxss b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxss
new file mode 100644
index 0000000..13d8392
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/grid-item.wxss
@@ -0,0 +1,124 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-grid-item {
+ box-sizing: border-box;
+ height: 100%;
+ display: inline-block;
+ vertical-align: top;
+}
+.t-grid-item--hover {
+ background-color: var(--td-grid-item-hover-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-grid-item--auto-size {
+ width: 168rpx;
+}
+.t-grid-item__content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ overflow: hidden;
+ position: relative;
+ padding: var(--td-grid-item-padding, 32rpx) 0 24rpx;
+}
+.t-grid-item__content--horizontal {
+ flex-direction: row;
+ padding-left: var(--td-grid-item-padding, 32rpx);
+}
+.t-grid-item__words {
+ width: 100%;
+ text-align: center;
+ position: relative;
+ flex-direction: column;
+ display: flex;
+ flex: 1;
+ justify-content: center;
+ align-items: center;
+}
+.t-grid-item__words--horizontal {
+ margin-left: 24rpx;
+}
+.t-grid-item__words:empty {
+ display: none;
+}
+.t-grid-item__image:not(:empty) {
+ width: var(--td-grid-item-image-width, 96rpx);
+ height: var(--td-grid-item-image-width, 96rpx);
+}
+.t-grid-item__image:not(:empty).t-grid-item__image--small {
+ width: 64rpx;
+ height: 64rpx;
+}
+.t-grid-item__image:not(:empty).t-grid-item__image--middle {
+ width: 80rpx;
+ height: 80rpx;
+}
+.t-grid-item__image:not(:empty) .t-grid__image {
+ width: 100%;
+ height: 100%;
+}
+.t-grid-item__image--icon {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3));
+ border-radius: var(--td-radius-default, 12rpx);
+}
+.t-grid-item--left {
+ justify-self: flex-start;
+ align-items: flex-start;
+}
+.t-grid-item--left .t-grid-item__words {
+ text-align: left;
+}
+.t-grid-item__text {
+ width: inherit;
+ color: var(--td-grid-item-text-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ font-size: var(--td-grid-item-text-font-size, 28rpx);
+ line-height: var(--td-grid-item-text-line-height, 44rpx);
+ padding-top: var(--td-grid-item-text-padding-top, 16rpx);
+}
+.t-grid-item__text--small,
+.t-grid-item__text--middle {
+ font-size: 24rpx;
+}
+.t-grid-item__text--horizontal {
+ padding-top: 0;
+ text-align: left;
+}
+.t-grid-item__description {
+ width: inherit;
+ color: var(--td-grid-item-description-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+ font-size: var(--td-grid-item-description-font-size, 24rpx);
+ line-height: var(--td-grid-item-description-line-height, 40rpx);
+}
+.t-grid-item__description--horizontal {
+ text-align-last: left;
+}
+.t-grid-item__icon {
+ font-size: 48rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/props.d.ts b/miniprogram_npm/tdesign-miniprogram/grid-item/props.d.ts
new file mode 100644
index 0000000..bd6c2fb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/props.d.ts
@@ -0,0 +1,3 @@
+import { TdGridItemProps } from './type';
+declare const props: TdGridItemProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/props.js b/miniprogram_npm/tdesign-miniprogram/grid-item/props.js
new file mode 100644
index 0000000..df49d24
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/props.js
@@ -0,0 +1,37 @@
+const props = {
+ badgeProps: {
+ type: Object,
+ value: null,
+ },
+ description: {
+ type: String,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ icon: {
+ type: null,
+ },
+ image: {
+ type: String,
+ },
+ imageProps: {
+ type: Object,
+ },
+ jumpType: {
+ type: String,
+ value: 'navigate-to',
+ },
+ layout: {
+ type: String,
+ value: 'vertical',
+ },
+ text: {
+ type: String,
+ },
+ url: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/type.d.ts b/miniprogram_npm/tdesign-miniprogram/grid-item/type.d.ts
new file mode 100644
index 0000000..c75363b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/type.d.ts
@@ -0,0 +1,47 @@
+import { BadgeProps } from '../badge/index';
+export interface TdGridItemProps {
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: BadgeProps;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ description?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-image', 't-class-text', 't-class-description'];
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ image?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ imageProps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ jumpType?: {
+ type: StringConstructor;
+ value?: 'redirect-to' | 'switch-tab' | 'relaunch' | 'navigate-to';
+ };
+ layout?: {
+ type: StringConstructor;
+ value?: 'vertical' | 'horizontal';
+ };
+ text?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ url?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid-item/type.js b/miniprogram_npm/tdesign-miniprogram/grid-item/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid-item/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/grid/README.en-US.md
new file mode 100644
index 0000000..9ea1966
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/README.en-US.md
@@ -0,0 +1,29 @@
+:: BASE_DOC ::
+
+## API
+### Grid Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+align | String | center | options锛歭eft/center | N
+border | Boolean / Object | false | Typescript锛歚boolean \| { color?: string; width?: string; style?: 'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'groove' \| 'inset' \| 'outset' }` | N
+column | Number | 4 | \- | N
+external-classes | Array | - | `['t-class']` | N
+gutter | Number | - | \- | N
+hover | Boolean | false | \- | N
+theme | String | default | options锛歞efault/card | N
+
+### GridItem Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+badge-props | Object | null | Typescript锛歚BadgeProps`锛孾Badge API Documents](./badge?tab=api)銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/grid-item/type.ts) | N
+description | String / Slot | - | \- | N
+external-classes | Array | - | `['t-class', 't-class-image', 't-class-text', 't-class-description']` | N
+icon | String / Object | - | \- | N
+image | String / Slot | - | \- | N
+image-props | Object | - | \- | N
+jump-type | String | navigate-to | options锛歳edirect-to/switch-tab/relaunch/navigate-to | N
+layout | String | vertical | options锛歷ertical/horizontal | N
+text | String / Slot | - | \- | N
+url | String | - | \- | N
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/README.md b/miniprogram_npm/tdesign-miniprogram/grid/README.md
new file mode 100644
index 0000000..355a0eb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/README.md
@@ -0,0 +1,84 @@
+---
+title: Grid 瀹牸
+description: 鐢ㄤ簬鍔熻兘鍏ュ彛甯冨眬锛屽皢椤甸潰鎴栫壒瀹氬尯鍩熷垏鍒嗘垚鑻ュ共绛夊ぇ鐨勫尯鍧楋紝褰㈡垚鑻ュ共鍔熻兘鍏ュ彛銆�
+spline: data
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-97%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-93%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-97%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-94%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-grid": "tdesign-miniprogram/grid/grid",
+ "t-grid-item": "tdesign-miniprogram/grid-item/grid-item"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 缁勪欢绫诲瀷
+鍩虹瀹牸
+
+{{ base }}
+
+甯﹁鏄庣殑瀹牸
+
+{{ description }}
+
+甯﹁竟妗嗙殑瀹牸
+
+{{ border }}
+
+甯﹀窘绔犵殑瀹牸
+
+{{ badge }}
+
+鍙粦鍔ㄧ殑瀹牸
+
+{{ scroll }}
+
+### 缁勪欢鏍峰紡
+
+鍙紶鍥炬爣鐨勫鏍�
+
+{{ icon-grid }}
+
+澶氳瀹牸
+
+{{ multiple }}
+
+鍗$墖瀹牸
+
+{{ card }}
+
+
+## API
+### Grid Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+align | String | center | 鍐呭瀵归綈鏂瑰紡銆傚彲閫夐」锛歭eft/center | N
+border | Boolean / Object | false | 杈规锛岄粯璁や笉鏄剧ず銆傚�间负 true 鍒欐樉绀洪粯璁よ竟妗嗭紝鍊肩被鍨嬩负 object 鍒欒〃绀鸿嚜瀹氫箟杈规鏍峰紡銆俆S 绫诲瀷锛歚boolean \| { color?: string; width?: string; style?: 'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'groove' \| 'inset' \| 'outset' }` | N
+column | Number | 4 | 姣忎竴琛岀殑鍒楁暟閲忥紱涓� 0 鏃剁瓑浜庡浐瀹氬ぇ灏� | N
+external-classes | Array | - | 缁勪欢绫诲悕锛岀敤浜庤缃粍浠跺灞傚厓绱犵被鍚嶃�俙['t-class']` | N
+gutter | Number | - | 闂撮殧澶у皬 | N
+hover | Boolean | false | 鏄惁寮�鍚偣鍑诲弽棣� | N
+theme | String | default | 瀹牸鐨勯鏍笺�傚彲閫夐」锛歞efault/card | N
+
+### GridItem Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+badge-props | Object | null | 閫忎紶鑷� Badge 灞炴�с�俆S 绫诲瀷锛歚BadgeProps`锛孾Badge API Documents](./badge?tab=api)銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/grid-item/type.ts) | N
+description | String / Slot | - | 鏂囨湰浠ュ鐨勬洿澶氭弿杩帮紝杈呭姪淇℃伅銆傚彲浠ラ�氳繃 Props 浼犲叆鏂囨湰锛屼篃鍙互鑷畾涔夋爣棰樿妭鐐� | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃粍浠跺灞傚厓绱犮�佸浘鐗囥�佹枃鏈�佹弿杩扮瓑鍏冪礌绫诲悕銆俙['t-class', 't-class-image', 't-class-text', 't-class-description']` | N
+icon | String / Object | - | 鍥炬爣鍚嶇О銆傚�间负瀛楃涓茶〃绀哄浘鏍囧悕绉帮紝鍊间负 `Object` 绫诲瀷锛岃〃绀洪�忎紶鑷� `icon` | N
+image | String / Slot | - | 鍥剧墖锛屽彲浠ユ槸鍥剧墖鍦板潃锛屼篃鍙互鑷畾涔夊浘鐗囪妭鐐癸紝鍊间负 slot 鐨勬椂鍊欐墠鑳戒娇鐢ㄦ彃妲� | N
+image-props | Object | - | 閫忎紶鑷� Image 缁勪欢 | N
+jump-type | String | navigate-to | 閾炬帴璺宠浆绫诲瀷銆傚彲閫夐」锛歳edirect-to/switch-tab/relaunch/navigate-to | N
+layout | String | vertical | 鍐呭甯冨眬鏂瑰紡銆傚彲閫夐」锛歷ertical/horizontal | N
+text | String / Slot | - | 鏂囨湰锛屽彲浠ラ�氳繃 Props 浼犲叆鏂囨湰锛屼篃鍙互鑷畾涔夋爣棰樿妭鐐� | N
+url | String | - | 鐐瑰嚮鍚庣殑璺宠浆閾炬帴 | N
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.d.ts b/miniprogram_npm/tdesign-miniprogram/grid/grid.d.ts
new file mode 100644
index 0000000..298f660
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.d.ts
@@ -0,0 +1,23 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class Grid extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ properties: import("./type").TdGridProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ contentStyle: string;
+ };
+ observers: {
+ 'column,hover,align'(): void;
+ 'gutter,border'(): void;
+ };
+ lifetimes: {
+ attached(): void;
+ };
+ methods: {
+ doForChild(action: (item: WechatMiniprogram.Component.TrivialInstance) => void): void;
+ updateContentStyle(): void;
+ getContentMargin(): string;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.js b/miniprogram_npm/tdesign-miniprogram/grid/grid.js
new file mode 100644
index 0000000..042b7a5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.js
@@ -0,0 +1,69 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { isObject, SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-grid`;
+let Grid = class Grid extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = ['t-class'];
+ this.relations = {
+ '../grid-item/grid-item': {
+ type: 'descendant',
+ },
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ contentStyle: '',
+ };
+ this.observers = {
+ 'column,hover,align'() {
+ this.updateContentStyle();
+ },
+ 'gutter,border'() {
+ this.updateContentStyle();
+ this.doForChild((child) => child.updateStyle());
+ },
+ };
+ this.lifetimes = {
+ attached() {
+ this.updateContentStyle();
+ },
+ };
+ this.methods = {
+ doForChild(action) {
+ this.$children.forEach(action);
+ },
+ updateContentStyle() {
+ const contentStyles = [];
+ const marginStyle = this.getContentMargin();
+ marginStyle && contentStyles.push(marginStyle);
+ this.setData({
+ contentStyle: contentStyles.join(';'),
+ });
+ },
+ getContentMargin() {
+ const { gutter } = this.properties;
+ let { border } = this.properties;
+ if (!border)
+ return `margin-left:-${gutter}rpx; margin-top:-${gutter}rpx`;
+ if (!isObject(border))
+ border = {};
+ const { width = 2 } = border;
+ return `margin-left:-${width}rpx; margin-top:-${width}rpx`;
+ },
+ };
+ }
+};
+Grid = __decorate([
+ wxComponent()
+], Grid);
+export default Grid;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.json b/miniprogram_npm/tdesign-miniprogram/grid/grid.json
new file mode 100644
index 0000000..a89ef4d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.wxml b/miniprogram_npm/tdesign-miniprogram/grid/grid.wxml
new file mode 100644
index 0000000..d497d7c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.wxml
@@ -0,0 +1,16 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view style="{{_._style([style, customStyle])}}" class="{{_.cls(classPrefix, [theme])}} class {{prefix}}-class">
+ <view wx:if="{{column > 0}}" class="{{classPrefix}}__content" style="{{ contentStyle }}">
+ <slot />
+ </view>
+ <scroll-view
+ wx:else
+ scroll-x
+ scroll-with-animation
+ class="{{classPrefix}}__content"
+ style="{{ 'white-space: nowrap;' + contentStyle }}"
+ >
+ <slot />
+ </scroll-view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/grid.wxss b/miniprogram_npm/tdesign-miniprogram/grid/grid.wxss
new file mode 100644
index 0000000..a3ae3c3
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/grid.wxss
@@ -0,0 +1,40 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-grid {
+ position: relative;
+ overflow: hidden;
+ background-color: var(--td-grid-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-grid__content {
+ width: auto;
+}
+.t-grid--card {
+ margin: 0 32rpx;
+ border-radius: var(--td-grid-card-radius, var(--td-radius-large, 18rpx));
+ overflow: hidden;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/props.d.ts b/miniprogram_npm/tdesign-miniprogram/grid/props.d.ts
new file mode 100644
index 0000000..f8f2feb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/props.d.ts
@@ -0,0 +1,3 @@
+import { TdGridProps } from './type';
+declare const props: TdGridProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/props.js b/miniprogram_npm/tdesign-miniprogram/grid/props.js
new file mode 100644
index 0000000..3285984
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/props.js
@@ -0,0 +1,29 @@
+const props = {
+ align: {
+ type: String,
+ value: 'center',
+ },
+ border: {
+ type: null,
+ value: false,
+ },
+ column: {
+ type: Number,
+ value: 4,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ gutter: {
+ type: Number,
+ },
+ hover: {
+ type: Boolean,
+ value: false,
+ },
+ theme: {
+ type: String,
+ value: 'default',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/type.d.ts b/miniprogram_npm/tdesign-miniprogram/grid/type.d.ts
new file mode 100644
index 0000000..7bd826c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/type.d.ts
@@ -0,0 +1,38 @@
+export interface TdGridProps {
+ align?: {
+ type: StringConstructor;
+ value?: 'left' | 'center';
+ };
+ border?: {
+ type: null;
+ value?: boolean | {
+ color?: string;
+ width?: string;
+ style?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'inset' | 'outset';
+ };
+ };
+ column?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class'];
+ };
+ gutter?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ hover?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'default' | 'card';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/grid/type.js b/miniprogram_npm/tdesign-miniprogram/grid/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/grid/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/README.md b/miniprogram_npm/tdesign-miniprogram/icon/README.md
new file mode 100644
index 0000000..1a77bf7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/README.md
@@ -0,0 +1,101 @@
+---
+title: Icon 鍥炬爣
+description: 鍥炬爣銆�
+spline: base
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-100%25-blue" /></span>
+
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-icon": "tdesign-miniprogram/icon/icon"
+}
+```
+
+## 甯歌闂
+
+<details>
+ <summary>
+ 鎺у埗鍙板憡璀︼細Faild to load font
+ <span class="icon">馃憞</span>
+ </summary>
+ <p style="margin-top: 10px; color: rgba(0, 0, 0, .6)">
+ 鍛婅灞炰簬寮�鍙戣�呭伐鍏风殑 bug锛屽彲浠ュ拷鐣ワ紝鍏蜂綋鍙互鐪� <a href="https://developers.weixin.qq.com/miniprogram/dev/api/ui/font/wx.loadFontFace.html" target="_blank">瀹樼綉鏂囨。</a>
+ </p>
+</details>
+
+## 浠g爜婕旂ず
+
+### 鍩虹缁勪欢鍥炬爣
+
+{{ base }}
+
+### 鑷畾涔夌粍浠跺浘鏍�
+
+{{ custom }}
+
+鑷畾涔夊浘鏍囩敤娉曪紝涓嬮潰浠� `iconfont` 涓轰緥
+
+#### 鍑嗗鍥炬爣鏂囦欢
+
+鏂囦欢鍚庣紑搴斾负`.wxss`锛屽涓嬫柟浠g爜鍧楁墍绀猴細
+
+```css
+@font-face {
+ font-family: 'icon'; // 浣跨敤鑷畾涔夌殑瀛椾綋鍚嶇О
+ 路路路
+}
+
+.icon {
+ font-family: 'icon' !important; // 瀛椾綋鍚嶇О
+ 路路路
+}
+
+.icon-a-0:before { // icon 鍥炬爣銆傛敞鎰� FontClass 鍓嶇紑涓� font-family 淇濇寔涓�鑷�
+ content: '\e64d';
+}
+```
+- 娣诲姞鎵�闇�鍥炬爣锛屼笅杞藉浘鏍囥�傚浘鏍囧簱涓�鑸細鎻愪緵 **鍦ㄧ嚎閾炬帴** 鎴栬�� **涓嬭浇鑷虫湰鍦�** 绛変娇鐢ㄦ柟寮忋��**鍦ㄧ嚎閾炬帴** 鏂瑰紡浼氭寚鍚戜竴涓� `.css` 鏂囦欢锛屽彲浠ヤ笅杞芥垨澶嶅埗鍏跺唴瀹癸紝灏嗗叾淇敼鎴愬悗缂�鍚嶄负 `.wxss` 鐨勬枃浠�
+- 灏� `.wxss` 鏂囦欢涓殑 `FontClass/Symbol鍓嶇紑` 涓� `Font Family` 涓ら」鍐呭淇濇寔涓�鑷达紝濡�: `FontClass/Symbol` 鍓嶇紑涓� `icon-`锛屽垯 `Font Family` 涓� `icon`銆�
+
+> 娉細鑻ユ槸閲囩敤 `涓嬭浇鑷虫湰鍦癭 鏂瑰紡锛岄渶鍏虫敞 `.css` 鍜� `.ttf` 鏂囦欢銆傜敱浜庡井淇″皬绋嬪簭涓嶆敮鎸佸鐞� `ttf銆亀off銆乪ot` 绛夋枃浠讹紝浣嗘敮鎸� `base64`锛屾墍浠ラ渶瑕佸皢 `.ttf` 鏂囦欢杞崲涓� `base64` (鍙�熷姪杞崲宸ュ叿锛屽 [transfonter.org](https://transfonter.org/)锛屼細寰楀埌涓�涓� `stylesheet.css` 鏂囦欢)锛岀劧鍚庡皢 `.css` 鏂囦欢涓殑 `@font-face {}` 鍐呭鏇挎崲涓� `stylesheet.css` 涓殑 `base64` 鍐呭锛屾渶鍚庡皢 `.css` 鏂囦欢淇敼鍚庣紑涓� `.wxss`
+
+#### 寮曞叆鑷畾涔夊浘鏍�
+
+- 鍏ㄥ眬寮曞叆锛氬湪椤圭洰 `app.wxss`锛屼娇鐢� `@import` 寮曞叆涓婅堪鐨� `.wxss` 鏂囦欢
+- 灞�閮ㄥ紩鍏ワ細鍦� `page` 瀵瑰簲鐨� `.wxss` 涓紝浣跨敤 `@import` 寮曞叆涓婅堪鐨� `.wxss` 鏂囦欢
+
+#### 鑷畾涔夊浘鏍囩殑浣跨敤
+
+ `<t-icon>` 缁勪欢涓殑 `prefix` 灞炴�у�间笌鍓嶉潰璁剧疆鐨� `Font Family` 淇濇寔涓�鑷达紝鍗� `prefix="icon"`锛宍name` 灞炴�у�间负鑷畾涔夊浘鏍囧悕绉帮紝濡傚浘鏍囩殑 `className` 涓� `icon-a-1h`锛屽垯 `name="a-1h"`銆�
+
+### 鍥剧墖閾炬帴
+
+{{ iconImage }}
+
+### 鍏ㄩ儴鍥炬爣
+
+<td-icons-view />
+
+## API
+
+#### Props
+
+| 灞炴�� | 鍊肩被鍨� | 榛樿鍊� | 蹇呬紶 | 璇存槑 |
+| ----------- | -------- | ---------- | ---- |----------------------------------------------------------------- |
+| name | String | - | Y | 鍥炬爣鍚嶇О鎴栧浘鐗囬摼鎺� |
+| size | String | - | N | 鍥炬爣澶у皬, 濡� `20`, `20px`, `48rpx`, 榛樿鍗曚綅鏄� `px` |
+| color | String | - | N | 鍥炬爣棰滆壊 |
+| prefix | String | - | N | 鑷畾涔夊浘鏍囧墠缂� |
+| external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃� 缁勪欢澶栧眰鍏冪礌銆佸浘鐗囧浘鏍囥�佸熀纭�鍥炬爣绛夊厓绱犵被鍚嶃�俙['t-class']` | N
+
+#### Events
+
+| 浜嬩欢 | 鍙傛暟 | 璇存槑 |
+| ---------- | ------------ | -------------- |
+| click | \- | 鐐瑰嚮鍥炬爣鏃惰Е鍙� |
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.d.ts b/miniprogram_npm/tdesign-miniprogram/icon/icon.d.ts
new file mode 100644
index 0000000..b70696a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.d.ts
@@ -0,0 +1,18 @@
+import { SuperComponent } from '../common/src/index';
+export default class Icon extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdIconProps;
+ data: {
+ componentPrefix: string;
+ classPrefix: string;
+ isImage: boolean;
+ iconStyle: any;
+ };
+ observers: {
+ 'name, color, size, style'(): void;
+ };
+ methods: {
+ onTap(event: any): void;
+ setIconStyle(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.js b/miniprogram_npm/tdesign-miniprogram/icon/icon.js
new file mode 100644
index 0000000..45f782c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.js
@@ -0,0 +1,51 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { styles, addUnit } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-icon`;
+let Icon = class Icon extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.data = {
+ componentPrefix: prefix,
+ classPrefix: name,
+ isImage: false,
+ iconStyle: undefined,
+ };
+ this.observers = {
+ 'name, color, size, style'() {
+ this.setIconStyle();
+ },
+ };
+ this.methods = {
+ onTap(event) {
+ this.triggerEvent('click', event.detail);
+ },
+ setIconStyle() {
+ const { name, color, size } = this.properties;
+ const isImage = name.indexOf('/') !== -1;
+ const sizeValue = addUnit(size);
+ const sizeStyle = isImage ? { width: sizeValue, height: sizeValue } : {};
+ const colorStyle = color ? { color: color } : {};
+ const fontStyle = size ? { 'font-size': sizeValue } : {};
+ this.setData({
+ isImage,
+ iconStyle: `${styles(Object.assign(Object.assign(Object.assign({}, colorStyle), fontStyle), sizeStyle))}`,
+ });
+ },
+ };
+ }
+};
+Icon = __decorate([
+ wxComponent()
+], Icon);
+export default Icon;
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.json b/miniprogram_npm/tdesign-miniprogram/icon/icon.json
new file mode 100644
index 0000000..a89ef4d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.wxml b/miniprogram_npm/tdesign-miniprogram/icon/icon.wxml
new file mode 100644
index 0000000..9146939
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.wxml
@@ -0,0 +1,15 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ class="{{ prefix ? prefix : classPrefix}} class {{componentPrefix}}-class"
+ style="{{_._style([iconStyle, style, customStyle])}}"
+ bind:tap="onTap"
+ aria-hidden="{{ariaHidden}}"
+ aria-label="{{ariaLabel}}"
+ aria-role="{{ariaRole}}"
+>
+ <view wx:if="{{ isImage }}" class="{{classPrefix}}--image">
+ <image src="{{ name }}" mode="aspectFit" class="{{classPrefix}}__image" />
+ </view>
+ <label wx:else class="{{ prefix ? prefix : classPrefix }}-{{ name }} {{ classPrefix }}-base"> </label>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/icon.wxss b/miniprogram_npm/tdesign-miniprogram/icon/icon.wxss
new file mode 100644
index 0000000..9b6c865
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/icon.wxss
@@ -0,0 +1,770 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+@font-face {
+ font-family: t;
+ src: url('https://tdesign.gtimg.com/icon/0.1.2/fonts/t.eot'), url('https://tdesign.gtimg.com/icon/0.1.2/fonts/t.eot?#iefix') format('ded-opentype'), url('https://tdesign.gtimg.com/icon/0.1.2/fonts/t.woff') format('woff'), url('https://tdesign.gtimg.com/icon/0.1.2/fonts/t.ttf') format('truetype'), url('https://tdesign.gtimg.com/icon/0.1.2/fonts/t.svg') format('svg');
+ /* iOS 4.1- */
+ font-weight: normal;
+ font-style: normal;
+}
+.t-icon--image {
+ width: 1em;
+ height: 1em;
+}
+.t-icon__image {
+ vertical-align: top;
+ width: 100%;
+ height: 100%;
+}
+.t-icon-base {
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+ text-align: center;
+ display: block;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+.t-icon {
+ /* stylelint-disable-next-line declaration-no-important */
+ font-family: t !important;
+ /* prevent issues with browser extensions that change fonts */
+}
+.t-icon-add-circle:before {
+ content: '\E001';
+}
+.t-icon-add-rectangle:before {
+ content: '\E002';
+}
+.t-icon-add:before {
+ content: '\E003';
+}
+.t-icon-app:before {
+ content: '\E004';
+}
+.t-icon-arrow-down-rectangle:before {
+ content: '\E005';
+}
+.t-icon-arrow-down:before {
+ content: '\E006';
+}
+.t-icon-arrow-left:before {
+ content: '\E007';
+}
+.t-icon-arrow-right:before {
+ content: '\E008';
+}
+.t-icon-arrow-up:before {
+ content: '\E009';
+}
+.t-icon-attach:before {
+ content: '\E00A';
+}
+.t-icon-backtop-rectangle:before {
+ content: '\E00B';
+}
+.t-icon-backtop:before {
+ content: '\E00C';
+}
+.t-icon-backward:before {
+ content: '\E00D';
+}
+.t-icon-barcode:before {
+ content: '\E00E';
+}
+.t-icon-books:before {
+ content: '\E00F';
+}
+.t-icon-browse-off:before {
+ content: '\E010';
+}
+.t-icon-browse:before {
+ content: '\E011';
+}
+.t-icon-bulletpoint:before {
+ content: '\E012';
+}
+.t-icon-calendar:before {
+ content: '\E013';
+}
+.t-icon-call:before {
+ content: '\E014';
+}
+.t-icon-caret-down-small:before {
+ content: '\E015';
+}
+.t-icon-caret-down:before {
+ content: '\E016';
+}
+.t-icon-caret-left-small:before {
+ content: '\E017';
+}
+.t-icon-caret-left:before {
+ content: '\E018';
+}
+.t-icon-caret-right-small:before {
+ content: '\E019';
+}
+.t-icon-caret-right:before {
+ content: '\E01A';
+}
+.t-icon-caret-up-small:before {
+ content: '\E01B';
+}
+.t-icon-caret-up:before {
+ content: '\E01C';
+}
+.t-icon-cart:before {
+ content: '\E01D';
+}
+.t-icon-chart-bar:before {
+ content: '\E01E';
+}
+.t-icon-chart-bubble:before {
+ content: '\E01F';
+}
+.t-icon-chart-pie:before {
+ content: '\E020';
+}
+.t-icon-chart:before {
+ content: '\E021';
+}
+.t-icon-chat:before {
+ content: '\E022';
+}
+.t-icon-check-circle-filled:before {
+ content: '\E023';
+}
+.t-icon-check-circle:before {
+ content: '\E024';
+}
+.t-icon-check-rectangle-filled:before {
+ content: '\E025';
+}
+.t-icon-check-rectangle:before {
+ content: '\E026';
+}
+.t-icon-check:before {
+ content: '\E027';
+}
+.t-icon-chevron-down-circle:before {
+ content: '\E028';
+}
+.t-icon-chevron-down-rectangle:before {
+ content: '\E029';
+}
+.t-icon-chevron-down:before {
+ content: '\E02A';
+}
+.t-icon-chevron-left-circle:before {
+ content: '\E02B';
+}
+.t-icon-chevron-left-double:before {
+ content: '\E02C';
+}
+.t-icon-chevron-left-rectangle:before {
+ content: '\E02D';
+}
+.t-icon-chevron-left:before {
+ content: '\E02E';
+}
+.t-icon-chevron-right-circle:before {
+ content: '\E02F';
+}
+.t-icon-chevron-right-double:before {
+ content: '\E030';
+}
+.t-icon-chevron-right-rectangle:before {
+ content: '\E031';
+}
+.t-icon-chevron-right:before {
+ content: '\E032';
+}
+.t-icon-chevron-up-circle:before {
+ content: '\E033';
+}
+.t-icon-chevron-up-rectangle:before {
+ content: '\E034';
+}
+.t-icon-chevron-up:before {
+ content: '\E035';
+}
+.t-icon-circle:before {
+ content: '\E036';
+}
+.t-icon-clear:before {
+ content: '\E037';
+}
+.t-icon-close-circle-filled:before {
+ content: '\E038';
+}
+.t-icon-close-circle:before {
+ content: '\E039';
+}
+.t-icon-close-rectangle:before {
+ content: '\E03A';
+}
+.t-icon-close:before {
+ content: '\E03B';
+}
+.t-icon-cloud-download:before {
+ content: '\E03C';
+}
+.t-icon-cloud-upload:before {
+ content: '\E03D';
+}
+.t-icon-cloud:before {
+ content: '\E03E';
+}
+.t-icon-code:before {
+ content: '\E03F';
+}
+.t-icon-control-platform:before {
+ content: '\E040';
+}
+.t-icon-creditcard:before {
+ content: '\E041';
+}
+.t-icon-dashboard:before {
+ content: '\E042';
+}
+.t-icon-delete:before {
+ content: '\E043';
+}
+.t-icon-desktop:before {
+ content: '\E044';
+}
+.t-icon-discount-filled:before {
+ content: '\E045';
+}
+.t-icon-discount:before {
+ content: '\E046';
+}
+.t-icon-download:before {
+ content: '\E047';
+}
+.t-icon-edit-1:before {
+ content: '\E048';
+}
+.t-icon-edit:before {
+ content: '\E049';
+}
+.t-icon-ellipsis:before {
+ content: '\E04A';
+}
+.t-icon-enter:before {
+ content: '\E04B';
+}
+.t-icon-error-circle-filled:before {
+ content: '\E04C';
+}
+.t-icon-error-circle:before {
+ content: '\E04D';
+}
+.t-icon-error:before {
+ content: '\E04E';
+}
+.t-icon-file-add:before {
+ content: '\E04F';
+}
+.t-icon-file-copy:before {
+ content: '\E050';
+}
+.t-icon-file-excel:before {
+ content: '\E051';
+}
+.t-icon-file-icon:before {
+ content: '\E052';
+}
+.t-icon-file-image:before {
+ content: '\E053';
+}
+.t-icon-file-paste:before {
+ content: '\E054';
+}
+.t-icon-file-pdf:before {
+ content: '\E055';
+}
+.t-icon-file-powerpoint:before {
+ content: '\E056';
+}
+.t-icon-file-unknown:before {
+ content: '\E057';
+}
+.t-icon-file-word:before {
+ content: '\E058';
+}
+.t-icon-file:before {
+ content: '\E059';
+}
+.t-icon-filter-clear:before {
+ content: '\E05A';
+}
+.t-icon-filter:before {
+ content: '\E05B';
+}
+.t-icon-flag:before {
+ content: '\E05C';
+}
+.t-icon-folder-add:before {
+ content: '\E05D';
+}
+.t-icon-folder-open:before {
+ content: '\E05E';
+}
+.t-icon-folder:before {
+ content: '\E05F';
+}
+.t-icon-fork:before {
+ content: '\E060';
+}
+.t-icon-format-horizontal-align-bottom:before {
+ content: '\E061';
+}
+.t-icon-format-horizontal-align-center:before {
+ content: '\E062';
+}
+.t-icon-format-horizontal-align-top:before {
+ content: '\E063';
+}
+.t-icon-format-vertical-align-center:before {
+ content: '\E064';
+}
+.t-icon-format-vertical-align-left:before {
+ content: '\E065';
+}
+.t-icon-format-vertical-align-right:before {
+ content: '\E066';
+}
+.t-icon-forward:before {
+ content: '\E067';
+}
+.t-icon-fullscreen-exit:before {
+ content: '\E068';
+}
+.t-icon-fullscreen:before {
+ content: '\E069';
+}
+.t-icon-gender-female:before {
+ content: '\E06A';
+}
+.t-icon-gender-male:before {
+ content: '\E06B';
+}
+.t-icon-gift:before {
+ content: '\E06C';
+}
+.t-icon-heart-filled:before {
+ content: '\E06D';
+}
+.t-icon-heart:before {
+ content: '\E06E';
+}
+.t-icon-help-circle-filled:before {
+ content: '\E06F';
+}
+.t-icon-help-circle:before {
+ content: '\E070';
+}
+.t-icon-help:before {
+ content: '\E071';
+}
+.t-icon-history:before {
+ content: '\E072';
+}
+.t-icon-home:before {
+ content: '\E073';
+}
+.t-icon-hourglass:before {
+ content: '\E074';
+}
+.t-icon-image-error:before {
+ content: '\E075';
+}
+.t-icon-image:before {
+ content: '\E076';
+}
+.t-icon-info-circle-filled:before {
+ content: '\E077';
+}
+.t-icon-info-circle:before {
+ content: '\E078';
+}
+.t-icon-internet:before {
+ content: '\E079';
+}
+.t-icon-jump:before {
+ content: '\E07A';
+}
+.t-icon-laptop:before {
+ content: '\E07B';
+}
+.t-icon-layers:before {
+ content: '\E07C';
+}
+.t-icon-link-unlink:before {
+ content: '\E07D';
+}
+.t-icon-link:before {
+ content: '\E07E';
+}
+.t-icon-loading:before {
+ content: '\E07F';
+}
+.t-icon-location:before {
+ content: '\E080';
+}
+.t-icon-lock-off:before {
+ content: '\E081';
+}
+.t-icon-lock-on:before {
+ content: '\E082';
+}
+.t-icon-login:before {
+ content: '\E083';
+}
+.t-icon-logo-android:before {
+ content: '\E084';
+}
+.t-icon-logo-apple-filled:before {
+ content: '\E085';
+}
+.t-icon-logo-apple:before {
+ content: '\E086';
+}
+.t-icon-logo-chrome-filled:before {
+ content: '\E087';
+}
+.t-icon-logo-chrome:before {
+ content: '\E088';
+}
+.t-icon-logo-codepen:before {
+ content: '\E089';
+}
+.t-icon-logo-github-filled:before {
+ content: '\E08A';
+}
+.t-icon-logo-github:before {
+ content: '\E08B';
+}
+.t-icon-logo-ie-filled:before {
+ content: '\E08C';
+}
+.t-icon-logo-ie:before {
+ content: '\E08D';
+}
+.t-icon-logo-qq:before {
+ content: '\E08E';
+}
+.t-icon-logo-wechat:before {
+ content: '\E08F';
+}
+.t-icon-logo-wecom:before {
+ content: '\E090';
+}
+.t-icon-logo-windows-filled:before {
+ content: '\E091';
+}
+.t-icon-logo-windows:before {
+ content: '\E092';
+}
+.t-icon-logout:before {
+ content: '\E093';
+}
+.t-icon-mail:before {
+ content: '\E094';
+}
+.t-icon-menu-fold:before {
+ content: '\E095';
+}
+.t-icon-menu-unfold:before {
+ content: '\E096';
+}
+.t-icon-minus-circle-filled:before {
+ content: '\E097';
+}
+.t-icon-minus-circle:before {
+ content: '\E098';
+}
+.t-icon-minus-rectangle:before {
+ content: '\E099';
+}
+.t-icon-mirror:before {
+ content: '\E09A';
+}
+.t-icon-mobile-vibrate:before {
+ content: '\E09B';
+}
+.t-icon-mobile:before {
+ content: '\E09C';
+}
+.t-icon-money-circle:before {
+ content: '\E09D';
+}
+.t-icon-more:before {
+ content: '\E09E';
+}
+.t-icon-move:before {
+ content: '\E09F';
+}
+.t-icon-next:before {
+ content: '\E0A0';
+}
+.t-icon-notification-filled:before {
+ content: '\E0A1';
+}
+.t-icon-notification:before {
+ content: '\E0A2';
+}
+.t-icon-order-adjustment-column:before {
+ content: '\E0A3';
+}
+.t-icon-order-ascending:before {
+ content: '\E0A4';
+}
+.t-icon-order-descending:before {
+ content: '\E0A5';
+}
+.t-icon-page-first:before {
+ content: '\E0A6';
+}
+.t-icon-page-last:before {
+ content: '\E0A7';
+}
+.t-icon-pause-circle-filled:before {
+ content: '\E0A8';
+}
+.t-icon-photo:before {
+ content: '\E0A9';
+}
+.t-icon-pin-filled:before {
+ content: '\E0AA';
+}
+.t-icon-pin:before {
+ content: '\E0AB';
+}
+.t-icon-play-circle-filled:before {
+ content: '\E0AC';
+}
+.t-icon-play-circle-stroke:before {
+ content: '\E0AD';
+}
+.t-icon-play-circle:before {
+ content: '\E0AE';
+}
+.t-icon-play:before {
+ content: '\E0AF';
+}
+.t-icon-poweroff:before {
+ content: '\E0B0';
+}
+.t-icon-precise-monitor:before {
+ content: '\E0B1';
+}
+.t-icon-previous:before {
+ content: '\E0B2';
+}
+.t-icon-print:before {
+ content: '\E0B3';
+}
+.t-icon-qrcode:before {
+ content: '\E0B4';
+}
+.t-icon-queue:before {
+ content: '\E0B5';
+}
+.t-icon-rectangle:before {
+ content: '\E0B6';
+}
+.t-icon-refresh:before {
+ content: '\E0B7';
+}
+.t-icon-relativity:before {
+ content: '\E0B8';
+}
+.t-icon-remove:before {
+ content: '\E0B9';
+}
+.t-icon-rollback:before {
+ content: '\E0BA';
+}
+.t-icon-rollfront:before {
+ content: '\E0BB';
+}
+.t-icon-root-list:before {
+ content: '\E0BC';
+}
+.t-icon-rotation:before {
+ content: '\E0BD';
+}
+.t-icon-round:before {
+ content: '\E0BE';
+}
+.t-icon-save:before {
+ content: '\E0BF';
+}
+.t-icon-scan:before {
+ content: '\E0C0';
+}
+.t-icon-search:before {
+ content: '\E0C1';
+}
+.t-icon-secured:before {
+ content: '\E0C2';
+}
+.t-icon-server:before {
+ content: '\E0C3';
+}
+.t-icon-service:before {
+ content: '\E0C4';
+}
+.t-icon-setting:before {
+ content: '\E0C5';
+}
+.t-icon-share:before {
+ content: '\E0C6';
+}
+.t-icon-shop:before {
+ content: '\E0C7';
+}
+.t-icon-slash:before {
+ content: '\E0C8';
+}
+.t-icon-sound:before {
+ content: '\E0C9';
+}
+.t-icon-star-filled:before {
+ content: '\E0CA';
+}
+.t-icon-star:before {
+ content: '\E0CB';
+}
+.t-icon-stop-circle-1:before {
+ content: '\E0CC';
+}
+.t-icon-stop-circle-filled:before {
+ content: '\E0CD';
+}
+.t-icon-stop-circle:before {
+ content: '\E0CE';
+}
+.t-icon-stop:before {
+ content: '\E0CF';
+}
+.t-icon-swap-left:before {
+ content: '\E0D0';
+}
+.t-icon-swap-right:before {
+ content: '\E0D1';
+}
+.t-icon-swap:before {
+ content: '\E0D2';
+}
+.t-icon-thumb-down:before {
+ content: '\E0D3';
+}
+.t-icon-thumb-up:before {
+ content: '\E0D4';
+}
+.t-icon-time-filled:before {
+ content: '\E0D5';
+}
+.t-icon-time:before {
+ content: '\E0D6';
+}
+.t-icon-tips:before {
+ content: '\E0D7';
+}
+.t-icon-tools:before {
+ content: '\E0D8';
+}
+.t-icon-unfold-less:before {
+ content: '\E0D9';
+}
+.t-icon-unfold-more:before {
+ content: '\E0DA';
+}
+.t-icon-upload:before {
+ content: '\E0DB';
+}
+.t-icon-usb:before {
+ content: '\E0DC';
+}
+.t-icon-user-add:before {
+ content: '\E0DD';
+}
+.t-icon-user-avatar:before {
+ content: '\E0DE';
+}
+.t-icon-user-circle:before {
+ content: '\E0DF';
+}
+.t-icon-user-clear:before {
+ content: '\E0E0';
+}
+.t-icon-user-talk:before {
+ content: '\E0E1';
+}
+.t-icon-user:before {
+ content: '\E0E2';
+}
+.t-icon-usergroup-add:before {
+ content: '\E0E3';
+}
+.t-icon-usergroup-clear:before {
+ content: '\E0E4';
+}
+.t-icon-usergroup:before {
+ content: '\E0E5';
+}
+.t-icon-video:before {
+ content: '\E0E6';
+}
+.t-icon-view-column:before {
+ content: '\E0E7';
+}
+.t-icon-view-list:before {
+ content: '\E0E8';
+}
+.t-icon-view-module:before {
+ content: '\E0E9';
+}
+.t-icon-wallet:before {
+ content: '\E0EA';
+}
+.t-icon-wifi:before {
+ content: '\E0EB';
+}
+.t-icon-zoom-in:before {
+ content: '\E0EC';
+}
+.t-icon-zoom-out:before {
+ content: '\E0ED';
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/props.d.ts b/miniprogram_npm/tdesign-miniprogram/icon/props.d.ts
new file mode 100644
index 0000000..a472c01
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/props.d.ts
@@ -0,0 +1,3 @@
+import { TdIconProps } from './type';
+declare const props: TdIconProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/props.js b/miniprogram_npm/tdesign-miniprogram/icon/props.js
new file mode 100644
index 0000000..51a5fd6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/props.js
@@ -0,0 +1,20 @@
+const props = {
+ color: {
+ type: String,
+ value: '',
+ },
+ name: {
+ type: String,
+ value: '',
+ required: true,
+ },
+ size: {
+ type: String,
+ value: '',
+ },
+ prefix: {
+ type: String,
+ value: undefined,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/type.d.ts b/miniprogram_npm/tdesign-miniprogram/icon/type.d.ts
new file mode 100644
index 0000000..5b7da04
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/type.d.ts
@@ -0,0 +1,27 @@
+export interface TdIconProps {
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ required?: boolean;
+ };
+ color?: {
+ type: StringConstructor;
+ value?: string;
+ required?: boolean;
+ };
+ name: {
+ type: StringConstructor;
+ value?: string;
+ required?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: string;
+ required?: boolean;
+ };
+ prefix?: {
+ type: StringConstructor;
+ value?: string;
+ reuqired?: boolean;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/icon/type.js b/miniprogram_npm/tdesign-miniprogram/icon/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/icon/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/image/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/image/README.en-US.md
new file mode 100644
index 0000000..599ccba
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/README.en-US.md
@@ -0,0 +1,25 @@
+:: BASE_DOC ::
+
+## API
+### Image Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+error | String / Slot | 'default' | \- | N
+external-classes | Array | - | `['t-class', 't-class-load']` | N
+height | String / Number | - | \- | N
+lazy | Boolean | false | \- | N
+loading | String / Slot | 'default' | \- | N
+mode | String | scaleToFill | options锛歴caleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right | N
+shape | String | square | options锛歝ircle/round/square | N
+show-menu-by-longpress | Boolean | false | \- | N
+src | String | - | \- | N
+webp | Boolean | false | \- | N
+width | String / Number | - | \- | N
+
+### Image Events
+
+name | params | description
+-- | -- | --
+error | \- | \-
+load | \- | \-
diff --git a/miniprogram_npm/tdesign-miniprogram/image/README.md b/miniprogram_npm/tdesign-miniprogram/image/README.md
new file mode 100644
index 0000000..659dbb5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/README.md
@@ -0,0 +1,65 @@
+---
+title: Image 鍥剧墖
+description: 鐢ㄤ簬灞曠ず鏁堟灉锛屼富瑕佷负涓婁笅宸﹀彸灞呬腑瑁佸垏銆佹媺浼搞�佸钩閾虹瓑鏂瑰紡銆�
+spline: base
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-100%25-blue" /></span>
+
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-image": "tdesign-miniprogram/image/image"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 瑁佸垏鏍峰紡
+
+{{ base }}
+
+### 鍔犺浇鐘舵��
+
+{{ status }}
+
+## 甯歌闂
+
+<details>
+ <summary>
+ 鏈湴鍥剧墖鏃犳硶姝g‘寮曠敤?
+ <span class="icon">馃憞</span>
+ </summary>
+ <p style="margin-top: 10px; color: rgba(0, 0, 0, .6)">
+ 寤鸿浣跨敤缁濆璺緞锛岃�屼笉鏄浉瀵硅矾寰勩�傜粷瀵硅矾寰勪互 app.json 鎵�鍦ㄤ綅缃负鍩哄噯銆�
+ </p>
+</details>
+
+
+## API
+### Image Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+error | String / Slot | 'default' | 鍔犺浇澶辫触鏃舵樉绀虹殑鍐呭銆傚�间负 `default` 鍒欒〃绀轰娇鐢ㄩ粯璁ゅ姞杞藉け璐ラ鏍硷紱鍊间负绌烘垨鑰� `slot` 琛ㄧず浣跨敤鎻掓Ы娓叉煋锛屾彃妲藉悕绉颁负 `error`锛涘�间负鍏朵粬鍒欒〃绀烘櫘閫氭枃鏈唴瀹癸紝濡傗�滃姞杞藉け璐モ�� | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃姞杞界粍浠跺灞傚厓绱狅紝涓棿鍐呭绛夊厓绱犵被鍚嶃�俙['t-class', 't-class-load']` | N
+height | String / Number | - | 楂樺害锛岄粯璁ゅ崟浣嶄负`px` | N
+lazy | Boolean | false | 鏄惁寮�鍚浘鐗囨噿鍔犺浇 | N
+loading | String / Slot | 'default' | 鍔犺浇鎬佸唴瀹广�傚�间负 `default` 鍒欒〃绀轰娇鐢ㄩ粯璁ゅ姞杞戒腑椋庢牸锛涘�间负鍏朵粬鍒欒〃绀烘櫘閫氭枃鏈唴瀹癸紝濡傗�滃姞杞戒腑鈥� | N
+mode | String | scaleToFill | 鍥剧墖瑁佸壀銆佺缉鏀剧殑妯″紡锛沎灏忕▼搴忓畼鏂规枃妗(https://developers.weixin.qq.com/miniprogram/dev/component/image.html)銆傚彲閫夐」锛歴caleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right | N
+shape | String | square | 鍥剧墖鍦嗚绫诲瀷銆傚彲閫夐」锛歝ircle/round/square | N
+show-menu-by-longpress | Boolean | false | 闀挎寜鍥剧墖鏄剧ず鍙戦�佺粰鏈嬪弸銆佹敹钘忋�佷繚瀛樺浘鐗囥�佹悳涓�鎼溿�佹墦寮�鍚嶇墖/鍓嶅線缇よ亰/鎵撳紑灏忕▼搴忥紙鑻ュ浘鐗囦腑鍖呭惈瀵瑰簲浜岀淮鐮佹垨灏忕▼搴忕爜锛夌殑鑿滃崟銆� | N
+src | String | - | 鍥剧墖閾炬帴 | N
+webp | Boolean | false | 榛樿涓嶈В鏋� webP 鏍煎紡锛屽彧鏀寔缃戠粶璧勬簮 | N
+width | String / Number | - | 瀹藉害锛岄粯璁ゅ崟浣嶄负`px` | N
+
+### Image Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+error | \- | 鍥剧墖鍔犺浇澶辫触鏃惰Е鍙�
+load | \- | 鍥剧墖鍔犺浇瀹屾垚鏃惰Е鍙�
diff --git a/miniprogram_npm/tdesign-miniprogram/image/image-info.json b/miniprogram_npm/tdesign-miniprogram/image/image-info.json
new file mode 100644
index 0000000..7157c4c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image-info.json
@@ -0,0 +1,75 @@
+{
+ "key": "Image",
+ "label": "鍥剧墖",
+ "icon": "",
+ "properties": [
+ {
+ "key": "error",
+ "type": ["String", "TNode"],
+ "defaultValue": "'default'",
+ "desc": "鍔犺浇澶辫触鏃舵樉绀虹殑鍐呭銆傚�间负 `default` 鍒欒〃绀轰娇鐢ㄩ粯璁ゅ姞杞藉け璐ラ鏍硷紱鍊间负绌烘垨鑰� `slot` 琛ㄧず浣跨敤鎻掓Ы娓叉煋锛屾彃妲藉悕绉颁负 `error`锛涘�间负鍏朵粬鍒欒〃绀烘櫘閫氭枃鏈唴瀹癸紝濡傗�滃姞杞藉け璐モ��",
+ "label": ""
+ },
+ {
+ "key": "externalClasses",
+ "type": ["Array"],
+ "defaultValue": "",
+ "desc": "缁勪欢绫诲悕锛屽垎鍒敤浜庤缃姞杞界粍浠跺灞傚厓绱狅紝涓棿鍐呭绛夊厓绱犵被鍚�",
+ "label": ""
+ },
+ {
+ "key": "lazy",
+ "type": ["Boolean"],
+ "defaultValue": "false",
+ "desc": "鏄惁寮�鍚浘鐗囨噿鍔犺浇",
+ "label": ""
+ },
+ {
+ "key": "loading",
+ "type": ["String", "TNode"],
+ "defaultValue": "'default'",
+ "desc": "鍔犺浇鎬佸唴瀹广�傚�间负 `default` 鍒欒〃绀轰娇鐢ㄩ粯璁ゅ姞杞戒腑椋庢牸锛涘�间负绌烘垨鑰� `slot` 琛ㄧず浣跨敤鎻掓Ы娓叉煋锛屾彃妲藉悕绉颁负 `loading`锛涘�间负鍏朵粬鍒欒〃绀烘櫘閫氭枃鏈唴瀹癸紝濡傗�滃姞杞戒腑鈥�",
+ "label": ""
+ },
+ {
+ "key": "MP_EXCLUDE_PROPS",
+ "type": ["String"],
+ "defaultValue": "",
+ "desc": "涓洪伩鍏嶉噸澶嶆垨鍐茬獊锛岄渶瑕佽繃婊ゆ帀鐨勫皬绋嬪簭鍘熺敓灞炴��",
+ "label": ""
+ },
+ {
+ "key": "MP_PROPS",
+ "type": ["String"],
+ "defaultValue": "",
+ "desc": "[灏忕▼搴忓師鐢熷睘鎬(https://developers.weixin.qq.com/miniprogram/dev/component/image.html)",
+ "label": ""
+ },
+ {
+ "key": "shape",
+ "type": ["String"],
+ "defaultValue": "square",
+ "desc": "鍥剧墖鍦嗚绫诲瀷",
+ "label": ""
+ },
+ {
+ "key": "src",
+ "type": ["String"],
+ "defaultValue": "",
+ "desc": "鍥剧墖閾炬帴",
+ "label": ""
+ }
+ ],
+ "events": [
+ {
+ "key": "error",
+ "desc": "鍥剧墖鍔犺浇澶辫触鏃惰Е鍙�",
+ "label": ""
+ },
+ {
+ "key": "load",
+ "desc": "鍥剧墖鍔犺浇瀹屾垚鏃惰Е鍙�",
+ "label": ""
+ }
+ ]
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image/image.d.ts b/miniprogram_npm/tdesign-miniprogram/image/image.d.ts
new file mode 100644
index 0000000..e86224a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.d.ts
@@ -0,0 +1,27 @@
+import { SuperComponent } from '../common/src/index';
+export default class Image extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdImageProps;
+ data: {
+ prefix: string;
+ isLoading: boolean;
+ isFailed: boolean;
+ innerStyle: string;
+ classPrefix: string;
+ };
+ preSrc: string;
+ lifetimes: {
+ attached(): void;
+ };
+ observers: {
+ src(): void;
+ };
+ methods: {
+ onLoaded(e: any): void;
+ onLoadError(e: any): void;
+ update(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image/image.js b/miniprogram_npm/tdesign-miniprogram/image/image.js
new file mode 100644
index 0000000..d832d1e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.js
@@ -0,0 +1,100 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import ImageProps from './props';
+import config from '../common/config';
+import { addUnit, getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-image`;
+let Image = class Image extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-load`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = ImageProps;
+ this.data = {
+ prefix,
+ isLoading: true,
+ isFailed: false,
+ innerStyle: '',
+ classPrefix: name,
+ };
+ this.preSrc = '';
+ this.lifetimes = {
+ attached() {
+ const { width, height } = this.data;
+ let innerStyle = '';
+ this.update();
+ if (width) {
+ innerStyle += `width: ${addUnit(width)};`;
+ }
+ if (height) {
+ innerStyle += `height: ${addUnit(height)};`;
+ }
+ this.setData({
+ innerStyle,
+ });
+ },
+ };
+ this.observers = {
+ src() {
+ if (this.preSrc === this.properties.src)
+ return;
+ this.update();
+ },
+ };
+ this.methods = {
+ onLoaded(e) {
+ const sdkVersion = wx.getSystemInfoSync().SDKVersion;
+ const versionArray = sdkVersion.split('.').map((v) => parseInt(v, 10));
+ const { mode } = this.properties;
+ const isInCompatible = versionArray[0] < 2 ||
+ (versionArray[0] === 2 && versionArray[1] < 10) ||
+ (versionArray[0] === 2 && versionArray[1] === 10 && versionArray[2] < 3);
+ if (mode === 'heightFix' && isInCompatible) {
+ const { height: picHeight, width: picWidth } = e.detail;
+ getRect(this, '#image').then((rect) => {
+ const { height } = rect;
+ const resultWidth = ((height / picHeight) * picWidth).toFixed(2);
+ this.setData({ innerStyle: `height: ${addUnit(height)}; width: ${resultWidth}px;` });
+ });
+ }
+ this.setData({
+ isLoading: false,
+ isFailed: false,
+ });
+ this.triggerEvent('load', e.detail);
+ },
+ onLoadError(e) {
+ this.setData({
+ isLoading: false,
+ isFailed: true,
+ });
+ this.triggerEvent('error', e.detail);
+ },
+ update() {
+ const { src } = this.properties;
+ this.preSrc = src;
+ if (!src) {
+ this.onLoadError({ errMsg: '鍥剧墖閾炬帴涓虹┖' });
+ }
+ else {
+ this.setData({
+ isLoading: true,
+ isFailed: false,
+ });
+ }
+ },
+ };
+ }
+};
+Image = __decorate([
+ wxComponent()
+], Image);
+export default Image;
diff --git a/miniprogram_npm/tdesign-miniprogram/image/image.json b/miniprogram_npm/tdesign-miniprogram/image/image.json
new file mode 100644
index 0000000..5de7a66
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-loading": "../loading/loading",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image/image.wxml b/miniprogram_npm/tdesign-miniprogram/image/image.wxml
new file mode 100644
index 0000000..bde7038
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.wxml
@@ -0,0 +1,52 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<!-- 鍔犺浇涓崰浣� -->
+<view
+ wx:if="{{isLoading}}"
+ style="{{_._style([innerStyle, style, customStyle])}}"
+ class="class {{prefix}}-class {{classPrefix}} {{classPrefix}}__mask {{classPrefix}}--loading {{classPrefix}}--shape-{{shape}}"
+ aria-hidden="{{ariaHidden}}"
+>
+ <t-loading
+ wx:if="{{loading === 'default'}}"
+ theme="dots"
+ size="44rpx"
+ loading
+ inherit-color
+ t-class="t-class-load"
+ t-class-text="{{classPrefix}}--loading-text"
+ ></t-loading>
+ <view wx:elif="{{loading !== '' && loading !== 'slot'}}" class="{{classPrefix}}__common {{prefix}}-class-load">
+ {{loading}}
+ </view>
+ <slot wx:else name="loading" />
+</view>
+<!-- 鍔犺浇澶辫触鍗犱綅 -->
+<view
+ wx:elif="{{isFailed}}"
+ style="{{_._style([innerStyle, style, customStyle])}}"
+ class="class {{prefix}}-class {{classPrefix}} {{classPrefix}}__mask {{classPrefix}}--failed {{classPrefix}}--shape-{{shape}}"
+ aria-hidden="{{ariaHidden}}"
+>
+ <view wx:if="{{error === 'default'}}" style="font-size: 44rpx" class="{{prefix}}-class-load">
+ <t-icon name="close" aria-role="img" aria-label="鍔犺浇澶辫触" />
+ </view>
+ <view wx:elif="{{error && error !== 'slot'}}" class="{{classPrefix}}__common {{prefix}}-class-load"> {{error}} </view>
+ <slot wx:else name="error" />
+</view>
+<!-- 鍥剧墖 -->
+<image
+ id="image"
+ hidden="{{isLoading || isFailed}}"
+ class="class {{prefix}}-class {{classPrefix}} {{classPrefix}}--shape-{{shape}}"
+ src="{{src}}"
+ style="{{_._style([innerStyle, style, customStyle])}}"
+ mode="{{mode}}"
+ webp="{{webp}}"
+ lazy-load="{{lazy}}"
+ bind:load="onLoaded"
+ bind:error="onLoadError"
+ show-menu-by-longpress="{{showMenuByLongpress}}"
+ aria-hidden="{{ariaHidden || isLoading || isFailed}}"
+ aria-label="{{ariaLabel}}"
+/>
diff --git a/miniprogram_npm/tdesign-miniprogram/image/image.wxss b/miniprogram_npm/tdesign-miniprogram/image/image.wxss
new file mode 100644
index 0000000..1a3c3e1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/image.wxss
@@ -0,0 +1,58 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-image {
+ color: var(--td-image-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+ vertical-align: top;
+}
+.t-image__mask {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: var(--td-image-loading-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ color: var(--td-image-loading-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
+}
+.t-image--loading-text {
+ width: 0;
+ height: 0;
+}
+.t-image__common {
+ width: 100%;
+ height: 100%;
+}
+.t-image--shape-circle {
+ border-radius: 50%;
+ overflow: hidden;
+}
+.t-image--shape-round {
+ border-radius: var(--td-image-round-radius, var(--td-radius-default, 12rpx));
+ overflow: hidden;
+}
+.t-image--shape-square {
+ border-radius: 0;
+ overflow: hidden;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image/index.d.ts b/miniprogram_npm/tdesign-miniprogram/image/index.d.ts
new file mode 100644
index 0000000..0f85c43
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/index.d.ts
@@ -0,0 +1,4 @@
+import { TdImageProps } from './type';
+export declare type ImageProps = TdImageProps;
+export * from './props';
+export * from './image';
diff --git a/miniprogram_npm/tdesign-miniprogram/image/index.js b/miniprogram_npm/tdesign-miniprogram/image/index.js
new file mode 100644
index 0000000..4fd3953
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/index.js
@@ -0,0 +1,2 @@
+export * from './props';
+export * from './image';
diff --git a/miniprogram_npm/tdesign-miniprogram/image/props.d.ts b/miniprogram_npm/tdesign-miniprogram/image/props.d.ts
new file mode 100644
index 0000000..0ab571b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/props.d.ts
@@ -0,0 +1,3 @@
+import { TdImageProps } from './type';
+declare const props: TdImageProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/image/props.js b/miniprogram_npm/tdesign-miniprogram/image/props.js
new file mode 100644
index 0000000..595db41
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/props.js
@@ -0,0 +1,44 @@
+const props = {
+ error: {
+ type: String,
+ value: 'default',
+ },
+ externalClasses: {
+ type: Array,
+ },
+ height: {
+ type: null,
+ },
+ lazy: {
+ type: Boolean,
+ value: false,
+ },
+ loading: {
+ type: String,
+ value: 'default',
+ },
+ mode: {
+ type: String,
+ value: 'scaleToFill',
+ },
+ shape: {
+ type: String,
+ value: 'square',
+ },
+ showMenuByLongpress: {
+ type: Boolean,
+ value: false,
+ },
+ src: {
+ type: String,
+ value: '',
+ },
+ webp: {
+ type: Boolean,
+ value: false,
+ },
+ width: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/image/type.d.ts b/miniprogram_npm/tdesign-miniprogram/image/type.d.ts
new file mode 100644
index 0000000..09a454f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/type.d.ts
@@ -0,0 +1,50 @@
+export interface TdImageProps {
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ error?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-load'];
+ };
+ height?: {
+ type: null;
+ value?: string | number;
+ };
+ lazy?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ loading?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ mode?: {
+ type: StringConstructor;
+ value?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
+ };
+ shape?: {
+ type: StringConstructor;
+ value?: 'circle' | 'round' | 'square';
+ };
+ showMenuByLongpress?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ src?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ webp?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ width?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/image/type.js b/miniprogram_npm/tdesign-miniprogram/image/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/image/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/loading/README.en-US.md
new file mode 100644
index 0000000..1969d2e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/README.en-US.md
@@ -0,0 +1,21 @@
+:: BASE_DOC ::
+
+## API
+
+### Loading Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+delay | Number | 0 | \- | N
+duration | Number | 800 | \- | N
+external-classes | Array | - | `['t-class', 't-class-text', 't-class-indicator']` | N
+indicator | Boolean | true | \- | N
+inherit-color | Boolean | false | \- | N
+layout | String | horizontal | options锛歨orizontal/vertical | N
+loading | Boolean | true | \- | N
+pause | Boolean | false | \- | N
+progress | Number | - | \- | N
+reverse | Boolean | - | \- | N
+size | String | '40rpx' | \- | N
+text | String / Slot | - | \- | N
+theme | String | circular | options锛歝ircular/spinner/dots | N
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/README.md b/miniprogram_npm/tdesign-miniprogram/loading/README.md
new file mode 100644
index 0000000..9ca1917
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/README.md
@@ -0,0 +1,70 @@
+---
+title: Loading 鍔犺浇
+description: 鐢ㄤ簬琛ㄧず椤甸潰鎴栨搷浣滅殑鍔犺浇鐘舵�侊紝缁欎簣鐢ㄦ埛鍙嶉鐨勫悓鏃跺噺缂撶瓑寰呯殑鐒﹁檻鎰燂紝鐢变竴涓垨涓�缁勫弽棣堝姩鏁堢粍鎴愩��
+spline: message
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-95%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-95%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-83%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-loading": "tdesign-miniprogram/loading/loading"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 绾痠con
+
+{{ base }}
+
+### icon鍔犳枃瀛楁í鍚�
+
+{{ horizontal }}
+
+### icon鍔犳枃瀛楃珫鍚�
+
+{{ vertical }}
+
+### 绾枃瀛�
+
+{{ text }}
+
+### 鍔犺浇澶辫触
+
+{{ error }}
+
+### 鐘舵��
+
+{{ status }}
+
+### 鍔犺浇閫熷害
+
+{{ duration }}
+
+### 瑙勬牸
+
+{{ size }}
+
+## API
+### Loading Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+delay | Number | 0 | 寤惰繜鏄剧ず鍔犺浇鏁堟灉鐨勬椂闂达紝鐢ㄤ簬闃叉璇锋眰閫熷害杩囧揩寮曡捣鐨勫姞杞介棯鐑侊紝鍗曚綅锛氭绉� | N
+duration | Number | 800 | 鍔犺浇鍔ㄧ敾鎵ц瀹屾垚涓�娆$殑鏃堕棿锛屽崟浣嶏細姣 | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃姞杞界粍浠跺灞傚厓绱狅紝鍔犺浇缁勪欢鏂囨湰锛屽姞杞界粍浠舵寚绀虹锛屽姞杞芥寚绀虹鍐呬晶鍚屽績鍦嗙瓑鍏冪礌绫诲悕銆俙['t-class', 't-class-text', 't-class-indicator']` | N
+indicator | Boolean | true | 鏄惁鏄剧ず鍔犺浇鎸囩ず绗� | N
+inherit-color | Boolean | false | 鏄惁缁ф壙鐖跺厓绱犻鑹� | N
+layout | String | horizontal | 瀵归綈鏂瑰紡銆傚彲閫夐」锛歨orizontal/vertical | N
+loading | Boolean | true | 鏄惁澶勪簬鍔犺浇鐘舵�� | N
+pause | Boolean | false | 鏄惁鏆傚仠鍔ㄧ敾 | N
+progress | Number | - | 鍔犺浇杩涘害 | N
+reverse | Boolean | - | 鍔犺浇鍔ㄧ敾鏄惁鍙嶅悜 | N
+size | String | '40rpx' | 灏哄锛岀ず渚嬶細40rpx/20px | N
+text | String / Slot | - | 鍔犺浇鎻愮ず鏂囨 | N
+theme | String | circular | 鍔犺浇缁勪欢绫诲瀷銆傚彲閫夐」锛歝ircular/spinner/dots | N
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/index.d.ts b/miniprogram_npm/tdesign-miniprogram/loading/index.d.ts
new file mode 100644
index 0000000..2806bd6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './loading';
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/index.js b/miniprogram_npm/tdesign-miniprogram/loading/index.js
new file mode 100644
index 0000000..2806bd6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './loading';
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/loading.d.ts b/miniprogram_npm/tdesign-miniprogram/loading/loading.d.ts
new file mode 100644
index 0000000..512396e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.d.ts
@@ -0,0 +1,81 @@
+import { SuperComponent } from '../common/src/index';
+import type { TdLoadingProps } from './type';
+export interface LoadingProps extends TdLoadingProps {
+}
+export default class Loading extends SuperComponent {
+ externalClasses: string[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ show: boolean;
+ };
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: {
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ delay?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ["t-class", "t-class-text", "t-class-indicator"];
+ };
+ indicator?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ inheritColor?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ layout?: {
+ type: StringConstructor;
+ value?: "horizontal" | "vertical";
+ };
+ loading?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ pause?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ progress?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ reverse?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ text?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: "error" | "circular" | "spinner" | "bar" | "dots";
+ };
+ };
+ timer: any;
+ observers: {
+ loading(this: any, cur: any): void;
+ };
+ lifetimes: {
+ detached(): void;
+ };
+ refreshPage(): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/loading.js b/miniprogram_npm/tdesign-miniprogram/loading/loading.js
new file mode 100644
index 0000000..f59a423
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.js
@@ -0,0 +1,61 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-loading`;
+let Loading = class Loading extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-text`, `${prefix}-class-indicator`];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ show: true,
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = Object.assign({}, props);
+ this.timer = null;
+ this.observers = {
+ loading(cur) {
+ const { delay } = this.properties;
+ if (this.timer) {
+ clearTimeout(this.timer);
+ }
+ if (cur) {
+ if (delay) {
+ this.timer = setTimeout(() => {
+ this.setData({ show: cur });
+ this.timer = null;
+ }, delay);
+ }
+ else {
+ this.setData({ show: cur });
+ }
+ }
+ else {
+ this.setData({ show: cur });
+ }
+ },
+ };
+ this.lifetimes = {
+ detached() {
+ clearTimeout(this.timer);
+ },
+ };
+ }
+ refreshPage() {
+ this.triggerEvent('reload');
+ }
+};
+Loading = __decorate([
+ wxComponent()
+], Loading);
+export default Loading;
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/loading.json b/miniprogram_npm/tdesign-miniprogram/loading/loading.json
new file mode 100644
index 0000000..a89ef4d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/loading.wxml b/miniprogram_npm/tdesign-miniprogram/loading/loading.wxml
new file mode 100644
index 0000000..a619f46
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.wxml
@@ -0,0 +1,39 @@
+<wxs src="../common/utils.wxs" module="_" />
+<view
+ style="{{_._style([style, customStyle, !text ? ('width: ' + _.addUnit(size) + '; height: ' + _.addUnit(size)) : ''])}} {{show ? '' : 'display:none'}} {{inheritColor ? 'color: inherit' : ''}}"
+ class="class {{prefix}}-class {{classPrefix}} {{classPrefix + '--' + layout}}"
+>
+ <view
+ wx:if="{{indicator}}"
+ class="{{prefix}}-class-indicator {{classPrefix}}__spinner {{classPrefix}}__spinner--{{ theme }} {{reverse ? 'reverse' : ''}}"
+ style="width: {{ _.addUnit(size) }}; height: {{ _.addUnit(size) }}; {{inheritColor ? 'color: inherit' : ''}} {{indicator ? '' : 'display:none'}}; {{duration ? 'animation-duration: ' + duration / 1000 + 's;' : ''}} animation-play-state: {{pause ? 'paused' : 'running'}};"
+ aria-role="{{ariaRole || 'img'}}"
+ aria-label="{{ ariaLabel || text || '鍔犺浇涓�' }}"
+ >
+ <view wx:if="{{ theme === 'spinner' }}" wx:for="{{12}}" wx:key="index" class="{{classPrefix}}__dot" />
+ <view wx:if="{{ theme === 'circular' }}" class="{{classPrefix}}__circular" />
+ <block wx:if="{{ theme === 'dots' }}">
+ <view
+ class="{{classPrefix}}__dot"
+ style="{{duration ? 'animation-duration: ' + duration/1000 + 's; animation-delay:' + 0 + 's;' : ''}} animation-play-state: {{pause ? 'paused' : 'running'}};"
+ ></view>
+ <view
+ class="{{classPrefix}}__dot"
+ style="{{duration ? 'animation-duration: ' + duration/1000 + 's; animation-delay:' + duration * 1 / 3000 + 's;' : ''}} animation-play-state: {{pause ? 'paused' : 'running'}};"
+ ></view>
+ <view
+ class="{{classPrefix}}__dot"
+ style="{{duration ? 'animation-duration: ' + duration/1000 + 's; animation-delay:' + duration * 2 / 3000 + 's;' : ''}} animation-play-state: {{pause ? 'paused' : 'running'}};"
+ ></view>
+ </block>
+ </view>
+ <view
+ class="{{_.cls(classPrefix + '__text', [layout])}} {{prefix}}-class-text"
+ aria-hidden="{{indicator}}"
+ aria-label="{{ ariaLabel || text }}"
+ >
+ <block wx:if="{{text}}">{{text}}</block>
+ <slot name="text" />
+ <slot />
+ </view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/loading.wxss b/miniprogram_npm/tdesign-miniprogram/loading/loading.wxss
new file mode 100644
index 0000000..155e4d1
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/loading.wxss
@@ -0,0 +1,218 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-loading {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 24rpx;
+}
+.t-loading__spinner {
+ position: relative;
+ box-sizing: border-box;
+ width: 100%;
+ height: 100%;
+ max-width: 100%;
+ max-height: 100%;
+ animation: rotate 0.8s linear infinite;
+ color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-loading__spinner.reverse {
+ animation-name: rotateReverse;
+}
+.t-loading__spinner--spinner {
+ animation-timing-function: steps(12);
+ color: var(--td-font-gray-1, rgba(0, 0, 0, 0.9));
+}
+.t-loading__spinner--spinner .t-loading__dot {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+.t-loading__spinner--spinner .t-loading__dot::before {
+ display: block;
+ width: 5rpx;
+ height: 25%;
+ margin: 0 auto;
+ background-color: currentColor;
+ border-radius: 40%;
+ content: ' ';
+}
+.t-loading__spinner--circular .t-loading__circular {
+ border-radius: 100%;
+ width: 100%;
+ height: 100%;
+ background: conic-gradient(from 180deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0) 60deg, currentColor 330deg, rgba(255, 255, 255, 0) 360deg);
+ mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%);
+ /* stylelint-disable-next-line */
+ -webkit-mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%);
+}
+.t-loading__spinner--dots {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ animation: none;
+}
+.t-loading__spinner--dots .t-loading__dot {
+ width: 20%;
+ height: 20%;
+ border-radius: 50%;
+ background-color: currentColor;
+ animation-duration: 1.8s;
+ animation-name: dotting;
+ animation-timing-function: linear;
+ animation-iteration-count: infinite;
+ animation-fill-mode: both;
+}
+.t-loading__text {
+ font-size: var(--td-loading-text-font-size, 24rpx);
+ line-height: var(--td-loading-text-line-height, 40rpx);
+}
+.t-loading__text--vertical:not(:first-child):not(:empty) {
+ margin-top: 12rpx;
+}
+.t-loading__text--horizontal:not(:first-child):not(:empty) {
+ margin-left: 16rpx;
+}
+.t-loading--vertical {
+ flex-direction: column;
+}
+.t-loading--horizontal {
+ flex-direction: row;
+ vertical-align: top;
+}
+@keyframes t-bar {
+ 0% {
+ width: 0;
+ }
+ 50% {
+ width: 70%;
+ }
+ 100% {
+ width: 80%;
+ }
+}
+@keyframes t-bar-loaded {
+ 0% {
+ height: 6rpx;
+ opacity: 1;
+ width: 90%;
+ }
+ 50% {
+ height: 6rpx;
+ opacity: 1;
+ width: 100%;
+ }
+ 100% {
+ height: 0;
+ opacity: 0;
+ width: 100%;
+ }
+}
+.t-loading__dot:nth-of-type(1) {
+ transform: rotate(30deg);
+ opacity: 0;
+}
+.t-loading__dot:nth-of-type(2) {
+ transform: rotate(60deg);
+ opacity: 0.08333333;
+}
+.t-loading__dot:nth-of-type(3) {
+ transform: rotate(90deg);
+ opacity: 0.16666667;
+}
+.t-loading__dot:nth-of-type(4) {
+ transform: rotate(120deg);
+ opacity: 0.25;
+}
+.t-loading__dot:nth-of-type(5) {
+ transform: rotate(150deg);
+ opacity: 0.33333333;
+}
+.t-loading__dot:nth-of-type(6) {
+ transform: rotate(180deg);
+ opacity: 0.41666667;
+}
+.t-loading__dot:nth-of-type(7) {
+ transform: rotate(210deg);
+ opacity: 0.5;
+}
+.t-loading__dot:nth-of-type(8) {
+ transform: rotate(240deg);
+ opacity: 0.58333333;
+}
+.t-loading__dot:nth-of-type(9) {
+ transform: rotate(270deg);
+ opacity: 0.66666667;
+}
+.t-loading__dot:nth-of-type(10) {
+ transform: rotate(300deg);
+ opacity: 0.75;
+}
+.t-loading__dot:nth-of-type(11) {
+ transform: rotate(330deg);
+ opacity: 0.83333333;
+}
+.t-loading__dot:nth-of-type(12) {
+ transform: rotate(360deg);
+ opacity: 0.91666667;
+}
+@keyframes rotate {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
+@keyframes rotateReverse {
+ from {
+ transform: rotate(360deg);
+ }
+ to {
+ transform: rotate(0deg);
+ }
+}
+@keyframes dotting {
+ 0% {
+ opacity: 0.15;
+ }
+ 1% {
+ opacity: 0.8;
+ }
+ 33% {
+ opacity: 0.8;
+ }
+ 34% {
+ opacity: 0.15;
+ }
+ 100% {
+ opacity: 0.15;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/props.d.ts b/miniprogram_npm/tdesign-miniprogram/loading/props.d.ts
new file mode 100644
index 0000000..a05a659
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/props.d.ts
@@ -0,0 +1,3 @@
+import { TdLoadingProps } from './type';
+declare const props: TdLoadingProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/props.js b/miniprogram_npm/tdesign-miniprogram/loading/props.js
new file mode 100644
index 0000000..d86ae7a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/props.js
@@ -0,0 +1,51 @@
+const props = {
+ delay: {
+ type: Number,
+ value: 0,
+ },
+ duration: {
+ type: Number,
+ value: 800,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ indicator: {
+ type: Boolean,
+ value: true,
+ },
+ inheritColor: {
+ type: Boolean,
+ value: false,
+ },
+ layout: {
+ type: String,
+ value: 'horizontal',
+ },
+ loading: {
+ type: Boolean,
+ value: true,
+ },
+ pause: {
+ type: Boolean,
+ value: false,
+ },
+ progress: {
+ type: Number,
+ },
+ reverse: {
+ type: Boolean,
+ },
+ size: {
+ type: String,
+ value: '40rpx',
+ },
+ text: {
+ type: String,
+ },
+ theme: {
+ type: String,
+ value: 'circular',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/type.d.ts b/miniprogram_npm/tdesign-miniprogram/loading/type.d.ts
new file mode 100644
index 0000000..5b3aa71
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/type.d.ts
@@ -0,0 +1,58 @@
+export interface TdLoadingProps {
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ delay?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-text', 't-class-indicator'];
+ };
+ indicator?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ inheritColor?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ layout?: {
+ type: StringConstructor;
+ value?: 'horizontal' | 'vertical';
+ };
+ loading?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ pause?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ progress?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ reverse?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ text?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'circular' | 'spinner' | 'bar' | 'error' | 'dots';
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/loading/type.js b/miniprogram_npm/tdesign-miniprogram/loading/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/loading/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.d.ts b/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.d.ts
new file mode 100644
index 0000000..7571f3c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.d.ts
@@ -0,0 +1,6 @@
+/// <reference types="miniprogram-api-typings" />
+/// <reference types="miniprogram-api-typings" />
+declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
+declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void;
+declare const _default: (scroller: Scroller) => string;
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.js b/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.js
new file mode 100644
index 0000000..b9f1345
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/page-scroll.js
@@ -0,0 +1,37 @@
+import { getCurrentPage } from '../common/utils';
+const onPageScroll = function (event) {
+ const page = getCurrentPage();
+ if (!page)
+ return;
+ const { pageScroller } = page;
+ pageScroller.forEach((scroller) => {
+ if (typeof scroller === 'function') {
+ scroller(event);
+ }
+ });
+};
+export default (scroller) => {
+ return Behavior({
+ attached() {
+ const page = getCurrentPage();
+ if (!page)
+ return;
+ const bindScroller = scroller.bind(this);
+ if (Array.isArray(page.pageScroller)) {
+ page.pageScroller.push(bindScroller);
+ }
+ else {
+ page.pageScroller =
+ typeof page.onPageScroll === 'function' ? [page.onPageScroll.bind(page), bindScroller] : [bindScroller];
+ }
+ page.onPageScroll = onPageScroll;
+ },
+ detached() {
+ var _a;
+ const page = getCurrentPage();
+ if (!page)
+ return;
+ page.pageScroller = ((_a = page.pageScroller) === null || _a === void 0 ? void 0 : _a.filter((item) => item !== scroller)) || [];
+ },
+ });
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/touch.d.ts b/miniprogram_npm/tdesign-miniprogram/mixins/touch.d.ts
new file mode 100644
index 0000000..ae80eca
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/touch.d.ts
@@ -0,0 +1,2 @@
+declare const _default: string;
+export default _default;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/touch.js b/miniprogram_npm/tdesign-miniprogram/mixins/touch.js
new file mode 100644
index 0000000..cbabccc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/touch.js
@@ -0,0 +1,35 @@
+const MinDistance = 10;
+const getDirection = (x, y) => {
+ if (x > y && x > MinDistance) {
+ return 'horizontal';
+ }
+ if (y > x && y > MinDistance) {
+ return 'vertical';
+ }
+ return '';
+};
+export default Behavior({
+ methods: {
+ resetTouchStatus() {
+ this.direction = '';
+ this.deltaX = 0;
+ this.deltaY = 0;
+ this.offsetX = 0;
+ this.offsetY = 0;
+ },
+ touchStart(event) {
+ this.resetTouchStatus();
+ const [touch] = event.touches;
+ this.startX = touch.clientX;
+ this.startY = touch.clientY;
+ },
+ touchMove(event) {
+ const [touch] = event.touches;
+ this.deltaX = touch.clientX - this.startX;
+ this.deltaY = touch.clientY - this.startY;
+ this.offsetX = Math.abs(this.deltaX);
+ this.offsetY = Math.abs(this.deltaY);
+ this.direction = getDirection(this.offsetX, this.offsetY);
+ },
+ },
+});
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/transition.d.ts b/miniprogram_npm/tdesign-miniprogram/mixins/transition.d.ts
new file mode 100644
index 0000000..8c23e35
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/transition.d.ts
@@ -0,0 +1 @@
+export default function transition(): string;
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/transition.js b/miniprogram_npm/tdesign-miniprogram/mixins/transition.js
new file mode 100644
index 0000000..ee5215a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/transition.js
@@ -0,0 +1,123 @@
+import config from '../common/config';
+const { prefix } = config;
+export default function transition() {
+ return Behavior({
+ properties: {
+ visible: {
+ type: Boolean,
+ value: null,
+ observer: 'watchVisible',
+ },
+ appear: Boolean,
+ name: {
+ type: String,
+ value: 'fade',
+ },
+ durations: {
+ type: Number,
+ optionalTypes: [Array],
+ },
+ },
+ data: {
+ transitionClass: '',
+ transitionDurations: 300,
+ className: '',
+ realVisible: false,
+ },
+ created() {
+ this.status = '';
+ this.transitionT = 0;
+ },
+ attached() {
+ this.durations = this.getDurations();
+ if (this.data.visible) {
+ this.enter();
+ }
+ this.inited = true;
+ },
+ detached() {
+ clearTimeout(this.transitionT);
+ },
+ methods: {
+ watchVisible(curr, prev) {
+ if (this.inited && curr !== prev) {
+ curr ? this.enter() : this.leave();
+ }
+ },
+ getDurations() {
+ const { durations } = this.data;
+ if (Array.isArray(durations)) {
+ return durations.map((item) => Number(item));
+ }
+ return [Number(durations), Number(durations)];
+ },
+ enter() {
+ const { name } = this.data;
+ const [duration] = this.durations;
+ this.status = 'entering';
+ this.setData({
+ realVisible: true,
+ transitionClass: `${prefix}-${name}-enter ${prefix}-${name}-enter-active`,
+ });
+ setTimeout(() => {
+ this.setData({
+ transitionClass: `${prefix}-${name}-enter-active ${prefix}-${name}-enter-to`,
+ });
+ }, 30);
+ if (typeof duration === 'number' && duration > 0) {
+ this.transitionT = setTimeout(this.entered.bind(this), duration + 30);
+ }
+ },
+ entered() {
+ this.customDuration = false;
+ clearTimeout(this.transitionT);
+ this.status = 'entered';
+ this.setData({
+ transitionClass: '',
+ });
+ },
+ leave() {
+ const { name } = this.data;
+ const [, duration] = this.durations;
+ this.status = 'leaving';
+ this.setData({
+ transitionClass: `${prefix}-${name}-leave ${prefix}-${name}-leave-active`,
+ });
+ clearTimeout(this.transitionT);
+ setTimeout(() => {
+ this.setData({
+ transitionClass: `${prefix}-${name}-leave-active ${prefix}-${name}-leave-to`,
+ });
+ }, 30);
+ if (typeof duration === 'number' && duration > 0) {
+ this.customDuration = true;
+ this.transitionT = setTimeout(this.leaved.bind(this), duration + 30);
+ }
+ },
+ leaved() {
+ this.customDuration = false;
+ this.triggerEvent('leaved');
+ clearTimeout(this.transitionT);
+ this.status = 'leaved';
+ this.setData({
+ transitionClass: '',
+ });
+ },
+ onTransitionEnd() {
+ if (this.customDuration) {
+ return;
+ }
+ clearTimeout(this.transitionT);
+ if (this.status === 'entering' && this.data.visible) {
+ this.entered();
+ }
+ else if (this.status === 'leaving' && !this.data.visible) {
+ this.leaved();
+ this.setData({
+ realVisible: false,
+ });
+ }
+ },
+ },
+ });
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/README.md b/miniprogram_npm/tdesign-miniprogram/overlay/README.md
new file mode 100644
index 0000000..8170e5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/README.md
@@ -0,0 +1,49 @@
+---
+title: Overlay 閬僵灞�
+description: 閫氳繃閬僵灞傦紝鍙互寮鸿皟閮ㄥ垎鍐呭
+spline: message
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-100%25-blue" /></span>
+
+<div style="background: #ecf2fe; display: flex; align-items: center; line-height: 20px; padding: 14px 24px; border-radius: 3px; color: #555a65">
+ <svg fill="none" viewBox="0 0 16 16" width="16px" height="16px" style="margin-right: 5px">
+ <path fill="#0052d9" d="M8 15A7 7 0 108 1a7 7 0 000 14zM7.4 4h1.2v1.2H7.4V4zm.1 2.5h1V12h-1V6.5z" fillOpacity="0.9"></path>
+ </svg>
+ 璇ョ粍浠朵簬 0.10.0 鐗堟湰涓婄嚎锛岃鐣欐剰鐗堟湰銆�
+</div>
+
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-overlay": "tdesign-miniprogram/overlay/overlay"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 鍩虹浣跨敤
+
+{{ base }}
+
+## API
+
+### Overlay Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+visible | Boolean | false | 鏄惁灞曠ず | N
+zIndex | Number | 11000 | 閬僵灞傚強 | N
+duration | Number | 300 | (鏆備笉鏀寔)鑳屾櫙鑹茶繃娓℃椂闂达紝鍗曚綅姣 | N
+backgroundColor | String | - | 閬僵灞傜殑鑳屾櫙鑹� | N
+preventScrollThrough | Boolean | true | 闃叉婊氬姩绌块�忥紝鍗充笉鍏佽鐐瑰嚮鍜屾粴鍔� | N
+
+### Overlay Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+click | `({ visible: boolean })` | 鐐瑰嚮閬僵鏃惰Е鍙�
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts
new file mode 100644
index 0000000..ea9b296
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.d.ts
@@ -0,0 +1,36 @@
+import { SuperComponent } from '../common/src/index';
+export default class Overlay extends SuperComponent {
+ properties: {
+ zIndex: {
+ type: NumberConstructor;
+ value: number;
+ };
+ duration: {
+ type: NumberConstructor;
+ value: number;
+ };
+ backgroundColor: {
+ type: StringConstructor;
+ value: string;
+ };
+ preventScrollThrough: {
+ type: BooleanConstructor;
+ value: boolean;
+ };
+ };
+ behaviors: string[];
+ data: {
+ prefix: string;
+ classPrefix: string;
+ computedStyle: string;
+ _zIndex: number;
+ };
+ observers: {
+ backgroundColor(v: any): void;
+ zIndex(v: any): void;
+ };
+ methods: {
+ handleClick(): void;
+ noop(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.js b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.js
new file mode 100644
index 0000000..6f98fdc
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.js
@@ -0,0 +1,65 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import transition from '../mixins/transition';
+const { prefix } = config;
+const name = `${prefix}-overlay`;
+let Overlay = class Overlay extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.properties = {
+ zIndex: {
+ type: Number,
+ value: 11000,
+ },
+ duration: {
+ type: Number,
+ value: 300,
+ },
+ backgroundColor: {
+ type: String,
+ value: '',
+ },
+ preventScrollThrough: {
+ type: Boolean,
+ value: true,
+ },
+ };
+ this.behaviors = [transition()];
+ this.data = {
+ prefix,
+ classPrefix: name,
+ computedStyle: '',
+ _zIndex: 11000,
+ };
+ this.observers = {
+ backgroundColor(v) {
+ this.setData({
+ computedStyle: `background-color: ${v};`,
+ });
+ },
+ zIndex(v) {
+ if (v !== 0) {
+ this.setData({
+ _zIndex: v,
+ });
+ }
+ },
+ };
+ this.methods = {
+ handleClick() {
+ this.triggerEvent('click', { visible: !this.properties.visible });
+ },
+ noop() { },
+ };
+ }
+};
+Overlay = __decorate([
+ wxComponent()
+], Overlay);
+export default Overlay;
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.json b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.json
new file mode 100644
index 0000000..467ce29
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxml b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxml
new file mode 100644
index 0000000..55750dd
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxml
@@ -0,0 +1,25 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ wx:if="{{realVisible && preventScrollThrough}}"
+ class="{{prefix}}-overlay {{transitionClass}} class"
+ style="{{_._style(['z-index:' + _zIndex, computedStyle, style, customStyle])}}"
+ bind:tap="handleClick"
+ catchtouchmove="noop"
+ bind:transitionend="onTransitionEnd"
+ aria-role="{{ ariaRole || 'button' }}"
+ aria-label="{{ ariaLabel || '鍏抽棴' }}"
+>
+ <slot />
+</view>
+<view
+ wx:elif="{{realVisible}}"
+ class="{{prefix}}-overlay {{transitionClass}} class"
+ style="{{_._style(['z-index:' + _zIndex, computedStyle, style, customStyle])}}"
+ bind:tap="handleClick"
+ bind:transitionend="onTransitionEnd"
+ aria-role="{{ ariaRole || 'button' }}"
+ aria-label="{{ ariaLabel || '鍏抽棴' }}"
+>
+ <slot />
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxss b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxss
new file mode 100644
index 0000000..c84c213
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/overlay/overlay.wxss
@@ -0,0 +1,42 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ bottom: 0;
+ background-color: var(--td-overlay-bg-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
+ transition: opacity var(--td-overlay-transition-duration, 300ms) ease;
+}
+.t-fade-enter {
+ opacity: 0;
+}
+.t-fade-leave-to {
+ opacity: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md
new file mode 100644
index 0000000..3aa395d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md
@@ -0,0 +1,25 @@
+:: BASE_DOC ::
+
+## API
+### Popup Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+close-btn | Boolean / Slot | - | \- | N
+close-on-overlay-click | Boolean | true | \- | N
+content | String / Slot | - | \- | N
+duration | Number | 240 | \- | N
+external-classes | Array | - | `['t-class', 't-class-overlay', 't-class-content']` | N
+overlay-props | Object | {} | \- | N
+placement | String | top | options锛歵op/left/right/bottom/center | N
+prevent-scroll-through | Boolean | true | \- | N
+show-overlay | Boolean | true | \- | N
+visible | Boolean | false | Typescript锛歚boolean` | N
+default-visible | Boolean | undefined | uncontrolled property銆俆ypescript锛歚boolean` | N
+z-index | Number | 11500 | \- | N
+
+### Popup Events
+
+name | params | description
+-- | -- | --
+visible-change | `(visible: boolean, trigger: PopupSource) ` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/popup/type.ts)銆�<br/>`type PopupSource = 'close-btn' \| 'overlay'`<br/>
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/README.md b/miniprogram_npm/tdesign-miniprogram/popup/README.md
new file mode 100644
index 0000000..620c7f7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/README.md
@@ -0,0 +1,57 @@
+---
+title: Popup 寮瑰嚭灞�
+description: 鐢卞叾浠栨帶浠惰Е鍙戯紝灞忓箷婊戝嚭鎴栧脊鍑轰竴鍧楄嚜瀹氫箟鍐呭鍖哄煙銆�
+spline: message
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-100%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-popup": "tdesign-miniprogram/popup/popup"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 缁勪欢绫诲瀷
+
+鍩虹寮瑰嚭灞�
+
+{{ base }}
+
+### 缁勪欢绀轰緥
+
+搴旂敤绀轰緥
+
+{{ with-title }}
+
+{{ custom-close }}
+
+## API
+### Popup Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+close-btn | Boolean / Slot | - | 鍏抽棴鎸夐挳锛屽�肩被鍨嬩负 Boolean 鏃惰〃绀烘槸鍚︽樉绀哄叧闂寜閽�備篃鍙互鑷畾涔夊叧闂寜閽� | N
+close-on-overlay-click | Boolean | true | 鐐瑰嚮閬僵灞傛槸鍚﹀叧闂� | N
+content | String / Slot | - | 娴眰閲岄潰鐨勫唴瀹� | N
+duration | Number | 240 | 鍔ㄧ敾杩囨浮鏃堕棿 | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃� 缁勪欢澶栧眰鍏冪礌銆侀伄缃╁眰銆佹诞灞傚唴瀹� 绛夊厓绱犵被鍚嶃�俙['t-class', 't-class-overlay', 't-class-content']` | N
+overlay-props | Object | {} | 閬僵灞傜殑灞炴�э紝閫忎紶鑷� overlay | N
+placement | String | top | 娴眰鍑虹幇浣嶇疆銆傚彲閫夐」锛歵op/left/right/bottom/center | N
+prevent-scroll-through | Boolean | true | 闃叉婊氬姩绌块�� | N
+show-overlay | Boolean | true | 鏄惁鏄剧ず閬僵灞� | N
+visible | Boolean | false | 鏄惁鏄剧ず娴眰銆俆S 绫诲瀷锛歚boolean` | N
+default-visible | Boolean | undefined | 鏄惁鏄剧ず娴眰銆傞潪鍙楁帶灞炴�с�俆S 绫诲瀷锛歚boolean` | N
+z-index | Number | 11500 | 缁勪欢灞傜骇锛學eb 渚ф牱寮忛粯璁や负 5500锛岀Щ鍔ㄧ鏍峰紡榛樿涓� 1500锛屽皬绋嬪簭鏍峰紡榛樿涓�11500 | N
+
+### Popup Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+visible-change | `(visible: boolean, trigger: PopupSource) ` | 褰撴诞灞傞殣钘忔垨鏄剧ず鏃惰Е鍙戙�俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/popup/type.ts)銆�<br/>`type PopupSource = 'close-btn' \| 'overlay'`<br/>
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.d.ts b/miniprogram_npm/tdesign-miniprogram/popup/popup.d.ts
new file mode 100644
index 0000000..543d354
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.d.ts
@@ -0,0 +1,20 @@
+import { TdPopupProps } from './type';
+import { SuperComponent } from '../common/src/index';
+export declare type PopupProps = TdPopupProps;
+export default class Popup extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: TdPopupProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ };
+ methods: {
+ onStopPropagation(): void;
+ handleOverlayClick(): void;
+ handleClose(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.js b/miniprogram_npm/tdesign-miniprogram/popup/popup.js
new file mode 100644
index 0000000..b38ba13
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.js
@@ -0,0 +1,44 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import transition from '../mixins/transition';
+delete props.visible;
+const { prefix } = config;
+const name = `${prefix}-popup`;
+let Popup = class Popup extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`];
+ this.behaviors = [transition()];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ };
+ this.methods = {
+ onStopPropagation() { },
+ handleOverlayClick() {
+ const { closeOnOverlayClick } = this.properties;
+ if (closeOnOverlayClick) {
+ this.triggerEvent('visible-change', { visible: false });
+ }
+ },
+ handleClose() {
+ this.triggerEvent('visible-change', { visible: false });
+ },
+ };
+ }
+};
+Popup = __decorate([
+ wxComponent()
+], Popup);
+export default Popup;
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.json b/miniprogram_npm/tdesign-miniprogram/popup/popup.json
new file mode 100644
index 0000000..870a7b6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-overlay": "../overlay/overlay",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.wxml b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxml
new file mode 100644
index 0000000..87cb78d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxml
@@ -0,0 +1,30 @@
+<wxs src="./popup.wxs" module="utils" />
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ wx:if="{{realVisible}}"
+ style="{{_._style([utils.getPopupStyles(zIndex), style, customStyle])}}"
+ class="{{_.cls(classPrefix, [placement])}} {{transitionClass}} class {{prefix}}-class"
+ bind:transitionend="onTransitionEnd"
+ aria-role="dialog"
+ aria-modal="{{ true }}"
+>
+ <view class="{{classPrefix}}__content {{prefix}}-class-content">
+ <slot name="content" />
+ <slot />
+ <view class="{{classPrefix}}__close" bind:tap="handleClose">
+ <t-icon name="close" wx:if="{{closeBtn}}" size="64rpx" />
+ <slot name="close-btn" class="{{classPrefix}}-slot" />
+ </view>
+ </view>
+</view>
+
+<t-overlay
+ id="popup-overlay"
+ wx:if="{{showOverlay}}"
+ visible="{{visible}}"
+ z-index="{{overlayProps.zIndex || 11000}}"
+ prevent-scroll-through="{{preventScrollThrough || overlayProps.preventScrollThrough}}"
+ bind:tap="handleOverlayClick"
+ custom-style="{{overlayProps.style || ''}}"
+/>
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.wxs b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxs
new file mode 100644
index 0000000..a2da0d0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxs
@@ -0,0 +1,8 @@
+function getPopupStyles(zIndex) {
+ var zIndexStyle = zIndex ? 'z-index:' + zIndex + ';' : '';
+ return zIndexStyle;
+}
+
+module.exports = {
+ getPopupStyles: getPopupStyles,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss
new file mode 100644
index 0000000..3dab153
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss
@@ -0,0 +1,104 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-popup {
+ position: fixed;
+ z-index: 11500;
+ max-height: 100vh;
+ transition: all 300ms ease;
+ background-color: var(--td-popup-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-popup__content {
+ position: relative;
+ z-index: 1;
+}
+.t-popup__close {
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: 20rpx;
+ line-height: 1;
+}
+.t-popup--top {
+ top: 0;
+ left: 0;
+ width: 100%;
+ border-bottom-left-radius: var(--td-popup-border-radius, var(--td-radius-default, 12rpx));
+ border-bottom-right-radius: var(--td-popup-border-radius, var(--td-radius-default, 12rpx));
+}
+.t-popup--bottom {
+ bottom: 0;
+ left: 0;
+ width: 100vw;
+ border-top-left-radius: var(--td-popup-border-radius, var(--td-radius-default, 12rpx));
+ border-top-right-radius: var(--td-popup-border-radius, var(--td-radius-default, 12rpx));
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+}
+.t-popup--left {
+ top: 0;
+ left: 0;
+ height: 100vh;
+}
+.t-popup--right {
+ top: 0;
+ right: 0;
+ height: 100vh;
+}
+.t-popup--center {
+ top: 50%;
+ left: 50%;
+ transform: scale(1) translate3d(-50%, -50%, 0);
+ transform-origin: 0% 0%;
+ border-radius: var(--td-popup-border-radius, var(--td-radius-default, 12rpx));
+}
+.t-popup.t-fade-enter.t-popup--top,
+.t-popup.t-fade-leave-to.t-popup--top {
+ transform: translateY(-100%);
+}
+.t-popup.t-fade-enter.t-popup--bottom,
+.t-popup.t-fade-leave-to.t-popup--bottom {
+ transform: translateY(100%);
+}
+.t-popup.t-fade-enter.t-popup--left,
+.t-popup.t-fade-leave-to.t-popup--left {
+ transform: translateX(-100%);
+}
+.t-popup.t-fade-enter.t-popup--right,
+.t-popup.t-fade-leave-to.t-popup--right {
+ transform: translateX(100%);
+}
+.t-popup.t-fade-enter.t-popup--center,
+.t-popup.t-fade-leave-to.t-popup--center {
+ transform: scale(0.6) translate3d(-50%, -50%, 0);
+ opacity: 0;
+}
+.t-popup.t-dialog-enter.t-popup--center,
+.t-popup.t-dialog-leave-to.t-popup--center {
+ transform: scale(0.6) translate3d(-50%, -50%, 0);
+ opacity: 0;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/props.d.ts b/miniprogram_npm/tdesign-miniprogram/popup/props.d.ts
new file mode 100644
index 0000000..e23cd6c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/props.d.ts
@@ -0,0 +1,3 @@
+import { TdPopupProps } from './type';
+declare const props: TdPopupProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/props.js b/miniprogram_npm/tdesign-miniprogram/popup/props.js
new file mode 100644
index 0000000..dd31f2c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/props.js
@@ -0,0 +1,51 @@
+const props = {
+ closeBtn: {
+ type: Boolean,
+ },
+ closeOnOverlayClick: {
+ type: Boolean,
+ value: true,
+ },
+ content: {
+ type: String,
+ },
+ duration: {
+ type: Number,
+ value: 240,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ overlayProps: {
+ type: Object,
+ value: {},
+ },
+ placement: {
+ type: String,
+ value: 'top',
+ },
+ preventScrollThrough: {
+ type: Boolean,
+ value: true,
+ },
+ showOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ transitionProps: {
+ type: Object,
+ },
+ visible: {
+ type: Boolean,
+ value: null,
+ },
+ defaultVisible: {
+ type: Boolean,
+ value: false,
+ },
+ zIndex: {
+ type: Number,
+ value: 11500,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/type.d.ts b/miniprogram_npm/tdesign-miniprogram/popup/type.d.ts
new file mode 100644
index 0000000..fa09661
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/type.d.ts
@@ -0,0 +1,62 @@
+import { TdTransitionProps } from '../transition/index';
+export interface TdPopupProps {
+ closeBtn?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ closeOnOverlayClick?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ content?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ duration?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-overlay', 't-class-content'];
+ };
+ overlayProps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ placement?: {
+ type: StringConstructor;
+ value?: 'top' | 'left' | 'right' | 'bottom' | 'center';
+ };
+ preventScrollThrough?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ showOverlay?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ transitionProps?: {
+ type: ObjectConstructor;
+ value?: TdTransitionProps;
+ };
+ visible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ defaultVisible?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
+export interface PopupVisibleChangeContext {
+ trigger: 'close-btn' | 'overlay';
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/popup/type.js b/miniprogram_npm/tdesign-miniprogram/popup/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/popup/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/progress/README.en-US.md
new file mode 100644
index 0000000..c4b14b8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/README.en-US.md
@@ -0,0 +1,15 @@
+:: BASE_DOC ::
+
+## API
+### Progress Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+color | String / Object / Array | '' | Typescript锛歚string \| Array<string> \| Record<string, string>` | N
+external-classes `v0.25.0` | Array | - | `['t-class', 't-class-bar', 't-class-label']` | N
+label | String / Boolean / Slot | true | \- | N
+percentage | Number | 0 | \- | N
+status | String | - | options锛歴uccess/error/warning/active銆俆ypescript锛歚StatusEnum` `type StatusEnum = 'success' \| 'error' \| 'warning' \| 'active'`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
+stroke-width | String / Number | - | \- | N
+theme | String | line | options锛歭ine/plump/circle銆俆ypescript锛歚ThemeEnum` `type ThemeEnum = 'line' \| 'plump' \| 'circle'`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
+track-color | String | '' | \- | N
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/README.md b/miniprogram_npm/tdesign-miniprogram/progress/README.md
new file mode 100644
index 0000000..a95554d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/README.md
@@ -0,0 +1,71 @@
+---
+title: Progress 杩涘害鏉�
+description: 鐢ㄤ簬灞曠ず浠诲姟褰撳墠鐨勮繘搴︺��
+spline: message
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-88%25-blue" /></span>
+
+<div style="background: #ecf2fe; display: flex; align-items: center; line-height: 20px; padding: 14px 24px; border-radius: 3px; color: #555a65">
+ <svg fill="none" viewBox="0 0 16 16" width="16px" height="16px" style="margin-right: 5px">
+ <path fill="#0052d9" d="M8 15A7 7 0 108 1a7 7 0 000 14zM7.4 4h1.2v1.2H7.4V4zm.1 2.5h1V12h-1V6.5z" fillOpacity="0.9"></path>
+ </svg>
+ 璇ョ粍浠朵簬 0.7.3 鐗堟湰涓婄嚎锛岃鐣欐剰鐗堟湰銆�
+</div>
+
+## 寮曞叆
+
+### 寮曞叆缁勪欢
+
+鍦� `app.json` 鎴� `page.json` 涓紩鍏ョ粍浠讹細
+
+```json
+"usingComponents": {
+ "t-progress": "tdesign-miniprogram/progress/progress"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 01 缁勪欢绫诲瀷
+
+鍩虹杩涘害鏉�
+
+{{ base }}
+
+杩囨浮鏍峰紡
+
+{{ transition }}
+
+鑷畾涔夐鑹�/鍦嗚
+
+{{ custom }}
+
+### 02 缁勪欢鐘舵��
+
+绾挎�ц繘搴︽潯
+
+{{ line }}
+
+鐧惧垎姣斿唴鏄捐繘搴︽潯
+
+{{ plump }}
+
+鐜舰杩涘害鏉�
+
+{{ circle }}
+
+## API
+### Progress Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+color | String / Object / Array | '' | 杩涘害鏉¢鑹层�傜ず渚嬶細'#ED7B2F' 鎴� 'orange' 鎴� `['#f00', '#0ff', '#f0f']` 鎴� `{ '0%': '#f00', '100%': '#0ff' }` 鎴� `{ from: '#000', to: '#000' }` 绛夈�俆S 绫诲瀷锛歚string \| Array<string> \| Record<string, string>` | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃� 缁勪欢澶栧眰銆佽繘搴︽枃瀛楃瓑鍏冪礌绫诲悕銆傘�俙['t-class', 't-class-bar', 't-class-label']` | N
+label | String / Boolean / Slot | true | 杩涘害鐧惧垎姣旓紝鍙嚜瀹氫箟 | N
+percentage | Number | 0 | 杩涘害鏉$櫨鍒嗘瘮 | N
+status | String | - | 杩涘害鏉$姸鎬併�傚彲閫夐」锛歴uccess/error/warning/active銆俆S 绫诲瀷锛歚StatusEnum` `type StatusEnum = 'success' \| 'error' \| 'warning' \| 'active'`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
+stroke-width | String / Number | - | 杩涘害鏉$嚎瀹斤紝榛樿鍗曚綅 `px`銆倈 N
+theme | String | line | 杩涘害鏉¢鏍笺�傚�间负 line锛屾爣绛撅紙label锛夋樉绀哄湪杩涘害鏉″彸渚э紱鍊间负 plump锛屾爣绛撅紙label锛夋樉绀哄湪杩涘害鏉¢噷闈紱鍊间负 circle锛屾爣绛撅紙label锛夋樉绀哄湪杩涘害鏉℃涓棿銆傚彲閫夐」锛歭ine/plump/circle銆俆S 绫诲瀷锛歚ThemeEnum` `type ThemeEnum = 'line' \| 'plump' \| 'circle'`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
+track-color | String | '' | 杩涘害鏉℃湭瀹屾垚閮ㄥ垎棰滆壊 | N
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.d.ts b/miniprogram_npm/tdesign-miniprogram/progress/progress.d.ts
new file mode 100644
index 0000000..c627dc5
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.d.ts
@@ -0,0 +1,26 @@
+import { SuperComponent } from '../common/src/index';
+export default class Progress extends SuperComponent {
+ externalClasses: string[];
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdProgressProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ colorBar: string;
+ heightBar: string;
+ computedStatus: string;
+ computedProgress: number;
+ };
+ observers: {
+ percentage(percentage: any): void;
+ color(color: any): void;
+ strokeWidth(strokeWidth: any): string;
+ theme(theme: any): void;
+ trackColor(trackColor: any): void;
+ };
+ methods: {
+ getInnerDiameter(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.js b/miniprogram_npm/tdesign-miniprogram/progress/progress.js
new file mode 100644
index 0000000..4f91512
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.js
@@ -0,0 +1,81 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+import { getBackgroundColor } from './utils';
+import { unitConvert, getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-progress`;
+let Progress = class Progress extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-bar`, `${prefix}-class-label`];
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ colorBar: '',
+ heightBar: '',
+ computedStatus: '',
+ computedProgress: 0,
+ };
+ this.observers = {
+ percentage(percentage) {
+ percentage = Math.max(0, Math.min(percentage, 100));
+ this.setData({
+ computedStatus: percentage === 100 ? 'success' : '',
+ computedProgress: percentage,
+ });
+ },
+ color(color) {
+ this.setData({
+ colorBar: getBackgroundColor(color),
+ colorCircle: typeof color === 'object' ? '' : color,
+ });
+ },
+ strokeWidth(strokeWidth) {
+ if (!strokeWidth) {
+ return '';
+ }
+ this.setData({
+ heightBar: unitConvert(strokeWidth),
+ });
+ },
+ theme(theme) {
+ if (theme === 'circle') {
+ this.getInnerDiameter();
+ }
+ },
+ trackColor(trackColor) {
+ this.setData({
+ bgColorBar: trackColor,
+ });
+ },
+ };
+ this.methods = {
+ getInnerDiameter() {
+ const { strokeWidth } = this.properties;
+ const wrapID = `.${name}__canvas--circle`;
+ if (strokeWidth) {
+ getRect(this, wrapID).then((wrapRect) => {
+ this.setData({
+ innerDiameter: wrapRect.width - unitConvert(strokeWidth) * 2,
+ });
+ });
+ }
+ },
+ };
+ }
+};
+Progress = __decorate([
+ wxComponent()
+], Progress);
+export default Progress;
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.json b/miniprogram_npm/tdesign-miniprogram/progress/progress.json
new file mode 100644
index 0000000..049940c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.wxml b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxml
new file mode 100644
index 0000000..f531829
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxml
@@ -0,0 +1,101 @@
+<import src="../common/template/icon.wxml" />
+<wxs src="../common/utils.wxs" module="_" />
+<wxs src="./progress.wxs" module="this" />
+
+<view style="{{_._style([style, customStyle])}}" class="{{classPrefix}} class">
+ <view
+ aria-role="progressbar"
+ role="progressbar"
+ aria-valuenow="{{computedProgress}}"
+ aria-valuemin="0"
+ aria-valuemax="100"
+ aria-label="{{ ariaLabel || this.getAriaLabel(status) }}"
+ aria-labelledby="{{ ariaLabelledby }}"
+ aria-describedby="{{ ariaDescribedby }}"
+ aria-busy="{{ ariaBusy }}"
+ wx:if="{{theme === this.PRO_THEME.LINE}}"
+ class="{{classPrefix }}--thin {{classPrefix}}--status--{{status || computedStatus}} {{prefix}}-class"
+ >
+ <view
+ class="{{classPrefix }}__bar"
+ style="height: {{heightBar}}px;border-radius: {{heightBar}}px;background-color: {{bgColorBar}}"
+ >
+ <view
+ class="{{classPrefix }}__inner {{prefix}}-class-bar"
+ style="background: {{colorBar}}; width: {{computedProgress + '%'}}"
+ ></view>
+ </view>
+ <view wx:if="{{label}}" class="{{classPrefix}}__info {{prefix}}-class-label">
+ <template
+ wx:if="{{_.includes(this.STATUS, status)}}"
+ is="icon"
+ data="{{class: classPrefix + '__icon', size:'44rpx', name: this.LINE_STATUS_ICON[status]}}"
+ ></template>
+ <text wx:else>{{ _.isString(label)? label: computedProgress + '%' }}</text>
+ </view>
+ <slot name="label" />
+ </view>
+
+ <view
+ wx:if="{{theme === this.PRO_THEME.PLUMP}}"
+ aria-role="progressbar"
+ role="progressbar"
+ aria-valuenow="{{computedProgress}}"
+ aria-valuemin="0"
+ aria-valuemax="100"
+ aria-label="{{ ariaLabel || this.getAriaLabel(status) }}"
+ aria-labelledby="{{ ariaLabelledby }}"
+ aria-describedby="{{ ariaDescribedby }}"
+ aria-busy="{{ ariaBusy }}"
+ class="{{classPrefix}}__bar {{classPrefix}}--plump {{computedProgress > 10 ? classPrefix + '--over-ten': classPrefix + '--under-ten'}} {{classPrefix}}--status--{{status || computedStatus}} {{prefix}}-class"
+ style="height: {{heightBar}}px;border-radius: {{heightBar}}px;background-color: {{bgColorBar}}"
+ >
+ <view
+ class="{{classPrefix}}__inner {{prefix}}-class-bar"
+ style="background: {{colorBar}}; width: {{computedProgress}}%"
+ >
+ <view wx:if="{{label && computedProgress > 10}}" class="{{classPrefix }}__info {{prefix}}-class-label">
+ <text>{{ _.isString(label)? label: computedProgress + '%' }}</text>
+ </view>
+ <slot name="label" />
+ </view>
+ <view wx:if="{{label && computedProgress <= 10}}" class="{{ classPrefix }}__info {{prefix}}-class-label">
+ <text>{{ _.isString(label)? label: computedProgress + '%' }}</text>
+ </view>
+ <slot name="label" />
+ </view>
+
+ <view
+ wx:if="{{theme === this.PRO_THEME.CIRCLE}}"
+ aria-role="progressbar"
+ role="progressbar"
+ aria-valuenow="{{computedProgress}}"
+ aria-valuemin="0"
+ aria-valuemax="100"
+ aria-label="{{ ariaLabel || this.getAriaLabel(status) }}"
+ aria-labelledby="{{ ariaLabelledby }}"
+ aria-describedby="{{ ariaDescribedby }}"
+ aria-busy="{{ ariaBusy }}"
+ class="{{classPrefix}}--status--{{status || computedStatus}} {{prefix}}-class"
+ >
+ <view
+ class="{{classPrefix}}__canvas--circle"
+ style="background-image: conic-gradient( {{colorCircle || this.STATUS_COLOR[status] || '#0052d9'}} {{computedProgress}}%, {{bgColorBar || '#e7e7e7'}} 0%);"
+ >
+ <view
+ class="{{classPrefix}}__canvas--inner {{prefix}}-class-bar"
+ style="{{innerDiameter? 'width:'+ innerDiameter*2 + 'rpx;' + 'height:'+ innerDiameter*2 + 'rpx;': ''}}"
+ >
+ <view wx:if="{{label}}" class="{{classPrefix}}__info {{prefix}}-class-label">
+ <template
+ wx:if="{{_.includes(this.STATUS, status)}}"
+ is="icon"
+ data="{{class: classPrefix + '__icon', size:'96rpx', name: this.CIRCLE_STATUS_ICON[status]}}"
+ ></template>
+ <text wx:else>{{ _.isString(label)? label: computedProgress + '%' }}</text>
+ </view>
+ <slot name="label" />
+ </view>
+ </view>
+ </view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.wxs b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxs
new file mode 100644
index 0000000..04d10f4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxs
@@ -0,0 +1,44 @@
+var STATUS = ['success', 'error', 'warning'];
+var STATUS_TEXT = ['success', 'error', 'warning', 'active'];
+
+var PRO_THEME = {
+ LINE: 'line',
+ PLUMP: 'plump',
+ CIRCLE: 'circle',
+};
+
+var STATUS_COLOR = {
+ success: '#00a870',
+ error: '#e34d59',
+ warning: '#ed7b2f',
+};
+var LINE_STATUS_ICON = {
+ success: 'check-circle-filled',
+ error: 'error-circle-filled',
+ warning: 'error-circle-filled',
+};
+var CIRCLE_STATUS_ICON = {
+ success: 'check',
+ error: 'close',
+ warning: 'error',
+};
+
+var getAriaLabel = function (status) {
+ if (status === 'error') {
+ return '杩涘害澶辫触';
+ }
+ if (status === 'warning') {
+ return '杩涘害寮傚父';
+ }
+ return '';
+};
+
+module.exports = {
+ STATUS: STATUS,
+ STATUS_TEXT: STATUS_TEXT,
+ PRO_THEME: PRO_THEME,
+ STATUS_COLOR: STATUS_COLOR,
+ LINE_STATUS_ICON: LINE_STATUS_ICON,
+ CIRCLE_STATUS_ICON: CIRCLE_STATUS_ICON,
+ getAriaLabel: getAriaLabel,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/progress.wxss b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxss
new file mode 100644
index 0000000..8d684f4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/progress.wxss
@@ -0,0 +1,156 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-progress__inner {
+ position: relative;
+ height: 100%;
+ background: var(--td-progress-inner-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-radius: var(--td-radius-round, 999px);
+ transition: all var(--td-anim-duration-base, 0.2s) var(--td-anim-time-fn-easing, cubic-bezier(0.38, 0, 0.24, 1));
+}
+.t-progress__bar {
+ width: 100%;
+ height: 12rpx;
+ overflow: hidden;
+ background: var(--td-progress-track-bg-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
+ border-radius: var(--td-radius-round, 999px);
+}
+.t-progress__info {
+ margin-left: var(--td-spacer, 16rpx);
+ color: var(--td-progress-info-dark-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
+ white-space: nowrap;
+ display: inline-flex;
+}
+.t-progress--thin {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+.t-progress--thin .t-progress__icon {
+ font-size: calc(var(--td-font-size-base, 28rpx) + 2px);
+}
+.t-progress--plump {
+ height: 40rpx;
+ border-radius: calc(40rpx / 2);
+ display: flex;
+ align-items: center;
+}
+.t-progress--plump .t-progress__info {
+ font-size: var(--td-font-size-s, 24rpx);
+}
+.t-progress--over-ten .t-progress__info {
+ position: absolute;
+ top: 50%;
+ right: var(--td-spacer, 16rpx);
+ color: var(--td-progress-info-light-color, var(--td-font-white-1, #ffffff));
+ transform: translateY(-50%);
+}
+.t-progress--under-ten .t-progress__info,
+.t-progress--under-ten .t-progress__inner {
+ display: inline-block;
+}
+.t-progress--under-ten .t-progress__info {
+ vertical-align: top;
+}
+.t-progress__canvas--circle {
+ position: relative;
+ width: 224rpx;
+ height: 224rpx;
+ border-radius: var(--td-radius-circle, 50%);
+}
+.t-progress__canvas--circle .t-progress__canvas--inner {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ width: calc(100% - 12rpx*2);
+ height: calc(100% - 12rpx*2);
+ border-radius: var(--td-radius-circle, 50%);
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+ background-color: var(--td-progress-circle-inner-bg-color, var(--td-font-white-1, #ffffff));
+}
+.t-progress__canvas--circle .t-progress__info {
+ margin: 0;
+ font-size: 40rpx;
+ font-weight: 700;
+ line-height: 56rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+}
+.t-progress__canvas--circle .t-progress__icon {
+ font-size: 96rpx;
+}
+.t-progress--status--active .t-progress__inner::before {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1;
+ content: '';
+ animation: progress-active-animation 2s cubic-bezier(0.23, 0.99, 0.86, 0.2) infinite;
+ background: var(--td-progress-inner-bg-color-active, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+ opacity: 0.2;
+}
+.t-progress--status--success .t-progress__inner {
+ background: var(--td-progress-inner-bg-color-success, var(--td-success-color, var(--td-success-color-5, #2ba471)));
+}
+.t-progress--status--success .t-progress__icon {
+ color: var(--td-success-color, var(--td-success-color-5, #2ba471));
+}
+.t-progress--status--warning .t-progress__inner {
+ background: var(--td-progress-inner-bg-color-warning, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
+}
+.t-progress--status--warning .t-progress__icon {
+ color: var(--td-warning-color, var(--td-warning-color-5, #e37318));
+}
+.t-progress--status--error .t-progress__inner {
+ background: var(--td-progress-inner-bg-color-error, var(--td-error-color, var(--td-error-color-6, #d54941)));
+}
+.t-progress--status--error .t-progress__icon {
+ color: var(--td-error-color, var(--td-error-color-6, #d54941));
+}
+@keyframes progress-active-animation {
+ 0% {
+ width: 0;
+ opacity: 0.1;
+ }
+ 35% {
+ width: 50%;
+ opacity: 0.4;
+ }
+ 100% {
+ width: 100%;
+ opacity: 0;
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/props.d.ts b/miniprogram_npm/tdesign-miniprogram/progress/props.d.ts
new file mode 100644
index 0000000..214f11a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/props.d.ts
@@ -0,0 +1,3 @@
+import { TdProgressProps } from './type';
+declare const props: TdProgressProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/props.js b/miniprogram_npm/tdesign-miniprogram/progress/props.js
new file mode 100644
index 0000000..d203455
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/props.js
@@ -0,0 +1,32 @@
+const props = {
+ color: {
+ type: null,
+ value: '',
+ },
+ externalClasses: {
+ type: Array,
+ },
+ label: {
+ type: null,
+ value: true,
+ },
+ percentage: {
+ type: Number,
+ value: 0,
+ },
+ status: {
+ type: String,
+ },
+ strokeWidth: {
+ type: null,
+ },
+ theme: {
+ type: String,
+ value: 'line',
+ },
+ trackColor: {
+ type: String,
+ value: '',
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/type.d.ts b/miniprogram_npm/tdesign-miniprogram/progress/type.d.ts
new file mode 100644
index 0000000..d0e3d07
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/type.d.ts
@@ -0,0 +1,40 @@
+export interface TdProgressProps {
+ color?: {
+ type: null;
+ value?: string | Array<string> | Record<string, string>;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-bar', 't-class-label'];
+ };
+ label?: {
+ type: null;
+ value?: string | boolean;
+ };
+ percentage?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ status?: {
+ type: StringConstructor;
+ value?: StatusEnum;
+ };
+ strokeWidth?: {
+ type: null;
+ value?: string | number;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: ThemeEnum;
+ };
+ trackColor?: {
+ type: StringConstructor;
+ value?: string;
+ };
+}
+export declare type StatusEnum = 'success' | 'error' | 'warning' | 'active';
+export declare type ThemeEnum = 'line' | 'plump' | 'circle';
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/type.js b/miniprogram_npm/tdesign-miniprogram/progress/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/utils.d.ts b/miniprogram_npm/tdesign-miniprogram/progress/utils.d.ts
new file mode 100644
index 0000000..84b7889
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/utils.d.ts
@@ -0,0 +1,11 @@
+export declare type Gradients = {
+ [percent: string]: string;
+};
+export declare type FromTo = {
+ from: string;
+ to: string;
+};
+export declare type LinearGradient = {
+ direction?: string;
+} & (Gradients | FromTo);
+export declare function getBackgroundColor(color: string | string[] | LinearGradient): string;
diff --git a/miniprogram_npm/tdesign-miniprogram/progress/utils.js b/miniprogram_npm/tdesign-miniprogram/progress/utils.js
new file mode 100644
index 0000000..455982c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/progress/utils.js
@@ -0,0 +1,30 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+export function getBackgroundColor(color) {
+ if (typeof color === 'string') {
+ return color;
+ }
+ if (Array.isArray(color)) {
+ if (color[0] && color[0][0] === '#') {
+ color.unshift('90deg');
+ }
+ return `linear-gradient( ${color.join(',')} )`;
+ }
+ const { from, to, direction = 'to right' } = color, rest = __rest(color, ["from", "to", "direction"]);
+ let keys = Object.keys(rest);
+ if (keys.length) {
+ keys = keys.sort((a, b) => parseFloat(a.substr(0, a.length - 1)) - parseFloat(b.substr(0, b.length - 1)));
+ const tempArr = keys.map((key) => `${rest[key]} ${key}`);
+ return `linear-gradient(${direction}, ${tempArr.join(',')})`;
+ }
+ return `linear-gradient(${direction}, ${from}, ${to})`;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.d.ts
new file mode 100644
index 0000000..cdda046
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSideBarItemProps } from './type';
+declare const props: TdSideBarItemProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.js b/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.js
new file mode 100644
index 0000000..8ce799a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/props.js
@@ -0,0 +1,20 @@
+const props = {
+ badgeProps: {
+ type: Object,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: null,
+ },
+ label: {
+ type: String,
+ value: '',
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.d.ts
new file mode 100644
index 0000000..a0d8ffb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.d.ts
@@ -0,0 +1,20 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class SideBarItem extends SuperComponent {
+ externalClasses: string[];
+ properties: import("./type").TdSideBarItemProps;
+ relations: RelationsOptions;
+ observers: {
+ icon(v: any): void;
+ };
+ data: {
+ classPrefix: string;
+ prefix: string;
+ active: boolean;
+ isPre: boolean;
+ isNext: boolean;
+ };
+ methods: {
+ updateActive(value: any): void;
+ handleClick(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.js b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.js
new file mode 100644
index 0000000..0fa2495
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.js
@@ -0,0 +1,58 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-side-bar-item`;
+let SideBarItem = class SideBarItem extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.relations = {
+ '../side-bar/side-bar': {
+ type: 'parent',
+ linked(parent) {
+ this.parent = parent;
+ this.updateActive(parent.data.value);
+ },
+ },
+ };
+ this.observers = {
+ icon(v) {
+ this.setData({ _icon: typeof v === 'string' ? { name: v } : v });
+ },
+ };
+ this.data = {
+ classPrefix: name,
+ prefix,
+ active: false,
+ isPre: false,
+ isNext: false,
+ };
+ this.methods = {
+ updateActive(value) {
+ const active = value === this.data.value;
+ this.setData({
+ active,
+ });
+ },
+ handleClick() {
+ var _a;
+ if (this.data.disabled)
+ return;
+ const { value, label } = this.data;
+ (_a = this.parent) === null || _a === void 0 ? void 0 : _a.doChange({ value, label });
+ },
+ };
+ }
+};
+SideBarItem = __decorate([
+ wxComponent()
+], SideBarItem);
+export default SideBarItem;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.json b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.json
new file mode 100644
index 0000000..2c00c37
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-badge": "../badge/badge",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxml b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxml
new file mode 100644
index 0000000..a95478e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxml
@@ -0,0 +1,24 @@
+<import src="../common/template/badge" />
+<import src="../common/template/icon" />
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ class="{{_.cls(classPrefix, [['active', active], ['disabled', disabled]])}} class {{prefix}}-class"
+ style="{{_._style([style, customStyle])}}"
+ bind:tap="handleClick"
+ aria-role="button"
+ aria-label="{{ active ? '宸查�変腑锛�' + label : label}}"
+ aria-label="{{ ariaLabel || (badgeProps.dot || badgeProps.count ? (active ? '宸查�変腑锛�' + label + _.getBadgeAriaLabel({ ...badgeProps }) : label + _.getBadgeAriaLabel({ ...badgeProps })) : '') }}"
+ aria-disabled="{{disabled}}"
+>
+ <block wx:if="{{active}}">
+ <view class="{{classPrefix}}__line"></view>
+ <view class="{{classPrefix}}__prefix"></view>
+ <view class="{{classPrefix}}__suffix"></view>
+ </block>
+ <template wx:if="{{_icon}}" is="icon" data="{{ class: classPrefix + '__icon', ..._icon }}" />
+ <block wx:if="{{badgeProps}}">
+ <template is="badge" data="{{ ...badgeProps, content: label }}" />
+ </block>
+ <block wx:else>{{label}}</block>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxss b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxss
new file mode 100644
index 0000000..d5154f8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/side-bar-item.wxss
@@ -0,0 +1,92 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-side-bar-item {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+ padding: 32rpx;
+ font-size: var(--td-side-bar-font-size, 32rpx);
+ color: var(--td-side-bar-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ background: var(--td-side-bar-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ min-height: var(--td-side-bar-item-height, 112rpx);
+ box-sizing: border-box;
+ white-space: wrap;
+ line-height: var(--td-side-bar-item-line-height, 48rpx);
+}
+.t-side-bar-item--active {
+ font-weight: 600;
+ background: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ color: var(--td-side-bar-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-side-bar-item__icon {
+ font-size: var(--td-side-bar-icon-size, 40rpx);
+ margin-right: 4rpx;
+}
+.t-side-bar-item__prefix,
+.t-side-bar-item__suffix {
+ z-index: 1;
+ position: absolute;
+ right: 0;
+ width: calc(var(--td-side-bar-border-radius, 18rpx) * 2);
+ height: calc(var(--td-side-bar-border-radius, 18rpx) * 2);
+ background: #fff;
+}
+.t-side-bar-item__prefix::after,
+.t-side-bar-item__suffix::after {
+ content: '';
+ display: block;
+ width: 100%;
+ height: 100%;
+ background-color: var(--td-side-bar-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-side-bar-item__prefix {
+ top: calc(var(--td-side-bar-border-radius, 18rpx) * -2);
+}
+.t-side-bar-item__prefix::after {
+ border-bottom-right-radius: var(--td-side-bar-border-radius, 18rpx);
+}
+.t-side-bar-item__suffix {
+ bottom: calc(var(--td-side-bar-border-radius, 18rpx) * -2);
+}
+.t-side-bar-item__suffix::after {
+ border-top-right-radius: var(--td-side-bar-border-radius, 18rpx);
+}
+.t-side-bar-item--disabled {
+ color: var(--td-side-bar-disabled-color, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
+.t-side-bar-item__line {
+ width: 6rpx;
+ height: 28rpx;
+ position: absolute;
+ left: 0;
+ top: 50%;
+ transform: translateY(-50%);
+ background: var(--td-side-bar-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+ border-radius: 8rpx;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.d.ts
new file mode 100644
index 0000000..e5ceead
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.d.ts
@@ -0,0 +1,21 @@
+export interface TdSideBarItemProps {
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.js b/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar-item/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/side-bar/README.en-US.md
new file mode 100644
index 0000000..46109c9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/README.en-US.md
@@ -0,0 +1,26 @@
+:: BASE_DOC ::
+
+## API
+### SideBar Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+value | String / Number | - | \- | N
+default-value | String / Number | undefined | uncontrolled property | N
+
+### SideBar Events
+
+name | params | description
+-- | -- | --
+change | `(value: number \| string, label: string)` | \-
+click | `(value: number \| string, label: string)` | \-
+
+### SideBarItem Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+badge-props | Object | - | \- | N
+disabled | Boolean | false | \- | N
+icon | String / Object | - | `1.0.0-rc.1` | N
+label | String | - | \- | N
+value | String / Number | - | \- | N
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/README.md b/miniprogram_npm/tdesign-miniprogram/side-bar/README.md
new file mode 100644
index 0000000..ef10681
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/README.md
@@ -0,0 +1,69 @@
+---
+title: SideBar 渚ц竟鏍�
+description: 鐢ㄤ簬鍐呭鍒嗙被鍚庣殑灞曠ず鍒囨崲銆�
+spline: navigation
+isComponent: true
+---
+
+<div style="background: #ecf2fe; display: flex; align-items: center; line-height: 20px; padding: 14px 24px; border-radius: 3px; color: #555a65">
+ <svg fill="none" viewBox="0 0 16 16" width="16px" height="16px" style="margin-right: 5px">
+ <path fill="#0052d9" d="M8 15A7 7 0 108 1a7 7 0 000 14zM7.4 4h1.2v1.2H7.4V4zm.1 2.5h1V12h-1V6.5z" fillOpacity="0.9"></path>
+ </svg>
+ 璇ョ粍浠朵簬 0.25.0 鐗堟湰涓婄嚎锛岃鐣欐剰鐗堟湰銆�
+</div>
+
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+{
+ "usingComponents": {
+ "t-side-bar": "tdesign-miniprogram/side-bar/side-bar",
+ "t-side-bar-item": "tdesign-miniprogram/side-bar-item/side-bar-item",
+ }
+}
+```
+
+## 浠g爜婕旂ず
+
+### 閿氱偣鐢ㄦ硶
+
+{{ base }}
+
+### 鍒囬〉鐢ㄦ硶
+
+{{ switch }}
+
+### 甯﹀浘鏍囦晶杈瑰鑸�
+
+{{ with-icon }}
+
+### 鑷畾涔夋牱寮�
+
+{{ custom }}
+
+## API
+### SideBar Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+value | String / Number | - | 閫夐」鍊� | N
+default-value | String / Number | undefined | 閫夐」鍊笺�傞潪鍙楁帶灞炴�� | N
+
+### SideBar Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+change | `(value: number \| string, label: string)` | 閫夐」鍊煎彂鐢熷彉鍖栨椂瑙﹀彂
+click | `(value: number \| string, label: string)` | 鐐瑰嚮閫夐」鏃惰Е鍙�
+
+### SideBarItem Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+badge-props | Object | - | 閫忎紶鑷� Badge 缁勪欢 | N
+disabled | Boolean | false | 鏄惁绂佺敤 | N
+icon | String / Object | - | `1.0.0-rc.1`銆傚浘鏍囷紝浼犲璞″垯閫忎紶鑷� Icon | N
+label | String | - | 灞曠ず鐨勬爣绛� | N
+value | String / Number | - | 褰撳墠閫夐」鐨勫�� | N
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/props.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar/props.d.ts
new file mode 100644
index 0000000..fcab408
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSideBarProps } from './type';
+declare const props: TdSideBarProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/props.js b/miniprogram_npm/tdesign-miniprogram/side-bar/props.js
new file mode 100644
index 0000000..a8aca64
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/props.js
@@ -0,0 +1,10 @@
+const props = {
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.d.ts
new file mode 100644
index 0000000..2be2070
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.d.ts
@@ -0,0 +1,24 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class SideBar extends SuperComponent {
+ externalClasses: string[];
+ childs: any[];
+ relations: RelationsOptions;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ properties: import("./type").TdSideBarProps;
+ observers: {
+ value(v: any): void;
+ };
+ data: {
+ classPrefix: string;
+ prefix: string;
+ };
+ methods: {
+ doChange({ value, label }: {
+ value: any;
+ label: any;
+ }): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.js b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.js
new file mode 100644
index 0000000..50458f6
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.js
@@ -0,0 +1,58 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-side-bar`;
+const relationsPath = '../side-bar-item/side-bar-item';
+let SideBar = class SideBar extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.childs = [];
+ this.relations = {
+ [relationsPath]: {
+ type: 'child',
+ linked(child) {
+ this.childs.push(child);
+ },
+ unlinked(child) {
+ const index = this.childs.findIndex((item) => item === child);
+ this.childs.splice(index, 1);
+ },
+ },
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.properties = props;
+ this.observers = {
+ value(v) {
+ this.$children.forEach((item) => {
+ item.updateActive(v);
+ });
+ },
+ };
+ this.data = {
+ classPrefix: name,
+ prefix,
+ };
+ this.methods = {
+ doChange({ value, label }) {
+ this._trigger('change', { value, label });
+ },
+ };
+ }
+};
+SideBar = __decorate([
+ wxComponent()
+], SideBar);
+export default SideBar;
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.json b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.json
new file mode 100644
index 0000000..a1c9d56
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-side-bar-item": "../side-bar-item/side-bar-item"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxml b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxml
new file mode 100644
index 0000000..b251c7f
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxml
@@ -0,0 +1,6 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view class="{{classPrefix}} class {{prefix}}-class" style="{{_._style([style, customStyle])}}">
+ <slot />
+ <view class="{{classPrefix}}__padding"></view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxss b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxss
new file mode 100644
index 0000000..b0a6893
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/side-bar.wxss
@@ -0,0 +1,38 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-side-bar {
+ display: flex;
+ flex-direction: column;
+ width: var(--td-side-bar-width, 206rpx);
+ height: var(--td-side-bar-height, 100%);
+ overflow-y: auto;
+}
+.t-side-bar__padding {
+ flex: 1;
+ background-color: var(--td-side-bar-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/type.d.ts b/miniprogram_npm/tdesign-miniprogram/side-bar/type.d.ts
new file mode 100644
index 0000000..39d8876
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/type.d.ts
@@ -0,0 +1,10 @@
+export interface TdSideBarProps {
+ value?: {
+ type: null;
+ value?: string | number;
+ };
+ defaultValue?: {
+ type: null;
+ value?: string | number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/side-bar/type.js b/miniprogram_npm/tdesign-miniprogram/side-bar/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/side-bar/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/sticky/README.en-US.md
new file mode 100644
index 0000000..4b36d15
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/README.en-US.md
@@ -0,0 +1,19 @@
+:: BASE_DOC ::
+
+## API
+
+### Sticky Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+container | Function | - | \- | N
+disabled | Boolean | false | \- | N
+external-classes | Array | - | `['t-class']` | N
+offset-top | String / Number | 0 | \- | N
+z-index | Number | 99 | \- | N
+
+### Sticky Events
+
+name | params | description
+-- | -- | --
+scroll | `(detail: { scrollTop: number, isFixed: boolean })` | \-
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/README.md b/miniprogram_npm/tdesign-miniprogram/sticky/README.md
new file mode 100644
index 0000000..aff6695
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/README.md
@@ -0,0 +1,55 @@
+---
+title: Sticky 鍚搁《
+description: 鐢ㄤ簬甯搁┗椤甸潰椤堕儴鐨勪俊鎭�佹搷浣滃睍绀恒��
+spline: data
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-87%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-90%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-84%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-79%25-red" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-sticky": "tdesign-miniprogram/sticky/sticky"
+}
+```
+
+## 浠g爜婕旂ず
+
+灏嗗唴瀹瑰寘瑁瑰湪 `Sticky` 缁勪欢鍐�
+
+<img src="https://tdesign.gtimg.com/miniprogram/readme/sticky.gif" width="375px" height="50%">
+
+### 鍩虹鍚搁《
+
+{{ base }}
+
+
+### 鍚搁《璺濈
+
+{{ offset }}
+
+### 鎸囧畾瀹瑰櫒
+
+{{ container }}
+
+
+
+## API
+### Sticky Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+container | Function | - | 鍑芥暟杩斿洖瀹瑰櫒瀵瑰簲鐨� NodesRef 鑺傜偣锛屽皢瀵瑰簲鑺傜偣鎸囧畾涓虹粍浠剁殑澶栭儴瀹瑰櫒锛屾粴鍔ㄦ椂缁勪欢浼氬缁堜繚鎸佸湪瀹瑰櫒鑼冨洿鍐咃紝褰撶粍浠跺嵆灏嗚秴鍑哄鍣ㄥ簳閮ㄦ椂锛屼細杩斿洖鍘熶綅缃�� | N
+disabled | Boolean | false | 鏄惁绂佺敤缁勪欢 | N
+external-classes | Array | - | 鏍圭粨鐐瑰閮ㄦ牱寮忋�俙['t-class']` | N
+offset-top | String / Number | 0 | 鍚搁《鏃朵笌椤堕儴鐨勮窛绂伙紝鍗曚綅`px` | N
+z-index | Number | 99 | 鍚搁《鏃剁殑 z-index | N
+
+### Sticky Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+scroll | `(detail: { scrollTop: number, isFixed: boolean })` | 婊氬姩鏃惰Е鍙戯紝scrollTop: 璺濈椤堕儴浣嶇疆锛宨sFixed: 鏄惁鍚搁《
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/index.d.ts b/miniprogram_npm/tdesign-miniprogram/sticky/index.d.ts
new file mode 100644
index 0000000..a6df66d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/index.d.ts
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './sticky';
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/index.js b/miniprogram_npm/tdesign-miniprogram/sticky/index.js
new file mode 100644
index 0000000..a6df66d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/index.js
@@ -0,0 +1,3 @@
+export * from './props';
+export * from './type';
+export * from './sticky';
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/props.d.ts b/miniprogram_npm/tdesign-miniprogram/sticky/props.d.ts
new file mode 100644
index 0000000..175af72
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/props.d.ts
@@ -0,0 +1,3 @@
+import { TdStickyProps } from './type';
+declare const props: TdStickyProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/props.js b/miniprogram_npm/tdesign-miniprogram/sticky/props.js
new file mode 100644
index 0000000..7e5cb71
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/props.js
@@ -0,0 +1,21 @@
+const props = {
+ container: {
+ type: null,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ offsetTop: {
+ type: Number,
+ value: 0,
+ },
+ zIndex: {
+ type: Number,
+ value: 99,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.d.ts b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.d.ts
new file mode 100644
index 0000000..89ba546
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.d.ts
@@ -0,0 +1,30 @@
+import { SuperComponent } from '../common/src/index';
+import type { TdStickyProps } from './type';
+export interface StickyProps extends TdStickyProps {
+}
+export default class Sticky extends SuperComponent {
+ externalClasses: string[];
+ properties: TdStickyProps;
+ behaviors: string[];
+ observers: {
+ 'offsetTop, disabled, container'(): void;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ containerStyle: string;
+ contentStyle: string;
+ };
+ ready(): void;
+ methods: {
+ onScroll(event?: {
+ scrollTop: number;
+ }): void;
+ setDataAfterDiff(data: {
+ isFixed: boolean;
+ height?: number;
+ transform?: number;
+ }): void;
+ getContainerRect(): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.js b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.js
new file mode 100644
index 0000000..9272792
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.js
@@ -0,0 +1,120 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import props from './props';
+import config from '../common/config';
+import pageScrollMixin from '../mixins/page-scroll';
+import { getRect } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-sticky`;
+const ContainerClass = `.${name}`;
+let Sticky = class Sticky extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.properties = props;
+ this.behaviors = [
+ pageScrollMixin(function (event) {
+ this.onScroll(event);
+ }),
+ ];
+ this.observers = {
+ 'offsetTop, disabled, container'() {
+ this.onScroll();
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ containerStyle: '',
+ contentStyle: '',
+ };
+ this.methods = {
+ onScroll(event) {
+ const { scrollTop } = event || {};
+ const { container, offsetTop, disabled } = this.properties;
+ if (disabled) {
+ this.setDataAfterDiff({
+ isFixed: false,
+ transform: 0,
+ });
+ return;
+ }
+ this.scrollTop = scrollTop || this.scrollTop;
+ if (typeof container === 'function') {
+ Promise.all([getRect(this, ContainerClass), this.getContainerRect()]).then(([root, container]) => {
+ if (!root || !container)
+ return;
+ if (offsetTop + root.height > container.height + container.top) {
+ this.setDataAfterDiff({
+ isFixed: false,
+ transform: container.height - root.height,
+ });
+ }
+ else if (offsetTop >= root.top) {
+ this.setDataAfterDiff({
+ isFixed: true,
+ height: root.height,
+ transform: 0,
+ });
+ }
+ else {
+ this.setDataAfterDiff({ isFixed: false, transform: 0 });
+ }
+ });
+ return;
+ }
+ getRect(this, ContainerClass).then((root) => {
+ if (!root)
+ return;
+ if (offsetTop >= root.top) {
+ this.setDataAfterDiff({ isFixed: true, height: root.height });
+ this.transform = 0;
+ }
+ else {
+ this.setDataAfterDiff({ isFixed: false });
+ }
+ });
+ },
+ setDataAfterDiff(data) {
+ const { offsetTop } = this.properties;
+ const { containerStyle: prevContainerStyle, contentStyle: prevContentStyle } = this.data;
+ const { isFixed, height, transform } = data;
+ wx.nextTick(() => {
+ let containerStyle = '';
+ let contentStyle = '';
+ if (isFixed) {
+ containerStyle += `height:${height}px;`;
+ contentStyle += `position:fixed;top:${offsetTop}px;`;
+ }
+ if (transform) {
+ const translate = `translate3d(0, ${transform}px, 0)`;
+ contentStyle += `-webkit-transform:${translate};transform:${translate};`;
+ }
+ if (prevContainerStyle !== containerStyle || prevContentStyle !== contentStyle) {
+ this.setData({ containerStyle, contentStyle });
+ }
+ this.triggerEvent('scroll', {
+ scrollTop: this.scrollTop,
+ isFixed,
+ });
+ });
+ },
+ getContainerRect() {
+ const nodesRef = this.properties.container();
+ return new Promise((resolve) => nodesRef.boundingClientRect(resolve).exec());
+ },
+ };
+ }
+ ready() {
+ this.onScroll();
+ }
+};
+Sticky = __decorate([
+ wxComponent()
+], Sticky);
+export default Sticky;
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.json b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.json
new file mode 100644
index 0000000..a89ef4d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxml b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxml
new file mode 100644
index 0000000..8f0181c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxml
@@ -0,0 +1,10 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ class="{{classPrefix}} class {{prefix}}-class"
+ style="{{_._style(['z-index:' + zIndex, containerStyle, style, customStyle])}}"
+>
+ <view class="{{classPrefix}}__content" style="z-index:{{ zIndex }};{{ contentStyle }}">
+ <slot />
+ </view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxss b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxss
new file mode 100644
index 0000000..730de8a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/sticky.wxss
@@ -0,0 +1,33 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-sticky {
+ position: relative;
+}
+.t-sticky__content {
+ width: 100%;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/type.d.ts b/miniprogram_npm/tdesign-miniprogram/sticky/type.d.ts
new file mode 100644
index 0000000..40a7712
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/type.d.ts
@@ -0,0 +1,26 @@
+export interface TdStickyProps {
+ container?: {
+ type: undefined;
+ value?: null;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class'];
+ };
+ offsetTop?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+ zIndex?: {
+ type: NumberConstructor;
+ value?: number;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/sticky/type.js b/miniprogram_npm/tdesign-miniprogram/sticky/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/sticky/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/switch/README.en-US.md
new file mode 100644
index 0000000..5785a01
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/README.en-US.md
@@ -0,0 +1,22 @@
+:: BASE_DOC ::
+
+## API
+### Switch Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+custom-value | Array | [true, false] | Typescript锛歚Array<SwitchValue>` | N
+disabled | Boolean | false | \- | N
+icon | Array | [] | Typescript锛歚string[]` | N
+label | Array | [] | Typescript锛歚string[]` | N
+loading | Boolean | false | \- | N
+size | String | medium | options锛歴mall/medium/large | N
+style | String | - | \- | N
+value | String / Number / Boolean | null | Typescript锛歚SwitchValue` `type SwitchValue = string \| number \| boolean`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
+default-value | String / Number / Boolean | undefined | uncontrolled property銆俆ypescript锛歚SwitchValue` `type SwitchValue = string \| number \| boolean`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
+
+### Switch Events
+
+name | params | description
+-- | -- | --
+change | `(value: SwitchValue)` | \-
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/README.md b/miniprogram_npm/tdesign-miniprogram/switch/README.md
new file mode 100644
index 0000000..baa96b2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/README.md
@@ -0,0 +1,59 @@
+---
+title: Switch 寮�鍏�
+description: 鐢ㄤ簬鎺у埗鏌愪釜鍔熻兘鐨勫紑鍚拰鍏抽棴銆�
+spline: form
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-82%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-switch": "tdesign-miniprogram/switch/switch"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 鍩虹寮�鍏�
+
+{{ base }}
+
+### 甯︽弿杩板紑鍏�
+
+{{ label }}
+
+### 鑷畾涔夐鑹�
+
+{{ color }}
+
+### 寮�鍏崇姸鎬�
+
+{{ status }}
+
+### 灏哄
+
+{{ size }}
+
+## API
+### Switch Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+custom-value | Array | [true, false] | 鐢ㄤ簬鑷畾涔夊紑鍏崇殑鍊硷紝[鎵撳紑鏃剁殑鍊硷紝鍏抽棴鏃剁殑鍊糫銆傞粯璁や负 [true, false]銆傜ず渚嬶細[1, 0]銆乕'open', 'close']銆俆S 绫诲瀷锛歚Array<SwitchValue>` | N
+disabled | Boolean | false | 鏄惁绂佺敤缁勪欢 | N
+icon `v0.27.0` | Array | [] | 寮�鍏崇殑鍥炬爣锛沎鎵撳紑鏃剁殑鍥炬爣锛屽叧闂椂鐨勫浘鏍嘳銆俆S 绫诲瀷锛歚string[]` | N
+label `v0.27.0` | Array | [] | 寮�鍏崇殑鏍囩锛沎鎵撳紑鏃剁殑鏍囩锛屽叧闂椂鐨勬爣绛綸銆俆S 绫诲瀷锛歚string[]` | N
+loading `v0.27.0` | Boolean | false | 鏄惁澶勪簬鍔犺浇涓姸鎬� | N
+size `v0.27.0` | String | medium | 寮�鍏冲昂瀵搞�傚彲閫夐」锛歴mall/medium/large | N
+value | String / Number / Boolean | null | 寮�鍏冲�笺�俆S 绫诲瀷锛歚SwitchValue` `type SwitchValue = string \| number \| boolean`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
+default-value | String / Number / Boolean | undefined | 寮�鍏冲�笺�傞潪鍙楁帶灞炴�с�俆S 绫诲瀷锛歚SwitchValue` `type SwitchValue = string \| number \| boolean`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
+
+### Switch Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+change | `(value: SwitchValue)` | 鏁版嵁鍙戠敓鍙樺寲鏃惰Е鍙�
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/props.d.ts b/miniprogram_npm/tdesign-miniprogram/switch/props.d.ts
new file mode 100644
index 0000000..489f18a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/props.d.ts
@@ -0,0 +1,3 @@
+import { TdSwitchProps } from './type';
+declare const props: TdSwitchProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/props.js b/miniprogram_npm/tdesign-miniprogram/switch/props.js
new file mode 100644
index 0000000..eb61ffb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/props.js
@@ -0,0 +1,35 @@
+const props = {
+ customValue: {
+ type: Array,
+ value: [true, false],
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: Array,
+ value: [],
+ },
+ label: {
+ type: Array,
+ value: [],
+ },
+ loading: {
+ type: Boolean,
+ value: false,
+ },
+ size: {
+ type: String,
+ value: 'medium',
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ value: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.d.ts b/miniprogram_npm/tdesign-miniprogram/switch/switch.d.ts
new file mode 100644
index 0000000..6e43804
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.d.ts
@@ -0,0 +1,21 @@
+import { SuperComponent } from '../common/src/index';
+export default class Switch extends SuperComponent {
+ externalClasses: string[];
+ behaviors: string[];
+ properties: import("./type").TdSwitchProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ checked: boolean;
+ };
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ value(val: any): void;
+ };
+ methods: {
+ handleSwitch(): void;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.js b/miniprogram_npm/tdesign-miniprogram/switch/switch.js
new file mode 100644
index 0000000..6702e2a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.js
@@ -0,0 +1,53 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { wxComponent, SuperComponent } from '../common/src/index';
+import config from '../common/config';
+import props from './props';
+const { prefix } = config;
+const name = `${prefix}-switch`;
+let Switch = class Switch extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = ['t-class', 't-class-label', 't-class-body', 't-class-dot'];
+ this.behaviors = ['wx://form-field'];
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ checked: false,
+ };
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ value(val) {
+ const [activeValue] = this.data.customValue;
+ this.setData({
+ checked: val === activeValue,
+ });
+ },
+ };
+ this.methods = {
+ handleSwitch() {
+ const { disabled, value, customValue } = this.data;
+ const [activeValue, inactiveValue] = customValue;
+ if (disabled)
+ return;
+ this._trigger('change', {
+ value: value === activeValue ? inactiveValue : activeValue,
+ });
+ },
+ };
+ }
+};
+Switch = __decorate([
+ wxComponent()
+], Switch);
+export default Switch;
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.json b/miniprogram_npm/tdesign-miniprogram/switch/switch.json
new file mode 100644
index 0000000..708bd1b
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-icon": "../icon/icon",
+ "t-loading": "../loading/loading"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.wxml b/miniprogram_npm/tdesign-miniprogram/switch/switch.wxml
new file mode 100644
index 0000000..9aa2cd7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.wxml
@@ -0,0 +1,32 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ style="{{_._style([style, customStyle])}}"
+ class="class {{ prefix }}-class {{classPrefix}}"
+ bind:tap="handleSwitch"
+ aria-checked="{{checked}}"
+ aria-disabled="{{disabled}}"
+ aria-role="switch"
+>
+ <view
+ class="{{_.cls(classPrefix + '__body', [['checked', checked], ['disabled', disabled], size])}} {{prefix}}-class-body"
+ >
+ <view
+ class="{{_.cls(classPrefix + '__dot', [['checked', checked], ['plain', label.length != 2 && icon.length != 2 && !loading], size])}} {{prefix}}-class-dot"
+ aria-hidden="{{true}}"
+ >
+ <view
+ wx:if="{{label}}"
+ class="{{_.cls(classPrefix + '__label', [['checked', checked], ['disabled', disabled], size])}} {{prefix}}-class-label"
+ >
+ <t-loading wx:if="{{loading}}" inherit-color size="32rpx" />
+ <text wx:elif="{{label.length == 2}}">{{checked ? label[0] : label[1]}}</text>
+ <t-icon
+ wx:elif="{{icon.length == 2}}"
+ name="{{checked ? icon[0] : icon[1]}}"
+ t-class="{{_.cls(classPrefix + '__icon', [['checked', checked], size])}}"
+ />
+ </view>
+ </view>
+ </view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/switch.wxss b/miniprogram_npm/tdesign-miniprogram/switch/switch.wxss
new file mode 100644
index 0000000..f69c959
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/switch.wxss
@@ -0,0 +1,161 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-switch {
+ display: flex;
+ align-items: center;
+ overflow: hidden;
+}
+.t-switch__label {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-wrap: nowrap;
+ font-size: var(--td-swtich-label-font-size, 28rpx);
+ color: var(--td-switch-label-color, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+ overflow: hidden;
+}
+.t-switch__label--checked {
+ color: var(--td-switch-label-checked-color, var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-switch__label--disabled {
+ color: var(--td-switch-unchecked-disabled-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-switch__label--checked.t-switch__label--disabled {
+ color: var(--td-switch-checked-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-switch__label--large {
+ font-size: var(--td-swtich-label-font-size, 32rpx);
+}
+.t-switch__label--small {
+ font-size: var(--td-swtich-label-font-size, 24rpx);
+}
+.t-switch__label:empty {
+ display: none;
+}
+.t-switch__icon {
+ font-size: var(--td-switch-icon-size, 40rpx);
+}
+.t-switch__icon--large {
+ font-size: var(--td-switch-icon-large-size, 48rpx);
+}
+.t-switch__icon--small {
+ font-size: var(--td-switch-icon-small-size, 32rpx);
+}
+.t-switch__loading {
+ color: var(--td-switch-label-checked-color, var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
+}
+.t-switch__body {
+ vertical-align: middle;
+ width: var(--td-switch-width, 90rpx);
+ height: var(--td-switch-height, 56rpx);
+ border-radius: var(--td-switch-radius, calc(var(--td-switch-height, 56rpx) / 2));
+ background-color: var(--td-switch-unchecked-color, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+ position: relative;
+ transition: all 0.3s ease;
+ overflow: hidden;
+}
+.t-switch__body--checked {
+ background-color: var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-switch__body--disabled {
+ background-color: var(--td-switch-unchecked-disabled-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
+}
+.t-switch__body--checked.t-switch__body--disabled {
+ background-color: var(--td-switch-checked-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
+}
+.t-switch__body--large {
+ width: var(--td-switch-large-width, 104rpx);
+ height: var(--td-switch-large-height, 64rpx);
+ border-radius: var(--td-switch-large-radius, calc(var(--td-switch-large-height, 64rpx) / 2));
+}
+.t-switch__body--small {
+ width: var(--td-switch-small-width, 78rpx);
+ height: var(--td-switch-small-height, 48rpx);
+ border-radius: var(--td-switch-small-radius, calc(var(--td-switch-small-height, 48rpx) / 2));
+}
+.t-switch__dot {
+ position: absolute;
+ left: var(--td-switch-dot-horizontal-margin, 6rpx);
+ top: 50%;
+ width: var(--td-switch-dot-size, 44rpx);
+ height: var(--td-switch-dot-size, 44rpx);
+ border-radius: 50%;
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ transition: all 0.3s;
+ transform: translateY(-50%);
+ box-shadow: var(--td-switch-dot-shadow, var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12)));
+}
+.t-switch__dot:after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 200%;
+ height: 200%;
+ border: 1px solid var(--td-switch-dot-border-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+ border-radius: 50%;
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ box-sizing: border-box;
+}
+.t-switch__dot--large {
+ width: var(--td-switch-dot-large-size, 52rpx);
+ height: var(--td-switch-dot-large-size, 52rpx);
+}
+.t-switch__dot--small {
+ width: var(--td-switch-dot-small-size, 36rpx);
+ height: var(--td-switch-dot-small-size, 36rpx);
+}
+.t-switch__dot--checked {
+ left: calc(var(--td-switch-width, 90rpx) - var(--td-switch-dot-size, 44rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
+}
+.t-switch__dot--large.t-switch__dot--checked {
+ left: calc(var(--td-switch-large-width, 104rpx) - var(--td-switch-dot-large-size, 52rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
+}
+.t-switch__dot--small.t-switch__dot--checked {
+ left: calc(var(--td-switch-small-width, 78rpx) - var(--td-switch-dot-small-size, 36rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
+}
+.t-switch__dot--plain:not(.t-switch__dot--checked) {
+ width: var(--td-switch-dot-plain-size, 36rpx);
+ height: var(--td-switch-dot-plain-size, 36rpx);
+ left: var(--td-switch-dot-plain-horizontal-margin, 10rpx);
+}
+.t-switch__dot--large.t-switch__dot--plain:not(.t-switch__dot--checked) {
+ width: var(--td-switch-dot-plain-large-size, 44rpx);
+ height: var(--td-switch-dot-plain-large-size, 44rpx);
+}
+.t-switch__dot--small.t-switch__dot--plain:not(.t-switch__dot--checked) {
+ width: var(--td-switch-dot-plain-small-size, 28rpx);
+ height: var(--td-switch-dot-plain-small-size, 28rpx);
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/type.d.ts b/miniprogram_npm/tdesign-miniprogram/switch/type.d.ts
new file mode 100644
index 0000000..8ca8e81
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/type.d.ts
@@ -0,0 +1,39 @@
+export interface TdSwitchProps {
+ customValue?: {
+ type: ArrayConstructor;
+ value?: Array<SwitchValue>;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: ArrayConstructor;
+ value?: string[];
+ };
+ label?: {
+ type: ArrayConstructor;
+ value?: string[];
+ };
+ loading?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ size?: {
+ type: StringConstructor;
+ value?: 'small' | 'medium' | 'large';
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ value?: {
+ type: null;
+ value?: SwitchValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: SwitchValue;
+ };
+}
+export declare type SwitchValue = string | number | boolean;
diff --git a/miniprogram_npm/tdesign-miniprogram/switch/type.js b/miniprogram_npm/tdesign-miniprogram/switch/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/switch/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/props.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-panel/props.d.ts
new file mode 100644
index 0000000..9329be0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTabPanelProps } from './type';
+declare const props: TdTabPanelProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/props.js b/miniprogram_npm/tdesign-miniprogram/tab-panel/props.js
new file mode 100644
index 0000000..b9e29e0
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/props.js
@@ -0,0 +1,28 @@
+const props = {
+ badgeProps: {
+ type: Object,
+ value: null,
+ },
+ destroyOnHide: {
+ type: Boolean,
+ value: true,
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ icon: {
+ type: null,
+ },
+ label: {
+ type: String,
+ value: '',
+ },
+ panel: {
+ type: String,
+ },
+ value: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.d.ts
new file mode 100644
index 0000000..789414c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.d.ts
@@ -0,0 +1,23 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+export default class TabPanel extends SuperComponent {
+ externalClasses: string[];
+ relations: RelationsOptions;
+ options: {
+ multipleSlots: boolean;
+ };
+ properties: import("./type").TdTabPanelProps;
+ data: {
+ prefix: string;
+ classPrefix: string;
+ active: boolean;
+ hide: boolean;
+ id: string;
+ };
+ setId(id: any): void;
+ observers: {
+ 'label, badgeProps, disabled, icon, panel, value'(): void;
+ };
+ getComputedName(): string;
+ update(): void;
+ render(active: Boolean, parent: any): void;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.js b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.js
new file mode 100644
index 0000000..11bedd8
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.js
@@ -0,0 +1,61 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import props from './props';
+import config from '../common/config';
+const { prefix } = config;
+const name = `${prefix}-tab-panel`;
+let TabPanel = class TabPanel extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.externalClasses = [`${prefix}-class`];
+ this.relations = {
+ '../tabs/tabs': {
+ type: 'ancestor',
+ },
+ };
+ this.options = {
+ multipleSlots: true,
+ };
+ this.properties = props;
+ this.data = {
+ prefix,
+ classPrefix: name,
+ active: false,
+ hide: true,
+ id: '',
+ };
+ this.observers = {
+ 'label, badgeProps, disabled, icon, panel, value'() {
+ this.update();
+ },
+ };
+ }
+ setId(id) {
+ this.setData({ id });
+ }
+ getComputedName() {
+ if (this.properties.value != null) {
+ return `${this.properties.value}`;
+ }
+ return `${this.index}`;
+ }
+ update() {
+ var _a;
+ (_a = this.$parent) === null || _a === void 0 ? void 0 : _a.updateTabs();
+ }
+ render(active, parent) {
+ this.setData({
+ active,
+ hide: !parent.data.animation && !active,
+ });
+ }
+};
+TabPanel = __decorate([
+ wxComponent()
+], TabPanel);
+export default TabPanel;
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.json b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.json
new file mode 100644
index 0000000..a89ef4d
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml
new file mode 100644
index 0000000..7bcb902
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml
@@ -0,0 +1,12 @@
+<wxs src="../common/utils.wxs" module="_" />
+
+<view
+ class="class {{prefix}}-class {{classPrefix}} {{active ? prefix + '-is-active': ''}}"
+ style="{{_._style([style, customStyle, (hide ? 'display: none' : '')])}}"
+ id="{{id}}"
+ aria-role="tabpanel"
+>
+ <view wx:if="{{panel}}">{{panel}}</view>
+ <slot />
+ <slot name="panel" />
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxss b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxss
new file mode 100644
index 0000000..65ceb3e
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxss
@@ -0,0 +1,33 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-tab-panel {
+ flex-shrink: 0;
+ width: 100%;
+ height: 100%;
+ box-sizing: border-box;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/type.d.ts b/miniprogram_npm/tdesign-miniprogram/tab-panel/type.d.ts
new file mode 100644
index 0000000..cc98410
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/type.d.ts
@@ -0,0 +1,35 @@
+import { TabValue } from '../tabs/index';
+export interface TdTabPanelProps {
+ badgeProps?: {
+ type: ObjectConstructor;
+ value?: object;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ destroyOnHide?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ disabled?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ icon?: {
+ type: null;
+ value?: string | object;
+ };
+ label?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ panel?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ value?: {
+ type: null;
+ value?: TabValue;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tab-panel/type.js b/miniprogram_npm/tdesign-miniprogram/tab-panel/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tab-panel/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/README.en-US.md b/miniprogram_npm/tdesign-miniprogram/tabs/README.en-US.md
new file mode 100644
index 0000000..32aa3a4
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/README.en-US.md
@@ -0,0 +1,37 @@
+:: BASE_DOC ::
+
+## API
+### Tabs Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+animation | Object | - | Typescript锛歚TabAnimation` `type TabAnimation = { duration: number } & Record<string, any>`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+external-classes | Array | - | `['t-class', 't-class-item', 't-class-active', 't-class-track']` | N
+show-bottom-line | Boolean | true | \- | N
+space-evenly | Boolean | true | \- | N
+sticky | Boolean | false | \- | N
+sticky-props | Object | - | Typescript锛歚StickyProps`锛孾Sticky API Documents](./sticky?tab=api)銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+swipeable | Boolean | true | \- | N
+theme | String | line | options锛歭ine/tag/card | N
+value | String / Number | - | Typescript锛歚TabValue` `type TabValue = string \| number`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+default-value | String / Number | undefined | uncontrolled property銆俆ypescript锛歚TabValue` `type TabValue = string \| number`銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+
+### Tabs Events
+
+name | params | description
+-- | -- | --
+change | `(value: TabValue, label: string)` | \-
+click | `(value: TabValue, label: string)` | \-
+scroll | `(scrollTop: number, isFixed: boolean)` | \-
+
+### TabPanel Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+badge-props | Object | null | \- | N
+destroy-on-hide | Boolean | true | \- | N
+disabled | Boolean | false | \- | N
+icon | String / Object | - | `1.0.0-rc.1` | N
+label | String | - | \- | N
+panel | String / Slot | - | \- | N
+value | String / Number | - | Typescript锛歚TabValue`锛孾Tabs API Documents](./tabs?tab=api)銆俒see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-panel/type.ts) | N
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/README.md b/miniprogram_npm/tdesign-miniprogram/tabs/README.md
new file mode 100644
index 0000000..6176aea
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/README.md
@@ -0,0 +1,144 @@
+---
+title: Tabs 閫夐」鍗�
+description: 鐢ㄤ簬鍐呭鍒嗙被鍚庣殑灞曠ず鍒囨崲銆�
+spline: navigation
+isComponent: true
+---
+
+<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-93%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-88%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-90%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-80%25-blue" /></span>
+## 寮曞叆
+
+鍏ㄥ眬寮曞叆锛屽湪 miniprogram 鏍圭洰褰曚笅鐨刞app.json`涓厤缃紝灞�閮ㄥ紩鍏ワ紝鍦ㄩ渶瑕佸紩鍏ョ殑椤甸潰鎴栫粍浠剁殑`index.json`涓厤缃��
+
+```json
+"usingComponents": {
+ "t-tabs": "tdesign-miniprogram/tabs/tabs",
+ "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel"
+}
+```
+
+## 浠g爜婕旂ず
+
+### 鍩虹閫夐」鍗�
+
+{{ base }}
+
+### 绛夎窛閫夐」鍗�
+
+{{ scroll }}
+
+### 甯﹀浘鏍囬�夐」鍗�
+
+{{ with-icon }}
+
+### 甯﹀窘绔犻�夐」鍗�
+
+{{ with-badge }}
+
+### 甯﹀唴瀹瑰尯閫夐」鍗�
+
+{{ with-content }}
+
+### 閫夐」鍗$姸鎬�
+
+{{ status }}
+
+### 閫夐」鍗″昂瀵�
+
+{{ size }}
+
+### 閫夐」鍗℃牱寮�
+
+浣跨敤 theme 灞炴�у彲浠ュ彉鎹㈤鏍硷紝鏀寔 line = 绾挎潯锛堥粯璁わ級锛泃ag = 鏍囩锛沜ard = 鍗$墖
+
+{{ theme }}
+
+<!-- 妯悜閫夐」鍗℃敮鎸佽秴杩囧睆骞曟粦鍔� -->
+
+<img src="https://tdesign.gtimg.com/miniprogram/readme/tabs-3.png" width="375px" height="50%">
+
+
+### 鍙楁帶鐢ㄦ硶
+
+```html
+<t-tabs value="{{value}}" bind:change="onTabsChange">
+ <t-tab-panel label="鏍囩椤典竴" value="0">鏍囩涓�鍐呭</t-tab-panel>
+ <t-tab-panel label="鏍囩椤典簩" value="1">鏍囩浜屽唴瀹�</t-tab-panel>
+</t-tabs>
+```
+
+```js
+Page({
+ data: {
+ value: '0',
+ },
+ onTabsChange(e) {
+ this.setData({ value: e.detail.value })
+ },
+});
+```
+
+### 涓� Popup 浣跨敤
+
+```html
+ <t-popup visible="{{visible}}" bind:visible-change="onVisibleChange">
+ <t-tabs id="tabs" defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs">
+ <t-tab-panel label="鏍囩椤典竴" value="0">鏍囩涓�鍐呭</t-tab-panel>
+ <t-tab-panel label="鏍囩椤典簩" value="1">鏍囩浜屽唴瀹�</t-tab-panel>
+ <t-tab-panel label="鏍囩椤典笁" value="2">鏍囩涓夊唴瀹�</t-tab-panel>
+ </t-tabs>
+</t-popup>
+```
+
+```js
+Page({
+ data: {
+ visible: false
+ },
+ showPopup() {
+ this.setData({
+ visible: true
+ }, () => {
+ const tabs = this.selectComponent('tabs');
+
+ tabs.setTrack(); // 杩欎竴姝ュ緢閲嶈锛屽洜涓哄皬绋嬪簭鐨勬棤娉曟纭墽琛岀敓鍛藉懆鏈燂紝鎵�浠ラ渶瑕佹墜鍔ㄨ缃笅 tabs 鐨勬粦鍧�
+ })
+ }
+})
+```
+
+## API
+### Tabs Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+animation | Object | - | 鍔ㄧ敾鏁堟灉璁剧疆銆傚叾涓� duration 琛ㄧず鍔ㄧ敾鏃堕暱銆傦紙鍗曚綅绉掞級TS 绫诲瀷锛歚TabAnimation` `type TabAnimation = { duration: number } & Record<string, any>`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+external-classes | Array | - | 缁勪欢绫诲悕锛屽垎鍒敤浜庤缃� 缁勪欢澶栧眰鍏冪礌銆侀�夐」鍗″崟椤广�侀�夐」鍗℃縺娲绘�併�佹粴鍔ㄦ潯鏍峰紡绫诲悕 绛夌被鍚嶃�俙['t-class', 't-class-item', 't-class-active', 't-class-track']` | N
+show-bottom-line | Boolean | true | 鏄惁灞曠ず搴曢儴婵�娲荤嚎鏉� | N
+space-evenly | Boolean | true | 閫夐」鍗″ご閮ㄧ┖闂存槸鍚﹀潎鍒� | N
+sticky | Boolean | false | 鏄惁寮�鍚矘鎬у竷灞� | N
+sticky-props | Object | - | 閫忎紶鑷� Sticky 缁勪欢銆俆S 绫诲瀷锛歚StickyProps`锛孾Sticky API Documents](./sticky?tab=api)銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+swipeable | Boolean | true | 鏄惁鍙互婊戝姩鍒囨崲 | N
+theme | String | line | 鏍囩鐨勬牱寮忋�傚彲閫夐」锛歭ine/tag/card | N
+value | String / Number | - | 婵�娲荤殑閫夐」鍗″�笺�俆S 绫诲瀷锛歚TabValue` `type TabValue = string \| number`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+default-value | String / Number | undefined | 婵�娲荤殑閫夐」鍗″�笺�傞潪鍙楁帶灞炴�с�俆S 绫诲瀷锛歚TabValue` `type TabValue = string \| number`銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
+
+### Tabs Events
+
+鍚嶇О | 鍙傛暟 | 鎻忚堪
+-- | -- | --
+change | `(value: TabValue, label: string)` | 婵�娲荤殑閫夐」鍗″彂鐢熷彉鍖栨椂瑙﹀彂
+click | `(value: TabValue, label: string)` | 鐐瑰嚮閫夐」鍗℃椂瑙﹀彂
+scroll | `(scrollTop: number, isFixed: boolean)` | 椤甸潰婊氬姩鏃惰Е鍙�
+
+### TabPanel Props
+
+鍚嶇О | 绫诲瀷 | 榛樿鍊� | 璇存槑 | 蹇呬紶
+-- | -- | -- | -- | --
+badge-props | Object | null | 閫忎紶鑷� Badge 缁勪欢 | N
+destroy-on-hide | Boolean | true | 銆愬疄鐜版湁璇紝鏆備笉鏀寔銆戦�夐」鍗″唴瀹归殣钘忔椂鏄惁閿�姣� | N
+disabled | Boolean | false | 鏄惁绂佺敤褰撳墠閫夐」鍗� | N
+icon | String / Object | - | `1.0.0-rc.1`銆傚浘鏍囷紝浼犲璞″垯閫忎紶鑷� Icon | N
+label | String | - | 閫夐」鍗″悕绉� | N
+panel | String / Slot | - | 鐢ㄤ簬鑷畾涔夐�夐」鍗¢潰鏉垮唴瀹� | N
+value | String / Number | - | 閫夐」鍗$殑鍊硷紝鍞竴鏍囪瘑銆俆S 绫诲瀷锛歚TabValue`锛孾Tabs API Documents](./tabs?tab=api)銆俒璇︾粏绫诲瀷瀹氫箟](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-panel/type.ts) | N
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/index.d.ts b/miniprogram_npm/tdesign-miniprogram/tabs/index.d.ts
new file mode 100644
index 0000000..2f91d15
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/index.d.ts
@@ -0,0 +1,3 @@
+export * from './tabs';
+export * from './type';
+export * from './props';
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/index.js b/miniprogram_npm/tdesign-miniprogram/tabs/index.js
new file mode 100644
index 0000000..2f91d15
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/index.js
@@ -0,0 +1,3 @@
+export * from './tabs';
+export * from './type';
+export * from './props';
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/props.d.ts b/miniprogram_npm/tdesign-miniprogram/tabs/props.d.ts
new file mode 100644
index 0000000..215fa49
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/props.d.ts
@@ -0,0 +1,3 @@
+import { TdTabsProps } from './type';
+declare const props: TdTabsProps;
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/props.js b/miniprogram_npm/tdesign-miniprogram/tabs/props.js
new file mode 100644
index 0000000..9d515f7
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/props.js
@@ -0,0 +1,39 @@
+const props = {
+ animation: {
+ type: Object,
+ },
+ externalClasses: {
+ type: Array,
+ },
+ showBottomLine: {
+ type: Boolean,
+ value: true,
+ },
+ spaceEvenly: {
+ type: Boolean,
+ value: true,
+ },
+ sticky: {
+ type: Boolean,
+ value: false,
+ },
+ stickyProps: {
+ type: Object,
+ },
+ swipeable: {
+ type: Boolean,
+ value: true,
+ },
+ theme: {
+ type: String,
+ value: 'line',
+ },
+ value: {
+ type: null,
+ value: null,
+ },
+ defaultValue: {
+ type: null,
+ },
+};
+export default props;
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts
new file mode 100644
index 0000000..65f61ae
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts
@@ -0,0 +1,50 @@
+import { SuperComponent, RelationsOptions } from '../common/src/index';
+import { TdTabsProps } from './type';
+export interface TabsProps extends TdTabsProps {
+}
+export default class Tabs extends SuperComponent {
+ behaviors: string[];
+ externalClasses: string[];
+ relations: RelationsOptions;
+ properties: TdTabsProps;
+ controlledProps: {
+ key: string;
+ event: string;
+ }[];
+ observers: {
+ value(name: any): void;
+ };
+ data: {
+ prefix: string;
+ classPrefix: string;
+ tabs: any[];
+ currentIndex: number;
+ trackStyle: string;
+ isScrollX: boolean;
+ direction: string;
+ offset: number;
+ tabID: string;
+ placement: string;
+ };
+ lifetimes: {
+ created(): void;
+ attached(): void;
+ };
+ initChildId(): void;
+ methods: {
+ updateTabs(cb: any): void;
+ setCurrentIndexByName(name: any): void;
+ setCurrentIndex(index: number): void;
+ getCurrentName(): any;
+ calcScrollOffset(containerWidth: number, targetLeft: number, targetWidth: number, offset: number): number;
+ getTrackSize(): Promise<number>;
+ setTrack(): Promise<void>;
+ onTabTap(event: any): void;
+ onTouchStart(event: any): void;
+ onTouchMove(event: any): void;
+ onTouchEnd(): void;
+ onTouchScroll(event: WechatMiniprogram.CustomEvent): void;
+ changeIndex(index: any): void;
+ getAvailableTabIndex(deltaX: number): any;
+ };
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js
new file mode 100644
index 0000000..76f51c9
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js
@@ -0,0 +1,260 @@
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+import { SuperComponent, wxComponent } from '../common/src/index';
+import props from './props';
+import config from '../common/config';
+import touch from '../mixins/touch';
+import { getRect, uniqueFactory } from '../common/utils';
+const { prefix } = config;
+const name = `${prefix}-tabs`;
+const getUniqueID = uniqueFactory('tabs');
+let Tabs = class Tabs extends SuperComponent {
+ constructor() {
+ super(...arguments);
+ this.behaviors = [touch];
+ this.externalClasses = [`${prefix}-class`, `${prefix}-class-item`, `${prefix}-class-active`, `${prefix}-class-track`];
+ this.relations = {
+ '../tab-panel/tab-panel': {
+ type: 'descendant',
+ linked(target) {
+ this.children.push(target);
+ this.initChildId();
+ target.index = this.children.length - 1;
+ this.updateTabs();
+ },
+ unlinked(target) {
+ this.children = this.children.filter((item) => item.index !== target.index);
+ this.updateTabs(() => this.setTrack());
+ this.initChildId();
+ },
+ },
+ };
+ this.properties = props;
+ this.controlledProps = [
+ {
+ key: 'value',
+ event: 'change',
+ },
+ ];
+ this.observers = {
+ value(name) {
+ if (name !== this.getCurrentName()) {
+ this.setCurrentIndexByName(name);
+ }
+ },
+ };
+ this.data = {
+ prefix,
+ classPrefix: name,
+ tabs: [],
+ currentIndex: -1,
+ trackStyle: '',
+ isScrollX: true,
+ direction: 'X',
+ offset: 0,
+ tabID: '',
+ placement: 'top',
+ };
+ this.lifetimes = {
+ created() {
+ this.children = this.children || [];
+ },
+ attached() {
+ wx.nextTick(() => {
+ this.setTrack();
+ });
+ getRect(this, `.${name}`).then((rect) => {
+ this.containerWidth = rect.width;
+ });
+ this.setData({
+ tabID: getUniqueID(),
+ });
+ },
+ };
+ this.methods = {
+ updateTabs(cb) {
+ const { children } = this;
+ const tabs = children.map((child) => child.data);
+ tabs.forEach((item) => {
+ if (typeof item.icon === 'string') {
+ item.icon = { name: item.icon };
+ }
+ });
+ this.setData({ tabs }, cb);
+ this.setCurrentIndexByName(this.properties.value);
+ },
+ setCurrentIndexByName(name) {
+ const { children } = this;
+ const index = children.findIndex((child) => child.getComputedName() === `${name}`);
+ if (index > -1) {
+ this.setCurrentIndex(index);
+ }
+ },
+ setCurrentIndex(index) {
+ if (index <= -1 || index >= this.children.length)
+ return;
+ this.children.forEach((child, idx) => {
+ const isActive = index === idx;
+ if (isActive !== child.data.active) {
+ child.render(isActive, this);
+ }
+ });
+ if (this.data.currentIndex === index)
+ return;
+ this.setData({
+ currentIndex: index,
+ });
+ this.setTrack();
+ },
+ getCurrentName() {
+ if (this.children) {
+ const activeTab = this.children[this.data.currentIndex];
+ if (activeTab) {
+ return activeTab.getComputedName();
+ }
+ }
+ },
+ calcScrollOffset(containerWidth, targetLeft, targetWidth, offset) {
+ return offset + targetLeft - (1 / 2) * containerWidth + targetWidth / 2;
+ },
+ getTrackSize() {
+ return new Promise((resolve, reject) => {
+ if (this.trackWidth) {
+ resolve(this.trackWidth);
+ return;
+ }
+ getRect(this, `.${prefix}-tabs__track`)
+ .then((res) => {
+ if (res) {
+ this.trackWidth = res.width;
+ resolve(this.trackWidth);
+ }
+ })
+ .catch(reject);
+ });
+ },
+ setTrack() {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (!this.properties.showBottomLine)
+ return;
+ const { children } = this;
+ if (!children)
+ return;
+ const { currentIndex, isScrollX, direction } = this.data;
+ if (currentIndex <= -1)
+ return;
+ try {
+ const res = yield getRect(this, `.${prefix}-tabs__item`, true);
+ const rect = res[currentIndex];
+ if (!rect)
+ return;
+ let count = 0;
+ let distance = 0;
+ let totalSize = 0;
+ res.forEach((item) => {
+ if (count < currentIndex) {
+ distance += isScrollX ? item.width : item.height;
+ count += 1;
+ }
+ totalSize += isScrollX ? item.width : item.height;
+ });
+ if (this.containerWidth) {
+ const offset = this.calcScrollOffset(this.containerWidth, rect.left, rect.width, this.data.offset);
+ const maxOffset = totalSize - this.containerWidth;
+ this.setData({
+ offset: Math.min(Math.max(offset, 0), maxOffset),
+ });
+ }
+ if (isScrollX && this.data.theme === 'line') {
+ const trackLineWidth = yield this.getTrackSize();
+ distance += (rect.width - trackLineWidth) / 2;
+ }
+ let trackStyle = `-webkit-transform: translate${direction}(${distance}px);
+ transform: translate${direction}(${distance}px);
+ `;
+ if (!isScrollX) {
+ trackStyle += `height: ${rect.height}px;`;
+ }
+ this.setData({
+ trackStyle,
+ });
+ }
+ catch (err) {
+ this.triggerEvent('error', err);
+ }
+ });
+ },
+ onTabTap(event) {
+ const { index } = event.currentTarget.dataset;
+ this.changeIndex(index);
+ },
+ onTouchStart(event) {
+ if (!this.properties.swipeable)
+ return;
+ this.touchStart(event);
+ },
+ onTouchMove(event) {
+ if (!this.properties.swipeable)
+ return;
+ this.touchMove(event);
+ },
+ onTouchEnd() {
+ if (!this.properties.swipeable)
+ return;
+ const { direction, deltaX, offsetX } = this;
+ const minSwipeDistance = 50;
+ if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
+ const index = this.getAvailableTabIndex(deltaX);
+ if (index !== -1) {
+ this.changeIndex(index);
+ }
+ }
+ },
+ onTouchScroll(event) {
+ this._trigger('scroll', event.detail);
+ },
+ changeIndex(index) {
+ const currentTab = this.data.tabs[index];
+ const { value, label } = currentTab;
+ if (!(currentTab === null || currentTab === void 0 ? void 0 : currentTab.disabled) && index !== this.data.currentIndex) {
+ this._trigger('change', { value, label });
+ }
+ this._trigger('click', { value, label });
+ },
+ getAvailableTabIndex(deltaX) {
+ const step = deltaX > 0 ? -1 : 1;
+ const { currentIndex, tabs } = this.data;
+ const len = tabs.length;
+ for (let i = step; currentIndex + step >= 0 && currentIndex + step < len; i += step) {
+ const newIndex = currentIndex + i;
+ if (newIndex >= 0 && newIndex < len && tabs[newIndex] && !tabs[newIndex].disabled) {
+ return newIndex;
+ }
+ }
+ return -1;
+ },
+ };
+ }
+ initChildId() {
+ this.children.forEach((item, index) => {
+ item.setId(`${this.data.tabID}_panel_${index}`);
+ });
+ }
+};
+Tabs = __decorate([
+ wxComponent()
+], Tabs);
+export default Tabs;
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.json b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.json
new file mode 100644
index 0000000..0570f9a
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-sticky": "../sticky/sticky",
+ "t-badge": "../badge/badge",
+ "t-icon": "../icon/icon"
+ }
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxml b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxml
new file mode 100644
index 0000000..33479e2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxml
@@ -0,0 +1,75 @@
+<import src="../common/template/badge.wxml" />
+<import src="../common/template/icon.wxml" />
+<wxs src="./tabs.wxs" module="filters" />
+<wxs src="../common/utils.wxs" module="_" />
+
+<view style="{{_._style([style, customStyle])}}" class="{{_.cls(classPrefix, [placement])}} class {{prefix}}-class">
+ <t-sticky
+ t-class="{{_.cls(classPrefix + '__sticky', [placement])}}"
+ disabled="{{ !sticky }}"
+ z-index="{{ stickyProps.zIndex || '1' }}"
+ offset-top="{{ stickyProps.offsetTop || 0 }}"
+ container="{{ stickyProps.container }}"
+ bind:scroll="onTouchScroll"
+ >
+ <view class="{{_.cls(classPrefix + '__wrapper', [theme])}}">
+ <scroll-view
+ class="{{_.cls(classPrefix + '__scroll', [placement])}}"
+ enhanced
+ enable-flex
+ scroll-left="{{offset}}"
+ scroll-x="{{isScrollX}}"
+ scroll-y="{{isScrollY}}"
+ scroll-with-animation
+ show-scrollbar="{{false}}"
+ >
+ <view class="{{_.cls(classPrefix + '__nav', [placement])}}" aria-role="tablist">
+ <view
+ wx:for="{{tabs}}"
+ wx:key="index"
+ data-index="{{index}}"
+ class="{{_.cls(classPrefix + '__item', [theme, ['evenly', spaceEvenly], placement, ['disabled', item.disabled], ['active', currentIndex === index]])}} {{currentIndex === index ? prefix + '-class-active' : ''}} {{prefix}}-class-item"
+ bind:tap="onTabTap"
+ aria-role="tab"
+ aria-controls="{{tabID + '_panel_' + index}}"
+ aria-selected="{{currentIndex === index}}"
+ aria-disabled="{{item.disabled}}"
+ aria-label="{{ ariaLabel || (item.badgeProps.dot || item.badgeProps.count ? item.label + _.getBadgeAriaLabel({ ...item.badgeProps }) : '') }}"
+ >
+ <view
+ class="{{_.cls(classPrefix + '__item-inner', [theme, ['active', currentIndex === index]])}}"
+ aria-hidden="{{ item.badgeProps.dot || item.badgeProps.count }}"
+ >
+ <template wx:if="{{item.icon}}" is="icon" data="{{ class: classPrefix + '__icon', ...item.icon }}" />
+ <block wx:if="{{item.badgeProps}}">
+ <template is="badge" data="{{ ...item.badgeProps, content: item.label }}" />
+ </block>
+ <block wx:else>{{item.label}}</block>
+ </view>
+ <view wx:if="{{theme == 'card' && currentIndex - 1 == index}}" class="{{classPrefix}}__item-prefix" />
+ <view wx:if="{{theme == 'card' && currentIndex + 1 == index}}" class="{{classPrefix}}__item-suffix" />
+ </view>
+ <view
+ wx:if="{{theme == 'line' && showBottomLine}}"
+ class="{{_.cls(classPrefix + '__track', [placement])}} {{prefix}}-class-track"
+ style="{{trackStyle}}"
+ />
+ </view>
+ </scroll-view>
+ </view>
+ </t-sticky>
+ <view
+ class="{{_.cls(classPrefix + '__content', [['animated', animation]])}}"
+ bind:touchstart="onTouchStart"
+ bind:touchmove="onTouchMove"
+ bind:touchend="onTouchEnd"
+ bind:touchcancel="onTouchEnd"
+ >
+ <view
+ class="{{classPrefix}}__content-inner"
+ style="{{ filters.animate({duration: animation.duration, currentIndex:currentIndex, direction}) }}"
+ >
+ <slot />
+ </view>
+ </view>
+</view>
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxs b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxs
new file mode 100644
index 0000000..cb51149
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxs
@@ -0,0 +1,20 @@
+/* eslint-disable */
+
+function animate(options) {
+ var result = [];
+
+ if (options.duration) {
+ result.push('transition-duration: ' + options.duration + 's');
+ result.push(
+ options.direction === 'Y'
+ ? ';transform: translate3d( 0,' + -100 * options.currentIndex + '%, 0)'
+ : ';transform: translate3d( ' + -100 * options.currentIndex + '%,0, 0)',
+ );
+ }
+
+ return result.join(';');
+}
+
+module.exports = {
+ animate: animate,
+};
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss
new file mode 100644
index 0000000..61458e2
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss
@@ -0,0 +1,217 @@
+.t-float-left {
+ float: left;
+}
+.t-float-right {
+ float: right;
+}
+@keyframes tdesign-fade-out {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+.hotspot-expanded.relative {
+ position: relative;
+}
+.hotspot-expanded::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ transform: scale(1.5);
+}
+.t-tabs {
+ position: relative;
+ font-size: var(--tab-font-size, 28rpx);
+ background: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tabs__wrapper {
+ display: flex;
+ overflow: hidden;
+ background: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
+}
+.t-tabs__wrapper--card {
+ background: var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3));
+ --td-tab-border-color: transparent;
+}
+.t-tabs__item {
+ position: relative;
+ display: flex;
+ flex: none;
+ align-items: center;
+ justify-content: center;
+ font-weight: 400;
+ color: var(--td-tab-item-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
+ padding: 0 32rpx;
+ box-sizing: border-box;
+ white-space: nowrap;
+ overflow: hidden;
+}
+.t-tabs__item--active {
+ font-weight: 600;
+ color: var(--td-tab-item-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-tabs__item--disabled {
+ color: var(--td-tab-item-disabled-color, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
+}
+.t-tabs__item--evenly {
+ flex: 1;
+}
+.t-tabs__item--top,
+.t-tabs__item--bottom {
+ height: var(--td-tab-item-height, 96rpx);
+}
+.t-tabs__item-inner {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.t-tabs__item-inner--tag {
+ width: 100%;
+ text-align: center;
+ padding: 0 32rpx;
+ line-height: var(--td-tab-item-tag-height, 64rpx);
+ border-radius: calc(var(--td-tab-item-tag-height, 64rpx) / 2);
+ background-color: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
+}
+.t-tabs__item-inner--active.t-tabs__item-inner--tag {
+ background-color: var(--td-tab-item-tag-active-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
+}
+.t-tabs__item--tag:not(.t-tabs__item--evenly) {
+ padding: 0 8rpx;
+}
+.t-tabs__item--tag:not(.t-tabs__item--evenly):first-child {
+ margin-left: 16rpx;
+}
+.t-tabs__item--tag:not(.t-tabs__item--evenly):last-child {
+ padding-right: 24rpx;
+}
+.t-tabs__item--tag {
+ padding: 0 16rpx;
+}
+.t-tabs__item--card.t-tabs__item--active {
+ background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
+ border-radius: 18rpx 18rpx 0 0;
+}
+.t-tabs__item--card.t-tabs__item--active:first-child {
+ border-top-left-radius: 0;
+}
+.t-tabs__item--card.t-tabs__item--active:last-child {
+ border-top-right-radius: 0;
+}
+.t-tabs__item--card.t-tabs__item--pre {
+ border-bottom-right-radius: 18rpx;
+}
+.t-tabs__item-prefix,
+.t-tabs__item-suffix {
+ position: absolute;
+ bottom: 0;
+ width: 36rpx;
+ height: 36rpx;
+ background: #fff;
+}
+.t-tabs__item-prefix::after,
+.t-tabs__item-suffix::after {
+ content: '';
+ display: block;
+ width: 100%;
+ height: 100%;
+ background-color: var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3));
+}
+.t-tabs__item-prefix {
+ right: 0;
+}
+.t-tabs__item-prefix::after {
+ border-bottom-right-radius: 18rpx;
+}
+.t-tabs__item-suffix {
+ left: 0;
+}
+.t-tabs__item-suffix::after {
+ border-bottom-left-radius: 18rpx;
+}
+.t-tabs__icon {
+ font-size: var(--td-tab-icon-size, 36rpx);
+ margin-right: 4rpx;
+}
+.t-tabs__content {
+ overflow: hidden;
+}
+.t-tabs__nav {
+ position: relative;
+ user-select: none;
+ width: 100%;
+ display: flex;
+ flex-wrap: nowrap;
+ align-items: center;
+}
+.t-tabs__track {
+ position: absolute;
+ font-weight: 600;
+ z-index: 1;
+ transition-duration: 0.3s;
+ background-color: var(--td-tab-track-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
+}
+.t-tabs__track--top,
+.t-tabs__track--bottom {
+ left: 0;
+ bottom: 1rpx;
+ width: var(--td-tab-track-width, 32rpx);
+ height: var(--td-tab-track-thickness, 6rpx);
+ border-radius: var(--td-tab-track-radius, 8rpx);
+}
+.t-tabs__scroll::-webkit-scrollbar {
+ display: none;
+}
+.t-tabs__scroll--top,
+.t-tabs__scroll--bottom {
+ height: var(--td-tab-item-height, 96rpx);
+ position: relative;
+}
+.t-tabs__scroll--top {
+ position: relative;
+}
+.t-tabs__scroll--top::after {
+ content: '';
+ display: block;
+ position: absolute;
+ top: unset;
+ bottom: 0;
+ left: unset;
+ right: unset;
+ background-color: var(--td-tab-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
+}
+.t-tabs__scroll--top::after {
+ height: 1px;
+ left: 0;
+ right: 0;
+ transform: scaleY(0.5);
+}
+.t-tabs__content-inner {
+ display: block;
+}
+.t-tabs--top,
+.t-tabs--bottom {
+ flex-wrap: wrap;
+}
+.t-tabs--top .t-tabs__content,
+.t-tabs--bottom .t-tabs__content {
+ width: 100%;
+}
+.t-tabs--top .t-tabs__content--animated .t-tabs__content-inner,
+.t-tabs--bottom .t-tabs__content--animated .t-tabs__content-inner {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ will-change: left;
+ transition-property: transform;
+}
+.t-tabs--bottom {
+ flex-direction: column-reverse;
+}
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/type.d.ts b/miniprogram_npm/tdesign-miniprogram/tabs/type.d.ts
new file mode 100644
index 0000000..d3343bb
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/type.d.ts
@@ -0,0 +1,51 @@
+import { StickyProps } from '../sticky/index';
+export interface TdTabsProps {
+ animation?: {
+ type: ObjectConstructor;
+ value?: TabAnimation;
+ };
+ style?: {
+ type: StringConstructor;
+ value?: string;
+ };
+ externalClasses?: {
+ type: ArrayConstructor;
+ value?: ['t-class', 't-class-item', 't-class-active', 't-class-track'];
+ };
+ showBottomLine?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ spaceEvenly?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ sticky?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ stickyProps?: {
+ type: ObjectConstructor;
+ value?: StickyProps;
+ };
+ swipeable?: {
+ type: BooleanConstructor;
+ value?: boolean;
+ };
+ theme?: {
+ type: StringConstructor;
+ value?: 'line' | 'tag' | 'card';
+ };
+ value?: {
+ type: null;
+ value?: TabValue;
+ };
+ defaultValue?: {
+ type: null;
+ value?: TabValue;
+ };
+}
+export declare type TabAnimation = {
+ duration: number;
+} & Record<string, any>;
+export declare type TabValue = string | number;
diff --git a/miniprogram_npm/tdesign-miniprogram/tabs/type.js b/miniprogram_npm/tdesign-miniprogram/tabs/type.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/miniprogram_npm/tdesign-miniprogram/tabs/type.js
@@ -0,0 +1 @@
+export {};
diff --git a/model/ledger.js b/model/ledger.js
new file mode 100644
index 0000000..a4cb035
--- /dev/null
+++ b/model/ledger.js
@@ -0,0 +1,134 @@
+const moment = require('../utils/moment.min');
+
+// 缁熻鍙拌处涓婁紶鎯呭喌
+function parseLedgerStat(subtypes, lastMonth) {
+ const DEADLINEDAY = 10;
+ let monthInfo = {
+ totalMust: 0,
+ finishedMust: 0,
+ totalSelf: 0,
+ finishedSelf: 0,
+ totalSelect: 0,
+ finishedSelect: 0,
+ status: '',
+ overtime: '',
+ suggestion: '',
+ };
+ let map = new Map();
+ subtypes.forEach(s => {
+ //鏈堝害缁熻
+ if (s.ledgerTypeId == -1) {
+ monthInfo.totalSelf++;
+ if (s.upLoad) {
+ monthInfo.finishedSelf++;
+ }
+ } else {
+ if (s.needUpdate) {
+ monthInfo.totalMust++;
+ if (s.upLoad) {
+ monthInfo.finishedMust++;
+ }
+ } else {
+ monthInfo.totalSelect++;
+ if (s.upLoad) {
+ monthInfo.finishedSelect++;
+ }
+ }
+ }
+
+ refreshLedgerStatus(s);
+
+ if (!map.has(s.ledgerType)) {
+ map.set(s.ledgerType, []);
+ }
+ map.get(s.ledgerType).push(s);
+ });
+
+ //
+ if (monthInfo.finishedMust + monthInfo.finishedSelf == 0) {
+ monthInfo.status = '鏈彁浜�';
+ if (lastMonth) {
+ monthInfo.suggestion =
+ '寤鸿锛氬綋鏈熷彴璐﹀畬鍏ㄦ湭鎻愪氦锛屼弗閲嶅奖鍝嶈瘎浼扮粨鏋滐紝鍚庣画璇锋敞鎰�';
+ } else {
+ monthInfo.suggestion = '寤鸿锛氳灏藉揩鎻愪氦鍙拌处';
+ }
+ } else if (
+ monthInfo.finishedMust + monthInfo.finishedSelf <
+ monthInfo.totalMust + monthInfo.totalSelf
+ ) {
+ monthInfo.status = '閮ㄥ垎鎻愪氦';
+ if (lastMonth) {
+ monthInfo.suggestion =
+ '寤鸿锛氬綋鏈熷彴璐﹂儴鍒嗘湭鎻愪氦锛屼細褰卞搷璇勪及缁撴灉锛屽悗缁灏介噺鎻愪氦鎵�鏈夊彴璐�';
+ } else {
+ monthInfo.suggestion = '寤鸿锛氬綋鍓嶅凡鎻愪氦閮ㄥ垎鍙拌处锛岃琛ュ叏鍓╀綑鍙拌处';
+ }
+ } else {
+ monthInfo.status = '宸叉彁浜�';
+ if (lastMonth) {
+ monthInfo.suggestion = '褰撴湡鍙拌处宸插叏閮ㄦ彁浜わ紝璇蜂繚鎸�';
+ } else {
+ monthInfo.suggestion = '鏈湡鍙拌处宸插叏閮ㄦ彁浜�';
+ }
+ }
+ monthInfo.overtime = moment().date() - DEADLINEDAY;
+ monthInfo.percent =
+ monthInfo.totalMust == 0
+ ? 0
+ : Math.round((monthInfo.finishedMust / monthInfo.totalMust) * 100);
+ monthInfo.percent2 =
+ monthInfo.totalSelf == 0
+ ? 0
+ : Math.round((monthInfo.finishedSelf / monthInfo.totalSelf) * 100);
+
+ //閫夐」鍗�
+ var t = [];
+ var p = [];
+ for (let item of map) {
+ let notUpload = 0;
+ item[1].forEach(l => {
+ if (l.needUpdate && !l.upLoad) {
+ notUpload++;
+ }
+ });
+ t.push({
+ name: item[0],
+ tag: notUpload,
+ total: item[1].length,
+ });
+ p.push(item[1]);
+ }
+
+ return [t, p, monthInfo];
+}
+
+function refreshLedgerStatus(s) {
+ if (s.upLoad) {
+ s.badge = {
+ color: 'green',
+ count: '鉁�',
+ };
+ s.opacity = 0.7;
+ } else if (s.ledgerFinished) {
+ s.badge = {
+ color: 'yellow',
+ count: '!',
+ };
+ s.opacity = 1;
+ } else if (!s.needUpdate) {
+ s.badge = {
+ color: 'green',
+ count: '閫夊~',
+ };
+ s.opacity = 0.8;
+ } else {
+ s.badge = {
+ color: 'red',
+ count: '!',
+ };
+ s.opacity = 1;
+ }
+}
+
+export { parseLedgerStat, refreshLedgerStatus };
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..175368e
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,44 @@
+{
+ "name": "ep-law-abiding",
+ "version": "1.0.0",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "ep-law-abiding",
+ "version": "1.0.0",
+ "license": "ISC",
+ "dependencies": {
+ "tdesign-miniprogram": "^1.1.1"
+ }
+ },
+ "node_modules/dayjs": {
+ "version": "1.11.7",
+ "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.7.tgz",
+ "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ=="
+ },
+ "node_modules/tdesign-miniprogram": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmmirror.com/tdesign-miniprogram/-/tdesign-miniprogram-1.1.1.tgz",
+ "integrity": "sha512-35RuAfR74Hq3HEsOS3NRHyP9S1vdMI8/JSXgtPNV805KEtD9rHRK3Rn9gD08UqvGyemVOoB1IVzwk63fie4t2A==",
+ "dependencies": {
+ "dayjs": "^1.10.7"
+ }
+ }
+ },
+ "dependencies": {
+ "dayjs": {
+ "version": "1.11.7",
+ "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.7.tgz",
+ "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ=="
+ },
+ "tdesign-miniprogram": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmmirror.com/tdesign-miniprogram/-/tdesign-miniprogram-1.1.1.tgz",
+ "integrity": "sha512-35RuAfR74Hq3HEsOS3NRHyP9S1vdMI8/JSXgtPNV805KEtD9rHRK3Rn9gD08UqvGyemVOoB1IVzwk63fie4t2A==",
+ "requires": {
+ "dayjs": "^1.10.7"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..d9d53ff
--- /dev/null
+++ b/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "ep-law-abiding",
+ "version": "1.0.0",
+ "description": "",
+ "main": "app.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [
+ "law"
+ ],
+ "author": "feiyu",
+ "license": "ISC",
+ "dependencies": {
+ "tdesign-miniprogram": "^1.1.1"
+ }
+}
diff --git a/pages/home/home.js b/pages/home/home.js
index 652d042..4c6ee48 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -1,29 +1,30 @@
// pages/home/home.js
-const userservice = require("../../service/userservice")
-const notificationservice = require("../../service/notificationservice")
-const assessmentService = require("../../service/assessmentservice")
-const lawservice = require("../../service/lawservice")
-const promiseservice = require("../../service/promiseservice")
-const ledgerservice = require("../../service/ledgerservice")
-const moment = require('../../utils/moment.min')
-const app = getApp()
+import $f from '../../service/baserequest';
+
+const userservice = require('../../service/userservice');
+const notificationservice = require('../../service/notificationservice');
+const assessmentService = require('../../service/assessmentservice');
+const lawservice = require('../../service/lawservice');
+const promiseservice = require('../../service/promiseservice');
+const ledgerservice = require('../../service/ledgerservice');
+const moment = require('../../utils/moment.min');
+const app = getApp();
/**
* 棣栭〉
*/
Page({
-
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- notices: [],
+ icon1: $f.baseIconUrl + 'res/btn_bg_1.png',
+ icon2: $f.baseIconUrl + 'res/btn_bg_2.png',
+ icon3: $f.baseIconUrl + 'res/wm_assessment.png',
- dynamic: [{
- title: "浼佷笟钀ヤ笟鎵х収銆侀鍝佺粡钀ヨ鍙瘉涓㈠け璇ュ浣曡ˉ棰�",
- time: "2022骞�4鏈�5鏃�",
- views: 2012,
- pic: "/res/icons/temp_pic_1.png"
- }],
+ notices: [],
+ unReadNoiceCount: 0,
+
+ dynamic: [],
nextEvaluationTime: '2022骞�6鏈�9鏃�',
userRealName: '',
@@ -36,7 +37,7 @@
rank: '--',
legalIndex: '--',
illegalIndex: '--',
- period: ''
+ period: '',
},
//鍙拌处瀹屾垚鎯呭喌
ledgerCompleted: false,
@@ -48,9 +49,8 @@
},
//鎵胯瀹屾垚鎯呭喌
promsieInfo: {
- leftDays: 0
- }
-
+ leftDays: 0,
+ },
},
/**
@@ -58,93 +58,113 @@
*/
onLoad: function (options) {
//鍒ゆ柇鐢ㄦ埛鏄惁涓洪娆$櫥褰曪紝鍐冲畾鏄惁寮哄埗淇敼榛樿瀵嗙爜
- if (app.globalData.userInfo.remark == null || app.globalData.userInfo.remark == '') {
+ if (
+ app.globalData.userInfo.remark == null ||
+ app.globalData.userInfo.remark == ''
+ ) {
wx.navigateTo({
url: '/pages/mUser/pChangepw/pChangepw',
- })
+ });
}
wx.getStorage({
key: 'accessToken',
- success: (result) => {
+ success: result => {
console.log(result.data);
},
- fail: (res) => {},
- complete: (res) => {},
- })
+ fail: res => {},
+ complete: res => {},
+ });
- this.getNextEvaluationTime()
- this.getNotice()
- this.getUserInfo()
- this.getHistoryPoint()
- this.getNews()
- this.getCommitment()
- this.getLedgerType()
+ // this.getNextEvaluationTime();
+ // this.getNotice();
+ // this.getUnReadNoticeCount();
+ this.getUserInfo();
+ // this.getHistoryPoint();
+ // this.getNews();
+ // this.getCommitment();
+ // this.getLedgerType();
},
onShow() {
if (app.globalData.isLogin) {
-
+ wx.startPullDownRefresh({
+ success: res => {},
+ fail: res => {},
+ complete: res => {},
+ });
}
},
onPullDownRefresh() {
- console.log('onPullDownRefresh');
- this.getNextEvaluationTime()
- this.getNotice()
- this.getHistoryPoint()
- this.getNews()
- this.getCommitment()
- this.getLedgerType()
+ this.getNextEvaluationTime();
+ this.getNotice();
+ this.getUnReadNoticeCount();
+ this.getHistoryPoint();
+ this.getNews();
+ this.getCommitment();
+ this.getLedgerType();
},
getNextEvaluationTime() {
- let now = moment().add(1, 'months')
+ let now = moment().add(1, 'months');
this.setData({
- nextEvaluationTime: now.format("YYYY骞碝M鏈�10鏃�")
- })
+ nextEvaluationTime: now.format('YYYY骞碝M鏈�10鏃�'),
+ });
},
getUserInfo() {
this.setData({
- userRealName: app.globalData.userInfo.realname
- })
+ userRealName: app.globalData.userInfo.realname,
+ });
},
getNotice() {
- var that = this
+ var that = this;
notificationservice.getNotification(app.globalData.accessToken.userId, 1, {
success(res) {
- let notices = []
+ let notices = [];
res.forEach(r => {
notices.push({
notice: r.title,
time: moment(r.updateTime).format('YYYY/MM/DD'),
- isRead: r.hasRead
- })
+ isRead: r.hasRead,
+ });
that.setData({
- notices
- })
+ notices,
+ });
});
- }
- })
+ },
+ });
+ },
+
+ getUnReadNoticeCount() {
+ var that = this;
+ notificationservice.getUnReadNoticeCount(
+ app.globalData.accessToken.userId,
+ {
+ success(res) {
+ that.setData({ unReadNoiceCount: res });
+ },
+ },
+ );
},
getHistoryPoint() {
- var that = this
+ var that = this;
assessmentService.getHistoryPoint(app.globalData.accessToken.userId, 1, {
success(data) {
if (data.length == 0) {
- return
+ return;
}
- let lastOne = data[0]
- let year = lastOne.updateDate.substring(0, 4)
- let month = lastOne.updateDate.substring(5, 7)
- const now = moment()
+ let lastOne = data[0];
+ let year = lastOne.updateDate.substring(0, 4);
+ let month = lastOne.updateDate.substring(5, 7);
+ const now = moment();
if (now.year() == year && now.month() + 1 == month) {
that.setData({
- assessmentCompleted: true
- })
+ assessmentCompleted: true,
+ });
}
that.setData({
historyPoint: {
@@ -153,75 +173,85 @@
rank: lastOne.rank,
legalIndex: lastOne.level,
illegalIndex: lastOne.level,
- period: lastOne.period
- }
- })
- }
- })
+ period: lastOne.period,
+ },
+ });
+ },
+ });
},
getNews() {
- var that = this
- let user = app.globalData.userInfo
- lawservice.getLawRegulations(user.guid, 1, {
- sceneTypeId: user.extension2,
- fileType: 1
- }, {
- success(data) {
- let laws = []
- data.forEach(d => {
- laws.push({
- title: d.lrResourcetitle,
- time: d.lrPublishdate.substring(0, 10),
- views: parseInt(Math.random() * 1000 + 10),
- pic: d.lrPicurl,
- url: d.lrBodyurl,
- fileType: d.lrResourcefiletype,
- })
- });
- that.setData({
- dynamic: laws
- })
- }
- })
+ var that = this;
+ let user = app.globalData.userInfo;
+ lawservice.getLawRegulations(
+ user.guid,
+ 1,
+ {
+ sceneTypeId: user.extension2,
+ fileType: 1,
+ },
+ {
+ success(data) {
+ let laws = [];
+ data.forEach(d => {
+ laws.push({
+ title: d.lrResourcetitle,
+ time: d.lrPublishdate.substring(0, 10),
+ views: parseInt(Math.random() * 1000 + 10),
+ pic: d.lrPicurl,
+ url: d.lrBodyurl,
+ fileType: d.lrResourcefiletype,
+ });
+ });
+ that.setData({
+ dynamic: laws,
+ });
+ },
+ },
+ );
},
/**
* 鑾峰彇鎵胯鍘嗗彶璁板綍
*/
getCommitment() {
- var that = this
+ var that = this;
promiseservice.getCommitment(app.globalData.accessToken.userId, {
success(data) {
if (data.length > 0) {
- let c = data[0]
- let cTime = moment(c.cmCreateTime)
- let leftDays = cTime.add(1, 'years').diff(moment(), 'days')
+ let c = data[0];
+ let cTime = moment(c.cmCreateTime);
+ let leftDays = cTime.add(1, 'years').diff(moment(), 'days');
that.setData({
promsieInfo: {
- leftDays: leftDays
- }
- })
+ leftDays: leftDays,
+ },
+ });
}
- }
- })
+ },
+ });
},
getLedgerType() {
- var that = this
- var time = moment().format('YYYY-MM-DD')
- ledgerservice.getLedgerSummary(app.globalData.accessToken.userId, app.globalData.userInfo.extension2, time, {
- success(res) {
- that.parseLedgerType(res)
+ var that = this;
+ var time = moment().format('YYYY-MM-DD');
+ ledgerservice.getLedgerSummary(
+ app.globalData.accessToken.userId,
+ app.globalData.userInfo.extension2,
+ time,
+ {
+ success(res) {
+ that.parseLedgerType(res);
+ },
+ complete() {
+ wx.stopPullDownRefresh({
+ success: res => {},
+ fail: res => {},
+ complete: res => {},
+ });
+ },
},
- complete() {
- wx.stopPullDownRefresh({
- success: (res) => {},
- fail: (res) => {},
- complete: (res) => {},
- })
- }
- })
+ );
},
parseLedgerType(subtypes) {
@@ -229,103 +259,109 @@
totalMust: 0,
finishedMust: 0,
totalSelf: 0,
- finishedSelf: 0
- }
+ finishedSelf: 0,
+ };
subtypes.forEach(s => {
//鏈堝害缁熻
if (s.needUpdate) {
- monthInfo.totalMust++
+ monthInfo.totalMust++;
//缁熻鑷贰鏌ョ被鍨嬬殑鍙拌处锛岀被鍒负-1锛堟殏瀹氾級
if (s.ledgerTypeId == -1) {
- monthInfo.totalSelf++
+ monthInfo.totalSelf++;
}
if (s.upLoad) {
- monthInfo.finishedMust++
+ monthInfo.finishedMust++;
if (s.ledgerTypeId == -1) {
- monthInfo.finishedSelf++
+ monthInfo.finishedSelf++;
}
}
}
});
- monthInfo.percent = monthInfo.totalMust == 0 ? 0 : Math.round(monthInfo.finishedMust / monthInfo.totalMust * 100)
- monthInfo.percent2 = monthInfo.totalSelf == 0 ? 0 : Math.round(monthInfo.finishedSelf / monthInfo.totalSelf * 100)
+ monthInfo.percent =
+ monthInfo.totalMust == 0
+ ? 0
+ : Math.round((monthInfo.finishedMust / monthInfo.totalMust) * 100);
+ monthInfo.percent2 =
+ monthInfo.totalSelf == 0
+ ? 0
+ : Math.round((monthInfo.finishedSelf / monthInfo.totalSelf) * 100);
this.setData({
monthInfo,
ledgerCompleted: monthInfo.percent >= 100 && monthInfo.percent2 >= 100,
// ledgerCompleted: true
- })
+ });
},
/**
* 椤甸潰璺宠浆
*/
goto: function (e) {
- var url = ""
- var index = e.currentTarget.dataset.index
+ var url = '';
+ var index = e.currentTarget.dataset.index;
switch (index) {
- case "0":
+ case '0':
//娴嬭瘎鍘嗗彶璁板綍
if (this.data.historyPoint.period == '') {
- url = `/pages/mAssessment/grade/grade`
+ url = `/pages/mAssessment/grade/grade`;
} else {
- url = `/pages/mAssessment/gradereport/gradereport?period=${this.data.historyPoint.period}`
+ url = `/pages/mAssessment/gradereport/gradereport?period=${this.data.historyPoint.period}`;
}
break;
- case "5":
+ case '5':
wx.switchTab({
url: '/pages/mLedger/ledgerhome/ledgerhome',
- })
+ });
return;
- case "6":
- wx.switchTab({
+ case '6':
+ wx.navigateTo({
url: '/pages/mPromise/promisehome/promise',
- })
+ });
return;
- case "1":
+ case '1':
//宸ヤ綔鎻愰啋
- url = "/pages/mNotice/notice/notice"
+ url = '/pages/mNotice/notice/notice';
break;
- case "2":
+ case '2':
//鏅鸿兘鍦ㄧ嚎鍜ㄨ
- url = "/pages/mConsult/consulthome/consulthome"
+ url = '/pages/mConsult/consulthome/consulthome';
break;
- case "3":
+ case '3':
//鍦ㄧ嚎瀹堟硶瀛︿範
- url = `/pages/mLearn/learn/learn`
+ url = `/pages/mLearn/learn/learn`;
break;
- case "4":
+ case '4':
//瀹堟硶鍔ㄦ��
// url = "/pages/text/text"
- let bodyUrl = e.currentTarget.dataset.url
- let fileType = e.currentTarget.dataset.filetype
+ let bodyUrl = e.currentTarget.dataset.url;
+ let fileType = e.currentTarget.dataset.filetype;
wx.showLoading({
title: ' 鍔犺浇涓�',
mask: true,
- })
+ });
wx.downloadFile({
url: bodyUrl,
success: function (res) {
- wx.hideLoading()
- const filePath = res.tempFilePath
+ wx.hideLoading();
+ const filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
success: function (res) {
- console.log('鎵撳紑鏂囨。鎴愬姛')
+ console.log('鎵撳紑鏂囨。鎴愬姛');
},
fail(error) {
console.log(error);
- }
- })
- }
- })
+ },
+ });
+ },
+ });
return;
}
- if (url != "") {
+ if (url != '') {
wx.navigateTo({
- url: url
- })
+ url: url,
+ });
}
- }
-})
\ No newline at end of file
+ },
+});
diff --git a/pages/home/home.json b/pages/home/home.json
index 7ddecf4..84fa880 100644
--- a/pages/home/home.json
+++ b/pages/home/home.json
@@ -3,6 +3,7 @@
"enablePullDownRefresh":true,
"usingComponents": {
"cp-notice": "/component/notice/notice",
- "c-schedule": "/pages/mService/cSchedule/cSchedule"
+ "c-schedule": "/pages/mService/cSchedule/cSchedule",
+ "c-schedule-today": "/pages/mService/cScheduletoday/index"
}
}
\ No newline at end of file
diff --git a/pages/home/home.wxml b/pages/home/home.wxml
index 0b9e42c..f829fd2 100644
--- a/pages/home/home.wxml
+++ b/pages/home/home.wxml
@@ -22,19 +22,23 @@
</view>
</view>
</view> -->
- <view class="flex-h" style="margin-top: 4px;">
+ <view class="flex-h" style="margin-top: 4px">
<view class="flex-h_block">
<view class="top-card" bindtap="goto" data-index="0">
<view>
- <view style="font-size: 24rpx;" class="top-card__time">{{historyPoint.time}}</view>
- <view class="top-card__score"><text class="top-card__num">{{historyPoint.score}}</text>鍒�</view>
+ <view style="font-size: 24rpx" class="top-card__time"
+ >{{historyPoint.time}}</view
+ >
+ <view class="top-card__score"
+ ><text class="top-card__num">{{historyPoint.score}}</text>鍒�</view
+ >
<view class="top-card__time">鑷祴鏅鸿瘎寰楀垎 ></view>
</view>
<view class="top-card__items">
- <view class="top-card__item">
+ <!-- <view class="top-card__item">
<view>瀹堟硶鎺掑悕</view>
<text>{{historyPoint.rank}}</text>
- </view>
+ </view> -->
<view class="top-card__item">
<view>瀹堟硶鎸囨暟</view>
<text>{{historyPoint.legalIndex}}</text>
@@ -44,18 +48,23 @@
<text>{{historyPoint.illegalIndex}}</text>
</view> -->
</view>
- <image src="/res/icons/wm_assessment.png" mode="aspectFit"></image>
+ <image src="{{icon3}}" mode="aspectFit"></image>
</view>
</view>
<view class="flex-h_block">
<view class="top-card top-card_2" bindtap="goto" data-index="5">
<view class="flex-h">
<view>
- <view class="top-card__score"><text class="top-card__num">{{monthInfo.percent}}</text>%</view>
+ <view class="top-card__score"
+ ><text class="top-card__num">{{monthInfo.percent}}</text>%</view
+ >
<view class="top-card__time">鍙拌处瀹屾垚鐜� ></view>
</view>
<view>
- <view class="top-card__score"><text class="top-card__num">{{monthInfo.percent2}}</text>%</view>
+ <view class="top-card__score"
+ ><text class="top-card__num">{{monthInfo.percent2}}</text
+ >%</view
+ >
<view class="top-card__time">鑷贰鏌� ></view>
</view>
</view>
@@ -63,8 +72,12 @@
</view>
<view class="top-card top-card_3" bindtap="goto" data-index="6">
<view>
- <view class="top-card__score">{{promsieInfo.leftDays > 0 ? '鍓╀綑' : '澶辨晥'}}
- <text class="top-card__num">{{promsieInfo.leftDays > 0 ? promsieInfo.leftDays : 0 - promsieInfo.leftDays}}</text>澶�
+ <view class="top-card__score"
+ >{{promsieInfo.leftDays > 0 ? '鍓╀綑' : '澶辨晥'}}
+ <text class="top-card__num"
+ >{{promsieInfo.leftDays > 0 ? promsieInfo.leftDays : 0 -
+ promsieInfo.leftDays}}</text
+ >澶�
</view>
<view class="top-card__time">鎵胯鍊掕鏃� ></view>
</view>
@@ -73,8 +86,16 @@
</view>
</view>
</view>
- <view class="page__bd" style="padding-top: 8px;">
- <c-schedule ledgerCompleted="{{ledgerCompleted}}" assessmentCompleted="{{assessmentCompleted}}"></c-schedule>
+ <view class="page__bd" style="padding-top: 8px">
+ <view class="schedule-wrap">
+ <view style="margin-top: 4px">
+ <c-schedule-today></c-schedule-today>
+ </view>
+ <c-schedule
+ ledgerCompleted="{{ledgerCompleted}}"
+ assessmentCompleted="{{assessmentCompleted}}"
+ ></c-schedule>
+ </view>
<view class="fyui-panel" bindtap="goto" data-index="1">
<view class="fyui-cell fyui-cell_select title">
@@ -82,12 +103,23 @@
<image src="/res/icons/warn.png" class="icon" />
</view>
<view class="fyui-cell__bd">鏅鸿兘宸ヤ綔鎻愰啋</view>
- <view class="fyui-cell__ft">鏌ョ湅鏇村</view>
+ <view class="fyui-cell__ft" wx:if="{{unReadNoiceCount > 0}}"
+ ><view class="{{unReadNoiceCount > 0 ? 'notice-not-read-text' : ''}}"
+ >{{unReadNoiceCount }}</view
+ ></view
+ >
</view>
- <view wx:for="{{notices}}" wx:key="index" data-index="index" wx:item="item">
+ <view
+ wx:for="{{notices}}"
+ wx:key="index"
+ data-index="index"
+ wx:item="item"
+ >
<view class="fyui-cell">
<view class="fyui-cell__hd">
- <view class="{{item.isRead ? 'notice-read' : 'notice-not-read'}}"></view>
+ <view
+ class="{{item.isRead ? 'notice-read' : 'notice-not-read'}}"
+ ></view>
</view>
<view class="fyui-cell__bd notice">{{item.notice}}</view>
<view class="fyui-cell__ft">{{item.time}}</view>
@@ -95,15 +127,15 @@
</view>
</view>
- <view class="flex-h" style="padding: 8px 10px 0 10px;">
+ <view class="flex-h" style="padding: 8px 10px 0 10px">
<view class="image-btn" bindtap="goto" data-index="2">
- <image src="/res/icons/btn_bg_2.png" class="" />
+ <image src="{{icon2}}" class="" />
<text class="image-btn_title">鏅鸿兘鍦ㄧ嚎鍜ㄨ</text>
<text class="image-btn_abstract">鍦ㄧ嚎鏅鸿兘鍜ㄨ鏈嶅姟</text>
<view class="image-btn_goto"></view>
</view>
<view class="image-btn" bindtap="goto" data-index="3">
- <image src="/res/icons/btn_bg_1.png" class="" />
+ <image src="{{icon1}}" class="" />
<text class="image-btn_title">鍦ㄧ嚎瀹堟硶瀛︿範</text>
<text class="image-btn_abstract">瀹炴椂鍦ㄧ嚎瀛︿範鏈嶅姟</text>
<view class="image-btn_goto"></view>
@@ -117,24 +149,39 @@
<view class="fyui-cell__bd">瀹堟硶鍔ㄦ��</view>
<view class="fyui-cell__ft">鏌ョ湅鏇村</view>
</view>
- <view wx:for="{{dynamic}}" wx:key="index" data-index="index" wx:item="item">
- <view class="fyui-box" bindtap="goto" data-index="4" data-url="{{item.url}}" data-filetype="{{item.fileType}}">
+ <view
+ wx:for="{{dynamic}}"
+ wx:key="index"
+ data-index="index"
+ wx:item="item"
+ >
+ <view
+ class="fyui-box"
+ bindtap="goto"
+ data-index="4"
+ data-url="{{item.url}}"
+ data-filetype="{{item.fileType}}"
+ >
<view class="fyui-box__bd">
<view class="fyui-box__content">{{item.title}}</view>
<view class="fyui-box__tag">
<view>{{item.time}}</view>
<view class="flex-h">
- <image src="/res/icons/view.png" class="image-16"></image>{{item.views}}
+ <image src="/res/icons/view.png" class="image-16"></image
+ >{{item.views}}
</view>
</view>
</view>
<view class="fyui-box__hd">
- <image src="{{item.pic}}" class="fyui-box__hd_image" mode="aspectFill" />
+ <image
+ src="{{item.pic}}"
+ class="fyui-box__hd_image"
+ mode="aspectFill"
+ />
</view>
</view>
</view>
</view>
</view>
<view class="page__ft"></view>
-
-</view>
\ No newline at end of file
+</view>
diff --git a/pages/home/home.wxss b/pages/home/home.wxss
index d73b853..9d57cad 100644
--- a/pages/home/home.wxss
+++ b/pages/home/home.wxss
@@ -135,17 +135,29 @@
}
.notice-read {
- width: 12px;
- height: 12px;
- background-color: #CECECE;
+ width: 10px;
+ height: 10px;
+ background-color: transparent;
border-radius: 50%;
}
.notice-not-read {
- width: 12px;
- height: 12px;
+ width: 10px;
+ height: 10px;
background-color: red;
border-radius: 50%;
+ color: white;
+}
+
+.notice-not-read-text {
+ width: 16px;
+ height: 16px;
+ background-color: red;
+ border-radius: 50%;
+ color: white;
+ display: flex;
+ align-items: center;
+ justify-content: center;
}
.notice {
@@ -195,6 +207,13 @@
background-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
}
+.schedule-wrap {
+ /* background-color: white; */
+ margin: 0 10px;
+ padding: 4px 0;
+ /* border-radius: 4px; */
+ /* box-shadow: 0 1px 3px rgba(0, 0, 0, .4); */
+}
/* .image-btn .image-btn_goto>image {
width: 14px;
height: 20px;
diff --git a/pages/icons/icons.js b/pages/icons/icons.js
index 5eb9c54..ffe7566 100644
--- a/pages/icons/icons.js
+++ b/pages/icons/icons.js
@@ -498,8 +498,6 @@
const app = getApp()
app.watchThemeChange && app.watchThemeChange(this.setIconColor)
-
- console.log("wtf:::::::::::::::::::::");
},
setIconColor(theme) {
const color = theme === 'dark' ? colorDark : colorLight
diff --git a/pages/mAssessment/gradereport/gradereport.js b/pages/mAssessment/gradereport/gradereport.js
index b076adb..bbfe53a 100644
--- a/pages/mAssessment/gradereport/gradereport.js
+++ b/pages/mAssessment/gradereport/gradereport.js
@@ -1,11 +1,11 @@
// pages/gradereport/gradereport.js
-import bLoadingStatus from '../../../base/behaviors/bLoadingStatus'
-import bLoadingToast from '../../../base/behaviors/bLoadingToast'
+import bLoadingStatus from '../../../base/behaviors/bLoadingStatus';
+import bLoadingToast from '../../../base/behaviors/bLoadingToast';
-const echarts = require("../../../component/ec-canvas/echarts")
-const assessmentService = require("../../../service/assessmentservice")
-const moment = require('../../../utils/moment.min')
-const app = getApp()
+const echarts = require('../../../component/ec-canvas/echarts');
+const assessmentService = require('../../../service/assessmentservice');
+const moment = require('../../../utils/moment.min');
+const app = getApp();
function setOption(chart, data) {
var option = {
@@ -23,7 +23,7 @@
// textBorderWidth: 1
},
subtextStyle: {
- fontFamily: "寰蒋闆呴粦",
+ fontFamily: '寰蒋闆呴粦',
fontSize: 10,
color: 'black',
textBorderColor: 'black',
@@ -34,12 +34,12 @@
color: ['white'],
tooltip: {},
legend: {
- show: false
+ show: false,
},
radar: {
radius: '60%',
axisName: {
- color: 'white'
+ color: 'white',
},
shape: 'polygon',
axisLine: {
@@ -47,40 +47,44 @@
lineStyle: {
color: 'white',
type: 'dashed',
- join: 'round'
- }
+ join: 'round',
+ },
},
axisLabel: {
- show: false
+ show: false,
},
splitLine: {
show: true,
- color: 'white'
+ color: 'white',
},
splitArea: {
show: true,
areaStyle: {
color: ['#4ca796', '#63c5b3', '#74DFCB', '#76E6D2', '#75ECD7'],
- }
+ },
},
- indicator: data.indicator
+ indicator: data.indicator,
},
- series: [{
- name: "寰楀垎",
- type: "radar",
- areaStyle: {
- color: 'white',
- opacity: 0.9
+ series: [
+ {
+ name: '寰楀垎',
+ type: 'radar',
+ areaStyle: {
+ color: 'white',
+ opacity: 0.9,
+ },
+ label: {
+ show: false,
+ position: 'inside',
+ },
+ data: [
+ {
+ value: data.value,
+ name: '寰楀垎',
+ },
+ ],
},
- label: {
- show: false,
- position: 'inside'
- },
- data: [{
- value: data.value,
- name: "寰楀垎"
- }]
- }],
+ ],
// grid: {
// x: 30,
// y: 30,
@@ -98,41 +102,52 @@
*/
data: {
ec: {
- lazyLoad: true
+ lazyLoad: true,
},
creditText: '----------------------',
- gradeDetails: [{
- name: '鑷瘎寰楀垎',
- detail: '--'
- }, {
- name: '椋庨櫓鎺掑悕',
- detail: '--'
- }, {
- name: '椋庨櫓绛夌骇',
- detail: '--'
- }, {
- name: '鑷瘎鍛ㄦ湡',
- detail: '--'
- }, {
- name: '鑷瘎鏃堕棿',
- detail: '--'
- }],
+ gradeDetails: [
+ {
+ name: '鑷瘎寰楀垎',
+ detail: '--',
+ },
+ {
+ name: '椋庨櫓鎺掑悕',
+ detail: '--',
+ },
+ {
+ name: '椋庨櫓绛夌骇',
+ detail: '--',
+ },
+ {
+ name: '鑷瘎鍛ㄦ湡',
+ detail: '--',
+ },
+ {
+ name: '鑷瘎鏃堕棿',
+ detail: '--',
+ },
+ ],
//澶卞垎鐨勭被鍨�
losePointsItem: [],
- losePoints: [{
- baseRule: '',
- name: '',
- itemlist: [{
- ruleName: '----',
- score: '--',
- remark: '------------'
- },{
- ruleName: '----',
- score: '--',
- remark: '------------'
- }]
- }]
+ losePoints: [
+ {
+ baseRule: '',
+ name: '',
+ itemlist: [
+ {
+ ruleName: '----',
+ score: '--',
+ remark: '------------',
+ },
+ {
+ ruleName: '----',
+ score: '--',
+ remark: '------------',
+ },
+ ],
+ },
+ ],
},
/**
@@ -141,15 +156,15 @@
onLoad: function (options) {
if (options.period) {
this.setData({
- period: options.period
- })
+ period: options.period,
+ });
} else {
- let now = moment()
+ let now = moment();
//鏍规嵁褰撳墠鏃堕棿鑾峰彇璇勪及鍛ㄦ湡YYYY/M-M
- let period = `${now.year()}/${now.month()+1}-${now.month()+1}`
+ let period = `${now.year()}/${now.month() + 1}-${now.month() + 1}`;
this.setData({
- period: period
- })
+ period: period,
+ });
}
},
@@ -158,137 +173,163 @@
*/
onReady: function () {
this.ecComponent = this.selectComponent('#mychart-dom-radar');
- this.initChart()
+ this.initChart();
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
*/
- onShow: function () {
-
- },
+ onShow: function () {},
initChart: function () {
var data = {
score: '--',
level: '涓�鑸�',
- indicator: [{
- name: "娉曡",
- max: 100
- }, {
- name: "绠$悊",
- max: 100
- }, {
- name: "鎵胯",
- max: 100
- }, {
- name: "瀹堟硶",
- max: 100
- }, {
- name: "璁惧",
- max: 100
- }],
- value: [100, 100, 80, 5, 67, 82]
- }
- this.ecComponent.init((canvas, width, height, dpr) => {
- // 鑾峰彇缁勪欢鐨� canvas銆亀idth銆乭eight 鍚庣殑鍥炶皟鍑芥暟
- // 鍦ㄨ繖閲屽垵濮嬪寲鍥捐〃
- const chart = echarts.init(canvas, null, {
- width: width,
- height: height,
- devicePixelRatio: dpr // new
- });
- // setOption(chart, data);
-
- // 灏嗗浘琛ㄥ疄渚嬬粦瀹氬埌 this 涓婏紝鍙互鍦ㄥ叾浠栨垚鍛樺嚱鏁帮紙濡� dispose锛変腑璁块棶
- this.chart = chart;
+ indicator: [
+ {
+ name: '娉曡',
+ max: 100,
+ },
+ {
+ name: '绠$悊',
+ max: 100,
+ },
+ {
+ name: '鎵胯',
+ max: 100,
+ },
+ {
+ name: '瀹堟硶',
+ max: 100,
+ },
+ {
+ name: '璁惧',
+ max: 100,
+ },
+ ],
+ value: [100, 100, 80, 5, 67, 82],
+ };
+ this.ecComponent.init((canvas, width, height, dpr) => {
+ // 鑾峰彇缁勪欢鐨� canvas銆亀idth銆乭eight 鍚庣殑鍥炶皟鍑芥暟
+ // 鍦ㄨ繖閲屽垵濮嬪寲鍥捐〃
+ const chart = echarts.init(canvas, null, {
+ width: width,
+ height: height,
+ devicePixelRatio: dpr, // new
+ });
+ // setOption(chart, data);
- this.getDetail()
-
- // 娉ㄦ剰杩欓噷涓�瀹氳杩斿洖 chart 瀹炰緥锛屽惁鍒欎細褰卞搷浜嬩欢澶勭悊绛�
- return chart;
+ // 灏嗗浘琛ㄥ疄渚嬬粦瀹氬埌 this 涓婏紝鍙互鍦ㄥ叾浠栨垚鍛樺嚱鏁帮紙濡� dispose锛変腑璁块棶
+ this.chart = chart;
+
+ this.getDetail();
+
+ // 娉ㄦ剰杩欓噷涓�瀹氳杩斿洖 chart 瀹炰緥锛屽惁鍒欎細褰卞搷浜嬩欢澶勭悊绛�
+ return chart;
});
},
getDetail() {
- var that = this
- this.setData({loading: true})
- assessmentService.getDetail(app.globalData.accessToken.userId, this.data.period, {
- success(data) {
- let creditText = data.creditText
- let year = data.period.split('/')[0]
- let month = data.period.split('/')[1].split('-')[0]
- let gradeDetails = [{
- name: '鑷瘎寰楀垎',
- detail: data.score
- }, {
- name: '椋庨櫓鎺掑悕',
- detail: data.rank
- }, {
- name: '椋庨櫓绛夌骇',
- detail: data.level
- }, {
- name: '鑷瘎鍛ㄦ湡',
- detail: `${year}骞�${month}鏈坄
- }, {
- name: '鑷瘎鏃堕棿',
- detail: moment(data.time).format("YYYY-MM-DD HH:mm")
- }]
- let losePointsItem = []
- let losePoints = []
- for (const key in data.loseScore) {
- const s = data.loseScore[key];
- if (Object.keys(s).length > 0) {
- losePointsItem.push(key)
- for (const key1 in s) {
- const rule = s[key1];
- let p = {
- baseRule: key,
- name: key1,
- itemlist: []
- }
- rule.forEach(r => {
- // fixme : 姝ゅ鏆傛椂灏嗐�愰楗�戠被鍨嬬殑浼佷笟璇勪及寤鸿鐨勭涓�鍙ヨ瘽鍒犻櫎
- if (app.globalData.userInfo.extension2 === '1') {
- const i = r.third.indexOf('锛�')
- r.third = r.third.slice(i+1)
- r.third = r.third.replaceAll('浣�', '鎮�')
- }
- p.itemlist.push({
- ruleName: r.first,
- score: r.second,
- remark: r.third
- })
- });
- losePoints.push(p)
- }
- }
- }
- let classPoints = {
- score: data.score,
- level: data.level,
- indicator: [],
- value: []
- }
- data.classScore.forEach(c => {
- classPoints.indicator.push({
- name: c.first,
- max: c.second
- })
- classPoints.value.push(c.third)
- });
+ var that = this;
+ this.setData({ loading: true });
+ assessmentService.getDetail(
+ app.globalData.accessToken.userId,
+ this.data.period,
+ {
+ success(data) {
+ let creditText = data.creditText;
+ let year = data.period.split('/')[0];
+ let month = data.period.split('/')[1].split('-')[0];
+ let gradeDetails = [
+ {
+ name: '鑷瘎寰楀垎',
+ detail: data.score,
+ },
+ {
+ name: '椋庨櫓鎺掑悕',
+ detail: data.rank,
+ },
+ {
+ name: '椋庨櫓绛夌骇',
+ detail: data.level,
+ },
+ {
+ name: '鑷瘎鍛ㄦ湡',
+ detail: `${year}骞�${month}鏈坄,
+ },
+ {
+ name: '鑷瘎鏃堕棿',
+ detail: moment(data.time).format('YYYY-MM-DD HH:mm'),
+ },
+ ];
+ const {
+ pointsItem: losePointsItem,
+ points: losePoints,
+ } = that.parsePoint(data.loseScore);
+ const { pointsItem, points } = that.parsePoint(data.scoring);
+ let classPoints = {
+ score: data.score,
+ level: data.level,
+ indicator: [],
+ value: [],
+ };
+ data.classScore.forEach(c => {
+ classPoints.indicator.push({
+ name: c.first,
+ max: c.second,
+ });
+ classPoints.value.push(c.third);
+ });
- that.setData({
- creditText: creditText,
- gradeDetails: gradeDetails,
- losePoints: losePoints,
- losePointsItem: losePointsItem
- })
- setOption(that.chart, classPoints)
+ that.setData({
+ creditText,
+ gradeDetails,
+ losePoints,
+ losePointsItem,
+ pointsItem,
+ points,
+ });
+ setOption(that.chart, classPoints);
+ },
+ complete() {
+ that.setData({ loading: false });
+ },
},
- complete() {
- that.setData({loading: false})
+ );
+ },
+
+ parsePoint(itemList) {
+ const pointsItem = [];
+ const points = [];
+ for (const key in itemList) {
+ const s = itemList[key];
+ if (Object.keys(s).length > 0) {
+ pointsItem.push(key);
+ for (const key1 in s) {
+ const rule = s[key1];
+ let p = {
+ baseRule: key,
+ name: key1,
+ itemlist: [],
+ };
+ rule.forEach(r => {
+ // fixme : 姝ゅ鏆傛椂灏嗐�愰楗�戠被鍨嬬殑浼佷笟璇勪及寤鸿鐨勭涓�鍙ヨ瘽鍒犻櫎
+ if (app.globalData.userInfo.extension2 === '1') {
+ const i = r.third.indexOf('锛�');
+ r.third = r.third.slice(i + 1);
+ r.third = r.third.replaceAll('浣�', '鎮�');
+ }
+ p.itemlist.push({
+ ruleName: r.first,
+ score: r.second,
+ remark: r.third,
+ });
+ });
+ points.push(p);
+ }
}
- })
- }
-})
\ No newline at end of file
+ }
+
+ return { pointsItem, points };
+ },
+});
diff --git a/pages/mAssessment/gradereport/gradereport.wxml b/pages/mAssessment/gradereport/gradereport.wxml
index 4b65c66..a181e08 100644
--- a/pages/mAssessment/gradereport/gradereport.wxml
+++ b/pages/mAssessment/gradereport/gradereport.wxml
@@ -29,6 +29,10 @@
<view class="fyui-panel fyui-panel__max">
<view class="fyui-panel_title">鑷瘎璇婃柇</view>
<view wx:if="{{losePoints.length > 0}}">
+ <view style="font-size: 16px;" class="first">
+ <view style="display: inline-block; border: 6px solid orange;"></view>
+ 鎵e垎椤�
+ </view>
鏈娴嬭瘎涓昏褰卞搷绫诲埆涓�<text style="color: orange;font-weight: 600;font-size: 16px;" wx:for="{{losePointsItem}}" wx:key="index">{{index > 0 ? "銆�" : ""}}{{item}}</text>
绛夊叡璁�<text style="color: orange;font-weight: 600;font-size: 18px;">{{losePoints.length}}</text>椤癸紝鍏蜂綋璇婃柇鍙婂缓璁涓嬶細
</view>
@@ -37,7 +41,7 @@
<view class="{{index !=0 ? 'first' : ''}}">
<view class="fyui-panel_title">{{index + 1}}. 銆�<text style="color: orange;">{{item.baseRule}}</text>銆憑{item.name}}</view>
<block wx:for="{{item.itemlist}}" wx:for-item="rule" wx:key="index">
- <view style="margin-top: 8px;border-top: 4px solid rgb(147, 250, 226);width: 30px;"></view>
+ <view style="margin-top: 8px;border-top: 4px solid orange;width: 30px;"></view>
<view class="fyui-panel_desc">
<view>鏉$洰锛�</view>{{rule.ruleName}}
</view>
@@ -50,6 +54,32 @@
</block>
</view>
</block>
+
+ <view wx:if="{{losePoints.length > 0}}">
+ <view style="font-size: 16px;" class="first">
+ <view style="display: inline-block; border: 6px solid rgb(95, 211, 184);"></view>
+ 鍔犲垎椤�
+ </view>
+ 鏈娴嬭瘎鍔犲垎椤逛负<text style="color: rgb(95, 211, 184);font-weight: 600;font-size: 16px;" wx:for="{{pointsItem}}" wx:key="index">{{index > 0 ? "銆�" : ""}}{{item}}</text>
+ 绛夊叡璁�<text style="color: rgb(95, 211, 184);font-weight: 600;font-size: 18px;">{{points.length}}</text>椤癸紝鍏蜂綋濡備笅锛�
+ </view>
+ <block wx:for="{{points}}" wx:key="index">
+ <view class="{{index !=0 ? 'first' : ''}}">
+ <view class="fyui-panel_title">{{index + 1}}. 銆�<text style="color: rgb(95, 211, 184);">{{item.baseRule}}</text>銆憑{item.name}}</view>
+ <block wx:for="{{item.itemlist}}" wx:for-item="rule" wx:key="index">
+ <view style="margin-top: 8px;border-top: 4px solid rgb(95, 211, 184);width: 30px;"></view>
+ <view class="fyui-panel_desc">
+ <view>鏉$洰锛�</view>{{rule.ruleName}}
+ </view>
+ <view class="fyui-panel_desc">
+ <view>{{rule.score < 0 ? '鎵e垎' : '鍔犲垎'}}锛�</view><text style="{{rule.score < 0 ? 'color: orange;' : 'color: rgb(95, 211, 184);'}}">{{rule.score}}鍒�</text>
+ </view>
+ <view class="fyui-panel_desc">
+ <view>瑙f瀽锛�</view>{{rule.remark}}
+ </view>
+ </block>
+ </view>
+ </block>
</view>
</view>
<view class="page__ft">
diff --git a/pages/mConsult/cResultItemSearch/cResultItemSearch.wxml b/pages/mConsult/cResultItemSearch/cResultItemSearch.wxml
index 122be6e..019cf29 100644
--- a/pages/mConsult/cResultItemSearch/cResultItemSearch.wxml
+++ b/pages/mConsult/cResultItemSearch/cResultItemSearch.wxml
@@ -1 +1,7 @@
-<c-result-item results="{{results}}" loading="{{loading}}" needLoadMore="{{needLoadMore}}" scrollable="{{scrollable}}" bindgotoMore="gotoMore"></c-result-item>
\ No newline at end of file
+<c-result-item
+ results="{{results}}"
+ loading="{{loading}}"
+ needLoadMore="{{needLoadMore}}"
+ scrollable="{{scrollable}}"
+ bindgotoMore="gotoMore"
+></c-result-item>
diff --git a/pages/mConsult/consultdetailcase/consultdetailcase.wxml b/pages/mConsult/consultdetailcase/consultdetailcase.wxml
index fc3c8e9..484a80a 100644
--- a/pages/mConsult/consultdetailcase/consultdetailcase.wxml
+++ b/pages/mConsult/consultdetailcase/consultdetailcase.wxml
@@ -24,7 +24,7 @@
<image class="image-16" src="/res/icons/case_forfeit.png"></image>
缃氭鏁伴
</view>
- <view style="color: red;">{{case.ecForfeit}}涓囧厓</view>
+ <view style="color: red;">{{case.ecForfeit ? case.ecForfeit : '/ '}}涓囧厓</view>
</view>
<view class="fyui-panel">
<view>妗堜緥绫诲埆锛歿{case.ecType}}</view>
diff --git a/pages/mConsult/consultdetailqa/consultdetailqa.js b/pages/mConsult/consultdetailqa/consultdetailqa.js
index e2caf2d..ac964da 100644
--- a/pages/mConsult/consultdetailqa/consultdetailqa.js
+++ b/pages/mConsult/consultdetailqa/consultdetailqa.js
@@ -1,4 +1,5 @@
// pages/mConsult/consultdetailqa/consultdetailqa.js
+import $f from "../../../service/baserequest";
const consultservice = require("../../../service/consultservice")
const app = getApp()
@@ -8,6 +9,8 @@
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ icon1: $f.baseIconUrl + 'res/con_qa.png',
+
showloading: false,
question: {},
//闂娑夊強鐨勯」鐩�
diff --git a/pages/mConsult/consultdetailqa/consultdetailqa.wxml b/pages/mConsult/consultdetailqa/consultdetailqa.wxml
index 190f042..c8b2f85 100644
--- a/pages/mConsult/consultdetailqa/consultdetailqa.wxml
+++ b/pages/mConsult/consultdetailqa/consultdetailqa.wxml
@@ -31,7 +31,7 @@
<block wx:for="{{answers}}" wx:for-index="index" wx:key="index">
<view class="fyui-box fyui-box__text">
<view class="fyui-box__hd">
- <image class="user-avator" src="/res/icons/con_qa.png"></image>
+ <image class="user-avator" src="{{icon1}}"></image>
<view>
<view class="user-name">鐜繚鏅鸿兘鍔╂墜</view>
<view class="user-tag">鐜繚鏅鸿兘鍔╂墜</view>
diff --git a/pages/mConsult/consulthome/consulthome.js b/pages/mConsult/consulthome/consulthome.js
index a00aece..16928a8 100644
--- a/pages/mConsult/consulthome/consulthome.js
+++ b/pages/mConsult/consulthome/consulthome.js
@@ -1,4 +1,5 @@
// pages/mConsult/consulthome/consulthome.js
+import $f from "../../../service/baserequest";
Page({
// behaviors: [behavior],
@@ -6,6 +7,13 @@
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ icon1: $f.baseIconUrl + 'res/con_pro_bg.png',
+ icon2: $f.baseIconUrl + 'res/con_pro.png',
+ icon3: $f.baseIconUrl + 'res/con_lib_bg.png',
+ icon4: $f.baseIconUrl + 'res/con_lib.png',
+ icon5: $f.baseIconUrl + 'res/con_qa_bg.png',
+ icon6: $f.baseIconUrl + 'res/con_qa.png',
+
searchTips: '璇疯緭鍏ュ叧閿瓧鎼滅储',
tabList: [{
name: '鐑棬',
diff --git a/pages/mConsult/consulthome/consulthome.wxml b/pages/mConsult/consulthome/consulthome.wxml
index 38e1876..2345cac 100644
--- a/pages/mConsult/consulthome/consulthome.wxml
+++ b/pages/mConsult/consulthome/consulthome.wxml
@@ -7,24 +7,24 @@
</view>
<view class="flex-h">
<view class="card" bindtap="goto" data-index="0">
- <image src="/res/icons/con_pro_bg.png" class="card-bg" mode="scaleToFill" />
+ <image src="{{icon1}}" class="card-bg" mode="scaleToFill" />
<view class="card-title">鐜繚闂</view>
<view class="card-abstract">甯歌浼佷笟闂</view>
- <image src="/res/icons/con_pro.png" mode="aspectFit" class="icon"></image>
+ <image src="{{icon2}}" mode="aspectFit" class="icon"></image>
</view>
<view class="divider"></view>
<view class="card middle" bindtap="goto" data-index="1">
- <image src="/res/icons/con_lib_bg.png" class="card-bg" mode="scaleToFill" />
+ <image src="{{icon3}}" class="card-bg" mode="scaleToFill" />
<view class="card-title">鐜繚鐭ヨ瘑搴�</view>
<view class="card-abstract">鐢熸�佺幆澧冩硶寰嬫硶瑙�</view>
- <image src="/res/icons/con_lib.png" mode="aspectFit" class="icon"></image>
+ <image src="{{icon4}}" mode="aspectFit" class="icon"></image>
</view>
<view class="divider"></view>
<view class="card" bindtap="goto" data-index="2">
- <image src="/res/icons/con_qa_bg.png" class="card-bg" mode="scaleToFill" />
+ <image src="{{icon5}}" class="card-bg" mode="scaleToFill" />
<view class="card-title">鏅鸿兘鍜ㄨ</view>
<view class="card-abstract">鐜繚鏅鸿兘鍔╂墜</view>
- <image src="/res/icons/con_qa.png" mode="aspectFit" class="icon"></image>
+ <image src="{{icon6}}" mode="aspectFit" class="icon"></image>
</view>
</view>
</view>
diff --git a/pages/mConsult/consultonline/consultonline.js b/pages/mConsult/consultonline/consultonline.js
index 6f924f5..63d102d 100644
--- a/pages/mConsult/consultonline/consultonline.js
+++ b/pages/mConsult/consultonline/consultonline.js
@@ -1,4 +1,5 @@
// pages/mConsult/consultonline/consultonline.js
+import $f from "../../../service/baserequest";
const bSearch = require("../behaviors/bSearch")
const app = getApp()
@@ -8,6 +9,8 @@
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ icon1: $f.baseIconUrl + 'res/con_qa.png',
+
userId: app.globalData.accessToken.userId,
record: [{
id: 'system',
diff --git a/pages/mConsult/consultonline/consultonline.wxml b/pages/mConsult/consultonline/consultonline.wxml
index 7f7fb68..eae7703 100644
--- a/pages/mConsult/consultonline/consultonline.wxml
+++ b/pages/mConsult/consultonline/consultonline.wxml
@@ -6,7 +6,7 @@
<view class="consult-text_user">{{item.text}}</view>
</view>
<view wx:else class="consult-record_item">
- <image wx:if="{{item.type == 0}}" src="/res/icons/con_qa.png" class="consult-avator"></image>
+ <image wx:if="{{item.type == 0}}" src="{{icon1}}" class="consult-avator"></image>
<view wx:if="{{item.type == 0}}" class="consult-text">{{item.text}}</view>
<view wx:elif="{{item.type == 1}}" class="consult-text consult-qa">
<switch-tab tabList="{{item.text.tabList}}" refresh="{{item.refresh}}">
diff --git a/pages/mConsult/consultsearch/consultsearch.js b/pages/mConsult/consultsearch/consultsearch.js
index 95b80fd..6b46a48 100644
--- a/pages/mConsult/consultsearch/consultsearch.js
+++ b/pages/mConsult/consultsearch/consultsearch.js
@@ -132,7 +132,7 @@
success: (res) => {
// 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
res.eventChannel.emit('acceptDataFromOpenerPage', {
- fileId: fileId
+ id: fileId
})
},
})
diff --git a/pages/mConsult/consultsearch/consultsearch.wxml b/pages/mConsult/consultsearch/consultsearch.wxml
index 5e2c2c8..dfa4715 100644
--- a/pages/mConsult/consultsearch/consultsearch.wxml
+++ b/pages/mConsult/consultsearch/consultsearch.wxml
@@ -3,26 +3,54 @@
<view class="page__hd">
<view class="search-bar">
<mp-icon icon="search" size="15" color="black"></mp-icon>
- <input type="text" class="search-bar__input" placeholder="{{placeholder}}" value="{{value}}" focus="{{focus}}" bindinput="inputChange" />
- <text class="weui-icon-clear" hover-class="weui-active" wx:if="{{value.length > 0}}" bindtap="clearInput"></text>
+ <input
+ type="text"
+ class="search-bar__input"
+ placeholder="{{placeholder}}"
+ value="{{value}}"
+ focus="{{focus}}"
+ bindinput="inputChange"
+ />
+ <text
+ class="weui-icon-clear"
+ hover-class="weui-active"
+ wx:if="{{value.length > 0}}"
+ bindtap="clearInput"
+ ></text>
</view>
- <view class="btn" bindtap="search">{{value.length > 0 ? '鎼滅储' : '鍙栨秷'}}</view>
+ <view class="btn" bindtap="search"
+ >{{value.length > 0 ? '鎼滅储' : '鍙栨秷'}}</view
+ >
</view>
<view class="page__bd">
<view wx:if="{{history.length > 0}}">
<view>鍘嗗彶璁板綍</view>
<view class="history-record">
- <text wx:for="{{history}}" wx:key="index" data-index="{{index}}" bindtap="selectHistory">{{item}}</text>
+ <text
+ wx:for="{{history}}"
+ wx:key="index"
+ data-index="{{index}}"
+ bindtap="selectHistory"
+ >{{item}}</text
+ >
</view>
</view>
<view>澶у閮藉湪鎼�</view>
<view class="hot-topic">
- <view wx:for="{{hotTopic}}" wx:key="index" class="hot-topic__item" data-index="{{index}}" bindtap="gotoDetail">
- <view class="{{index < 3 ? 'hot-topic__hot' : 'hot-topic__normal'}}">{{index + 1}}</view>
+ <view
+ wx:for="{{hotTopic}}"
+ wx:key="index"
+ class="hot-topic__item"
+ data-index="{{index}}"
+ bindtap="gotoDetail"
+ >
+ <view class="{{index < 3 ? 'hot-topic__hot' : 'hot-topic__normal'}}"
+ >{{index + 1}}</view
+ >
<view class="hot-topic__name">{{item.mfName}}</view>
</view>
</view>
</view>
<view class="page__ft"></view>
-</view>
\ No newline at end of file
+</view>
diff --git a/pages/mExtra/pSupervisionchange/pSupervisionchange.js b/pages/mExtra/pSupervisionchange/pSupervisionchange.js
index 109c7bc..35b755b 100644
--- a/pages/mExtra/pSupervisionchange/pSupervisionchange.js
+++ b/pages/mExtra/pSupervisionchange/pSupervisionchange.js
@@ -29,7 +29,7 @@
if (options.time) {
let now = new Date()
now = now.getTime()
- if (now - options.time <= (1000 * 60 * 10)) {
+ if (now - options.time <= (1000 * 60 * 60 * 24 * 2)) {
this.setData({
enable: true,
})
diff --git a/pages/mExtra/pSupervisiontask/pSupervisiontask.js b/pages/mExtra/pSupervisiontask/pSupervisiontask.js
index 157851c..f528680 100644
--- a/pages/mExtra/pSupervisiontask/pSupervisiontask.js
+++ b/pages/mExtra/pSupervisiontask/pSupervisiontask.js
@@ -3,6 +3,7 @@
import bLoadingToast from '../../../base/behaviors/bLoadingToast'
import {sceneTypes2} from '../../../data/sceneTypes'
import moment from '../../../utils/moment.min'
+import $f from "../../../service/baserequest";
const taskservice = require('../../../service/taskservice')
@@ -62,7 +63,7 @@
return {
title: `[寰呮暣鏀筣${subTask.sceneName}`,
path: `/pages/mExtra/pSupervisionchange/pSupervisionchange?subTaskId=${subTask.stGuid}&time=${t}`,
- imageUrl: '/res/icons/change_icon.jpg'
+ imageUrl: $f.baseIconUrl + 'res/change_icon.png'
}
}
},
diff --git a/pages/mExtra/pSupervisiontask/pSupervisiontask.wxml b/pages/mExtra/pSupervisiontask/pSupervisiontask.wxml
index 83c962f..bf5ccd9 100644
--- a/pages/mExtra/pSupervisiontask/pSupervisiontask.wxml
+++ b/pages/mExtra/pSupervisiontask/pSupervisiontask.wxml
@@ -6,16 +6,38 @@
<view class="page__hd">
<view class="title">浠诲姟閫夋嫨</view>
<view class="select-time">
- <picker bindchange="bindTaskChange" value="{{tIndex}}" mode="selector" range="{{taskList}}" range-key="name">
+ <picker
+ bindchange="bindTaskChange"
+ value="{{tIndex}}"
+ mode="selector"
+ range="{{taskList}}"
+ range-key="name"
+ >
<view class="select-time-text">
{{taskList[tIndex].name}}
- <mp-icon extClass="icon-down" icon="arrow" size="10" color="white"></mp-icon>
+ <mp-icon
+ extClass="icon-down"
+ icon="arrow"
+ size="10"
+ color="white"
+ ></mp-icon>
</view>
</picker>
- <picker bindchange="bindSceneTypeChange" value="{{sIndex}}" mode="selector" range="{{sceneTypes}}" range-key="name">
+ <picker
+ bindchange="bindSceneTypeChange"
+ value="{{sIndex}}"
+ mode="selector"
+ range="{{sceneTypes}}"
+ range-key="name"
+ >
<view class="select-time-text">
{{sceneTypes[sIndex].name}}
- <mp-icon extClass="icon-down" icon="arrow" size="10" color="white"></mp-icon>
+ <mp-icon
+ extClass="icon-down"
+ icon="arrow"
+ size="10"
+ color="white"
+ ></mp-icon>
</view>
</picker>
<view bindtap="getSubTaskSummary" class="search-btn">
@@ -25,17 +47,31 @@
<!-- 鏁版嵁琛� -->
<view class="title">浠诲姟璇︽儏</view>
<view class="tab-card">
- <view bindtap="selectTab" data-index="0" class="{{tabIndex == 0 ? 'tab-card__selected' : ''}}">鏈暣鏀�({{unChangedSubTask}})</view>
- <view bindtap="selectTab" data-index="1" class="{{tabIndex == 1 ? 'tab-card__selected' : ''}}">宸叉暣鏀�({{changedSubTask}})</view>
+ <view
+ bindtap="selectTab"
+ data-index="0"
+ class="{{tabIndex == 0 ? 'tab-card__selected' : ''}}"
+ >鏈暣鏀�({{unChangedSubTask}})</view
+ >
+ <view
+ bindtap="selectTab"
+ data-index="1"
+ class="{{tabIndex == 1 ? 'tab-card__selected' : ''}}"
+ >宸叉暣鏀�({{changedSubTask}})</view
+ >
</view>
</view>
<view class="page__bd" style="margin-top: {{topMargin}};">
<block wx:if="{{subTaskList[tabIndex].length > 0}}">
<block wx:for="{{subTaskList[tabIndex]}}" wx:key="index">
- <view class="title">{{(index == 0 || item.stPlanTime != subTaskList[tabIndex][index-1].stPlanTime) ? item.stPlanTime : ''}}</view>
+ <view class="title"
+ >{{(index == 0 || item.stPlanTime !=
+ subTaskList[tabIndex][index-1].stPlanTime) ? item.stPlanTime :
+ ''}}</view
+ >
<view class="card-subtask">
<!-- <image src="/res/icons/con_lib_bg.png" mode="aspectFit"></image> -->
- <view style="z-index: 1;">
+ <view style="z-index: 1">
<view>{{item.sceneName}}</view>
<text>闂锛歿{item.proNum}}</text>
<text>鏁存敼锛歿{item.changeNum}}</text>
@@ -51,7 +87,5 @@
</block>
<template wx:else is="nodataPage"></template>
</view>
- <view class="page__ft">
-
- </view>
-</view>
\ No newline at end of file
+ <view class="page__ft"> </view>
+</view>
diff --git a/pages/mLearn/baseC/cLearnItem/cLearnItem.wxml b/pages/mLearn/baseC/cLearnItem/cLearnItem.wxml
index 295f3b1..125dceb 100644
--- a/pages/mLearn/baseC/cLearnItem/cLearnItem.wxml
+++ b/pages/mLearn/baseC/cLearnItem/cLearnItem.wxml
@@ -1,5 +1,11 @@
<view>
- <view wx:for="{{results}}" wx:key="index" wx:item="item" bindtap="openFile" data-index="{{index}}">
+ <view
+ wx:for="{{results}}"
+ wx:key="index"
+ wx:item="item"
+ bindtap="openFile"
+ data-index="{{index}}"
+ >
<view wx:if="{{item.lrResourcefiletype != 4}}" class="fyui-box fyui-panel">
<view class="fyui-box__hd">
<image src="{{item.lrPicurl}}" class="" mode="aspectFill" />
@@ -15,9 +21,15 @@
</view>
</view>
<view wx:else class="fyui-panel fyui-panel_video">
- <view style="position: relative;">
- <image src="{{item.lrPicurl}}" class="video-poster" mode="aspectFit" />
- <mp-icon class="video-play" icon="play" color="white" size="50" type="filled"></mp-icon>
+ <view style="position: relative">
+ <image src="{{item.lrPicurl}}" class="video-poster" mode="aspectFill" />
+ <mp-icon
+ class="video-play"
+ icon="play"
+ color="white"
+ size="50"
+ type="filled"
+ ></mp-icon>
</view>
<view class="video-title">{{item.lrResourcetitle}}</view>
<view class="tag">
@@ -28,5 +40,9 @@
</view>
</view>
</view>
- <mp-loadingstatus loading="{{loading}}" needLoadMore="{{needLoadMore}}" nodata="{{results.length == 0}}"></mp-loadingstatus>
-</view>
\ No newline at end of file
+ <mp-loadingstatus
+ loading="{{loading}}"
+ needLoadMore="{{needLoadMore}}"
+ nodata="{{results.length == 0}}"
+ ></mp-loadingstatus>
+</view>
diff --git a/pages/mLearn/baseC/cLearnItem/cLearnItem.wxss b/pages/mLearn/baseC/cLearnItem/cLearnItem.wxss
index 00207c7..984fe4b 100644
--- a/pages/mLearn/baseC/cLearnItem/cLearnItem.wxss
+++ b/pages/mLearn/baseC/cLearnItem/cLearnItem.wxss
@@ -1,6 +1,7 @@
/* pages/mLearn/baseC/cLearnItem/cLearnItem.wxss */
.fyui-panel_video .video-poster {
width: 100%;
+ height: 200px;
background-color: black;
}
diff --git a/pages/mLearn/learn/learn.js b/pages/mLearn/learn/learn.js
index 8a3d2f7..5ca1b3e 100644
--- a/pages/mLearn/learn/learn.js
+++ b/pages/mLearn/learn/learn.js
@@ -2,6 +2,7 @@
import ListPage from '../../../base/ListPage'
import bFetch from '../behaviors/bFetch'
import bOpenFile from '../behaviors/bOpenFile'
+import $f from "../../../service/baserequest";
ListPage({
behaviors: [bFetch, bOpenFile],
@@ -9,6 +10,9 @@
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ icon1: $f.baseIconUrl + 'res/learn_2.png',
+ icon2: $f.baseIconUrl + 'res/learn_1.png',
+
currentTab: 0,
tabList: [{
"name": "VOCs鎺掓斁"
diff --git a/pages/mLearn/learn/learn.wxml b/pages/mLearn/learn/learn.wxml
index b0d37e6..f851a3b 100644
--- a/pages/mLearn/learn/learn.wxml
+++ b/pages/mLearn/learn/learn.wxml
@@ -33,7 +33,7 @@
<view class="flex-h" style="padding: 8px 10px;">
<view class="image-btn" bindtap="goto" data-index="0">
- <image src="/res/icons/learn_1.png" class="image-btn__2" mode="aspectFit" />
+ <image src="{{icon2}}" class="image-btn__2" mode="aspectFit" />
<view class="image-btn_title">
<view class="image-btn_title_t">瀹堟硶瑙嗛</view>
<view>瀹堟硶鍩硅瑙嗛</view>
@@ -43,7 +43,7 @@
</view>
<view class="flex-v">
<view class="image-btn" style="background-color: #F4EED3;" bindtap="goto" data-index="1">
- <image src="/res/icons/learn_2.png" class="image-btn__2" mode="aspectFit" />
+ <image src="{{icon1}}" class="image-btn__2" mode="aspectFit" />
<view class="image-btn_title">
<view class="image-btn_title_t">杩濇硶妗堜緥</view>
<view>鍏稿瀷杩濇硶妗堜緥</view>
diff --git a/pages/mLearn/pLearnvideo/pLearnvideo.js b/pages/mLearn/pLearnvideo/pLearnvideo.js
index 64eb9d4..914b82d 100644
--- a/pages/mLearn/pLearnvideo/pLearnvideo.js
+++ b/pages/mLearn/pLearnvideo/pLearnvideo.js
@@ -1,13 +1,14 @@
// pages/module_common/pagevideo/pagevideo.js
import ListPage from '../../../base/ListPage'
import bFetch from '../behaviors/bFetch'
+import bOpenFile from '../behaviors/bOpenFile'
const lawservice = require("../../../service/lawservice")
const moment = require('../../../utils/moment.min')
const app = getApp()
ListPage({
- behaviors: [bFetch],
+ behaviors: [bFetch, bOpenFile],
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
diff --git a/pages/mLearn/pLearnvideo/pLearnvideo.wxml b/pages/mLearn/pLearnvideo/pLearnvideo.wxml
index 8c37969..120db5a 100644
--- a/pages/mLearn/pLearnvideo/pLearnvideo.wxml
+++ b/pages/mLearn/pLearnvideo/pLearnvideo.wxml
@@ -1,30 +1,51 @@
<!--pages/module_common/pagevideo/pagevideo.wxml-->
<view class="page">
<view class="page__hd">
- <video class="video" id="myVideo" src="{{video.lrBodyurl}}" binderror="videoErrorCallback" show-center-play-btn='{{false}}' show-play-btn="{{true}}" controls autoplay custom-cache="{{false}}" poster="{{video.lrPicurl}}" picture-in-picture-mode="{{['push', 'pop']}}" bindenterpictureinpicture='bindVideoEnterPictureInPicture' bindleavepictureinpicture='bindVideoLeavePictureInPicture'></video>
+ <video
+ class="video"
+ id="myVideo"
+ src="{{video.lrBodyurl}}"
+ binderror="videoErrorCallback"
+ show-center-play-btn="{{false}}"
+ show-play-btn="{{true}}"
+ controls
+ autoplay
+ custom-cache="{{false}}"
+ poster="{{video.lrPicurl}}"
+ picture-in-picture-mode="{{['push', 'pop']}}"
+ bindenterpictureinpicture="bindVideoEnterPictureInPicture"
+ bindleavepictureinpicture="bindVideoLeavePictureInPicture"
+ ></video>
</view>
<view class="page__bd">
- <view class="fyui-box fyui-box__text">
- <view class="fyui-box__hd">
- {{video.lrResourcetitle}}
- </view>
+ <view class="fyui-box fyui-box__text">
+ <view class="fyui-box__hd"> {{video.lrResourcetitle}} </view>
<view class="fyui-box__bd">
<view class="fyui-box__content">{{video.lrResourcedesc}}</view>
-
</view>
<view class="fyui-box__ft">
<view>{{video.lrPublishdate}}</view>
<view class="flex-h">
- <image src="/res/icons/view.png" class="icon" style="margin-right: 4px;"></image>{{video.views}}
+ <image
+ src="/res/icons/view.png"
+ class="icon"
+ style="margin-right: 4px"
+ ></image
+ >{{video.views}}
</view>
</view>
</view>
<view>
- <view wx:if="{{series.length > 0}}" class="fyui-box fyui-box__text">
+ <view wx:if="{{series.length > 0}}" class="fyui-box fyui-box__text">
<view class="video-series" bindtap="showSeries">
<view>瑙嗛鍚堥泦({{thisVideo}}/{{series.length}})</view>
- <mp-icon icon="arrow" class="icon-down" size="14" color="#7F7F7F"></mp-icon>
+ <mp-icon
+ icon="arrow"
+ class="icon-down"
+ size="14"
+ color="#7F7F7F"
+ ></mp-icon>
</view>
</view>
</view>
@@ -34,7 +55,7 @@
<!-- <c-learn-item results="{{results}}" loading="{{loading}}" needLoadMore="{{needLoadMore}}"></c-learn-item> -->
<view wx:for="{{results}}" wx:key="index" wx:item="item">
- <view class="fyui-box" bindtap="gotoResource" data-index="{{index}}">
+ <view class="fyui-box" bindtap="openFile" data-index="{{index}}">
<view class="fyui-box__hd">
<image src="{{item.lrPicurl}}" class="" mode="aspectFill" />
</view>
@@ -43,7 +64,12 @@
<view class="fyui-box__tag">
<view>{{item.lrPublishdate}}</view>
<view class="flex-h">
- <image src="/res/icons/view.png" class="icon" style="margin-right: 4px;"></image>{{item.views}}
+ <image
+ src="/res/icons/view.png"
+ class="icon"
+ style="margin-right: 4px"
+ ></image
+ >{{item.views}}
</view>
</view>
</view>
@@ -51,15 +77,26 @@
</view>
</view>
- <mp-actionSheet show="{{showDialog}}" actions="{{groups}}" showCancel="{{false}}">
+ <mp-actionSheet
+ show="{{showDialog}}"
+ actions="{{groups}}"
+ showCancel="{{false}}"
+ >
<view slot="actionSlot1" class="custom-action">
<view class="custom-action__series">
- <view wx:for="{{series}}" wx:key="index" data-index="{{index}}" bindtap="selectVideo">
- <view class="custom-action__video {{thisVideo == index + 1 ? 'selected' : ''}}">
+ <view
+ wx:for="{{series}}"
+ wx:key="index"
+ data-index="{{index}}"
+ bindtap="selectVideo"
+ >
+ <view
+ class="custom-action__video {{thisVideo == index + 1 ? 'selected' : ''}}"
+ >
{{index+1}}. {{item.lrResourcetitle}}
</view>
</view>
</view>
</view>
</mp-actionSheet>
-</view>
\ No newline at end of file
+</view>
diff --git a/pages/mLedger/behaviors/bUploadLedger.js b/pages/mLedger/behaviors/bUploadLedger.js
index 21f2c97..fa10fc9 100644
--- a/pages/mLedger/behaviors/bUploadLedger.js
+++ b/pages/mLedger/behaviors/bUploadLedger.js
@@ -1,9 +1,9 @@
-import bUpload from "../../../base/behaviors/bUpload"
-import ledgerservice from"../../../service/ledgerservice"
-import bLoadingStatus from '../../../base/behaviors/bLoadingStatus'
-import moment from '../../../utils/moment.min'
+import bUpload from '../../../base/behaviors/bUpload';
+import ledgerservice from '../../../service/ledgerservice';
+import bLoadingStatus from '../../../base/behaviors/bLoadingStatus';
+import moment from '../../../utils/moment.min';
-const app = getApp()
+const app = getApp();
/**
* 鍙拌处涓婁紶绠$悊
@@ -11,65 +11,81 @@
module.exports = Behavior({
behaviors: [bUpload, bLoadingStatus],
data: {
+ // 鍙拌处绫诲瀷
ledger: {},
+ // 鍙拌处璇︽儏
+ detail: undefined,
remark: '',
},
methods: {
_uploadLedger() {
- if (this.data.imgFiles.length == 0) return
-
- var that = this
- let path = []
- this.data.imgFiles.forEach(f => {
- path.push(f.url)
- });
- let ledger = this.data.ledger
- ledger.remark1 = this.data.remark
+ if (this.data.imgFiles.length == 0) return;
- this.setData({loading: true})
- ledgerservice.uploadLedger(app.globalData.accessToken.userId, ledger, path, {
- success (res) {
- that.setData({loading: false})
- if (typeof that._success === 'function') {
- that._success(res)
- }
+ var that = this;
+ let path = [];
+ this.data.imgFiles.forEach(f => {
+ path.push(f.url);
+ });
+ let ledger = this.data.ledger;
+ ledger.remark1 = this.data.remark;
+ if (this.data.detail) {
+ ledger.id = this.data.detail.id
+ }
+
+ this.setData({ loading: true });
+ ledgerservice.uploadLedger(
+ app.globalData.accessToken.userId,
+ ledger,
+ path,
+ {
+ success(res) {
+ that.setData({ loading: false });
+ if (typeof that._success === 'function') {
+ that._success(res);
+ }
+ },
+ fail(err) {
+ that.setData({ loading: false });
+ // wx.showToast({
+ // title: '涓婁紶澶辫触',
+ // duration: 1000,
+ // icon: 'none',
+ // mask: true,
+ // })
+ },
+ complete(res) {},
},
- fail(err) {
- that.setData({loading: false})
- // wx.showToast({
- // title: '涓婁紶澶辫触',
- // duration: 1000,
- // icon: 'none',
- // mask: true,
- // })
- },
- complete (res) {
- }
- })
+ );
},
_uploadNoLedger() {
- var that = this
- const time = moment().format('YYYY-MM-DD')
- const idList = [this.data.ledger.ledgerSubTypeId]
- this.setData({loading: true})
- ledgerservice.uploadNoLedger(app.globalData.accessToken.userId, time, idList, {
- success (res) {
- that.setData({loading: false})
- if (typeof that._success === 'function') {
- that._success(res)
- }
+ var that = this;
+ const time = moment().format('YYYY-MM-DD');
+ const idList = [this.data.ledger.ledgerSubTypeId];
+ this.setData({ loading: true });
+ ledgerservice.uploadNoLedger(
+ app.globalData.accessToken.userId,
+ time,
+ this.data.remark,
+ idList,
+ {
+ success(res) {
+ that.setData({ loading: false });
+ if (typeof that._success === 'function') {
+ that._success(res);
+ }
+ },
+ fail(err) {
+ that.setData({ loading: false });
+ // wx.showToast({
+ // title: '涓婁紶澶辫触',
+ // duration: 1000,
+ // icon: 'none',
+ // mask: true,
+ // })
+ },
},
- fail(err) {
- that.setData({loading: false})
- // wx.showToast({
- // title: '涓婁紶澶辫触',
- // duration: 1000,
- // icon: 'none',
- // mask: true,
- // })
- },
- })
- }
- }
-})
\ No newline at end of file
+ );
+ },
+ },
+});
diff --git a/pages/mLedger/behaviors/bUploadSelfPatrol.js b/pages/mLedger/behaviors/bUploadSelfPatrol.js
new file mode 100644
index 0000000..43200ed
--- /dev/null
+++ b/pages/mLedger/behaviors/bUploadSelfPatrol.js
@@ -0,0 +1,79 @@
+import bUpload from '../../../base/behaviors/bUpload';
+import selfpatrolservice from '../../../service/selfpatrolservice';
+import bLoadingStatus from '../../../base/behaviors/bLoadingStatus';
+import moment from '../../../utils/moment.min';
+
+const app = getApp();
+
+/**
+ * 鑷贰鏌ヤ笂浼犵鐞�
+ */
+module.exports = Behavior({
+ behaviors: [bUpload, bLoadingStatus],
+ data: {
+ ledger: {},
+ remark: '',
+ },
+ methods: {
+ _uploadSelfPatrol() {
+ if (this.data.imgFiles.length == 0) return;
+
+ var that = this;
+ let path = [];
+ this.data.imgFiles.forEach(f => {
+ path.push(f.url);
+ });
+ const { ledger, taskId } = this.data;
+ ledger.remark1 = this.data.remark;
+ if (this.data.detail) {
+ ledger.id = this.data.detail.id
+ }
+
+ this.setData({ loading: true });
+ selfpatrolservice.uploadSelfPatrol(
+ app.globalData.accessToken.userId,
+ taskId,
+ ledger,
+ path,
+ {
+ success(res) {
+ that.setData({ loading: false });
+ if (typeof that._success === 'function') {
+ that._success(res);
+ }
+ },
+ fail(err) {
+ that.setData({ loading: false });
+ },
+ complete(res) {},
+ },
+ );
+ },
+
+ _uploadNoSelfPatrol() {
+ var that = this;
+ const { taskId } = this.data;
+ const time = moment().format('YYYY-MM-DD');
+ const idList = [this.data.ledger.ledgerSubTypeId];
+ this.setData({ loading: true });
+ selfpatrolservice.uploadNoSelfPatrol(
+ app.globalData.accessToken.userId,
+ taskId,
+ time,
+ this.data.remark,
+ idList,
+ {
+ success(res) {
+ that.setData({ loading: false });
+ if (typeof that._success === 'function') {
+ that._success(res);
+ }
+ },
+ fail(err) {
+ that.setData({ loading: false });
+ },
+ },
+ );
+ },
+ },
+});
diff --git a/pages/mLedger/ledgerhistory/ledgerhistory.js b/pages/mLedger/ledgerhistory/ledgerhistory.js
index e667107..9ca6b32 100644
--- a/pages/mLedger/ledgerhistory/ledgerhistory.js
+++ b/pages/mLedger/ledgerhistory/ledgerhistory.js
@@ -150,7 +150,9 @@
});
res.forEach(r => {
let t = ledgerMap.get(r.ledgerType)
- t.ledgers.push(r)
+ if (t) {
+ t.ledgers.push(r)
+ }
});
let recordList = []
ledgerMap.forEach((e, key) => {
diff --git a/pages/mLedger/ledgerhistory/ledgerhistory.wxml b/pages/mLedger/ledgerhistory/ledgerhistory.wxml
index 2fa26ca..e888d78 100644
--- a/pages/mLedger/ledgerhistory/ledgerhistory.wxml
+++ b/pages/mLedger/ledgerhistory/ledgerhistory.wxml
@@ -4,26 +4,60 @@
<view class="page__hd">
<view class="flex-h">
<text class="title">鏌ョ湅璁板綍</text>
- <picker bindchange="bindYearChange" data-type="year" value="{{year}}" mode="date" fields="year" end="{{maxYear}}">
+ <picker
+ bindchange="bindYearChange"
+ data-type="year"
+ value="{{year}}"
+ mode="date"
+ fields="year"
+ end="{{maxYear}}"
+ >
<view class="fyui-selector">
{{year}}
- <mp-icon extClass="arrow-down" icon="arrow" color="black" size="{{12}}"></mp-icon>
+ <mp-icon
+ extClass="arrow-down"
+ icon="arrow"
+ color="black"
+ size="{{12}}"
+ ></mp-icon>
</view>
</picker>
</view>
<view class="horizal-list">
- <view class="{{selectedMonIndex == index ? 'tag_selected':'tag_unselected'}} {{item.hasData ? 'tag_has_data':''}}" wx:for="{{months}}" wx:key="month" bindtap="selectMonth" data-index="{{index}}">{{item.month}}鏈�</view>
+ <view
+ class="{{selectedMonIndex == index ? 'tag_selected':'tag_unselected'}} {{item.hasData ? 'tag_has_data':''}}"
+ wx:for="{{months}}"
+ wx:key="month"
+ bindtap="selectMonth"
+ data-index="{{index}}"
+ >{{item.month}}鏈�</view
+ >
</view>
</view>
<view class="page__bd" style="margin-top: {{marginTop}};">
<block wx:if="{{recordList.length > 0}}">
- <view wx:for="{{recordList}}" wx:key="index" wx:for-index="i1" class="fyui-panel">
+ <view
+ wx:for="{{recordList}}"
+ wx:key="index"
+ wx:for-index="i1"
+ class="fyui-panel"
+ >
<view class="flex-h">
<view class="ledger-type">{{item.ledgerType}}</view>
- <view class="ledger-type_2">({{item.ledgers.length}} / {{item.total}})</view>
+ <view class="ledger-type_2"
+ >({{item.ledgers.length}} / {{item.total}})</view
+ >
</view>
<view class="ledger-group">
- <view wx:for="{{item.ledgers}}" wx:for-item="ledger" wx:for-index="i2" wx:key="i2" class="ledger-group_item" bindtap="previewImage" data-index="{{i1}},{{i2}}">
+ <view
+ wx:for="{{item.ledgers}}"
+ wx:for-item="ledger"
+ wx:for-index="i2"
+ wx:key="i2"
+ class="ledger-group_item"
+ bindtap="previewImage"
+ data-index="{{i1}},{{i2}}"
+ >
<image class="" src="{{ledger.path1[0]}}" mode="aspectFill"></image>
<view>{{ledger.ledgerName}}</view>
</view>
@@ -33,4 +67,12 @@
<template wx:else is="nodataPage"></template>
</view>
</view>
-<my-gallery hide-on-click="{{true}}" show-delete="{{false}}" show="{{showPreview}}" img-urls="{{previewImageUrls}}" current="{{previewCurrent}}" title="{{ledgerTitle}}" remark="{{ledgerRemark}}"></my-gallery>
\ No newline at end of file
+<my-gallery
+ hide-on-click="{{true}}"
+ show-delete="{{false}}"
+ show="{{showPreview}}"
+ img-urls="{{previewImageUrls}}"
+ current="{{previewCurrent}}"
+ title="{{ledgerTitle}}"
+ remark="{{ledgerRemark}}"
+></my-gallery>
diff --git a/pages/mLedger/ledgerhome/ledgerhome.js b/pages/mLedger/ledgerhome/ledgerhome.js
index 2348115..a377ebb 100644
--- a/pages/mLedger/ledgerhome/ledgerhome.js
+++ b/pages/mLedger/ledgerhome/ledgerhome.js
@@ -1,10 +1,9 @@
// pages/mLedger/ledgerhome/ledgerhome.js
-const ledgerservice = require("../../../service/ledgerservice")
-const moment = require('../../../utils/moment.min')
-const app = getApp()
+const ledgerservice = require('../../../service/ledgerservice');
+const moment = require('../../../utils/moment.min');
+const app = getApp();
Page({
-
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
@@ -32,7 +31,7 @@
//瓒呮椂鎯呭喌
overtime: '',
//寤鸿
- suggestion: ''
+ suggestion: '',
},
//涓婃湀姹囨��
lastMonthInfo: {
@@ -42,7 +41,7 @@
finishedSelect: 0,
status: '',
overtime: '',
- suggestion: ''
+ suggestion: '',
},
//閫夐」鍗$浉鍏�
@@ -62,62 +61,67 @@
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad(options) {
- let now = moment()
- let limitTime = moment().date(this.DEADLINEDAY)
+ let now = moment();
+ let limitTime = moment().date(this.DEADLINEDAY);
//濡傛灉鏄柊娉ㄥ唽鐢ㄦ埛涓嶅埌涓�涓湀锛屽垯涓嶆彁閱掓湰鏈堟儏鍐碉紝鐩存帴鎻愰啋涓嬩釜鏈堢殑鎯呭喌
if (app.globalData.newUser) {
- limitTime.add(1, 'M')
+ limitTime.add(1, 'M');
}
- let deadline = limitTime.format(`MM-${this.DEADLINEDAY}`)
- let leftday = limitTime.diff(now, 'days')
- let thisMonth = now.format('YYYY-MM')
- let lastMonth = now.add(-1, 'M').format('YYYY-MM')
+ let deadline = limitTime.format(`MM-${this.DEADLINEDAY}`);
+ let leftday = limitTime.diff(now, 'days');
+ let thisMonth = now.format('YYYY-MM');
+ let lastMonth = now.add(-1, 'M').format('YYYY-MM');
this.setData({
deadline,
leftday,
thisMonth,
- lastMonth
- })
+ lastMonth,
+ });
- now = moment()
+ now = moment();
this.getLedgerType(now.format('YYYY-MM-DD'), r => {
this.setData({
tabList: r[0],
pageList: r[1],
- thisMonthInfo: r[2]
- })
- this.tabsHeight('.page0')
- }) //鏈湀
- this.getLedgerType(now.add(-1, 'M').format('YYYY-MM-DD'), r => {
- this.setData({
- lastMonthInfo: r[2]
- })
- }, true) //涓婃湀
+ thisMonthInfo: r[2],
+ });
+ this.tabsHeight('.page0');
+ }); //鏈湀
+ this.getLedgerType(
+ now.add(-1, 'M').format('YYYY-MM-DD'),
+ r => {
+ this.setData({
+ lastMonthInfo: r[2],
+ });
+ },
+ true,
+ ); //涓婃湀
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
*/
- onReady() {
-
- },
+ onReady() {},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
*/
- onShow() {
-
- },
+ onShow() {},
getLedgerType(time, success, lastMonth) {
- var that = this
+ var that = this;
// var time = moment().format('YYYY-MM-DD')
- ledgerservice.getLedgerSummary(app.globalData.accessToken.userId, app.globalData.userInfo.extension2, time, {
- success(res) {
- let r = that.parseLedgerType(res, lastMonth)
- success(r)
- }
- })
+ ledgerservice.getLedgerSummary(
+ app.globalData.accessToken.userId,
+ app.globalData.userInfo.extension2,
+ time,
+ {
+ success(res) {
+ let r = that.parseLedgerType(res, lastMonth);
+ success(r);
+ },
+ },
+ );
},
parseLedgerType(subtypes, lastMonth) {
@@ -128,147 +132,159 @@
finishedSelect: 0,
status: '',
overtime: '',
- suggestion: ''
- }
- let map = new Map()
+ suggestion: '',
+ };
+ let map = new Map();
subtypes.forEach(s => {
//鏈堝害缁熻
- if (s.needUpdate) {
- monthInfo.totalMust++
+ if (s.ledgerTypeId != -1 && s.needUpdate) {
+ monthInfo.totalMust++;
if (s.upLoad) {
- monthInfo.finishedMust++
+ monthInfo.finishedMust++;
}
} else {
- monthInfo.totalSelect++
+ monthInfo.totalSelect++;
if (s.upLoad) {
- monthInfo.finishedSelect++
+ monthInfo.finishedSelect++;
}
}
//閫夐」鍗�
if (s.upLoad) {
- s.tag = '/res/icons/round_check_fill.png'
- s.opacity = 0.7
+ s.tag = '/res/icons/round_check_fill.png';
+ s.opacity = 0.7;
} else if (s.ledgerFinished) {
- s.tag = '/res/icons/warning_yellow.png'
- s.opacity = 1
+ s.tag = '/res/icons/warning_yellow.png';
+ s.opacity = 1;
} else if (!s.needUpdate) {
- s.tag = '/res/icons/warning_selected.png'
- s.opacity = 0.8
+ s.tag = '/res/icons/warning_selected.png';
+ s.opacity = 0.8;
} else {
- s.tag = '/res/icons/warning_red.png'
- s.opacity = 1
+ s.tag = '/res/icons/warning_red.png';
+ s.opacity = 1;
}
if (!map.has(s.ledgerType)) {
- map.set(s.ledgerType, [])
+ map.set(s.ledgerType, []);
}
- map.get(s.ledgerType).push(s)
+ map.get(s.ledgerType).push(s);
});
//
if (monthInfo.finishedMust == 0) {
- monthInfo.status = '鏈彁浜�'
+ monthInfo.status = '鏈彁浜�';
if (lastMonth) {
- monthInfo.suggestion = '寤鸿锛氬綋鏈熷彴璐﹀畬鍏ㄦ湭鎻愪氦锛屼弗閲嶅奖鍝嶈瘎浼扮粨鏋滐紝鍚庣画璇锋敞鎰�'
+ monthInfo.suggestion =
+ '寤鸿锛氬綋鏈熷彴璐﹀畬鍏ㄦ湭鎻愪氦锛屼弗閲嶅奖鍝嶈瘎浼扮粨鏋滐紝鍚庣画璇锋敞鎰�';
} else {
- monthInfo.suggestion = '寤鸿锛氳灏藉揩鎻愪氦鍙拌处'
+ monthInfo.suggestion = '寤鸿锛氳灏藉揩鎻愪氦鍙拌处';
}
} else if (monthInfo.finishedMust < monthInfo.totalMust) {
- monthInfo.status = '閮ㄥ垎鎻愪氦'
+ monthInfo.status = '閮ㄥ垎鎻愪氦';
if (lastMonth) {
- monthInfo.suggestion = '寤鸿锛氬綋鏈熷彴璐﹂儴鍒嗘湭鎻愪氦锛屼細褰卞搷璇勪及缁撴灉锛屽悗缁灏介噺鎻愪氦鎵�鏈夊彴璐�'
+ monthInfo.suggestion =
+ '寤鸿锛氬綋鏈熷彴璐﹂儴鍒嗘湭鎻愪氦锛屼細褰卞搷璇勪及缁撴灉锛屽悗缁灏介噺鎻愪氦鎵�鏈夊彴璐�';
} else {
- monthInfo.suggestion = '寤鸿锛氬綋鍓嶅凡鎻愪氦閮ㄥ垎鍙拌处锛岃琛ュ叏鍓╀綑鍙拌处'
+ monthInfo.suggestion = '寤鸿锛氬綋鍓嶅凡鎻愪氦閮ㄥ垎鍙拌处锛岃琛ュ叏鍓╀綑鍙拌处';
}
} else {
- monthInfo.status = '宸叉彁浜�'
+ monthInfo.status = '宸叉彁浜�';
if (lastMonth) {
- monthInfo.suggestion = '褰撴湡鍙拌处宸插叏閮ㄦ彁浜わ紝璇蜂繚鎸�'
+ monthInfo.suggestion = '褰撴湡鍙拌处宸插叏閮ㄦ彁浜わ紝璇蜂繚鎸�';
} else {
- monthInfo.suggestion = '鏈湡鍙拌处宸插叏閮ㄦ彁浜�'
+ monthInfo.suggestion = '鏈湡鍙拌处宸插叏閮ㄦ彁浜�';
}
}
- monthInfo.overtime = moment().date() - this.DEADLINEDAY
- monthInfo.percent = Math.round(monthInfo.finishedMust / monthInfo.totalMust * 100)
+ monthInfo.overtime = moment().date() - this.DEADLINEDAY;
+ monthInfo.percent = Math.round(
+ (monthInfo.finishedMust / monthInfo.totalMust) * 100,
+ );
//閫夐」鍗�
- var t = []
- var p = []
+ var t = [];
+ var p = [];
for (let item of map) {
- let notUpload = 0
+ if (item[1][0].ledgerTypeId == -1) {
+ continue;
+ }
+ let notUpload = 0;
item[1].forEach(l => {
if (l.needUpdate && !l.upLoad) {
- notUpload++
+ notUpload++;
}
});
t.push({
name: item[0],
tag: notUpload,
- total: item[1].length
- })
- p.push(item[1])
+ total: item[1].length,
+ });
+ p.push(item[1]);
}
- return [t, p, monthInfo]
+ return [t, p, monthInfo];
},
gotoLedgerDetail(e) {
- var i = e.currentTarget.dataset.index.split(',')
- var indexGroup = [parseInt(i[0]), parseInt(i[1])]
- var ledger = this.data.pageList[indexGroup[0]][indexGroup[1]]
+ var i = e.currentTarget.dataset.index.split(',');
+ var indexGroup = [parseInt(i[0]), parseInt(i[1])];
+ var ledger = this.data.pageList[indexGroup[0]][indexGroup[1]];
- var that = this
+ var that = this;
wx.navigateTo({
url: '/pages/mLedger/ledgerupload/ledgerupload',
events: {
uploadOver: function (data) {
- let i = data.indexGroup
- let pageList = that.data.pageList
- pageList[i[0]][i[1]].upLoad = true
- pageList[i[0]][i[1]].tag = '/res/icons/round_check_fill.png'
- pageList[i[0]][i[1]].opacity = 0.7
+ let i = data.indexGroup;
+ let { pageList, tabList } = that.data;
+ tabList[i[0]].tag--;
+ pageList[i[0]][i[1]].upLoad = true;
+ pageList[i[0]][i[1]].tag = '/res/icons/round_check_fill.png';
+ pageList[i[0]][i[1]].opacity = 0.7;
that.setData({
- pageList
- })
- }
+ pageList,
+ tabList,
+ });
+ },
},
- success: (res) => {
+ success: res => {
// 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
res.eventChannel.emit('acceptDataFromOpenerPage', {
ledger: ledger,
- indexGroup: indexGroup
- })
+ indexGroup: indexGroup,
+ type: 0,
+ });
},
- })
+ });
},
- gotoHistory(){
- let tabList = this.data.tabList
+ gotoHistory() {
+ let tabList = this.data.tabList;
wx.navigateTo({
url: '/pages/mLedger/ledgerhistory/ledgerhistory',
- success: (res) => {
+ success: res => {
// 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
res.eventChannel.emit('acceptDataFromOpenerPage', {
tabList: tabList,
- })
+ });
},
- })
+ });
},
-
//璁$畻swiper楂樺害鏂规硶锛堝湪鍒囨崲鐨勬椂鍊欒皟鐢級
tabsHeight(element) {
let that = this;
let query = wx.createSelectorQuery(); //蹇呴』瑕佸厛鍒涘缓涓�涓煡璇�
- query.select(element).boundingClientRect(function (rect) {
- let pageheight = that.data.pageheight.split('px')[0]
- pageheight = parseInt(pageheight)
- if (rect.height > pageheight) {
- that.setData({
- pageheight: rect.height + 'px'
- });
- }
- }).exec();
+ query
+ .select(element)
+ .boundingClientRect(function (rect) {
+ let pageheight = that.data.pageheight.split('px')[0];
+ pageheight = parseInt(pageheight);
+ if (rect.height > pageheight) {
+ that.setData({
+ pageheight: rect.height + 'px',
+ });
+ }
+ })
+ .exec();
},
swichNav: function (e) {
var that = this;
@@ -277,8 +293,9 @@
} else {
that.setData({
currentTab: e.target.dataset.current,
- navScrollLeft: e.target.dataset.current >= 3 ? ((e.target.dataset.current) * 60) : 0 //鍒ゆ柇褰撳墠閫変腑鐨勪釜鏁版槸鍚︽槸绗�5涓�
- })
+ navScrollLeft:
+ e.target.dataset.current >= 3 ? e.target.dataset.current * 60 : 0, //鍒ゆ柇褰撳墠閫変腑鐨勪釜鏁版槸鍚︽槸绗�5涓�
+ });
// that.tabsHeight('.page' + e.target.dataset.current); //鏌ヨ鍝竴涓厓绱�
}
},
@@ -286,13 +303,13 @@
var that = this;
that.setData({
currentTab: e.detail.current,
- navScrollLeft: e.detail.current >= 3 ? ((e.detail.current) * 60) : 0 //鍒ゆ柇褰撳墠閫変腑鐨勪釜鏁版槸鍚︽槸绗�5涓�
+ navScrollLeft: e.detail.current >= 3 ? e.detail.current * 60 : 0, //鍒ゆ柇褰撳墠閫変腑鐨勪釜鏁版槸鍚︽槸绗�5涓�
});
- that.tabsHeight('.page' + e.detail.current); //鏌ヨ鍝竴涓厓绱�
+ that.tabsHeight('.page' + e.detail.current); //鏌ヨ鍝竴涓厓绱�
},
- changeMonth(){
- let showThisMonth = !this.data.showThisMonth
- this.setData({showThisMonth})
- }
-})
\ No newline at end of file
+ changeMonth() {
+ let showThisMonth = !this.data.showThisMonth;
+ this.setData({ showThisMonth });
+ },
+});
diff --git a/pages/mLedger/ledgerhome/ledgerhome.wxml b/pages/mLedger/ledgerhome/ledgerhome.wxml
index 9613cf8..3916f91 100644
--- a/pages/mLedger/ledgerhome/ledgerhome.wxml
+++ b/pages/mLedger/ledgerhome/ledgerhome.wxml
@@ -4,48 +4,82 @@
<view class="page__hd">
<!-- <view class="fyui-panel"> -->
<view class="head_right" bindtap="changeMonth">
- <text class="head_tag">{{showThisMonth ? thisMonth + '鏈湀' : lastMonth + '涓婃湀'}}姹囨��</text>
- <mp-icon style="margin-left: 4px;" icon="transfer2" color="white" size="{{20}}"></mp-icon>
+ <text class="head_tag"
+ >{{showThisMonth ? thisMonth + '鏈湀' : lastMonth + '涓婃湀'}}姹囨��</text
+ >
+ <mp-icon
+ style="margin-left: 4px"
+ icon="transfer2"
+ color="white"
+ size="{{20}}"
+ ></mp-icon>
</view>
<view class="card">
<block wx:if="{{showThisMonth}}">
<view class="head_row">
<view class="head_row_item">
<view class="head_tag">瀹屾垚搴�</view>
- <view class="head_1 head_1_big">{{thisMonthInfo.percent}}<text class="head_row_item_tag">%</text></view>
+ <view class="head_1 head_1_big"
+ >{{thisMonthInfo.percent}}<text class="head_row_item_tag"
+ >%</text
+ ></view
+ >
</view>
<view class="head_row_item">
<view class="head_tag">蹇呭~椤�</view>
- <view class="head_1">{{thisMonthInfo.finishedMust}}<text class="head_row_item_tag">/{{thisMonthInfo.totalMust}}</text></view>
+ <view class="head_1"
+ >{{thisMonthInfo.finishedMust}}<text class="head_row_item_tag"
+ >/{{thisMonthInfo.totalMust}}</text
+ ></view
+ >
</view>
<view class="head_row_item">
<view class="head_tag">閫夊~椤�</view>
- <view class="head_1">{{thisMonthInfo.finishedSelect}}<text class="head_row_item_tag">/{{thisMonthInfo.totalSelect}}</text></view>
+ <view class="head_1"
+ >{{thisMonthInfo.finishedSelect}}<text class="head_row_item_tag"
+ >/{{thisMonthInfo.totalSelect}}</text
+ ></view
+ >
</view>
</view>
<view class="head_row">
<view class="head_tag">鏈湡鍙拌处鎻愪氦鏃ワ細{{deadline}}</view>
<block wx:if="{{thisMonthInfo.percent < 1}}">
- <view wx:if="{{leftday > 0}}" class="head_tag">鍓╀綑<text>{{leftday}}</text>澶�</view>
- <view wx:else class="head_tag">閫炬湡 <text>{{thisMonthInfo.overtime}}</text>澶�</view>
+ <view wx:if="{{leftday > 0}}" class="head_tag"
+ >鍓╀綑<text>{{leftday}}</text>澶�</view
+ >
+ <view wx:else class="head_tag"
+ >閫炬湡 <text>{{thisMonthInfo.overtime}}</text>澶�</view
+ >
</block>
</view>
<view class="head_tag">{{thisMonthInfo.suggestion}}</view>
-
</block>
<block wx:else>
<view class="head_row">
<view class="head_row_item">
<view class="head_tag">瀹屾垚搴�</view>
- <view class="head_1">{{lastMonthInfo.percent}}<text class="head_row_item_tag">%</text></view>
+ <view class="head_1"
+ >{{lastMonthInfo.percent}}<text class="head_row_item_tag"
+ >%</text
+ ></view
+ >
</view>
<view class="head_row_item">
<view class="head_tag">蹇呭~椤�</view>
- <view class="head_1">{{lastMonthInfo.finishedMust}}<text class="head_row_item_tag">/{{lastMonthInfo.totalMust}}</text></view>
+ <view class="head_1"
+ >{{lastMonthInfo.finishedMust}}<text class="head_row_item_tag"
+ >/{{lastMonthInfo.totalMust}}</text
+ ></view
+ >
</view>
<view class="head_row_item">
<view class="head_tag">閫夊~椤�</view>
- <view class="head_1">{{lastMonthInfo.finishedSelect}}<text class="head_row_item_tag">/{{lastMonthInfo.totalSelect}}</text></view>
+ <view class="head_1"
+ >{{lastMonthInfo.finishedSelect}}<text class="head_row_item_tag"
+ >/{{lastMonthInfo.totalSelect}}</text
+ ></view
+ >
</view>
</view>
<view class="head_row">
@@ -61,27 +95,64 @@
<!-- </view> -->
<view class="page__bd">
<view class="swiper-tab">
- <scroll-view class="swiper-tab_view" scroll-into-view="item{{currentTab}}" scroll-x="true" show-scrollbar="true" scroll-with-animation="true">
+ <scroll-view
+ class="swiper-tab_view"
+ scroll-into-view="item{{currentTab}}"
+ scroll-x="true"
+ show-scrollbar="true"
+ scroll-with-animation="true"
+ >
<block wx:for="{{tabList}}" wx:key="i">
- <view id="item{{index}}" class="swiper-tab-list {{currentTab==index ? 'on' : ''}}" data-current="{{index}}" bindtap="swichNav">
+ <view
+ id="item{{index}}"
+ class="swiper-tab-list {{currentTab==index ? 'on' : ''}}"
+ data-current="{{index}}"
+ bindtap="swichNav"
+ >
{{item.name}}
- <text wx:if="{{item.tag > 0}}" class="swiper-tab-list__tag">{{item.tag}}</text>
+ <text wx:if="{{item.tag > 0}}" class="swiper-tab-list__tag"
+ >{{item.tag}}</text
+ >
</view>
</block>
</scroll-view>
</view>
- <swiper current="{{currentTab}}" class="swiper-box" duration="300" bindchange="bindChange" style="height: {{pageheight}};">
- <block wx:for="{{pageList}}" wx:for-item="page" wx:key="n" wx:for-index="i1">
+ <swiper
+ current="{{currentTab}}"
+ class="swiper-box"
+ duration="300"
+ bindchange="bindChange"
+ style="height: {{pageheight}};"
+ >
+ <block
+ wx:for="{{pageList}}"
+ wx:for-item="page"
+ wx:key="n"
+ wx:for-index="i1"
+ >
<swiper-item>
<view class="ledger-group page{{i1}}">
- <view wx:for="{{page}}" wx:for-item="ledger" wx:key="t" class="ledger-item" wx:for-index="i2" data-index="{{i1}},{{i2}}" bindtap="gotoLedgerDetail" style="opacity: {{ledger.opacity}};">
- <image class="ledger-tag" src="{{ledger.tag}}" mode="aspectFit"></image>
+ <view
+ wx:for="{{page}}"
+ wx:for-item="ledger"
+ wx:key="t"
+ class="ledger-item"
+ wx:for-index="i2"
+ data-index="{{i1}},{{i2}}"
+ bindtap="gotoLedgerDetail"
+ style="opacity: {{ledger.opacity}};"
+ >
+ <image
+ class="ledger-tag"
+ src="{{ledger.tag}}"
+ mode="aspectFit"
+ ></image>
<image class="ledger-icon" src="{{ledger.iconUrl}}"></image>
- <view>{{ledger.ledgerName}}</view>
+ <view style="padding: 0 10px;">{{ledger.ledgerName}}</view>
</view>
</view>
</swiper-item>
</block>
</swiper>
</view>
-</view>
\ No newline at end of file
+</view>
diff --git a/pages/mLedger/ledgerupload/ledgerupload.js b/pages/mLedger/ledgerupload/ledgerupload.js
index 7257283..2544bb5 100644
--- a/pages/mLedger/ledgerupload/ledgerupload.js
+++ b/pages/mLedger/ledgerupload/ledgerupload.js
@@ -1,75 +1,113 @@
// pages/mLedger/ledgerupload/ledgerupload.js
-import bUploadLedger from '../behaviors/bUploadLedger'
-import ledgerservice from "../../../service/ledgerservice"
-import moment from '../../../utils/moment.min'
-import bLoadingToast from '../../../base/behaviors/bLoadingToast'
+import bUploadLedger from '../behaviors/bUploadLedger';
+import bUploadSelfPatrol from '../behaviors/bUploadSelfPatrol';
+import ledgerservice from '../../../service/ledgerservice';
+import selfpatrolservice from '../../../service/selfpatrolservice';
+import moment from '../../../utils/moment.min';
+import bLoadingToast from '../../../base/behaviors/bLoadingToast';
-const app = getApp()
+const app = getApp();
Page({
- behaviors: [bUploadLedger, bLoadingToast],
+ behaviors: [bUploadLedger, bLoadingToast, bUploadSelfPatrol],
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ barTitle: '涓婁紶鍙拌处',
imgFiles: [],
remark: '',
remarkDisable: false,
- previewImageUrls:[],
+ previewImageUrls: [],
previewCurrent: 0,
showPreview: false,
uploadMode: 0,
},
-
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad(options) {
- var that = this
- this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function(data) {
- that.setData({
- ledger: data.ledger,
- indexGroup: data.indexGroup
- })
- if (data.barTitle) {
+ var that = this;
+ this.getOpenerEventChannel().on(
+ 'acceptDataFromOpenerPage',
+ function (data) {
+ data.ledger.description = data.ledger.description.replaceAll(
+ '\\n',
+ '\n',
+ );
+ that.setData({
+ ledger: data.ledger,
+ indexGroup: data.indexGroup,
+ type: data.type,
+ taskId: data.taskId,
+ reUpload: data.reUpload,
+ detail: data.detail,
+ });
+ if (data.barTitle) {
+ that.data.barTitle = data.barTitle;
+ }
wx.setNavigationBarTitle({
- title: data.barTitle,
- })
- }
+ title: that.data.barTitle,
+ });
- that.checkStatus()
- })
+ that.checkStatus();
+ },
+ );
},
+ /**
+ * 鍒ゆ柇褰撳墠鍙拌处鐘舵�侊紝濡傛灉鏈変笂浼犺褰曞垯鏄剧ず璁板綍
+ */
checkStatus() {
- if (this.data.ledger.path1) {
- let imgFiles = this.data.ledger.path1
- let remark = this.data.ledger.remark1 == null ? '' : this.data.ledger.remark1
- let remarkDisable = true
- this.setData({imgFiles, remark, remarkDisable})
- }else if (this.data.ledger.upLoad) {
- var that = this
- var userId = app.globalData.accessToken.userId
- var typeId = this.data.ledger.ledgerSubTypeId
- var sceneType = app.globalData.userInfo.extension2
- var time = moment().format('YYYY-MM-DD')
- ledgerservice.getLedgerDetail(userId, typeId, sceneType, time, {
- success (res) {
- if (res.length > 0) {
- let detail = res[0]
- if (detail.upLoad) {
- let imgFiles = detail.path1
- let remark = detail.remark1 == null ? '' : detail.remark1
- let remarkDisable = true
- that.setData({imgFiles, remark, remarkDisable})
+ if (this.data.reUpload) {
+ //do nothing
+ return;
+ } else if (this.data.ledger.path1) {
+ let imgFiles = this.data.ledger.path1;
+ let remark = this.data.remark;
+ if (this.data.ledger.remark1) remark = this.data.ledger.remark1;
+ let remarkDisable = true;
+ this.setData({ imgFiles, remark, remarkDisable });
+ } else if (this.data.ledger.upLoad) {
+ var that = this;
+ var userId = app.globalData.accessToken.userId;
+ var typeId = this.data.ledger.ledgerSubTypeId;
+ var taskId = this.data.taskId;
+ var sceneType = app.globalData.userInfo.extension2;
+ var time = moment().format('YYYY-MM-DD');
+ if (this.data.type == 0) {
+ ledgerservice.getLedgerDetail(userId, typeId, sceneType, time, {
+ success(res) {
+ if (res.length > 0) {
+ let detail = res[0];
+ if (detail.upLoad) {
+ let imgFiles = detail.path1;
+ let remark = detail.remark1 ? detail.remark1 : '';
+ let remarkDisable = true;
+ that.setData({ imgFiles, remark, remarkDisable, detail });
+ }
}
- }
- }
- })
+ },
+ });
+ } else {
+ selfpatrolservice.getSelfPatrolDetail(userId, typeId, taskId, {
+ success(res) {
+ if (res.success) {
+ let detail = res.data;
+ if (detail.upLoad) {
+ let imgFiles = detail.path1;
+ let remark = detail.remark1 ? detail.remark1 : '';
+ let remarkDisable = true;
+ that.setData({ imgFiles, remark, remarkDisable, detail });
+ }
+ }
+ },
+ });
+ }
}
},
@@ -79,12 +117,12 @@
wx.showToast({
title: '璇疯嚦灏戦�夋嫨涓�寮犲浘鐗�',
icon: 'none',
- })
+ });
} else {
this.setData({
showDialog: true,
- uploadMode: 0
- })
+ uploadMode: 0,
+ });
}
},
@@ -92,42 +130,75 @@
onSubmitNoLedger() {
this.setData({
showDialog: true,
- uploadMode: 1
- })
+ uploadMode: 1,
+ });
},
//鎻愪氦鍙拌处
submitLedger() {
this.setData({
showDialog: false,
- })
- if (this.uploadMode == 0) {
- this._uploadLedger()
+ });
+ if (this.data.uploadMode == 0) {
+ if (this.data.type == 0) {
+ this._uploadLedger();
+ } else {
+ this._uploadSelfPatrol();
+ }
} else {
- this._uploadNoLedger()
+ if (this.data.type == 0) {
+ this._uploadNoLedger();
+ } else {
+ this._uploadNoSelfPatrol();
+ }
}
+ },
+
+ reUpload() {
+ wx.navigateTo({
+ url: '/pages/mLedger/ledgerupload/ledgerupload',
+ success: res => {
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
+ ledger: this.data.ledger,
+ detail: this.data.detail,
+ type: this.data.type,
+ indexGroup: this.data.indexGroup,
+ taskId: this.data.taskId,
+ barTitle: `閲嶆柊${this.data.barTitle}`,
+ reUpload: true,
+ });
+ },
+ events: {
+ uploadOver: data => {
+ this.checkStatus();
+ },
+ },
+ });
},
//鍙拌处鎻愪氦鎴愬姛鍚�
_success(res) {
this.getOpenerEventChannel().emit('uploadOver', {
- indexGroup: this.data.indexGroup
- })
+ indexGroup: this.data.indexGroup,
+ });
wx.navigateBack({
delta: 1,
- })
+ });
},
//鍥剧墖鏀惧ぇ棰勮
previewImage(e) {
- const {
- index
- } = e.currentTarget.dataset;
+ const { index } = e.currentTarget.dataset;
const previewImageUrls = this.data.imgFiles;
this.setData({
previewImageUrls,
previewCurrent: index,
- showPreview: true
+ showPreview: true,
});
},
-})
\ No newline at end of file
+
+ onRemarkChange(e) {
+ const { value } = e.detail;
+ this.setData({ remark: value });
+ },
+});
diff --git a/pages/mLedger/ledgerupload/ledgerupload.json b/pages/mLedger/ledgerupload/ledgerupload.json
index 16f6fbb..761e0e2 100644
--- a/pages/mLedger/ledgerupload/ledgerupload.json
+++ b/pages/mLedger/ledgerupload/ledgerupload.json
@@ -5,6 +5,7 @@
"usingComponents": {
"mp-upload":"/component/uploader/uploader",
"c-dialog": "/component/commondialog/commondialog",
- "mp-gallery": "/component/gallery/gallery"
+ "mp-gallery": "/component/gallery/gallery",
+ "mp-icon": "/component/icon/icon"
}
}
\ No newline at end of file
diff --git a/pages/mLedger/ledgerupload/ledgerupload.wxml b/pages/mLedger/ledgerupload/ledgerupload.wxml
index 912a2d7..4806945 100644
--- a/pages/mLedger/ledgerupload/ledgerupload.wxml
+++ b/pages/mLedger/ledgerupload/ledgerupload.wxml
@@ -1,27 +1,91 @@
<!--pages/mLedger/ledgerupload/ledgerupload.wxml-->
<view class="page">
<view class="page__hd">
- {{ledger.ledgerName}}
+ <view> {{ledger.ledgerName}} </view>
</view>
<view class="page__bd">
- <textarea disabled="{{remarkDisable}}" value="{{remark}}" class="text-area" name="des" cols="30" rows="10" placeholder="鍙�夊垯杈撳叆鍙拌处澶囨敞"></textarea>
- <view wx:if="{{!ledger.upLoad}}" class="weui-upload-view">
- <mp-upload title="涓婁紶鍙拌处鍥剧墖" titleClass="upload-title-class" max-count="6" files="{{imgFiles}}"
- binduploadImg="uploadFile" binddelete="delImg"></mp-upload>
- </view>
- <view wx:else class="img-group">
- <view wx:for="{{imgFiles}}" wx:key="index">
- <image class="img-group_img" src="{{item}}" mode="aspectFill" bindtap="previewImage" data-index="{{index}}"></image>
+ <view wx:if="{{ledger.description}}" class="ledger-des">
+ <view style="display: flex; align-items: center; height: 20px;margin-bottom: 10px;">
+ <mp-icon icon="info" color="" size="{{16}}"></mp-icon>
+ <text>{{ledger.ledgerTypeId == -1 ? '鎿嶄綔鎻愮ず' : '鍙拌处鎻愮ず'}}</text>
</view>
+ <text>{{ledger.description}}</text>
</view>
+ <view
+ wx:if="{{!ledger.upLoad || reUpload}}"
+ class="weui-upload-view"
+ style="margin-top: 16px"
+ >
+ <mp-upload
+ title="涓婁紶鍥剧墖锛堝繀濉級"
+ titleClass="upload-title-class"
+ max-count="6"
+ files="{{imgFiles}}"
+ binduploadImg="uploadFile"
+ binddelete="delImg"
+ ></mp-upload>
+ <textarea
+ disabled="{{remarkDisable}}"
+ value="{{remark}}"
+ class="text-area"
+ auto-height="{{false}}"
+ name="des"
+ placeholder="娣诲姞澶囨敞锛堥�夊~锛�"
+ bindinput="onRemarkChange"
+ ></textarea>
+ </view>
+ <block wx:else>
+ <view style="font-size: 14px; margin-top: 16px">鍥剧墖</view>
+ <view class="img-group">
+ <image
+ wx:for="{{imgFiles}}"
+ wx:key="index"
+ class="img-group_img"
+ src="{{item}}"
+ mode="aspectFill"
+ bindtap="previewImage"
+ data-index="{{index}}"
+ ></image>
+ </view>
+ <view style="font-size: 14px; margin-top: 16px">澶囨敞</view>
+ <textarea
+ class="text-area text-area-read"
+ placeholder="鏃犲娉�"
+ value="{{remark}}"
+ ></textarea>
+ </block>
</view>
- <view class="page__ft">
- <view wx:if="{{!ledger.upLoad}}" class="submit" bindtap="onSubmit">鎻愪氦</view>
- <view wx:if="{{!ledger.upLoad && ledger.ledgerTypeId != -1}}" class="submit submit-2" bindtap="onSubmitNoLedger">涓嶆秹鍙婅绫诲彴璐�</view>
+ <view wx:if="{{!ledger.upLoad || reUpload}}" class="page__ft">
+ <view
+ wx:if="{{ledger.notRelated}}"
+ class="submit submit-2 left"
+ bindtap="onSubmitNoLedger"
+ >涓嶆秹鍙�</view
+ >
+ <view class="submit right" bindtap="onSubmit">鎻愪氦</view>
+ </view>
+ <view wx:else class="page__ft">
+ <!-- <view
+ wx:if="{{ledger.notRelated}}"
+ class="submit submit-2 left"
+ bindtap=""
+ >淇敼</view
+ > -->
+ <view class="submit right" bindtap="reUpload">閲嶆柊涓婁紶</view>
</view>
<c-dialog show="{{showDialog}}" yes="纭" bindconfirm="submitLedger">
- <view>{{uploadMode == 0 ? '纭鏄惁鎻愪氦鍙拌处锛�' : '纭鏈湀璇ュ彴璐︿笉娑夊強锛�'}}</view>
+ <view
+ >{{uploadMode == 0 ? '纭鏄惁鎻愪氦锛�' :
+ '纭涓嶆秹鍙婏紵'}}</view
+ >
</c-dialog>
- <mp-gallery class="gallery" hide-on-click="{{true}}" show-delete="{{false}}" show="{{showPreview}}" img-urls="{{previewImageUrls}}" current="{{previewCurrent}}"></mp-gallery>
-</view>
\ No newline at end of file
+ <mp-gallery
+ class="gallery"
+ hide-on-click="{{true}}"
+ show-delete="{{false}}"
+ show="{{showPreview}}"
+ img-urls="{{previewImageUrls}}"
+ current="{{previewCurrent}}"
+ ></mp-gallery>
+</view>
diff --git a/pages/mLedger/ledgerupload/ledgerupload.wxss b/pages/mLedger/ledgerupload/ledgerupload.wxss
index 733c06b..c1b3c52 100644
--- a/pages/mLedger/ledgerupload/ledgerupload.wxss
+++ b/pages/mLedger/ledgerupload/ledgerupload.wxss
@@ -9,6 +9,26 @@
.page__bd {
padding: 10px;
+ padding-bottom: 100px;
+}
+
+.page__ft {
+ box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.06);
+ position: fixed;
+ bottom: 0;
+ width: 100%;
+ padding-top: 0;
+ display: flex;
+ align-items: flex-end;
+ z-index: 1;
+}
+
+.page__ft .left {
+ flex: 1;
+}
+
+.page__ft .right {
+ flex: 2;
}
.upload-title-class {
@@ -16,8 +36,19 @@
}
.text-area {
- background-color: rgba(255, 255, 255, 0.185);
- width: 100%;
+ margin-top: 8px;
+ border: 1px solid rgba(173, 173, 173, 0.432);
+ border-radius: 4px;
+ width: 94%;
+ height: 80px;
+ font-size: 12px;
+ padding: 8px 4px;
+}
+
+.text-area-read {
+ /* border: 0px solid rgba(173, 173, 173, 0.432); */
+ /* height: initial; */
+ color: var(--fyui-text-color_2);
}
.img-group {
@@ -26,20 +57,32 @@
}
.img-group>view {
- width: 30vw;
+ width: 10vw;
text-align: center;
}
.img-group .img-group_img {
width: 29vw;
height: 29vw;
+ margin-bottom: 8px;
+ margin-right: 8px;
}
.submit-2 {
- background: var(--fyui-BG_1);
- color: var(--fyui-primary-color);
+ background: white;
+ border: 1px solid var(--fyui-btn-color_1);
+ color: var(--fyui-btn-color_1);
+ padding: 7px 0;
}
.submit-2:active {
background: #dfdfdf;
+}
+
+.ledger-des {
+ font-size: 12px;
+ color: var(--fyui-text-color_2);
+ background-color: var(--fyui-BG_1);
+ padding: 4px;
+ border-radius: 4px;
}
\ No newline at end of file
diff --git a/pages/mNotice/notice/notice.js b/pages/mNotice/notice/notice.js
index 32cc542..2d66107 100644
--- a/pages/mNotice/notice/notice.js
+++ b/pages/mNotice/notice/notice.js
@@ -1,42 +1,47 @@
// pages/notice/notice.js
-const notificationservice = require("../../../service/notificationservice")
-const moment = require('../../../utils/moment.min')
-const util = require("../../../utils/util.js")
-const app = getApp()
+const notificationservice = require('../../../service/notificationservice');
+const moment = require('../../../utils/moment.min');
+const util = require('../../../utils/util.js');
+const app = getApp();
Page({
-
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
currentTab: 0,
- tabList: [{
- "name": "宸ヤ綔閫氱煡"
+ tabList: [
+ {
+ name: '宸ヤ綔閫氱煡',
},
{
- "name": "棰勮璀︾ず"
+ name: '椋庨櫓棰勮',
},
{
- "name": "绯荤粺閫氱煡"
- }
+ name: '绯荤粺閫氱煡',
+ },
],
- pageList: [
- [],
- [],
- []
- ]
+ unReadList: [0, 0, 0],
+ pageList: [[], [], []],
+
+ showNoticeDetail: false,
+ showTitle: '',
+ showContent: '',
+ confirmBtn: { content: '鐭ラ亾浜�', variant: 'base' },
},
//璁$畻swiper楂樺害鏂规硶锛堝湪鍒囨崲鐨勬椂鍊欒皟鐢級
tabsHeight(element) {
let that = this;
let query = wx.createSelectorQuery(); //蹇呴』瑕佸厛鍒涘缓涓�涓煡璇�
- query.select(element).boundingClientRect(function (rect) {
- that.setData({
- pageheight: rect.height + 'px'
- });
- }).exec();
+ query
+ .select(element)
+ .boundingClientRect(function (rect) {
+ that.setData({
+ pageheight: rect.height + 'px',
+ });
+ })
+ .exec();
},
swichNav: function (e) {
var that = this;
@@ -45,16 +50,17 @@
} else {
that.setData({
currentTab: e.target.dataset.current,
- navScrollLeft: e.target.dataset.current >= 4 ? ((e.target.dataset.current) * 60) : 0 //鍒ゆ柇褰撳墠閫変腑鐨勪釜鏁版槸鍚︽槸绗�5涓�
- })
- that.tabsHeight('.page'+e.target.dataset.current); //鏌ヨ鍝竴涓厓绱�
+ navScrollLeft:
+ e.target.dataset.current >= 4 ? e.target.dataset.current * 60 : 0, //鍒ゆ柇褰撳墠閫変腑鐨勪釜鏁版槸鍚︽槸绗�5涓�
+ });
+ that.tabsHeight('.page' + e.target.dataset.current); //鏌ヨ鍝竴涓厓绱�
}
},
bindChange: function (e) {
var that = this;
that.setData({
currentTab: e.detail.current,
- navScrollLeft: e.detail.current >= 4 ? ((e.detail.current) * 60) : 0 //鍒ゆ柇褰撳墠閫変腑鐨勪釜鏁版槸鍚︽槸绗�5涓�
+ navScrollLeft: e.detail.current >= 4 ? e.detail.current * 60 : 0, //鍒ゆ柇褰撳墠閫変腑鐨勪釜鏁版槸鍚︽槸绗�5涓�
});
// that.tabsHeight('.page'+e.target.dataset.current); //鏌ヨ鍝竴涓厓绱�
},
@@ -64,36 +70,91 @@
*/
onLoad: function (options) {
this.tabsHeight('.page0');
- this.getNotice()
+ this.getNotice();
},
- onReachBottom () {
+ onReachBottom() {
if (this.cPage && this.tPage) {
if (this.cPage < this.tPage) {
- this.getNotice(this.cPage + 1)
+ this.getNotice(this.cPage + 1);
}
}
},
getNotice(cPage = 1) {
- var that = this
- notificationservice.getNotification(app.globalData.accessToken.userId, cPage, {
- onHead(header) {
- that.cPage = parseInt(header.currentPage)
- that.tPage = parseInt(header.totalPage)
- console.log(`cPage:${that.cPage}, tPage:${that.tPage}`);
+ var that = this;
+ notificationservice.getNotification(
+ app.globalData.accessToken.userId,
+ cPage,
+ {
+ onHead(header) {
+ that.cPage = parseInt(header.currentPage);
+ that.tPage = parseInt(header.totalPage);
+ console.log(`cPage:${that.cPage}, tPage:${that.tPage}`);
+ },
+ success(res) {
+ const { pageList, unReadList } = that.data;
+ res.forEach(r => {
+ r.updateTime = moment(r.updateTime).format('YYYY骞碝M鏈圖D鏃�');
+ switch (r.typeId) {
+ // 绯荤粺閫氱煡
+ case '1':
+ if (!r.hasRead) unReadList[2]++;
+ pageList[2].push(r);
+ break;
+ // 宸ヤ綔閫氱煡
+ case '2':
+ if (!r.hasRead) unReadList[0]++;
+ pageList[0].push(r);
+ break;
+ // 棰勮璀︾ず
+ case '3':
+ if (!r.hasRead) unReadList[1]++;
+ pageList[1].push(r);
+ break;
+ default:
+ if (!r.hasRead) unReadList[2]++;
+ pageList[2].push(r);
+ break;
+ }
+ });
+ that.setData({ pageList, unReadList });
+ that.tabsHeight('.page0'); //鍒锋柊楂樺害
+ },
},
- success(res) {
- res.forEach(r => {
- r.updateTime = moment(r.updateTime).format('YYYY骞碝M鏈圖D鏃�')
- });
- let notices = that.data.pageList[0].concat(res)
- that.setData({
- ['pageList[0]']: notices
- })
-
- that.tabsHeight('.page0'); //鍒锋柊楂樺害
- }
- }, 5)
+ 30,
+ );
},
-})
\ No newline at end of file
+
+ showDialog(e) {
+ const { index } = e.currentTarget.dataset;
+ const notice = this.data.pageList[index[0]][index[1]];
+ this.setData({
+ showNoticeDetail: true,
+ showTitle: notice.title,
+ showContent: notice.content,
+ });
+ if (!notice.hasRead) {
+ var that = this;
+ const { unReadList } = this.data;
+ notificationservice.updateReadState(
+ app.globalData.accessToken.userId,
+ [{ noticeId: notice.id, hasRead: true, hasSigned: true }],
+ {
+ success() {
+ notice.hasRead = true;
+ unReadList[index[0]]--;
+ that.setData({
+ [`pageList[${index[0]}][${index[1]}]`]: notice,
+ unReadList,
+ });
+ },
+ },
+ );
+ }
+ },
+
+ closeDialog() {
+ this.setData({ showNoticeDetail: false });
+ },
+});
diff --git a/pages/mNotice/notice/notice.wxml b/pages/mNotice/notice/notice.wxml
index 0753be8..2812442 100644
--- a/pages/mNotice/notice/notice.wxml
+++ b/pages/mNotice/notice/notice.wxml
@@ -3,34 +3,60 @@
<view class="page">
<view class="swiper-tab">
- <scroll-view scroll-left="{{navScrollLeft}}" scroll-x="true" show-scrollbar="false" scroll-with-animation="true">
+ <scroll-view
+ scroll-left="{{navScrollLeft}}"
+ scroll-x="true"
+ show-scrollbar="false"
+ scroll-with-animation="true"
+ >
<block wx:for="{{tabList}}" wx:key="i">
- <view class="swiper-tab-list {{currentTab==index ? 'on' : ''}}" data-current="{{index}}" bindtap="swichNav">{{item.name}}</view>
+ <view
+ class="swiper-tab-list {{currentTab==index ? 'on' : ''}}"
+ data-current="{{index}}"
+ bindtap="swichNav"
+ >{{item.name}}
+ <view class="badge" wx:if="{{unReadList[index] > 0}}">{{unReadList[index]}}</view>
+ </view>
</block>
</scroll-view>
</view>
- <swiper current="{{currentTab}}" class="swiper-box" duration="300" bindchange="bindChange" style="height: {{pageheight}};">
- <block wx:for="{{pageList}}" wx:for-item="page" wx:key="n">
+ <swiper
+ current="{{currentTab}}"
+ class="swiper-box"
+ duration="300"
+ bindchange="bindChange"
+ style="height: {{pageheight}};"
+ >
+ <block wx:for="{{pageList}}" wx:for-item="page" wx:key="index">
<swiper-item>
<view class="page{{index}}">
<block wx:if="{{page.length > 0}}">
- <view wx:for="{{page}}" wx:for-item="notice" wx:key="index">
- <view class="fyui-box fyui-box__text">
+ <view wx:for="{{page}}" wx:for-item="notice" wx:for-index="index2" wx:key="index2">
+ <view class="fyui-box fyui-box__text" data-index="{{[index, index2]}}" bindtap="showDialog">
+ <view
+ class="{{notice.hasRead ? 'notice-read' : 'notice-not-read'}}"
+ ></view>
<view class="fyui-box__hd">
- <image src="/res/icons/notice.png" class=""></image>
+ <!-- <image src="/res/icons/notice.png" class=""></image> -->
<view class="title">
- <view>宸ヤ綔閫氱煡</view>
- <text>{{notice.updateTime}}</text>
+ <view class="limit-line">{{notice.title}}</view>
</view>
</view>
<view class="fyui-box__bd">
<!-- <view class="fyui-box__content tag">鐩稿叧琛屼笟 -> {{item.fileIndustry}}</view> -->
- <text class="fyui-box__content des">{{notice.content}}</text>
+ <view class="fyui-box__content des limit-line">{{notice.content}}</view>
+ <view class="right-time">{{notice.updateTime}}</view>
</view>
- <view class="fyui-box__ft">
+ <view class="fyui-box__ft" wx:if="{{notice.needSigned}}">
<!-- <text class="detail">鏌ョ湅璇︽儏 ></text> -->
- <button wx:if="{{notice.needSigned}}" class="sign" size="mini" type="{{notice.hasSigned ? 'default' : 'primary'}}" plain="{{notice.hasSigned}}" loading="">
+ <button
+ class="sign"
+ size="mini"
+ type="{{notice.hasSigned ? 'default' : 'primary'}}"
+ plain="{{notice.hasSigned}}"
+ loading=""
+ >
{{notice.hasSigned ? '宸茬鏀�' : '绛炬敹'}}
</button>
</view>
@@ -43,6 +69,18 @@
</swiper-item>
</block>
</swiper>
+</view>
-
-</view>
\ No newline at end of file
+<t-dialog
+ visible="{{showNoticeDetail}}"
+ title="{{showTitle}}"
+ confirm-btn="{{confirmBtn}}"
+ prevent-scroll-through
+ bind:confirm="closeDialog"
+>
+ <scroll-view slot="content" scroll-y class="long-content">
+ <text class="content-container" user-select="{{true}}"
+ >{{showContent}}
+ </text>
+ </scroll-view>
+</t-dialog>
\ No newline at end of file
diff --git a/pages/mNotice/notice/notice.wxss b/pages/mNotice/notice/notice.wxss
index 06fd8ad..8fed2f4 100644
--- a/pages/mNotice/notice/notice.wxss
+++ b/pages/mNotice/notice/notice.wxss
@@ -10,6 +10,7 @@
}
.swiper-tab-list{
+ position: relative;
font-size: 30rpx;
display: inline-block;
min-width: 30%;
@@ -33,25 +34,26 @@
}
.fyui-box {
- margin-bottom: 16px;
+ margin-bottom: 1rpx;
}
.fyui-box .fyui-box__hd {
display: flex;
- align-items: center;
+ align-items: flex-start;
}
.title {
- display: flex;
width: 100%;
- justify-content: space-between;
align-items: flex-end;
- font-size: 40rpx;
+ font-size: 30rpx;
+ margin-left: 16rpx;
}
-.title>text {
+.right-time {
+ display: block;
font-size: small;
color: var(--fyui-text-color_2);
+ text-align: end;
}
@@ -95,9 +97,68 @@
width: 100%;
overflow: hidden; */
/* text-overflow: ellipsis; */
- font-size: 30rpx !important;
+ font-size: 28rpx !important;
+ color: var(--fyui-text-color_1) !important;
}
.page__ft {
color: var(--fyui-text-color_2);
+}
+
+.notice-read {
+ position: absolute;
+ top: 16px;
+ left: 4px;
+ width: 10px;
+ height: 10px;
+ background-color: transparent;
+ border-radius: 50%;
+}
+
+.notice-not-read {
+ position: absolute;
+ top: 16px;
+ left: 4px;
+ width: 10px;
+ height: 10px;
+ background-color: red;
+ border-radius: 50%;
+}
+
+.badge {
+ position: absolute;
+ top: 8px;
+ right: 4px;
+ width: 16px;
+ height: 16px;
+ background-color: red;
+ color: white;
+ border-radius: 50%;
+ font-size: 10px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.long-content {
+ max-height: 60vh;
+ margin-top: 16rpx;
+ margin-bottom: 16rpx;
+ font-size: 30rpx;
+ color: #888;
+}
+
+.long-content .content-container {
+ white-space: pre-line;
+}
+
+.limit-line {
+ /* background-color: aliceblue; */
+ word-break: break-all;
+ /* height: 100rpx; */
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
\ No newline at end of file
diff --git a/pages/mPromise/promisefile/promisefile.js b/pages/mPromise/promisefile/promisefile.js
index 7dd89ed..3991822 100644
--- a/pages/mPromise/promisefile/promisefile.js
+++ b/pages/mPromise/promisefile/promisefile.js
@@ -1,15 +1,11 @@
// pages/promisefile/promisefile.js
-const {promise} = require('../../../data/promise')
-const promiseservice = require("../../../service/promiseservice")
-const app = getApp()
+const { promise } = require('../../../data/promise');
+const promiseservice = require('../../../service/promiseservice');
+const app = getApp();
Page({
-
- /**
- * 椤甸潰鐨勫垵濮嬫暟鎹�
- */
data: {
- imgFiles: []
+ imgFiles: [],
},
commitmentVo: {
@@ -26,31 +22,34 @@
type4: false,
year: '',
month: '',
- day: ''
+ day: '',
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad: function (options) {
- var that = this
- var date = new Date()
- var year = date.getFullYear()
- var mon = date.getMonth() + 1
- var day = date.getDate()
+ var that = this;
+ var date = new Date();
+ var year = date.getFullYear();
+ var mon = date.getMonth() + 1;
+ var day = date.getDate();
this.setData({
- date: `${year}骞�${mon}鏈�${day}鏃
- })
+ date: `${year}骞�${mon}鏈�${day}鏃,
+ });
- this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
- that.commitmentVo = data
- })
+ this.getOpenerEventChannel().on(
+ 'acceptDataFromOpenerPage',
+ function (data) {
+ that.commitmentVo = data;
+ },
+ );
- let st = app.globalData.userInfo.extension2
- let t = promise[st]
+ let st = app.globalData.userInfo.extension2;
+ let t = promise[st];
this.setData({
- promiseText: promise[st]
- })
+ promiseText: promise[st],
+ });
},
/**
@@ -61,18 +60,18 @@
},
startSign() {
- var that = this
+ var that = this;
wx.navigateTo({
url: '/pages/mPromise/promisesign/promisesign',
events: {
onSignSuccess: function (imgPath) {
console.log('signover:' + imgPath);
- that.signOver(imgPath)
- }
+ that.signOver(imgPath);
+ },
},
- })
-
+ });
+
// wx.getStorage({
// key: 'signPath',
// success: (result) => {
@@ -96,10 +95,10 @@
},
signOver(imgPath) {
- let path = "imgFiles[0]"
+ let path = 'imgFiles[0]';
this.setData({
- [path]: imgPath
- })
+ [path]: imgPath,
+ });
},
onSubmit: function () {
@@ -113,42 +112,44 @@
wx.showLoading({
title: '鎵胯涔︾敓鎴愪腑',
mask: true,
- success: (res) => {},
- fail: (res) => {},
- complete: (res) => {},
- })
+ success: res => {},
+ fail: res => {},
+ complete: res => {},
+ });
// setTimeout(() => {
// wx.hideLoading()
// }, 20000);
- let signPic = this.data.imgFiles[0]
+ let signPic = this.data.imgFiles[0];
- promiseservice.createCommitment(app.globalData.accessToken.userId, this.commitmentVo, signPic, {
- success(data) {
- if (data.success) {
- wx.navigateTo({
- url: '/pages/mPromise/promiseresult/promiseresult',
- success: function (res) {
- console.log(res);
- // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- promise: {
- picPath: data.data[0],
- pdfPath: data.data[1],
- }
- })
- }
- })
- }
+ promiseservice.createCommitment(
+ app.globalData.accessToken.userId,
+ this.commitmentVo,
+ signPic,
+ {
+ success(data) {
+ if (data.success) {
+ wx.navigateTo({
+ url: '/pages/mPromise/promiseresult/promiseresult',
+ success: function (res) {
+ console.log(res);
+ // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
+ promise: {
+ picPath: data.data[0],
+ pdfPath: data.data[1],
+ },
+ });
+ },
+ });
+ }
+ },
+ fail(res) {},
+ complete(res) {
+ console.log(res);
+ wx.hideLoading({});
+ },
},
- fail(res) {
- },
- complete(res) {
- console.log(res);
- wx.hideLoading({
- })
- }
- })
-
- }
-})
\ No newline at end of file
+ );
+ },
+});
diff --git a/pages/mPromise/promisefile/promisefile.wxml b/pages/mPromise/promisefile/promisefile.wxml
index 84707b7..05244e6 100644
--- a/pages/mPromise/promisefile/promisefile.wxml
+++ b/pages/mPromise/promisefile/promisefile.wxml
@@ -4,18 +4,9 @@
<view class="page__bd">
<view class="fyui-panel">
<view class="p-title">瀹堟硶鎵胯涔�</view>
- <text class="p-content">
- <!-- 涓烘帹鍔ㄧ粡娴庣ぞ浼氬彲鎸佺画鍙戝睍锛屼笉鏂敼鍠勫尯鍩熺幆澧冭川閲忥紝鍔姏鍔犲揩鐢熸�佸煄甯傚缓璁炬浼愶紝鏈紒涓氶儜閲嶆壙璇猴細\n
- 涓�銆佺墷鍥烘爲绔嬬幆淇濇剰璇嗐�傛繁鍏ュ紑灞曠幆澧冨浼犳暀鑲诧紝鍊″绉戝鍙戝睍鐞嗗康锛屽姞寮轰紒涓氭枃鍖栧缓璁撅紝鏍戠珛鈥滀繚鎶ょ幆澧冨厜鑽o紝姹℃煋鐜鍙�烩�濇剰璇嗭紝鍧氭寔鍦ㄤ紒涓氬彂灞曚腑鍔犲己鐜淇濇姢锛屽湪淇濇姢鐜涓績杩涗紒涓氬彂灞曘��
- 寮哄寲淇濇姢鐜灏辨槸淇濇姢缇や紬鍋ュ悍鐨勭ぞ浼氳矗浠绘劅锛屽潥鎸佲�滈闃蹭负涓汇�侀槻娌荤粨鍚堚�濇柟閽堬紝鍒囧疄鑲╄礋璧风幆澧冧繚鎶ょ殑绀句細璐d换锛屼績杩涚ぞ浼氥�佺粡娴庡拰鐜鐨勫彲鎸佺画鍙戝睍銆俓n
- 浜屻�佷弗鏍奸伒瀹堢幆淇濇硶瑙勩�傚潥鍐宠疮褰昏惤瀹炵幆澧冧繚鎶ゆ斂绛栨硶瑙勫拰鏍囧噯锛屼弗鏍兼墽琛屾帓姹$敵鎶ュ拰鎺掓薄鏀惰垂绛夊埗搴︼紝鑷閬靛畧寤鸿椤圭洰鐜褰卞搷璇勪环鍜屸�滀笁鍚屾椂鈥濊瀹氾紝涓诲姩鎺ュ彈鐜鐜板満鎵ф硶妫�鏌ュ拰鐩戠潱绠$悊锛�
- 鍋氬埌鏃犵幆澧冩薄鏌撲簨鏁呭彂鐢燂紝纭繚鐜璐ㄩ噺鏀瑰杽銆俓n
- 涓夈�佸垏瀹炲姞寮烘薄鏌撻槻娌汇�傚潥鎸佽蛋绉戞妧鍚噺楂樸�佽祫婧愭秷鑰楀皯銆佺幆澧冩薄鏌撳皯銆佺粡娴庢晥鐩婂ソ鐨勬柊鍨嬪伐涓氬寲閬撹矾銆傚姞寮轰紒涓氳妭鑳藉噺鎺掓姇鍏ュ拰鎶�鏈敼閫犲姏搴︼紝纭繚鑺傝兘鍑忔帓鐩爣鍏ㄩ潰瀹炵幇銆傚姞寮烘薄鏌撴不鐞嗚鏂界殑杩愯绠$悊锛岀‘淇濆簾姘淬�佸簾姘斻�佸櫔澹板拰鍥哄簾杈炬爣鎺掓斁銆備富鍔ㄦ窐姹拌惤鍚庣殑鐢熶骇璁惧鍜屽伐鑹猴紝绉瀬瀹炴柦娓呮磥鐢熶骇锛屽彂灞曞惊鐜粡娴庯紝鎻愰珮璧勬簮鐨勫悎鐞嗗埄鐢ㄧ巼锛屽噺灏戞薄鏌撶墿鐨勬帓鏀俱�傚埗璁㈢瀛﹀彲琛岀殑绐佸彂鐜浜嬩欢搴旀�ラ妗堬紝骞剁粍缁囧簲鎬ユ紨缁冿紝纭繚鐜瀹夊叏銆俓n
- 鍥涖�佽嚜瑙夋帴鍙楃ぞ浼氱洃鐫c�傚姞寮轰紒涓氱幆澧冪鐞嗭紝寮哄寲璇氫俊鎰忚瘑锛屾仾瀹堢幆淇濅俊鐢紝灏嗚瘹淇$悊蹇佃疮绌夸簬浼佷笟鐢熶骇缁忚惀鍏ㄨ繃绋嬶紝鍏ㄥ姏鎵撻�犫�滆祫婧愯妭绾﹀瀷鍜岀幆澧冨弸濂藉瀷鈥濅紒涓氬搧鐗屻�傛墡瀹炴帹杩涗紒涓氱幆澧冧俊鎭叕寮�宸ヤ綔锛屼富鍔ㄥ鐞嗗ソ鍘傜兢鍏崇郴锛岃嚜瑙夌淮鎶ゅソ缇や紬鐨勭幆澧冩潈鐩婏紝鑷鎺ュ彈绀句細鍏紬鍜屾柊闂诲獟浣撶洃鐫c�傝繖鏄垜浠悜绀句細浣滃嚭鐨勫簞涓ユ壙璇猴紝鏁绀句細鍚勭晫浜堜互鐩戠潱銆傛垜浠皢杩涗竴姝ュ姞寮鸿嚜寰嬫剰璇嗭紝瑙嗙幆淇濅负浼佷笟鐢熷懡锛屽仛璇氫俊瀹堟硶浼佷笟銆俓n -->
- {{promiseText}}
- </text>
- <view style="text-align: end;">{{date}}</view>
- <view class="flex-h" style="margin-top: 16px;">
+ <text class="p-content"> {{promiseText}} </text>
+ <view style="text-align: end">{{date}}</view>
+ <view class="flex-h" style="margin-top: 16px">
<view>
<text class="p-sign">娉曚汉绛惧悕锛堝繀濉級</text>
<view class="weui-upload-view">
@@ -23,18 +14,33 @@
<view wx:if="{{imgFiles.length == 0}}" class="">
<view class="top-right" bindtap="startSign">
<view class="sign-btn">
- <mp-icon type="field" icon="add" color="gray" size="{{60}}"></mp-icon>
+ <mp-icon
+ type="field"
+ icon="add"
+ color="gray"
+ size="{{60}}"
+ ></mp-icon>
</view>
</view>
</view>
- <image wx:else class="sign-img" src="{{imgFiles[0]}}" mode="aspectFill" />
+ <image
+ wx:else
+ class="sign-img"
+ src="{{imgFiles[0]}}"
+ mode="aspectFill"
+ />
</view>
</view>
- <view style="display: none;">
+ <view style="display: none">
<text class="p-sign">鍗曚綅绛剧珷锛堥�夊~锛�</text>
<view class="weui-upload-view">
- <mp-upload data-type="1" max-count="1" files="{{imgFiles[1]}}" binduploadImg="uploadFile"
- binddelete="delImg"></mp-upload>
+ <mp-upload
+ data-type="1"
+ max-count="1"
+ files="{{imgFiles[1]}}"
+ binduploadImg="uploadFile"
+ binddelete="delImg"
+ ></mp-upload>
</view>
</view>
</view>
@@ -43,4 +49,4 @@
<view class="page__ft">
<view class="submit" bindtap="onSubmit">纭鎵胯</view>
</view>
-</view>
\ No newline at end of file
+</view>
diff --git a/pages/mPromise/promiseinfo/promiseinfo.js b/pages/mPromise/promiseinfo/promiseinfo.js
index d58c370..11b33dd 100644
--- a/pages/mPromise/promiseinfo/promiseinfo.js
+++ b/pages/mPromise/promiseinfo/promiseinfo.js
@@ -1,83 +1,72 @@
-// pages/promiseinfo/promiseinfo.js
-const userservice = require("../../../service/userservice")
-const app = getApp()
+import { getSceneName1 } from '../../../data/sceneTypes';
+const userservice = require('../../../service/userservice');
+const app = getApp();
Page({
-
- /**
- * 椤甸潰鐨勫垵濮嬫暟鎹�
- */
data: {
- sceneTypeMap: {
- '1': '椁愰ギ',
- '2': '宸ュ湴',
- '3': '鐮佸ご',
- '4': '鍫嗗満',
- '5': '鎼呮媽绔�',
- '6': '宸ヤ笟浼佷笟',
- '7': '姹戒慨',
- },
sceneType: '--',
- msg: [{
- name: "鍗曚綅鍚嶇О",
- id: "department",
- input: true,
- value: "",
- noValue: false
- },
+ msg: [
{
- name: "淇$敤浠g爜",
- id: "socialCode",
- input: true,
- value: "",
- noValue: false
- },
- {
- name: "鎶ュ缓鍙�",
- id: "number",
- input: true,
- value: "",
- noValue: false,
- required: false
- },
- {
- name: "娉曚汉濮撳悕",
- id: "juridicalPerson",
+ name: '鍗曚綅鍚嶇О',
+ id: 'department',
input: true,
value: '',
- noValue: false
+ noValue: false,
},
{
- name: "韬唤璇佸彿",
- id: "idNo",
+ name: '淇$敤浠g爜',
+ id: 'socialCode',
input: true,
- value: "",
+ value: '',
noValue: false,
- maxLength: 18
+ },
+ {
+ name: '鎶ュ缓鍙�',
+ id: 'number',
+ input: true,
+ value: '',
+ noValue: false,
+ required: false,
+ },
+ {
+ name: '娉曚汉濮撳悕',
+ id: 'juridicalPerson',
+ input: true,
+ value: '',
+ noValue: false,
+ },
+ {
+ name: '韬唤璇佸彿',
+ id: 'idNo',
+ input: true,
+ value: '',
+ noValue: false,
+ maxLength: 18,
},
],
- commitTypes: [{
+ commitTypes: [
+ {
value: 'type1',
name: '鐜繚涓讳綋璐d换鎵胯',
- checked: true
+ checked: true,
},
{
value: 'type2',
name: '鐜琛屾斂璁稿彲浜嬮」',
- checked: false
+ checked: false,
},
{
value: 'type3',
name: '鐜繚涓撻」璧勯噾鎴栧叾浠栬祫閲戣ˉ鍔�',
- checked: false
+ checked: false,
},
{
value: 'type4',
name: '鍏朵粬鐜繚鐢虫姤浜嬮」',
- checked: false
- }
+ checked: false,
+ },
],
commitTypeIndex: 0,
},
@@ -86,7 +75,7 @@
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad: function (options) {
- let st = app.globalData.userInfo.extension2
+ let st = app.globalData.userInfo.extension2;
switch (st) {
case '2':
case '3':
@@ -94,106 +83,106 @@
case '5':
case '6':
this.setData({
- 'msg[2].name': '鎶ュ缓鍙�'
- })
+ 'msg[2].name': '鎶ュ缓鍙�',
+ });
break;
case '1':
this.setData({
'msg[2].name': '鐜瘎瀹℃壒鏂囧彿',
'msg[2].show': false,
- })
+ });
break;
case '7':
this.setData({
- 'msg[2].name': '鐜瘎瀹℃壒鏂囧彿'
- })
+ 'msg[2].name': '鐜瘎瀹℃壒鏂囧彿',
+ });
break;
default:
this.setData({
- 'msg[2].name': '鐜瘎瀹℃壒鏂囧彿'
- })
+ 'msg[2].name': '鐜瘎瀹℃壒鏂囧彿',
+ });
break;
}
this.setData({
- sceneType: this.data.sceneTypeMap[st]
- })
- this.getUserBaseInfo()
+ sceneType: getSceneName1(st),
+ });
+ this.getUserBaseInfo();
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
*/
- onReady: function () {
-
- },
+ onReady: function () {},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
*/
- onShow: function () {
-
- },
+ onShow: function () {},
changeMsg(e) {
- let id = e.detail.params.id
- let value = e.detail.params.value
- let msg = this.data.msg
- let msgLength = msg.length
+ let id = e.detail.params.id;
+ let value = e.detail.params.value;
+ let msg = this.data.msg;
+ let msgLength = msg.length;
for (let i = 0; i < msgLength; i++) {
if (msg[i].id === id) {
- let path = "msg[" + i + "].value"
- let nPath = "msg[" + i + "].noValue"
+ let path = 'msg[' + i + '].value';
+ let nPath = 'msg[' + i + '].noValue';
this.setData({
[path]: value,
- [nPath]: false
- })
+ [nPath]: false,
+ });
}
}
},
checkboxChange(e) {
- console.log('checkbox鍙戠敓change浜嬩欢锛屾惡甯alue鍊间负锛�', e.detail.value)
+ console.log('checkbox鍙戠敓change浜嬩欢锛屾惡甯alue鍊间负锛�', e.detail.value);
- const items = this.data.commitTypes
- const values = e.detail.value
+ const items = this.data.commitTypes;
+ const values = e.detail.value;
for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
+ items[i].checked = false;
for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
if (items[i].value === values[j]) {
- items[i].checked = true
- break
+ items[i].checked = true;
+ break;
}
}
}
this.setData({
- commitTypes: items
- })
+ commitTypes: items,
+ });
// console.log(this.data.commitTypes);
},
getUserBaseInfo() {
- var that = this
- userservice.getBaseInfo(app.globalData.accessToken.userId, {
- success(data) {
- const msg = that.data.msg
- if (data.company) {
- msg[0].value = data.company.ciName
- msg[1].value = data.company.ciOrgCode
- msg[3].value = data.company.ciJuridicalPerson
- }
- that.setData({
- msg
- })
- }
- }, app.globalData.accessToken.openId)
+ var that = this;
+ userservice.getBaseInfo(
+ app.globalData.accessToken.userId,
+ {
+ success(data) {
+ const msg = that.data.msg;
+ if (data.company) {
+ msg[0].value = data.company.ciName;
+ msg[1].value = data.company.ciOrgCode;
+ msg[3].value = data.company.ciJuridicalPerson;
+ }
+ that.setData({
+ msg,
+ });
+ },
+ },
+ app.globalData.accessToken.openId,
+ );
},
onSubmit: function () {
- if (!this.submitCheck()) return
+ if (!this.submitCheck()) return;
- var _data = this.data
+ var _data = this.data;
wx.navigateTo({
url: '/pages/mPromise/promisefile/promisefile',
success: function (res) {
@@ -212,65 +201,65 @@
type4: _data.commitTypes[3].checked,
year: '',
month: '',
- day: ''
- })
- }
- })
+ day: '',
+ });
+ },
+ });
},
/**
* 淇℃伅瀹屾暣搴︽鏌�
*/
submitCheck() {
- let msg = this.data.msg
- let msgLength = msg.length
+ let msg = this.data.msg;
+ let msgLength = msg.length;
//纭淇℃伅瀹屾暣搴�
for (let i = 0; i < msgLength; i++) {
- if (msg[i].required != false && msg[i].value === "") {
- let error = msg[i].name + "涓嶅彲涓虹┖"
- let path = "msg[" + i + "].noValue"
+ if (msg[i].required != false && msg[i].value === '') {
+ let error = msg[i].name + '涓嶅彲涓虹┖';
+ let path = 'msg[' + i + '].noValue';
this.setData({
errorMsg: error,
- [path]: true
- })
+ [path]: true,
+ });
wx.pageScrollTo({
duration: 300,
scrollTop: 0,
// selector:"#" + msg[i].id,
- })
- return false
+ });
+ return false;
}
//韬唤璇佷綅鏁板垽鏂�
if (i == 4) {
if (msg[i].value.length < msg[i].maxLength) {
- let error = msg[i].name + "浣嶆暟閿欒"
- let path = "msg[" + i + "].noValue"
+ let error = msg[i].name + '浣嶆暟閿欒';
+ let path = 'msg[' + i + '].noValue';
this.setData({
errorMsg: error,
- [path]: true
- })
+ [path]: true,
+ });
- return false
+ return false;
}
}
}
- var cList = []
+ var cList = [];
for (let i = 0; i < this.data.commitTypes.length; i++) {
const t = this.data.commitTypes[i];
if (t.checked) {
- cList.push(t)
+ cList.push(t);
}
}
if (cList.length == 0) {
this.setData({
errorMsg: '鑷冲皯閫夋嫨涓�椤规壙璇虹被鍨�',
- })
- return false
+ });
+ return false;
}
- return true
- }
-})
\ No newline at end of file
+ return true;
+ },
+});
diff --git a/pages/mPromise/promiseresult/promiseresult.wxml b/pages/mPromise/promiseresult/promiseresult.wxml
index 7da1965..4f6e132 100644
--- a/pages/mPromise/promiseresult/promiseresult.wxml
+++ b/pages/mPromise/promiseresult/promiseresult.wxml
@@ -1,5 +1,11 @@
<!--pages/promiseresult/promiseresult.wxml-->
<view class="">
-<image wx:for="{{promise.picPath}}" src="{{item}}" class="image" show-menu-by-longpress="true" mode="widthFix"></image>
-<!-- <image src="https://fyami.com.cn:447/images/commitment-restaurant-1659927781518.jpg" class="image" show-menu-by-longpress="true" mode="widthFix"></image> -->
+ <image
+ wx:for="{{promise.picPath}}"
+ src="{{item}}"
+ class="image"
+ show-menu-by-longpress="true"
+ mode="widthFix"
+ ></image>
+ <!-- <image src="https://fyami.com.cn:447/images/commitment-restaurant-1659927781518.jpg" class="image" show-menu-by-longpress="true" mode="widthFix"></image> -->
</view>
diff --git a/pages/mPromise/promisesign/promisesign.wxml b/pages/mPromise/promisesign/promisesign.wxml
index 4363b53..9203126 100644
--- a/pages/mPromise/promisesign/promisesign.wxml
+++ b/pages/mPromise/promisesign/promisesign.wxml
@@ -1,13 +1,24 @@
<!--pages/test2/test2.wxml-->
<view class="page">
- <view class="canvas">
- <canvas id="signCanvas" type="2d" class="sign-canvas" bindtouchstart="touchStart"
- bindtouchmove="touchMove" bindtouchend="touchEnd" disable-scroll="true"></canvas>
- <view class="tips">璇锋棆杞睆骞曡嚦姝ゆ柟鍚戠鍚�</view>
- </view>
- <view class="btn-group">
- <view class="cancel" bindtap="onCancel">鍙栨秷</view>
- <view class="submit" bindtap="onSubmit">纭</view>
- </view>
- <canvas id="handWriting2" type="2d" style="position: absolute; z-index: -1; width:{{width}};height:{{height}};"></canvas>
-</view>
\ No newline at end of file
+ <view class="canvas">
+ <canvas
+ id="signCanvas"
+ type="2d"
+ class="sign-canvas"
+ bindtouchstart="touchStart"
+ bindtouchmove="touchMove"
+ bindtouchend="touchEnd"
+ disable-scroll="true"
+ ></canvas>
+ <view class="tips">璇锋棆杞睆骞曡嚦姝ゆ柟鍚戠鍚�</view>
+ </view>
+ <view class="btn-group">
+ <view class="cancel" bindtap="onCancel">鍙栨秷</view>
+ <view class="submit" bindtap="onSubmit">纭</view>
+ </view>
+ <canvas
+ id="handWriting2"
+ type="2d"
+ style="position: absolute; z-index: -1; width:{{width}};height:{{height}};"
+ ></canvas>
+</view>
diff --git a/pages/mSelfPatrol/components/emergency-self-patrol/index.js b/pages/mSelfPatrol/components/emergency-self-patrol/index.js
new file mode 100644
index 0000000..49b5268
--- /dev/null
+++ b/pages/mSelfPatrol/components/emergency-self-patrol/index.js
@@ -0,0 +1,120 @@
+import { parseLedgerStat, refreshLedgerStatus } from '../../../../model/ledger';
+const selfpatrolservice = require('../../../../service/selfpatrolservice');
+const moment = require('../../../../utils/moment.min');
+const app = getApp();
+
+Component({
+ properties: {},
+
+ offsetTopList: [],
+ data: {
+ refresh: false,
+ sideBarIndex: 0,
+ scrollTop: 0,
+ categories: [
+ // {
+ // label: '閫夐」浜�',
+ // title: '鏍囬浜�',
+ // badgeProps: {
+ // count: 8,
+ // },
+ // items: [],
+ // },
+ ],
+ },
+
+ lifetimes: {
+ attached: function () {
+ this.fetchSelfPatrolTask();
+ },
+ },
+
+ // pageLifetimes: {
+ // show: function () {
+ // this.fetchSelfPatrolTask();
+ // },
+ // },
+
+ methods: {
+ fetchSelfPatrolTask() {
+ const date = moment().format('YYYY-MM-DD');
+ selfpatrolservice.getTask(app.globalData.accessToken.userId, date, {
+ success: res => {
+ const categories = res.data.map(item => {
+ item.deadline = moment(item.spDeadline).format('YYYY-MM-DD HH鏃�');
+ return {
+ label: moment(item.spCreateTime).format('MM鏈圖D鏃�'),
+ // title: '鏍囬浜�',
+ taskId: item.spGuid,
+ badgeProps: {
+ dot: item.spTaskStatus == 1,
+ },
+ items: [],
+ task: item,
+ };
+ });
+ this.setData({ sideBarIndex: 0 });
+ if (categories.length > 0) {
+ const { taskId } = categories[0];
+ this.fetchTaskRecord(taskId, 0);
+ }
+ this.setData({ categories, refresh: false });
+ },
+ });
+ },
+
+ fetchTaskRecord(taskId, index) {
+ selfpatrolservice.getTaskRecord(taskId, {
+ success: res => {
+ let r = parseLedgerStat(res.data);
+ this.setData({
+ [`categories[${index}].items`]: r[1][0],
+ });
+ },
+ });
+ },
+
+ onSideBarChange(e) {
+ const { value } = e.detail;
+ const { categories } = this.data;
+ const { taskId } = categories[value];
+ this.fetchTaskRecord(taskId, value);
+ this.setData({ sideBarIndex: value });
+ },
+
+ gotoLedgerDetail(e) {
+ var i = e.currentTarget.dataset.index.split(',');
+ var indexGroup = [parseInt(i[0]), parseInt(i[1])];
+ const item = this.data.categories[indexGroup[0]];
+ const { taskId } = item;
+ var ledger = item.items[indexGroup[1]];
+
+ var that = this;
+ wx.navigateTo({
+ url: '/pages/mLedger/ledgerupload/ledgerupload',
+ events: {
+ uploadOver: function (data) {
+ let i = data.indexGroup;
+ const item = that.data.categories[indexGroup[0]];
+ let s = item.items[indexGroup[1]];
+ s.upLoad = true;
+ refreshLedgerStatus(s);
+ that.setData({
+ [`categories[${indexGroup[0]}].items[${indexGroup[1]}]`]: s,
+ });
+ },
+ },
+ success: res => {
+ // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
+ ledger: ledger,
+ indexGroup: indexGroup,
+ type: 1,
+ taskId: taskId,
+ barTitle: '涓婁紶搴旀�ヨ嚜宸℃煡',
+ });
+ },
+ });
+ },
+ },
+});
diff --git a/pages/mSelfPatrol/components/emergency-self-patrol/index.json b/pages/mSelfPatrol/components/emergency-self-patrol/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/pages/mSelfPatrol/components/emergency-self-patrol/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/mSelfPatrol/components/emergency-self-patrol/index.wxml b/pages/mSelfPatrol/components/emergency-self-patrol/index.wxml
new file mode 100644
index 0000000..aa08a8b
--- /dev/null
+++ b/pages/mSelfPatrol/components/emergency-self-patrol/index.wxml
@@ -0,0 +1,64 @@
+<scroll-view
+ bindrefresherrefresh="fetchSelfPatrolTask"
+ refresher-enabled
+ refresher-triggered="{{refresh}}"
+ scroll-y
+ style="height: 90vh;"
+>
+ <view class="side-bar-wrapper">
+ <t-side-bar value="{{sideBarIndex}}" bind:change="onSideBarChange">
+ <block wx:if="{{categories.length > 0}}">
+ <t-side-bar-item
+ wx:for="{{categories}}"
+ wx:key="index"
+ value="{{item.value || index}}"
+ label="{{item.label}}"
+ disabled="{{item.disabled}}"
+ badge-props="{{item.badgeProps}}"
+ />
+ </block>
+ <block wx:else>
+ <t-side-bar-item value="{{0}}" label="鏃犱换鍔�" disabled="{{false}}" />
+ </block>
+ </t-side-bar>
+ <view
+ class="content"
+ style="transform: translateY(-{{sideBarIndex * 100 + '%'}})"
+ >
+ <block wx:if="{{categories.length > 0}}">
+ <scroll-view
+ wx:for="{{categories}}"
+ wx:for-index="index"
+ wx:key="index"
+ class="section"
+ scroll-y
+ scroll-with-animation
+ show-scrollbar="{{false}}"
+ >
+ <view class="title">
+ <view>浠诲姟鏍囩锛歿{item.task.spTag}}</view>
+ <view>鍙戝竷鍗曚綅锛歿{item.task.spPublishUnit}}</view>
+ <view>瀹屾垚鏈熼檺锛歿{item.task.deadline}}</view>
+ </view>
+ <t-grid column="{{3}}" theme="card">
+ <t-grid-item
+ style="opacity: {{cargo.opacity}};"
+ badge-props="{{ cargo.badge }}"
+ wx:for="{{item.items}}"
+ wx:for-index="index2"
+ wx:key="index2"
+ wx:for-item="cargo"
+ text="{{cargo.ledgerName}}"
+ image="{{cargo.iconUrl}}"
+ data-index="{{index}},{{index2}}"
+ bindtap="gotoLedgerDetail"
+ />
+ </t-grid>
+ </scroll-view>
+ </block>
+ <block wx:else>
+ <view class="section"> 鏈湀鏆傛棤搴旀�ヨ嚜宸℃煡浠诲姟 </view>
+ </block>
+ </view>
+ </view>
+</scroll-view>
diff --git a/pages/mSelfPatrol/components/emergency-self-patrol/index.wxss b/pages/mSelfPatrol/components/emergency-self-patrol/index.wxss
new file mode 100644
index 0000000..4498caf
--- /dev/null
+++ b/pages/mSelfPatrol/components/emergency-self-patrol/index.wxss
@@ -0,0 +1,35 @@
+page {
+ background-color: #fff;
+}
+
+page .round-image {
+ border-radius: 12rpx;
+}
+
+.side-bar-wrapper {
+ display: flex;
+ height: 90vh;
+ overflow: hidden;
+}
+
+.side-bar-wrapper .content {
+ flex: 1;
+ transition: transform 0.3s ease;
+}
+
+.side-bar-wrapper .section {
+ padding: 32rpx 0;
+ box-sizing: border-box;
+ height: 100%;
+}
+
+.side-bar-wrapper .title {
+ padding-left: 40rpx;
+ margin-bottom: 8rpx;
+}
+
+.side-bar-wrapper .image {
+ width: 96rpx;
+ height: 96rpx;
+ border: 2rpx solid #e7e7e7;
+}
diff --git a/pages/mSelfPatrol/components/self-patrol/index.js b/pages/mSelfPatrol/components/self-patrol/index.js
new file mode 100644
index 0000000..21d8d56
--- /dev/null
+++ b/pages/mSelfPatrol/components/self-patrol/index.js
@@ -0,0 +1,110 @@
+import { parseLedgerStat, refreshLedgerStatus } from '../../../../model/ledger';
+const ledgerservice = require('../../../../service/ledgerservice');
+const moment = require('../../../../utils/moment.min');
+const app = getApp();
+
+Component({
+ /**
+ * 缁勪欢鐨勫睘鎬у垪琛�
+ */
+ properties: {},
+
+ /**
+ * 缁勪欢鐨勫垵濮嬫暟鎹�
+ */
+ data: {
+ refresh: false,
+ thisMonth: '',
+ tags1: { count: 0 },
+ pageList1: [],
+ },
+
+ lifetimes: {
+ attached: function () {
+ this.init();
+ },
+ },
+
+ /**
+ * 缁勪欢鐨勬柟娉曞垪琛�
+ */
+ methods: {
+ init() {
+ const now = moment();
+ const nowStr = now.format('YYYY-MM-DD');
+ const thisMonth = now.format('YYYY骞碝M鏈�');
+ this.setData({ thisMonth });
+ this.getLedgerType(nowStr, r => {
+ this.setData({
+ tags1: {
+ count: r[0][0].tag,
+ },
+ pageList1: r[1][0],
+ progress: r[2].percent2,
+ finished: r[2].finishedSelf,
+ tabList: [r[0][0]],
+ refresh: false,
+ });
+ });
+ },
+
+ getLedgerType(time, success, lastMonth) {
+ var that = this;
+ ledgerservice.getLedgerSummary(
+ app.globalData.accessToken.userId,
+ app.globalData.userInfo.extension2,
+ time,
+ {
+ success(res) {
+ let r = parseLedgerStat(res, lastMonth);
+ success(r);
+ },
+ },
+ );
+ },
+
+ gotoLedgerDetail(e) {
+ const { index } = e.currentTarget.dataset;
+ const indexGroup = index;
+ var ledger = this.data.pageList1[index];
+ var that = this;
+ wx.navigateTo({
+ url: '/pages/mLedger/ledgerupload/ledgerupload',
+ events: {
+ uploadOver: function (data) {
+ let i = data.indexGroup;
+ let s = that.data.pageList1[i];
+ s.upLoad = true;
+ refreshLedgerStatus(s);
+ that.setData({
+ [`pageList1[${i}]`]: s,
+ });
+ that.init();
+ },
+ },
+ success: res => {
+ // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
+ ledger: ledger,
+ indexGroup: indexGroup,
+ type: 0,
+ barTitle: '涓婁紶鑷贰鏌�',
+ });
+ },
+ });
+ },
+
+ gotoHistory() {
+ let tabList = this.data.tabList;
+ wx.navigateTo({
+ url: '/pages/mLedger/ledgerhistory/ledgerhistory',
+ success: res => {
+ // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
+ tabList: tabList,
+ });
+ },
+ });
+ },
+ },
+});
diff --git a/pages/mSelfPatrol/components/self-patrol/index.json b/pages/mSelfPatrol/components/self-patrol/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/pages/mSelfPatrol/components/self-patrol/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/mSelfPatrol/components/self-patrol/index.wxml b/pages/mSelfPatrol/components/self-patrol/index.wxml
new file mode 100644
index 0000000..9af9f77
--- /dev/null
+++ b/pages/mSelfPatrol/components/self-patrol/index.wxml
@@ -0,0 +1,42 @@
+<scroll-view
+ bindrefresherrefresh="init"
+ refresher-enabled
+ refresher-triggered="{{refresh}}"
+ scroll-y
+ style="height: 90vh;"
+>
+ <view class="self-patrol-static">
+ <view> {{thisMonth}} </view>
+ <view class="head_row">
+ <view class="head_row_item">
+ <view class="head_tag">鑷贰鏌ユ彁浜ゆ暟</view>
+ <view class="head_1">{{finished}}</view>
+ </view>
+ <view class="head_row_item">
+ <view class="head_tag">鑷贰鏌ユ彁浜ゅ崰姣�</view>
+ <view class="head_1"
+ >{{progress}}<text class="head_row_item_tag">%</text></view
+ >
+ </view>
+ </view>
+ <view class="head_right">
+ <text class="head_btn" bindtap="gotoHistory">鍘嗗彶璁板綍 ></text>
+ </view>
+ <!-- <view class="self-patrol-progress">
+ <t-progress percentage="{{progress}}" />
+ </view> -->
+ </view>
+ <t-grid column="{{3}}" theme="card">
+ <t-grid-item
+ style="opacity: {{item.opacity}};"
+ badge-props="{{ item.badge }}"
+ wx:for="{{pageList1}}"
+ wx:key="index"
+ text="{{item.ledgerName}}"
+ image="{{item.iconUrl}}"
+ data-index="{{index}}"
+ bindtap="gotoLedgerDetail"
+ t-class-text="grid-item"
+ />
+ </t-grid>
+</scroll-view>
diff --git a/pages/mSelfPatrol/components/self-patrol/index.wxss b/pages/mSelfPatrol/components/self-patrol/index.wxss
new file mode 100644
index 0000000..0e62477
--- /dev/null
+++ b/pages/mSelfPatrol/components/self-patrol/index.wxss
@@ -0,0 +1,64 @@
+.self-patrol-static {
+ padding: 16rpx 32rpx;
+}
+
+.self-patrol-progress {
+ color: red;
+}
+
+.head_row{
+ display: flex;
+ /* padding: 0 30px; */
+ margin-top: 24rpx;
+ justify-content: space-between;
+ align-items: baseline;
+}
+
+.head_row_item{
+ text-align: center;
+ /* width: 20vw; */
+ flex: 1;
+ /* background-color: red; */
+}
+
+.head_row_item_tag{
+ font-size: 12px;
+ font-weight: 559;
+}
+
+.head_right {
+ text-align: end;
+ font-size: 12px;
+ /* background-color: brown; */
+ margin-bottom: 8px;
+ vertical-align: middle;
+}
+
+.head_tag{
+ font-size: 12px;
+ color: var(--fyui-text-color_3);
+}
+
+.head_btn{
+ background-color: var(--fyui-primary-color);
+ padding: 4px 6px;
+ border-radius: 4px;
+ color: white;
+}
+
+.head_btn:active{
+ background-color: var(--fyui-primary-color-2);
+}
+
+.head_tag>text {
+ font-size: 40px;
+ font-weight: 600;
+}
+
+.head_1 {
+ font-size: 40rpx;
+}
+
+.grid-item {
+ font-size: 24rpx;
+}
\ No newline at end of file
diff --git a/pages/mSelfPatrol/patrolhome/index.js b/pages/mSelfPatrol/patrolhome/index.js
new file mode 100644
index 0000000..bc88398
--- /dev/null
+++ b/pages/mSelfPatrol/patrolhome/index.js
@@ -0,0 +1,38 @@
+const ledgerservice = require('../../../service/ledgerservice');
+const selfpatrolservice = require('../../../service/selfpatrolservice');
+const moment = require('../../../utils/moment.min');
+const app = getApp();
+
+Page({
+ data: {
+ stickyProps: {
+ zIndex: 2,
+ },
+ exist: 0,
+ loading: true,
+ },
+
+ onLoad(options) {
+ },
+
+ onShow() {
+ this.fetchSelfPatrolTask();
+ },
+
+ fetchSelfPatrolTask() {
+ const date = moment().format('YYYY-MM-DD');
+ selfpatrolservice.getTask(app.globalData.accessToken.userId, date, {
+ success: res => {
+ let unfinishedNum = 0;
+ res.data.forEach(e => {
+ if (e.spTaskStatus == 1) unfinishedNum++;
+ });
+ this.setData({
+ unfinishedNum,
+ exist: res.data.length != 0,
+ loading: false,
+ });
+ },
+ });
+ },
+});
diff --git a/pages/mSelfPatrol/patrolhome/index.json b/pages/mSelfPatrol/patrolhome/index.json
new file mode 100644
index 0000000..e2f513a
--- /dev/null
+++ b/pages/mSelfPatrol/patrolhome/index.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "鑷贰鏌ョ鐞�",
+ "usingComponents": {
+ "t-self-patrol": "../components/self-patrol/index",
+ "t-emergency-self-patrol": "../components/emergency-self-patrol/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/mSelfPatrol/patrolhome/index.wxml b/pages/mSelfPatrol/patrolhome/index.wxml
new file mode 100644
index 0000000..5f873f4
--- /dev/null
+++ b/pages/mSelfPatrol/patrolhome/index.wxml
@@ -0,0 +1,29 @@
+<view class="page">
+ <t-self-patrol wx:if="{{!exist}}" />
+ <t-tabs
+ wx:else
+ sticky
+ stickyProps="{{stickyProps}}"
+ defaultValue="{{0}}"
+ >
+ <t-tab-panel label="鑷贰鏌�" value="0">
+ <t-self-patrol />
+ </t-tab-panel>
+ <t-tab-panel
+ label="搴旀�ヨ嚜宸℃煡"
+ value="1"
+ badge-props="{{ { count: unfinishedNum, offset: ['-16rpx', '8rpx'] } }}"
+ >
+ <t-emergency-self-patrol />
+ </t-tab-panel>
+ </t-tabs>
+ <!-- <t-loading
+ t-class="t-class-loading"
+ t-class-text="t-class-loading-text"
+ t-class-indicator="t-class-indicator"
+ loading="{{loading}}"
+ text="鍔犺浇涓�..."
+ theme="circular"
+ size="40rpx"
+ /> -->
+</view>
diff --git a/pages/mSelfPatrol/patrolhome/index.wxss b/pages/mSelfPatrol/patrolhome/index.wxss
new file mode 100644
index 0000000..67771f6
--- /dev/null
+++ b/pages/mSelfPatrol/patrolhome/index.wxss
@@ -0,0 +1,4 @@
+/* pages/mSelfPatrol/patrolhome/index.wxss */
+.a {
+ color: rgb(0, 182, 0);
+}
\ No newline at end of file
diff --git a/pages/mService/behaviors/bScheduleManager.js b/pages/mService/behaviors/bScheduleManager.js
index e19eeb9..1704cb5 100644
--- a/pages/mService/behaviors/bScheduleManager.js
+++ b/pages/mService/behaviors/bScheduleManager.js
@@ -1,9 +1,9 @@
-import scheduleservice from '../../../service/scheduleservice'
-import sysSchedules from '../../../data/schedules'
-import moment from '../../../utils/moment.min'
-import util from '../../../utils/util'
+import scheduleservice from '../../../service/scheduleservice';
+import sysSchedules from '../../../data/schedules';
+import moment from '../../../utils/moment.min';
+import util from '../../../utils/util';
-const app = getApp()
+const app = getApp();
/**
* 鐜繚鏃ョ▼绠$悊
@@ -14,123 +14,139 @@
ledgerCompleted: {
type: Boolean,
observer(value) {
- this.checkScheduleComplete(0, value)
- }
+ this.checkScheduleComplete(0, value);
+ },
},
assessmentCompleted: {
type: Boolean,
observer(value) {
- this.checkScheduleComplete(1, value)
- }
- }
+ this.checkScheduleComplete(1, value);
+ },
+ },
},
data: {
allSchedules: [],
thisSchedule: {},
- index: 0
+ index: 0,
},
lifetimes: {
attached: function () {
- this.getRecentSchedule()
+ this.getRecentSchedule();
+ this.getSchedules();
if (app.globalData.newUser) {
- this.nextSchedules()
+ this.nextSchedules();
}
// this.getAllSchedules()
- }
+ },
},
methods: {
+ getSchedules() {
+ // let startTime = '2023-04-10';
+ // let endTime = '2023-04-10';
+ let startTime = moment().format('YYYY-MM-DD');
+ let endTime = startTime;
+ const that = this;
+ scheduleservice.getSchedules(
+ { startTime, endTime, type: 0 },
+ {
+ success(res) {
+ if (res.data.length > 0) {
+ const schedule = res.data[0];
+ schedule.time = moment(schedule.time.split('T')[0]).format(
+ 'YYYY-MM-DD',
+ );
+ that.setData({
+ thisSchedule: schedule,
+ });
+ }
+ },
+ fail(e) {
+ console.log(e);
+ },
+ },
+ );
+ },
+
//鏌ユ壘鏈�涓磋繎鐨勬棩绋�
getRecentSchedule() {
//1. 浠庢帴鍙h幏鍙栫敤鎴蜂釜浜恒�佺敤鎴蜂紒涓氱被鍨嬬殑鐩稿叧鏈�涓磋繎鏃ョ▼
//2. 鎸夌収鏈湴閫昏緫锛屽緱鍑烘渶閭昏繎鏃ョ▼
- const schedules = sysSchedules()
+ const schedules = sysSchedules();
//2.1 灏嗗彴璐︺�佽瘎浼般�佹壙璇轰笁椤笰PP鍔熻兘瀹氫箟涓烘棩绋�
- //2.2 閫夋嫨鏈�閭昏繎鐨勪簨椤逛綔涓哄綋鏃ョ殑鎻愰啋浜嬮」,
- let today = moment().hour(0).minute(0).second(0).millisecond(0)
- let diffDays = 999
- let schedule
- let index = 0
+ //2.2 閫夋嫨鏈�閭昏繎鐨勪簨椤逛綔涓哄綋鏃ョ殑鎻愰啋浜嬮」,
+ let today = moment().hour(0).minute(0).second(0).millisecond(0);
+ let diffDays = 999;
+ let schedule;
+ let index = 0;
for (let i = 0; i < schedules.length; i++) {
let s = schedules[i];
- let d = s.time.diff(today, 'days')
- s.diffDays = d
+ let d = s.time.diff(today, 'days');
+ s.diffDays = d;
if (Math.abs(d) < Math.abs(diffDays)) {
- let _index = i
+ let _index = i;
- schedule = s
- diffDays = d
- index = _index
+ schedule = s;
+ diffDays = d;
+ index = _index;
}
}
//2.3 鏃ョ▼鍦ㄦ椂闂寸淮搴︿笂鍒嗕负涓夌被鎻愰啋锛岄鍛娿�佸綋鏃ャ�佹湭瀹屾垚鐨勯�炬湡鎻愰啋
-
this.setData({
allSchedules: schedules,
- thisSchedule: {
- date: schedule.time,
- time: schedule.time.format('YYYY-MM-DD dddd'),
- type: schedule.type,
- events: schedule.events,
- diffDays: schedule.diffDays,
- },
- index
- })
+ // thisSchedule: {
+ // date: schedule.time,
+ // time: schedule.time.format('YYYY-MM-DD dddd'),
+ // type: schedule.type,
+ // events: schedule.events,
+ // diffDays: schedule.diffDays,
+ // },
+ index,
+ });
},
//鑾峰彇鎵�鏈夋棩绋�
getAllSchedules() {
- console.log('getAllSchedules');
- scheduleservice.getAllSchedules(app.globalData.accessToken.userId, {
- success(res) {
- console.log('success');
- console.log(res);
- },
- fail(e) {
- console.log('fail');
- console.log(e);
- },
- complete(res) {
- console.log('complete');
- },
- })
+ const schedules = sysSchedules();
+ this.setData({
+ allSchedules: schedules,
+ });
},
// 褰撳墠鏃ョ▼瀹屾垚锛岄『寤朵笅涓�涓棩绋�
nextSchedules() {
- let today = moment().hour(0).minute(0).second(0).millisecond(0)
+ let today = moment().hour(0).minute(0).second(0).millisecond(0);
let s = this.data.allSchedules[this.data.index + 1];
- let d = s.time.diff(today, 'days')
- s.diffDays = d
+ let d = s.time.diff(today, 'days');
+ s.diffDays = d;
this.setData({
thisSchedule: {
date: s.time,
- time: s.time.format('YYYY-MM-DD dddd'),
+ time: s.time.format('YYYY-MM-DD'),
type: s.type,
events: s.events,
diffDays: s.diffDays,
},
- index: this.data.index + 1
- })
+ index: this.data.index + 1,
+ });
},
// 妫�鏌ュ綋鍓嶆棩绋嬫槸鍚﹀畬鎴�
checkScheduleComplete(type, value) {
- debugger
// 鏂扮敤鎴蜂笉鍋氬垽鏂�
- if (app.globalData.newUser) return
+ if (app.globalData.newUser) return;
// 鏃ョ▼绫诲瀷涓嶄竴鑷存棤闇�鍒ゆ柇
- if (this.data.thisSchedule.type != type) return
+ if (this.data.thisSchedule.type != type) return;
// 鏃ョ▼涓嶅湪褰撴湀鐨勬棤闇�鍒ゆ柇
- const thisMonth = moment().month()
- const sTimeMonth = moment(this.data.thisSchedule.date).month()
- if (thisMonth != sTimeMonth) return
+ const thisMonth = moment().month();
+ const sTimeMonth = moment(this.data.thisSchedule.date).month();
+ if (thisMonth != sTimeMonth) return;
// 鏃ョ▼瀹屾垚鍒欓『寤朵笅涓棩绋�
if (value) {
- this.nextSchedules()
+ this.nextSchedules();
}
- }
- }
-})
\ No newline at end of file
+ },
+ },
+});
diff --git a/pages/mService/cSchedule/cSchedule.js b/pages/mService/cSchedule/cSchedule.js
index f4996ff..5e11992 100644
--- a/pages/mService/cSchedule/cSchedule.js
+++ b/pages/mService/cSchedule/cSchedule.js
@@ -1,5 +1,5 @@
// pages/mService/cSchedule/cSchedule.js
-import moment from '../../../utils/moment.min'
+import $f from "../../../service/baserequest";
import bScheduleManager from '../behaviors/bScheduleManager'
Component({
@@ -18,7 +18,7 @@
* 缁勪欢鐨勫垵濮嬫暟鎹�
*/
data: {
-
+ icon_setting: $f.baseIconUrl + 'res/setting.png',
},
/**
diff --git a/pages/mService/cSchedule/cSchedule.wxml b/pages/mService/cSchedule/cSchedule.wxml
index c65d216..b521a7d 100644
--- a/pages/mService/cSchedule/cSchedule.wxml
+++ b/pages/mService/cSchedule/cSchedule.wxml
@@ -1,16 +1,35 @@
-<!--pages/mService/cSchedule/cSchedule.wxml-->
-<view class="schedule-card {{thisSchedule.diffDays > 0 ? 'schedule-card__2' : (thisSchedule.diffDays < 0 ? 'schedule-card__3' : '')}}" bindtap="goto">
- <view class="schedule-tag">{{thisSchedule.diffDays > 0 ? 'FUTURE' : (thisSchedule.diffDays == 0 ? 'TODAY' : 'PAST')}}</view>
+<!-- <view
+ class="schedule-card {{thisSchedule.diffDays > 0 ? 'schedule-card__2' : (thisSchedule.diffDays < 0 ? 'schedule-card__3' : '')}}"
+ bindtap="goto"
+> -->
+<view class="schedule-card" bindtap="goto">
+ <view class="schedule-tag"
+ >{{thisSchedule.diffDays > 0 ? 'FUTURE' : (thisSchedule.diffDays == 0 ?
+ 'TODAY' : 'PAST')}}</view
+ >
<view class="schedule-category">
- <image class="image-16" src="/res/icons/schedule_1.png"></image>
- <!-- <text>{{thisSchedule.events[0].type == 1 ? '绯荤粺鏃ョ▼' : '鐜繚鏃ョ▼'}}</text> -->
- <text>鐜繚宸ヤ綔鏃ョ▼</text>
+ <t-icon name="{{icon_setting}}" size="36rpx" />
+ <text>宸ヤ綔鏃ョ▼</text>
</view>
- <view class="schedule-title">{{thisSchedule.events[0].name}}</view>
+ <view class="schedule-title">{{thisSchedule.title}}</view>
<view class="schedule-time">
<text>{{thisSchedule.time}}</text>
- <text wx:if="{{thisSchedule.diffDays < 0}}">杩囧幓{{-thisSchedule.diffDays}}澶�</text>
- <text wx:elif="{{thisSchedule.diffDays == 0}}">浠婂ぉ</text>
- <text wx:else>杩樻湁{{thisSchedule.diffDays}}澶�</text>
+ <view class="schedule-time__right">
+ <view
+ wx:if="{{thisSchedule.diffDays < 0}}"
+ class="{{thisSchedule.diffDays < -3 ? 'schedule-time__right-3' : 'schedule-time__right-2'}}"
+ >
+ <text
+ >宸茶秴鏈�<text class="schedule-time__day"
+ >{{-thisSchedule.diffDays}}</text
+ >澶�</text
+ >
+ </view>
+ <text wx:elif="{{thisSchedule.diffDays == 0}}">浠婂ぉ</text>
+ <text wx:else
+ >鍓╀綑<text class="schedule-time__day">{{thisSchedule.diffDays}}</text
+ >澶╄秴鏈�</text
+ >
+ </view>
</view>
</view>
diff --git a/pages/mService/cSchedule/cSchedule.wxss b/pages/mService/cSchedule/cSchedule.wxss
index 95a6a95..22e0d3f 100644
--- a/pages/mService/cSchedule/cSchedule.wxss
+++ b/pages/mService/cSchedule/cSchedule.wxss
@@ -1,12 +1,12 @@
/* pages/mService/cSchedule/cSchedule.wxss */
.schedule-card {
position: relative;
- background: linear-gradient(0deg, #e9c07f, #F8BD6B, #FFAC38);
- /* background-color: aqua; */
- margin: 0 10px;
- padding: 8px;
- color: rgb(255, 255, 255);
+ /* background: linear-gradient(0deg, #e9c07f, #F8BD6B, #FFAC38); */
+ /* padding: 8px; */
+ background-color: white;
+ color: var(--fyui-text-color_1);
border-radius: 6px;
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, .4);
}
.schedule-card__2 {
@@ -22,14 +22,17 @@
position: absolute;
top: 0;
right: 4px;
- color: rgba(255, 255, 255, 0.15);
+ color: rgba(255, 255, 255, 0.719);
font-size: 30px;
}
.schedule-category {
display: flex;
+ background: linear-gradient(0deg, #ffffff, #E2EFFF, #c5dfff);
align-items: center;
- font-size: 14px;
+ font-size: 30rpx;
+ padding: 8px;
+ border-radius: 6px 6px 0 0;
}
.schedule-category>text {
@@ -37,15 +40,35 @@
}
.schedule-title {
- font-size: 20px;
- margin: 12px 0;
+ padding: 8px;
+ font-size: 36rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
+ font-weight: 600;
+ border-top: 1px solid rgba(151, 151, 151, 0.068);
}
.schedule-time {
+ padding: 0 8px;
display: flex;
justify-content: space-between;
- font-size: 14px;
+ align-items: baseline;
+ font-size: 24rpx;
+}
+
+.schedule-time__day {
+ font-size: 36rpx;
+}
+
+.schedule-time__right {
+ color: #77b2fa;
+}
+
+.schedule-time__right-2 {
+ color: orange;
+}
+
+.schedule-time__right-3 {
+ color: red;
}
\ No newline at end of file
diff --git a/pages/mService/cScheduletoday/index.js b/pages/mService/cScheduletoday/index.js
new file mode 100644
index 0000000..f15118f
--- /dev/null
+++ b/pages/mService/cScheduletoday/index.js
@@ -0,0 +1,150 @@
+import scheduleservice from '../../../service/scheduleservice';
+import moment from '../../../utils/moment.min';
+import { animation1 } from '../../../utils/animation';
+import $f from "../../../service/baserequest";
+
+Component({
+ properties: {},
+
+ data: {
+ icon_calendar: $f.baseIconUrl + 'res/calendar.jpg',
+ shcedules: [],
+ expand: false,
+ unfinishedCount: 0,
+ },
+ lifetimes: {
+ attached: function () {
+ this.getTodaySchedules();
+ },
+ },
+ methods: {
+ initAnimation() {
+ this.animation = animation1({
+ content: this,
+ selector: '.schedule-card__item',
+ size: this.data.schedules.length,
+ margin: 1,
+ });
+ },
+
+ getTodaySchedules() {
+ let startTime = moment().format('YYYY-MM-DD');
+ let endTime = startTime;
+ const that = this;
+ scheduleservice.getSchedules(
+ { startTime, endTime, type: 1 },
+ {
+ success(res) {
+ const schedules = [];
+ let unfinishedCount = 0;
+ res.data.forEach(r => {
+ r.time = moment(r.time.split('T')[0]).format('YYYY-MM-DD dddd');
+ schedules.push(r);
+ if (!r.finished) unfinishedCount++;
+ });
+ schedules.sort((a, b) => {
+ return a.finished - b.finished;
+ });
+ that.setData({ schedules, unfinishedCount });
+ that.initAnimation();
+ },
+ fail(e) {
+ console.log(e);
+ },
+ },
+ );
+ },
+
+ onCardClick() {
+ if (this.data.expand) {
+ this.setData({ expand: !this.data.expand });
+ this.animation.collapse();
+ } else {
+ this.animation.expand(() => {
+ this.setData({ expand: !this.data.expand });
+ });
+ }
+ },
+
+ onComplete(e) {
+ const { index } = e.currentTarget.dataset;
+ const s = this.data.schedules[index];
+ this.setData({
+ [`schedules[${index}].loading`]: true,
+ });
+ const that = this;
+ scheduleservice.completeSchedule(
+ { id: s.id },
+ {
+ success(res) {
+ that.setData({
+ [`schedules[${index}].loading`]: false,
+ [`schedules[${index}].recordId`]: res.data.srId,
+ });
+ that.completeAnimation(index);
+ },
+ fail(e) {
+ that.setData({
+ [`schedules[${index}].loading`]: false,
+ });
+ },
+ complete() {},
+ },
+ );
+ },
+
+ onRevoke(e) {
+ const { index } = e.currentTarget.dataset;
+ const s = this.data.schedules[index];
+ this.setData({
+ [`schedules[${index}].loading`]: true,
+ });
+ const that = this;
+ scheduleservice.revokeSchedule(
+ { recordId: s.recordId },
+ {
+ success(res) {
+ that.setData({
+ [`schedules[${index}].loading`]: false,
+ });
+ that.completeAnimation(index);
+ },
+ fail(e) {
+ that.setData({
+ [`schedules[${index}].loading`]: false,
+ });
+ },
+ complete() {},
+ },
+ );
+ },
+
+ completeAnimation(index) {
+ const { schedules } = this.data;
+ const s = schedules[index];
+ schedules.splice(index, 1);
+ let nextIndex = index;
+ if (s.finished) {
+ schedules.unshift(s);
+ nextIndex = 0;
+ } else {
+ schedules.push(s);
+ nextIndex = schedules.length - 1;
+ }
+ s.finished = !s.finished;
+ this.checkFinishedCount(s.finished);
+ this.animation.slideOut(index, () => {
+ this.setData({
+ schedules,
+ });
+ this.animation.slideIn(nextIndex, () => {});
+ });
+ },
+
+ checkFinishedCount(finished) {
+ let { unfinishedCount } = this.data;
+ unfinishedCount += finished ? -1 : 1;
+ this.setData({ unfinishedCount });
+ },
+ },
+});
diff --git a/pages/mService/cScheduletoday/index.json b/pages/mService/cScheduletoday/index.json
new file mode 100644
index 0000000..4a42478
--- /dev/null
+++ b/pages/mService/cScheduletoday/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+
+ }
+}
\ No newline at end of file
diff --git a/pages/mService/cScheduletoday/index.wxml b/pages/mService/cScheduletoday/index.wxml
new file mode 100644
index 0000000..d517a43
--- /dev/null
+++ b/pages/mService/cScheduletoday/index.wxml
@@ -0,0 +1,50 @@
+<block wx:if="{{schedules.length > 0}}">
+ <view
+ class="schedule-top {{unfinishedCount > 0 ? '' : 'schedule-top__finished'}}"
+ >
+ <view class="schedule-top-main">
+ <t-icon name="{{icon_calendar}}" size="36rpx" />
+ <text>浠婃棩瑕佺偣</text>
+ </view>
+ <view class="schedule-top-extend" bindtap="onCardClick">
+ <text
+ >{{unfinishedCount > 0 ? '浠婃棩寰呭畬鎴愪簨鍔�' + unfinishedCount + '椤�' :
+ '浠婃棩浜嬪姟宸插叏閮ㄥ畬鎴�'}}</text
+ >
+ <t-icon name="{{expand ? 'chevron-up' : 'chevron-down'}}" size="36rpx" />
+ </view>
+ </view>
+ <view class="schedule-wrap schedule-card__item-wrap">
+ <view
+ wx:for="{{schedules}}"
+ wx:key="index"
+ class="schedule-card {{expand ? 'schedule-card__expand' : ''}} schedule-card__item-{{index}} {{item.finished ? 'schedule-card__finished':''}}"
+ data-index="{{index}}"
+ catchtap="{{item.finished ? 'onRevoke' : 'onComplete'}}"
+ style="top: {{index * 3}}px;z-index: {{schedules.length - index}};left: {{index * 2}}px;"
+ >
+ <t-icon
+ name="{{item.finished ? 'check-circle-filled':'circle'}}"
+ color="orange"
+ size="36rpx"
+ />
+ <view class="schedule-title">{{item.title}}</view>
+ <!-- <t-button
+ t-class="t-class-button"
+ variant="outline"
+ shape="square"
+ theme="light"
+ size="small"
+ data-index="{{index}}"
+ catchtap="{{item.finished ? 'onRevoke' : 'onComplete'}}"
+ disabled="{{item.loading}}"
+ >
+ <view
+ slot="content"
+ class="schedule-btn {{item.finished ? 'schedule-btn__finished' : ''}}"
+ >{{item.finished ? '鎾ら攢':'瀹屾垚'}}</view
+ >
+ </t-button> -->
+ </view>
+ </view>
+</block>
diff --git a/pages/mService/cScheduletoday/index.wxss b/pages/mService/cScheduletoday/index.wxss
new file mode 100644
index 0000000..0fae3a3
--- /dev/null
+++ b/pages/mService/cScheduletoday/index.wxss
@@ -0,0 +1,110 @@
+.schedule-top {
+ background: linear-gradient(0deg, #ffffff, #E2EFFF, #c5dfff);
+ /* margin: 0 10px; */
+ padding: 8px;
+ font-size: 30rpx;
+ color: var(--fyui-text-color_1);
+ border-radius: 6px 6px 0 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
+}
+
+.schedule-top__finished {
+ /* background: linear-gradient(0deg, #158a0b, #3a9c26, #6ead5b); */
+}
+
+.schedule-top-main {
+ display: flex;
+ align-items: center;
+}
+
+.schedule-top-main>text {
+ margin-left: 8rpx;
+}
+
+.schedule-top-extend {
+ display: flex;
+ font-size: 24rpx;
+ align-items: center;
+ color: var(--fyui-text-color_2);
+}
+
+.schedule-wrap {
+ position: relative;
+ min-height: 100rpx;
+ margin-bottom: 16rpx;
+}
+
+.schedule-card {
+ position: absolute;
+ /* width: max-content; */
+ /* background: linear-gradient(0deg, #ffffff, #E2EFFF, #c5dfff); */
+ background-color: white;
+ /* margin: 0 10px; */
+ /* margin-top: 4px; */
+ padding: 8px;
+ color: var(--fyui-text-color_1);
+ border-radius: 6px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ left: 0;
+ right: 0;
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, .4);
+}
+
+.schedule-card__expand {
+ z-index: 0 !important;
+}
+
+.schedule-card__finished {
+ /* background: linear-gradient(0deg, #6ead5b, #3a9c26, #158a0b); */
+}
+
+.schedule-card__item-0 {
+ border-radius: 0 0 6px 6px !important;
+}
+
+.schedule-category {
+ display: block;
+ font-size: 16px;
+ font-weight: 600;
+ color: rgb(255, 255, 255);
+}
+
+.schedule-category>view>text {
+ margin-right: 4px;
+}
+
+.schedule-title {
+ font-size: 14px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ flex: 1;
+ padding: 0 4px;
+}
+
+.t-class-button {
+ --td-button-small-font-size: 36rpx;
+ /* --td-button-small-height: 50px; */
+}
+
+.schedule-btn {
+ background-color: white;
+ text-align: center;
+ color: #e08402;
+ font-size: 14px;
+ padding: 4px 8px;
+ border-radius: 8px;
+}
+
+.schedule-btn__finished {
+ color: #158a0b;
+}
+
+.schedule-btn:active {
+ background: rgb(224, 224, 224);
+}
\ No newline at end of file
diff --git a/pages/mService/pScheduledetail/pScheduledetail.js b/pages/mService/pScheduledetail/pScheduledetail.js
index 9d0add6..73e2027 100644
--- a/pages/mService/pScheduledetail/pScheduledetail.js
+++ b/pages/mService/pScheduledetail/pScheduledetail.js
@@ -1,40 +1,35 @@
// pages/mService/pScheduledetail/pScheduledetail.js
-Page({
+const util = require('../../../utils/util.js');
+Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
- data: {
- steps: [{
- index: '01',
- title: ['鍓嶅線鐜�', '淇濋儴闂�'],
- content: '鍓嶅線鐩稿叧鐜繚閮ㄩ棬鎻愪緵鐩稿叧璇佷欢锛屽彲杩涜钀ヤ笟鎵х収缁湡銆�'
- }, {
- index: '02',
- title: ['钀ヤ笟鎵�', '鐓х画鏈�'],
- content: '鍓嶅線鐩稿叧鐜繚閮ㄩ棬鎻愪緵鐩稿叧璇佷欢锛屽彲杩涜钀ヤ笟鎵х収缁湡銆�'
- }, {
- index: '03',
- title: ['钀ヤ笟鎵�', '鐓х画鏈�'],
- content: '鍓嶅線鐩稿叧鐜繚閮ㄩ棬鎻愪緵鐩稿叧璇佷欢锛屽彲杩涜钀ヤ笟鎵х収缁湡銆�'
- }]
- },
+ data: {},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad(options) {
- this.getOpenerEventChannel().on('acceptDataFromOpenerPage', (data) => {
- this.setData({
- thisSchedule: data
- })
- })
+ this.getOpenerEventChannel().on('acceptDataFromOpenerPage', data => {
+ let thisSchedule = util.deepCopy(data);
+ thisSchedule.steps.forEach((s, i) => {
+ s.index = util.formatNumber(i + 1);
+ s.title = this.splitStr(s.title);
+ });
+ this.setData({ thisSchedule });
+ });
},
onSubmit() {
wx.navigateTo({
url: '/pages/mService/pSchedule/pSchedule',
- success: (result) => {},
- })
- }
-})
\ No newline at end of file
+ success: result => {},
+ });
+ },
+
+ splitStr(str) {
+ let mid = Math.ceil(str.length / 2);
+ return [str.substring(0, mid), str.substring(mid, str.length)];
+ },
+});
diff --git a/pages/mService/pScheduledetail/pScheduledetail.wxml b/pages/mService/pScheduledetail/pScheduledetail.wxml
index 455b33c..615cac2 100644
--- a/pages/mService/pScheduledetail/pScheduledetail.wxml
+++ b/pages/mService/pScheduledetail/pScheduledetail.wxml
@@ -3,12 +3,12 @@
<view class="page__hd">
<view class="sd-card">
<view class="sd-card__title">{{thisSchedule.time}}</view>
- <view class="sd-card__content">{{thisSchedule.events[0].name}}</view>
+ <view class="sd-card__content">{{thisSchedule.title}}</view>
</view>
<view class="sd-item">
<view>鏃ョ▼绫诲埆</view>
- <view>{{thisSchedule.events[0].type == 1 ? '绯荤粺鏃ョ▼' : '鐜繚鏃ョ▼'}}</view>
+ <view>{{thisSchedule.type == 0 ? '鐜繚鏃ョ▼' : '鐜繚浜嬪姟'}}</view>
</view>
<view class="sd-item">
<view>寮�濮嬫椂闂�</view>
@@ -21,7 +21,7 @@
</view>
<view class="page__bd">
<view class="sd-divider"> <text>* * *</text> 鏃ョ▼鎻愰啋 <text>* * *</text> </view>
- <view class="sd-step" wx:for="{{thisSchedule.events[0].steps}}" wx:key="index">
+ <view class="sd-step" wx:for="{{thisSchedule.steps}}" wx:key="index" wx:for-index="index">
<text class="sd-step__index">{{item.index}}</text>
<view class="sd-step__title">{{item.title[0]}}<text>{{item.title[1]}}</text></view>
<view class="sd-step__content">{{item.content}}</view>
diff --git a/pages/mService/pServicehome/servicehome.wxml b/pages/mService/pServicehome/servicehome.wxml
index 6fc26a6..b60380b 100644
--- a/pages/mService/pServicehome/servicehome.wxml
+++ b/pages/mService/pServicehome/servicehome.wxml
@@ -3,13 +3,13 @@
<view class="page">
<view class="page__hd flex-h">
<view class="image-btn" bindtap="goto" data-index="2">
- <image src="/res/icons/btn_bg_2.png" class="" />
+ <image src="{{icon2}}" class="" />
<text class="image-btn_title">鏅鸿兘鍦ㄧ嚎鍜ㄨ</text>
<text class="image-btn_abstract">鍦ㄧ嚎鏅鸿兘鍜ㄨ鏈嶅姟</text>
<view class="image-btn_goto"></view>
</view>
<view class="image-btn" bindtap="goto" data-index="3">
- <image src="/res/icons/btn_bg_1.png" class="" />
+ <image src="{{icon1}}" class="" />
<text class="image-btn_title">鍦ㄧ嚎瀹堟硶瀛︿範</text>
<text class="image-btn_abstract">瀹炴椂鍦ㄧ嚎瀛︿範鏈嶅姟</text>
<view class="image-btn_goto"></view>
diff --git a/pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js b/pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js
index a696abb..00f4b22 100644
--- a/pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js
+++ b/pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js
@@ -1,13 +1,14 @@
// pages/mUser/baseC/c_company-info/c_company-info.js
-import {companyLedger} from '../../../../data/sceneInfo'
-import userservice from '../../../../service/userservice'
-import authservice from '../../../../service/authservice'
-import ledgerservice from "../../../../service/ledgerservice"
-import bInputCheck from '../../../../base/behaviors/bInputCheck'
-import bUploadLedger from '../../../mLedger/behaviors/bUploadLedger'
-import bLoadingToast from '../../../../base/behaviors/bLoadingToast'
+import { companyLedger } from '../../../../data/sceneInfo';
+import { sceneTypes1 } from '../../../../data/sceneTypes';
+import userservice from '../../../../service/userservice';
+import authservice from '../../../../service/authservice';
+import ledgerservice from '../../../../service/ledgerservice';
+import bInputCheck from '../../../../base/behaviors/bInputCheck';
+import bUploadLedger from '../../../mLedger/behaviors/bUploadLedger';
+import bLoadingToast from '../../../../base/behaviors/bLoadingToast';
-const app = getApp()
+const app = getApp();
Component({
behaviors: [bInputCheck, bUploadLedger, bLoadingToast],
@@ -20,65 +21,58 @@
properties: {
submitText: {
type: String,
- value: '鎻愪氦'
+ value: '鎻愪氦',
},
sceneType: {
type: String,
- value: '1'
+ value: '1',
},
},
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- sceneTypes: [
- {value: '1', name: '椁愰ギ'},
- {value: '7', name: '姹戒慨'},
- {value: '6', name: '宸ヤ笟浼佷笟' },
- {value: '2', name: '宸ュ湴'},
- {value: '3', name: '鐮佸ご'},
- {value: '4', name: '鍫嗗満'},
- {value: '5', name: '鎼呮媽绔�' },
- ],
+ sceneTypes: sceneTypes1,
sceneTypeIndex: 0,
- msg: [{
- name: "浼佷笟鍚嶇О",
- id: "ciName",
+ msg: [
+ {
+ name: '浼佷笟鍚嶇О',
+ id: 'ciName',
input: true,
value: '',
noValue: false,
},
{
- name: "浼佷笟鍦板潃",
- id: "ciAddress",
+ name: '浼佷笟鍦板潃',
+ id: 'ciAddress',
input: true,
value: '',
noValue: false,
},
{
- name: "淇$敤浠g爜",
- id: "ciOrgCode",
- input: true,
- value: "",
- noValue: false,
- },
- {
- name: "娉曚汉",
- id: "ciJuridicalPerson",
+ name: '淇$敤浠g爜',
+ id: 'ciOrgCode',
input: true,
value: '',
noValue: false,
},
{
- name: "鑱旂郴浜�",
- id: "ciContactName",
+ name: '娉曚汉',
+ id: 'ciJuridicalPerson',
input: true,
value: '',
noValue: false,
},
{
- name: "鑱旂郴鏂瑰紡",
- id: "ciTelephone",
+ name: '鑱旂郴浜�',
+ id: 'ciContactName',
+ input: true,
+ value: '',
+ noValue: false,
+ },
+ {
+ name: '鑱旂郴鏂瑰紡',
+ id: 'ciTelephone',
input: true,
value: '',
noValue: false,
@@ -89,13 +83,13 @@
ready() {
this.setData({
loadingText: '涓婁紶涓�',
- loadCompleteText: '涓婁紶瀹屾垚'
- })
+ loadCompleteText: '涓婁紶瀹屾垚',
+ });
this.setData({
- ledger: companyLedger[this.data.sceneType]
- })
- this.getCompanyInfo()
+ ledger: companyLedger[app.globalData.userInfo.extension2],
+ });
+ this.getCompanyInfo();
},
/**
@@ -103,84 +97,100 @@
*/
methods: {
changeSceneType(e) {
- let i = e.detail.value
+ let i = e.detail.value;
this.setData({
- sceneTypeIndex: i
- })
+ sceneTypeIndex: i,
+ });
},
//鑾峰彇浼佷笟淇℃伅
getCompanyInfo() {
- var that = this
- userservice.getBaseInfo(app.globalData.accessToken.userId, {
- success(data) {
- const msg = that.data.msg
- if (data.company != null) {
- const info = data.company
- msg[0].value = info.ciName
- msg[1].value = info.ciAddress
- msg[2].value = info.ciOrgCode
- msg[3].value = info.ciJuridicalPerson
- msg[4].value = info.ciContactName
- msg[5].value = info.ciTelephone
- that.setData({
- msg, info
- })
- }
- }
- }, app.globalData.accessToken.openId)
+ var that = this;
+ userservice.getBaseInfo(
+ app.globalData.accessToken.userId,
+ {
+ success(data) {
+ const msg = that.data.msg;
+ if (data.company != null) {
+ const info = data.company;
+ msg[0].value = info.ciName;
+ msg[1].value = info.ciAddress;
+ msg[2].value = info.ciOrgCode;
+ msg[3].value = info.ciJuridicalPerson;
+ msg[4].value = info.ciContactName;
+ msg[5].value = info.ciTelephone;
+ that.setData({
+ msg,
+ info,
+ });
+ }
+ },
+ },
+ app.globalData.accessToken.openId,
+ );
ledgerservice.getLedgerDetail(
- app.globalData.accessToken.userId, that.data.ledger.ledgerSubTypeId, that.data.ledger.sceneType, undefined, {
+ app.globalData.accessToken.userId,
+ that.data.ledger.ledgerSubTypeId,
+ that.data.ledger.sceneType,
+ undefined,
+ {
success(res) {
if (res.length > 0) {
- let detail = res[0]
+ let detail = res[0];
if (detail.upLoad) {
- let imgFiles = [{
- url: detail.path1[0],
- loading: false
- }]
+ let imgFiles = [
+ {
+ url: detail.path1[0],
+ loading: false,
+ },
+ ];
that.setData({
- imgFiles
- })
+ imgFiles,
+ });
}
}
- }
- })
+ },
+ },
+ );
},
//鎻愪氦浼佷笟淇℃伅
_submit() {
- var that = this
- this.setData({loading: true})
- authservice.authCompany(app.globalData.accessToken.openId, this.data.info, {
- success(res) {
- that.submintLedger()
+ var that = this;
+ this.setData({ loading: true });
+ authservice.authCompany(
+ app.globalData.accessToken.openId,
+ this.data.info,
+ {
+ success(res) {
+ that.submintLedger();
+ },
},
- })
+ );
},
//鎻愪氦鍥剧墖淇℃伅
submintLedger() {
if (this.data.imgFiles.length == 0) {
this.setData({
- loading: false
- })
+ loading: false,
+ });
wx.navigateBack({
delta: 1,
- })
- return
+ });
+ return;
}
if (this.data.imgFiles[0].url.indexOf('http') != -1) {
wx.downloadFile({
url: this.data.imgFiles[0].url,
- success: (res) => {
- const imgPath = res.tempFilePath
- this.data.imgFiles[0].url = imgPath
- this._uploadLedger()
- }
- })
+ success: res => {
+ const imgPath = res.tempFilePath;
+ this.data.imgFiles[0].url = imgPath;
+ this._uploadLedger();
+ },
+ });
} else {
- this._uploadLedger()
+ this._uploadLedger();
}
},
@@ -188,8 +198,7 @@
_success(res) {
wx.navigateBack({
delta: 1,
- })
- }
-
- }
-})
\ No newline at end of file
+ });
+ },
+ },
+});
diff --git a/pages/mUser/baseC/cSceneInfo/cSceneInfo.js b/pages/mUser/baseC/cSceneInfo/cSceneInfo.js
index 695ea15..61d40d8 100644
--- a/pages/mUser/baseC/cSceneInfo/cSceneInfo.js
+++ b/pages/mUser/baseC/cSceneInfo/cSceneInfo.js
@@ -1,13 +1,13 @@
// pages/mUser/baseC/cSceneInfo/cSceneInfo.js
-import {sceneInfo, sceneLedger} from '../../../../data/sceneInfo'
-import userservice from '../../../../service/userservice'
-import deviceservice from '../../../../service/deviceservice'
-import ledgerservice from "../../../../service/ledgerservice"
-import bInputCheck from '../../../../base/behaviors/bInputCheck'
-import bUploadLedger from '../../../mLedger/behaviors/bUploadLedger'
-import bLoadingToast from '../../../../base/behaviors/bLoadingToast'
+import { sceneInfo, sceneLedger } from '../../../../data/sceneInfo';
+import userservice from '../../../../service/userservice';
+import deviceservice from '../../../../service/deviceservice';
+import ledgerservice from '../../../../service/ledgerservice';
+import bInputCheck from '../../../../base/behaviors/bInputCheck';
+import bUploadLedger from '../../../mLedger/behaviors/bUploadLedger';
+import bLoadingToast from '../../../../base/behaviors/bLoadingToast';
-const app = getApp()
+const app = getApp();
Component({
behaviors: [bInputCheck, bUploadLedger, bLoadingToast],
@@ -20,30 +20,30 @@
properties: {
submitText: {
type: String,
- value: '鎻愪氦'
+ value: '鎻愪氦',
},
sceneType: {
type: String,
- value: '1'
+ value: '1',
},
authStatus: {
type: Boolean,
- value: false
- }
+ value: false,
+ },
},
ready() {
this.setData({
loadingText: '涓婁紶涓�',
- loadCompleteText: '涓婁紶瀹屾垚'
- })
- const info = sceneInfo()
+ loadCompleteText: '涓婁紶瀹屾垚',
+ });
+ const info = sceneInfo();
this.setData({
msg: info.get(this.data.sceneType),
- ledger: sceneLedger[this.data.sceneType]
- })
+ ledger: sceneLedger[this.data.sceneType],
+ });
//鑾峰彇鍦烘櫙淇℃伅
- this.getSceneInfo()
+ this.getSceneInfo();
},
/**
@@ -51,7 +51,8 @@
*/
data: {
msg: [],
- info: {}
+ info: {},
+ isUploadFile: true,
},
/**
@@ -60,200 +61,294 @@
methods: {
//鑾峰彇鍦烘櫙淇℃伅
getSceneInfo() {
- var that = this
- userservice.getBaseInfo(app.globalData.accessToken.userId, {
- success(data) {
- const msg = that.data.msg
- switch (that.data.sceneType) {
- case '1':
- if (data.baseInfo != null) {
- msg[0].value = data.baseInfo.biName
- msg[1].value = data.baseInfo.biNickName
- msg[3].value = data.baseInfo.biAddress
- msg[10].value = data.baseInfo.biContact
- msg[11].value = data.baseInfo.biTelephone
- msg[12].value = data.baseInfo.biTownName == null ? [] : [
- data.baseInfo.biProvinceName, data.baseInfo.biCityName, data.baseInfo.biDistrictName, data.baseInfo.biTownName,
- data.baseInfo.biProvinceCode, data.baseInfo.biCityCode, data.baseInfo.biDistrictCode, data.baseInfo.biTownCode,
- ]
- msg[12].displayValue = data.baseInfo.biTownName == null ? [] : [
- data.baseInfo.biProvinceName, data.baseInfo.biCityName, data.baseInfo.biDistrictName, data.baseInfo.biTownName,
- ]
- }
- if (data.specialInfo != null) {
- msg[2].value = data.specialInfo.rbCuisine
- msg[2].options.forEach(o => {
- o.checked = false
- });
- msg[2].value.split(';').forEach(v => {
- for (let i = 0; i < msg[2].options.length; i++) {
- const o = msg[2].options[i];
- if (v == o.name) {
- o.checked = true
- break
- } else if (o.hasRemark) {
- o.checked = true
- o.remark += v
- }
- }
- });
- const s = data.specialInfo.rbTotalSeating
- msg[4].value = data.specialInfo.rbTotalSeating
- msg[4].options.forEach(o => {
- o.checked = false
- });
- if (s == 0) {
- msg[4].options[0].checked = true
- } else if (s > 0 && s <= 20) {
- msg[4].options[1].checked = true
- } else if (s > 20 && s <= 50) {
- msg[4].options[2].checked = true
- } else if (s > 50 && s <= 100) {
- msg[4].options[3].checked = true
- } else {
- msg[4].options[4].checked = true
+ var that = this;
+ userservice.getBaseInfo(
+ app.globalData.accessToken.userId,
+ {
+ success(data) {
+ const msg = that.data.msg;
+ switch (that.data.sceneType) {
+ case '1':
+ that.setData({ isUploadFile: true });
+ msg[0].value = data.name;
+ msg[12].displayValue = ['涓婃捣甯�', '涓婃捣甯�', data.userInfo.extension1]
+ if (data.baseInfo != null) {
+ msg[1].value = data.baseInfo.biNickName;
+ msg[3].value = data.baseInfo.biAddress;
+ msg[10].value = data.baseInfo.biContact;
+ msg[11].value = data.baseInfo.biTelephone;
+ msg[12].value =
+ data.baseInfo.biTownName == null
+ ? []
+ : [
+ data.baseInfo.biProvinceName,
+ data.baseInfo.biCityName,
+ data.baseInfo.biDistrictName,
+ data.baseInfo.biTownName,
+ data.baseInfo.biProvinceCode,
+ data.baseInfo.biCityCode,
+ data.baseInfo.biDistrictCode,
+ data.baseInfo.biTownCode,
+ ];
+ msg[12].displayValue =
+ data.baseInfo.biTownName == null
+ ? []
+ : [
+ data.baseInfo.biProvinceName,
+ data.baseInfo.biCityName,
+ data.baseInfo.biDistrictName,
+ data.baseInfo.biTownName,
+ ];
}
- msg[7].value = data.specialInfo.rbCookingRangeNum
- msg[8].value = parseInt(data.specialInfo.rbCookingOilCapacity) * 12
- msg[9].value = data.specialInfo.rbCookingOilType
- msg[9].options.forEach(o => {
- o.checked = false
- });
- msg[9].value.split(';').forEach(v => {
- for (let i = 0; i < msg[9].options.length; i++) {
- const o = msg[9].options[i];
- if (v == o.name) {
- o.checked = true
- break
- } else if (o.hasRemark) {
- o.checked = true
- o.remark += v
- }
- }
- });
- msg[13].value = data.specialInfo.rbConcentrationArea
- msg[14].value = data.specialInfo.rbOutfallCount
- msg[15].value = data.specialInfo.rbOutfallLocation
- msg[16].value = data.specialInfo.rbOutfallNum
- }
- deviceservice.getPurifyDeviceInfo(app.globalData.accessToken.userId, {
- success(res) {
- if (res.length > 0) {
- that.setData({
- ['msg[5].value']: res[0].fpNum
- })
- }
- }
- })
- deviceservice.getMoniterDeviceInfo(app.globalData.accessToken.userId, {
- success(res) {
- if (res.length > 0) {
- that.setData({
- ['msg[6].value']: res[0].mdNum
- })
- }
- }
- })
- ledgerservice.getLedgerDetail(
- app.globalData.accessToken.userId, that.data.ledger.ledgerSubTypeId, that.data.ledger.sceneType, undefined, {
- success(res) {
- if (res.length > 0) {
- let detail = res[0]
- if (detail.upLoad) {
- let imgFiles = [{
- url: detail.path1[0],
- loading: false
- }]
- that.setData({
- imgFiles
- })
+ if (data.specialInfo != null) {
+ msg[2].value = data.specialInfo.rbCuisine;
+ msg[2].options.forEach(o => {
+ o.checked = false;
+ });
+ msg[2].value.split(';').forEach(v => {
+ for (let i = 0; i < msg[2].options.length; i++) {
+ const o = msg[2].options[i];
+ if (v == o.name) {
+ o.checked = true;
+ break;
+ } else if (o.hasRemark) {
+ o.checked = true;
+ o.remark += v;
}
}
+ });
+ const s = data.specialInfo.rbTotalSeating;
+ msg[4].value = data.specialInfo.rbTotalSeating;
+ msg[4].options.forEach(o => {
+ o.checked = false;
+ });
+ if (s == 0) {
+ msg[4].options[0].checked = true;
+ } else if (s > 0 && s <= 20) {
+ msg[4].options[1].checked = true;
+ } else if (s > 20 && s <= 50) {
+ msg[4].options[2].checked = true;
+ } else if (s > 50 && s <= 100) {
+ msg[4].options[3].checked = true;
+ } else {
+ msg[4].options[4].checked = true;
}
- })
- break;
- case '2':
+ msg[7].value = data.specialInfo.rbCookingRangeNum;
+ msg[8].value =
+ parseInt(data.specialInfo.rbCookingOilCapacity) * 12;
+ msg[9].value = data.specialInfo.rbCookingOilType;
+ msg[9].options.forEach(o => {
+ o.checked = false;
+ });
+ msg[9].value.split(';').forEach(v => {
+ for (let i = 0; i < msg[9].options.length; i++) {
+ const o = msg[9].options[i];
+ if (v == o.name) {
+ o.checked = true;
+ break;
+ } else if (o.hasRemark) {
+ o.checked = true;
+ o.remark += v;
+ }
+ }
+ });
+ msg[13].value = data.specialInfo.rbConcentrationArea;
+ msg[14].value = data.specialInfo.rbOutfallCount;
+ msg[15].value = data.specialInfo.rbOutfallLocation;
+ msg[16].value = data.specialInfo.rbOutfallNum;
+ }
+ deviceservice.getPurifyDeviceInfo(
+ app.globalData.accessToken.userId,
+ {
+ success(res) {
+ if (res.length > 0) {
+ that.setData({
+ ['msg[5].value']: res[0].fpNum,
+ });
+ }
+ },
+ },
+ );
+ deviceservice.getMoniterDeviceInfo(
+ app.globalData.accessToken.userId,
+ {
+ success(res) {
+ if (res.length > 0) {
+ that.setData({
+ ['msg[6].value']: res[0].mdNum,
+ });
+ }
+ },
+ },
+ );
+ ledgerservice.getLedgerDetail(
+ app.globalData.accessToken.userId,
+ that.data.ledger.ledgerSubTypeId,
+ that.data.ledger.sceneType,
+ undefined,
+ {
+ success(res) {
+ if (res.length > 0) {
+ let detail = res[0];
+ if (detail.upLoad) {
+ let imgFiles = [
+ {
+ url: detail.path1[0],
+ loading: false,
+ },
+ ];
+ that.setData({
+ imgFiles,
+ });
+ }
+ }
+ },
+ },
+ );
+ break;
+ case '2':
+ break;
+ case '3':
+ break;
+ case '4':
+ break;
+ case '5':
+ break;
+ case '6':
+ that.setData({ isUploadFile: false });
+ msg[0].value = data.name;
+ msg[5].displayValue = ['涓婃捣甯�', '涓婃捣甯�', data.userInfo.extension1]
+ if (data.baseInfo != null) {
+ msg[1].value = data.baseInfo.biNickName;
+ msg[2].value = data.baseInfo.biAddress;
+ msg[3].value = data.baseInfo.biContact;
+ msg[4].value = data.baseInfo.biTelephone;
+ msg[5].value =
+ data.baseInfo.biTownName == null
+ ? []
+ : [
+ data.baseInfo.biProvinceName,
+ data.baseInfo.biCityName,
+ data.baseInfo.biDistrictName,
+ data.baseInfo.biTownName,
+ data.baseInfo.biProvinceCode,
+ data.baseInfo.biCityCode,
+ data.baseInfo.biDistrictCode,
+ data.baseInfo.biTownCode,
+ ];
+ msg[5].displayValue =
+ data.baseInfo.biTownName == null
+ ? []
+ : [
+ data.baseInfo.biProvinceName,
+ data.baseInfo.biCityName,
+ data.baseInfo.biDistrictName,
+ data.baseInfo.biTownName,
+ ];
+ }
+ if (data.specialInfo != null) {
+ msg[6].value = data.specialInfo.ibProductionTechnique;
+ msg[7].value = data.specialInfo.ibWasteGasTechnique;
+ that._parseCheckBox(msg[7]);
+ msg[8].value = data.specialInfo.ibWasteGasMeasure;
+ that._parseCheckBox(msg[8]);
+ }
+ break;
+ case '7':
+ break;
+ default:
+ break;
+ }
+ that.setData({
+ msg,
+ });
+ },
+ },
+ app.globalData.accessToken.openId,
+ );
+ },
- break;
- case '3':
-
- break;
- case '4':
-
- break;
- case '5':
-
- break;
- case '6':
-
- break;
- case '7':
-
- break;
- default:
- break;
+ _parseCheckBox(data) {
+ data.options.forEach(o => {
+ o.checked = false;
+ });
+ data.value.split(';').forEach(v => {
+ for (let i = 0; i < data.options.length; i++) {
+ const o = data.options[i];
+ if (v == o.name) {
+ o.checked = true;
+ break;
+ } else if (o.hasRemark) {
+ o.checked = true;
+ o.remark += v;
}
- console.log(msg);
- that.setData({
- msg
- })
}
- }, app.globalData.accessToken.openId)
+ });
},
//鎻愪氦鍦烘櫙淇℃伅
_submit() {
- var that = this
- this.setData({
- loading: true
- })
+ var that = this;
//閽堝涓嶅悓鍦烘櫙锛屾暟鎹粨鏋勪細鏈変笉鍚岀殑瀹氬埗闇�姹�
switch (this.data.sceneType) {
case '1':
- const m = this.data.msg[4]
+ this.setData({
+ loading: true,
+ });
+ const m = this.data.msg[4];
for (let i = 0; i < m.options.length; i++) {
const o = m.options[i];
if (o.checked) {
this.setData({
- [`info.${m.id}`]: o.value
- })
- break
+ [`info.${m.id}`]: o.value,
+ });
+ break;
}
}
+ const sceneInfoStr = JSON.stringify(this.data.info);
+ userservice.authScene(
+ app.globalData.accessToken.openId,
+ app.globalData.userInfo.extension2,
+ sceneInfoStr,
+ {
+ success(res) {
+ that.submintLedger();
+ },
+ },
+ );
+ break;
+ case '6':
+ // this.setData({
+ // loading: false,
+ // });
break;
default:
break;
}
- const sceneInfoStr = JSON.stringify(this.data.info)
- userservice.authScene(app.globalData.accessToken.openId, app.globalData.userInfo.extension2, sceneInfoStr, {
- success(res) {
- that.submintLedger()
- },
- })
},
//鎻愪氦鍥剧墖淇℃伅
submintLedger() {
if (this.data.imgFiles.length == 0) {
this.setData({
- loading: false
- })
+ loading: false,
+ });
wx.navigateBack({
delta: 1,
- })
- return
+ });
+ return;
}
if (this.data.imgFiles[0].url.indexOf('http') != -1) {
wx.downloadFile({
url: this.data.imgFiles[0].url,
- success: (res) => {
- const imgPath = res.tempFilePath
- this.data.imgFiles[0].url = imgPath
- this._uploadLedger()
- }
- })
+ success: res => {
+ const imgPath = res.tempFilePath;
+ this.data.imgFiles[0].url = imgPath;
+ this._uploadLedger();
+ },
+ });
} else {
- this._uploadLedger()
+ this._uploadLedger();
}
},
@@ -261,7 +356,7 @@
_success(res) {
wx.navigateBack({
delta: 1,
- })
- }
- }
-})
\ No newline at end of file
+ });
+ },
+ },
+});
diff --git a/pages/mUser/baseC/cSceneInfo/cSceneInfo.wxml b/pages/mUser/baseC/cSceneInfo/cSceneInfo.wxml
index df23482..94dfa98 100644
--- a/pages/mUser/baseC/cSceneInfo/cSceneInfo.wxml
+++ b/pages/mUser/baseC/cSceneInfo/cSceneInfo.wxml
@@ -1,42 +1,28 @@
-<!--pages/mUser/baseC/cSceneInfo/cSceneInfo.wxml-->
-<view class="page__bd">
- <mp-toptips type="error" msg="{{errorMsg}}" show="{{errorMsg}}" delay="2000"></mp-toptips>
+<import src="../template-inputcell.wxml" />
- <view class="items">
- <mp-cells>
- <block wx:for="{{msg}}" wx:key="index">
- <block wx:if="{{item.type == 'checkbox'}}">
- <view class="hr-view"></view>
- <view id="{{item.id}}" class="item-title"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
- <mp-checkboxgroup options="{{item.options}}" data-index="{{index}}" bindchange="selectChange"></mp-checkboxgroup>
- </block>
- <block wx:elif="{{item.type == 'radio'}}">
- <view class="hr-view"></view>
- <view id="{{item.id}}" class="item-title"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
- <mp-radiogroup options="{{item.options}}" data-index="{{index}}" bindchange="selectChange"></mp-radiogroup>
- </block>
- <block wx:elif="{{item.type == 'picker'}}">
- <view class="hr-view"></view>
- <view class="top-card">
- <view id="{{item.id}}" class="tag"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
- <picker wx:if="{{item.pickerMode == 'selector'}}" mode="selector" bindchange="pickerChange" data-index="{{index}}" data-mode="selector" value="{{item.selectIndex}}" range="{{item.options}}" range-key="name" class="value">
- <view class="picker-text">{{item.options[item.selectIndex].name}}</view>
- </picker>
- <picker wx:elif="{{item.pickerMode == 'region'}}" mode="region" bindchange="pickerChange" data-index="{{index}}" data-mode="region" value="{{item.displayValue}}" class="value" level="sub-district">
- <view class="picker-text" wx:if="{{item.value.length > 0}}">{{item.value[0] + (item.value[1] == item.value[0] ? '' : item.value[1]) + item.value[2] + item.value[3]}}</view>
- <view wx:else class="picker-text" style="color: #B2B2B2;">璇烽�夋嫨琛楅晣</view>
- </picker>
- <mp-icon icon="arrow" color="black" size="{{10}}"></mp-icon>
- </view>
- </block>
- <input-cell id="{{item.id}}" wx:else item="{{item}}" bindpassValue="changeMsg"></input-cell>
- </block>
- </mp-cells>
- </view>
- <view class="weui-upload-view">
- <mp-upload title="涓婁紶椋熷搧缁忚惀璁稿彲璇�" titleClass="upload-title-class" max-count="1" files="{{imgFiles}}" binduploadImg="uploadFile" binddelete="delImg"></mp-upload>
+<view class="page__bd">
+ <mp-toptips
+ type="error"
+ msg="{{errorMsg}}"
+ show="{{errorMsg}}"
+ delay="2000"
+ ></mp-toptips>
+ <!-- <include src="../template-inputcell.wxml" /> -->
+ <!-- <slot name="head"></slot> -->
+ <view class="title-1">浼佷笟鍩烘湰淇℃伅</view>
+ <template is="sceneInfo" data="{{msg}}"> </template>
+ <slot></slot>
+ <view wx:if="{{isUploadFile}}" class="weui-upload-view">
+ <mp-upload
+ title="涓婁紶椋熷搧缁忚惀璁稿彲璇�"
+ titleClass="upload-title-class"
+ max-count="1"
+ files="{{imgFiles}}"
+ binduploadImg="uploadFile"
+ binddelete="delImg"
+ ></mp-upload>
</view>
</view>
<view class="page__ft">
<view class="submit" bindtap="onSubmit">{{submitText}}</view>
-</view>
\ No newline at end of file
+</view>
diff --git a/pages/mUser/baseC/cSceneInfo/cSceneInfo.wxss b/pages/mUser/baseC/cSceneInfo/cSceneInfo.wxss
index 8dc015a..08b1486 100644
--- a/pages/mUser/baseC/cSceneInfo/cSceneInfo.wxss
+++ b/pages/mUser/baseC/cSceneInfo/cSceneInfo.wxss
@@ -1,56 +1,4 @@
-/* pages/mUser/baseC/cSceneInfo/cSceneInfo.wxss */
-.top-card {
- /* width: 100vw; */
- position: relative;
- display: flex;
- flex-direction: row;
- /* justify-content: space-between; */
- background-color: white;
- padding: 8px 0px;
- /* margin: 0 8px; */
- font-size: 1rem;
- flex-wrap: nowrap;
-}
-
-.picker-text {
- /* color: var(--fyui-primary-color); */
- color: var(--fyui-text-color_1);
-}
-
-.items {
- position: relative;
- padding: 0 10px;
- background-color: white;
-}
-
-.item-title {
- white-space: nowrap;
- display: inline-block;
- font-size: 1rem;
- width: 32vw;
- margin-top: 8px;
-}
-
-.top-card .tag {
- flex-shrink: 0;
- width: 32vw;
- white-space: nowrap;
- /* background-color: seagreen; */
-}
-
-.top-card .value {
- flex-grow: 1;
-}
-
-.top-card .value view {
- /* white-space: nowrap; */
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- overflow-x: hidden;
- text-overflow: ellipsis;
- /* background-color: bisque; */
-}
+@import '../template-inputcell.wxss';
.weui-upload-view {
background-color: white;
@@ -61,22 +9,6 @@
background-color: white;
}
-.hr-view {
- height: 2rpx;
- margin: 0 0rpx;
- background-color: #f1f1f1;
-}
-
-.required {
- color: red;
- text-align: center;
- vertical-align: middle;
-}
-
-.not-required {
- color: transparent;
-}
-
.upload-title-class {
font-size: small;
-}
\ No newline at end of file
+}
diff --git a/pages/mUser/baseC/template-inputcell.wxml b/pages/mUser/baseC/template-inputcell.wxml
new file mode 100644
index 0000000..d7f525e
--- /dev/null
+++ b/pages/mUser/baseC/template-inputcell.wxml
@@ -0,0 +1,103 @@
+<template name="sceneInfo">
+ <view class="items">
+ <!-- <view wx:if="head" class="title-1">浼佷笟鍩烘湰淇℃伅</view> -->
+ <mp-cells>
+ <block wx:for="{{msg}}" wx:key="index">
+ <block wx:if="{{item.type == 'checkbox'}}">
+ <view class="hr-view"></view>
+ <view id="{{item.id}}" class="item-title"
+ ><text
+ class="{{item.required != false ? 'required' : 'not-required'}}"
+ >*</text
+ >{{item.name}}</view
+ >
+ <mp-checkboxgroup
+ options="{{item.options}}"
+ data-index="{{index}}"
+ bindchange="selectChange"
+ ></mp-checkboxgroup>
+ </block>
+ <block wx:elif="{{item.type == 'radio'}}">
+ <view class="hr-view"></view>
+ <view id="{{item.id}}" class="item-title"
+ ><text
+ class="{{item.required != false ? 'required' : 'not-required'}}"
+ >*</text
+ >{{item.name}}</view
+ >
+ <mp-radiogroup
+ options="{{item.options}}"
+ data-index="{{index}}"
+ bindchange="selectChange"
+ ></mp-radiogroup>
+ </block>
+ <block wx:elif="{{item.type == 'picker'}}">
+ <view class="hr-view"></view>
+ <view class="top-card">
+ <view id="{{item.id}}" class="tag"
+ ><text
+ class="{{item.required != false ? 'required' : 'not-required'}}"
+ >*</text
+ >{{item.name}}</view
+ >
+ <picker
+ wx:if="{{item.pickerMode == 'selector'}}"
+ mode="selector"
+ bindchange="pickerChange"
+ data-index="{{index}}"
+ data-mode="selector"
+ value="{{item.selectIndex}}"
+ range="{{item.options}}"
+ range-key="name"
+ class="value"
+ >
+ <view class="picker-text"
+ >{{item.options[item.selectIndex].name}}</view
+ >
+ </picker>
+ <picker
+ wx:elif="{{item.pickerMode == 'region'}}"
+ mode="region"
+ bindchange="pickerChange"
+ data-index="{{index}}"
+ data-mode="region"
+ value="{{item.displayValue}}"
+ class="value"
+ level="sub-district"
+ >
+ <view class="picker-text" wx:if="{{item.value.length > 0}}"
+ >{{item.value[0] + (item.value[1] == item.value[0] ? '' :
+ item.value[1]) + item.value[2] + item.value[3]}}</view
+ >
+ <view wx:else class="picker-text" style="color: #b2b2b2"
+ >璇烽�夋嫨琛楅晣</view
+ >
+ </picker>
+ <picker
+ wx:if="{{item.pickerMode == 'date'}}"
+ mode="date"
+ bindchange="pickerChange"
+ data-index="{{index}}"
+ data-mode="date"
+ value="{{item.selectIndex}}"
+ range="{{item.options}}"
+ range-key="name"
+ class="value"
+ >
+ <view class="picker-text"
+ >{{item.options[item.selectIndex].name}}</view
+ >
+ </picker>
+ <mp-icon icon="arrow" color="black" size="{{10}}"></mp-icon>
+ </view>
+ </block>
+ <input-cell
+ id="{{item.id}}"
+ wx:else
+ item="{{item}}"
+ bindpassValue="changeMsg"
+ ></input-cell>
+ </block>
+ </mp-cells>
+ </view>
+</template>
diff --git a/pages/mUser/baseC/template-inputcell.wxss b/pages/mUser/baseC/template-inputcell.wxss
new file mode 100644
index 0000000..a13a879
--- /dev/null
+++ b/pages/mUser/baseC/template-inputcell.wxss
@@ -0,0 +1,77 @@
+.items {
+ position: relative;
+ padding: 0 10px;
+ background-color: white;
+}
+
+.hr-view {
+ height: 2rpx;
+ margin: 0 0rpx;
+ background-color: #f1f1f1;
+}
+
+.item-title {
+ white-space: nowrap;
+ display: inline-block;
+ font-size: 1rem;
+ width: 32vw;
+ margin-top: 8px;
+}
+
+.required {
+ color: red;
+ text-align: center;
+ vertical-align: middle;
+}
+
+.not-required {
+ color: transparent;
+}
+
+.top-card {
+ /* width: 100vw; */
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ /* justify-content: space-between; */
+ background-color: white;
+ padding: 8px 0px;
+ /* margin: 0 8px; */
+ font-size: 30rpx;
+ flex-wrap: nowrap;
+}
+
+.top-card .tag {
+ flex-shrink: 0;
+ width: 32vw;
+ white-space: nowrap;
+ /* background-color: seagreen; */
+}
+
+.top-card .value {
+ flex-grow: 1;
+}
+
+.top-card .value view {
+ /* white-space: nowrap; */
+ display: -webkit-box;
+ -webkit-line-clamp: 1;
+ -webkit-box-orient: vertical;
+ overflow-x: hidden;
+ text-overflow: ellipsis;
+ /* background-color: bisque; */
+}
+
+.picker-text {
+ /* color: var(--fyui-primary-color); */
+ color: var(--fyui-text-color_1);
+}
+
+.title-1 {
+ position: relative;
+ display: flex;
+ justify-content: space-between;
+ padding: 12rpx 8px;
+ color: var(--fyui-text-color_2);
+ background-color: white;
+}
\ No newline at end of file
diff --git a/pages/mUser/companyauthentication/companyauthentication.js b/pages/mUser/companyauthentication/companyauthentication.js
index 38db596..6e2d766 100644
--- a/pages/mUser/companyauthentication/companyauthentication.js
+++ b/pages/mUser/companyauthentication/companyauthentication.js
@@ -1,4 +1,5 @@
// pages/mUser/companyauthentication/companyauthentication.js
+import $f from "../../../service/baserequest";
Page({
@@ -6,7 +7,7 @@
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
-
+ icon1: $f.baseIconUrl + 'res/companyinfo-1.png'
},
/**
diff --git a/pages/mUser/companyauthentication/companyauthentication.wxml b/pages/mUser/companyauthentication/companyauthentication.wxml
index 8b93ac9..637943d 100644
--- a/pages/mUser/companyauthentication/companyauthentication.wxml
+++ b/pages/mUser/companyauthentication/companyauthentication.wxml
@@ -1,6 +1,6 @@
<!--pages/mUser/companyauthentication/companyauthentication.wxml-->
<view class="page">
- <image class="banner-bg" src="/res/icons/companyinfo-1.png" mode="widthFix"></image>
+ <image class="banner-bg" src="{{icon1}}" mode="widthFix"></image>
<view class="tips">璇蜂粩缁嗘鏌ヤ互涓嬩俊鎭紝纭鏄惁姝g‘锛岃皟鏁村畬鎴愬悗鎻愪氦瀹屾垚璁よ瘉锛堝叾涓甫*鐨勪负蹇呭~椤癸紝鍏朵綑涓洪�夊~椤癸級</view>
<c-company-info></c-company-info>
</view>
diff --git a/pages/mUser/mine/mine.js b/pages/mUser/mine/mine.js
index e51ab94..28d9a96 100644
--- a/pages/mUser/mine/mine.js
+++ b/pages/mUser/mine/mine.js
@@ -1,19 +1,21 @@
// pages/mine/mine.js
-import userservice from '../../../service/userservice'
+import userservice from '../../../service/userservice';
+import $f from '../../../service/baserequest';
-const app = getApp()
+const app = getApp();
Page({
-
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ icon1: $f.baseIconUrl + 'res/learn_2.png',
+
version: app.globalData.version,
//璁よ瘉鐘舵�侊紝[浼佷笟, 鍦烘櫙, 涓汉]
- authStatus:[],
+ authStatus: [],
//鍦烘櫙绫诲瀷
- sceneType: app.globalData.userInfo.extension2
+ sceneType: app.globalData.userInfo.extension2,
},
/**
@@ -22,141 +24,163 @@
onLoad: function (options) {
this.setData({
userRealName: app.globalData.userInfo.realname,
- sceneType: app.globalData.userInfo.extension2
- })
- this.getBaseInfo()
+ sceneType: app.globalData.userInfo.extension2,
+ });
+ this.getBaseInfo();
},
onShow() {
- this.getAuthStatus()
+ this.getAuthStatus();
},
//鑾峰彇鐢ㄦ埛璁よ瘉鐘舵��
getAuthStatus() {
- var that = this
- userservice.getAuthStatus(app.globalData.accessToken.openId, app.globalData.accessToken.userId, {
- success(res) {
- if (res.success) {
- that.setData({
- authStatus: res.data
- })
- }else{
- wx.showToast({
- title: res.message,
- duration: 2000,
- icon: 'error',
- })
- }
- }
- })
+ var that = this;
+ userservice.getAuthStatus(
+ app.globalData.accessToken.openId,
+ app.globalData.accessToken.userId,
+ {
+ success(res) {
+ if (res.success) {
+ that.setData({
+ authStatus: res.data,
+ });
+ } else {
+ wx.showToast({
+ title: res.message,
+ duration: 2000,
+ icon: 'error',
+ });
+ }
+ },
+ },
+ );
},
getBaseInfo() {
- var that = this
- userservice.getBaseInfo(app.globalData.accessToken.userId, {
- success(data) {
- if (data.company != null) {
- that.setData({
- companyName: data.company.ciName
- })
- }
- }
- }, app.globalData.accessToken.openId)
+ var that = this;
+ userservice.getBaseInfo(
+ app.globalData.accessToken.userId,
+ {
+ success(data) {
+ if (data.company != null) {
+ that.setData({
+ companyName: data.company.ciName,
+ });
+ }
+ },
+ },
+ app.globalData.accessToken.openId,
+ );
},
logout() {
wx.reLaunch({
url: '/pages/mUser/userlogin/userlogin',
- })
+ });
},
goto(e) {
- var url = ""
- var index = e.currentTarget.dataset.index
+ var url = '';
+ var index = e.currentTarget.dataset.index;
switch (index) {
- case "0":
+ case '0':
//鐩戞祴鏁版嵁
- url = "/pages/mService/pDevicedata/pDevicedata"
+ url = '/pages/mService/pDevicedata/pDevicedata';
break;
- case "1":
+ case '1':
//閫氱煡绠$悊
- url = "/pages/mNotice/notice/notice"
+ url = '/pages/mNotice/notice/notice';
break;
- case "2":
+ case '2':
//鎶�鏈敮鎸�
- url = "/pages/mUser/pSupport/pSupport"
+ url = '/pages/mUser/pSupport/pSupport';
break;
- case "3":
+ case '3':
//鎴戠殑鏀惰棌
- url = ""
+ url = '';
break;
- case "4":
+ case '4':
//鎴戣鍜ㄨ
- url = "/pages/mConsult/consultonline/consultonline"
+ url = '/pages/mConsult/consultonline/consultonline';
break;
- case "5":
+ case '5':
//鐜繚鏃ョ▼
- url = "/pages/mService/pSchedule/pSchedule"
+ url = '/pages/mService/pSchedule/pSchedule';
break;
- case "6":
+ case '6':
//鍏充簬
- url = "/pages/mUser/pAbout/pAbout"
+ url = '/pages/mUser/pAbout/pAbout';
break;
- case "7":
+ case '7':
//鎿嶄綔鎸囧紩
- url = "/pages/mUser/pInstructions/pInstructions"
+ url = '/pages/mUser/pInstructions/pInstructions';
+ break;
+ case '8':
+ //瀹堟硶鎵胯
+ url = '/pages/mPromise/promisehome/promise';
break;
}
- if (url != "") {
+ if (url != '') {
wx.navigateTo({
- url: url
- })
+ url: url,
+ });
} else {
wx.showToast({
title: '鍔熻兘鏁鏈熷緟',
duration: 1000,
icon: 'none',
mask: true,
- })
+ });
}
},
//璁よ瘉
gotoAuthentication(e) {
//绛夊緟璁よ瘉鐘舵�佸姞杞藉畬姣�
- if (this.data.authStatus.length == 0) return
- var url = ""
- var index = e.currentTarget.dataset.index
+ if (this.data.authStatus.length == 0) return;
+ var url = '';
+ var index = e.currentTarget.dataset.index;
switch (index) {
//浼佷笟璁よ瘉
- case "0":
- url = "/pages/mUser/companyauthentication/companyauthentication"
+ case '0':
+ url = '/pages/mUser/companyauthentication/companyauthentication';
break;
//鍦烘櫙璁よ瘉
- case "1":
- url = "/pages/mUser/sceneauthentication/sceneauthentication"
+ case '1':
+ switch (this.data.sceneType) {
+ case '1':
+ url = '/pages/mUser/sceneauthentication/sceneauthentication';
+ break;
+ case '6':
+ url = '/pages/mUser/sceneauthentication/industrial/index';
+ break;
+ default:
+ url = '/pages/mUser/sceneauthentication/sceneauthentication';
+ break;
+ }
break;
//涓汉璁よ瘉
- case "2":
- url = "/pages/mUser/personalauthentication/personalauthentication"
+ case '2':
+ url = '/pages/mUser/personalauthentication/personalauthentication';
break;
}
- if (url != "") {
+ if (url != '') {
wx.navigateTo({
url: url,
- success: (res) => {
+ success: res => {
res.eventChannel.emit('acceptDataFromOpenerPage', {
- authStatus: this.data.authStatus[parseInt(index)]
- })
+ authStatus: this.data.authStatus[parseInt(index)],
+ });
},
- })
+ });
} else {
wx.showToast({
title: '鍔熻兘鏁鏈熷緟',
duration: 1000,
icon: 'none',
mask: true,
- })
+ });
}
},
@@ -167,6 +191,6 @@
// success: (res) => {
// res.eventChannel.emit('acceptDataFromOpenerPage', app.globalData.)
// },
- })
- }
-})
\ No newline at end of file
+ });
+ },
+});
diff --git a/pages/mUser/mine/mine.wxml b/pages/mUser/mine/mine.wxml
index 0d0e45b..0971741 100644
--- a/pages/mUser/mine/mine.wxml
+++ b/pages/mUser/mine/mine.wxml
@@ -6,7 +6,7 @@
<image bindtap="gotoQrcode" style="width: 24px;height: 24px;padding: 6px;" src="/res/icons/qrcode.png"></image>
</view>
<view class="flex-h" style="margin-top: 30px;">
- <image class="user-icon" src="/res/icons/learn_2.png" mode="aspectFill"></image>
+ <image class="user-icon" src="{{icon1}}" mode="aspectFill"></image>
<view class="flex-v">
<view class="user-name">{{userRealName}}</view>
<view class="user-tag">{{companyName}}</view>
@@ -27,6 +27,11 @@
<!-- <view>{{authStatus[1] ? '淇敼搴楅摵淇℃伅' : '搴楅摵淇℃伅璁よ瘉'}}</view> -->
<view>搴楅摵淇℃伅璁よ瘉</view>
</view>
+ <view wx:if="{{sceneType == 6}}" bindtap="gotoAuthentication" data-index="1">
+ <text class="{{authStatus[1] ? 'status-1' : 'status-2'}}">{{authStatus[1] ? '宸茶璇�' : '鏈璇�'}}</text>
+ <image src="/res/icons/scene_info.png"></image>
+ <view>鐜繚绠$悊璁よ瘉</view>
+ </view>
<view bindtap="gotoAuthentication" data-index="2">
<text class="{{authStatus[2] ? 'status-1' : 'status-2'}}">{{authStatus[2] ? '宸茶璇�' : '鏈璇�'}}</text>
<image src="/res/icons/personal.png"></image>
@@ -35,9 +40,16 @@
</view>
</view>
<view class="fyui-panel">
+ <view class="fyui-cell fyui-cell_select title" bindtap="goto" data-index="8">
+ <view class="fyui-cell__hd">
+ <image src="/res/icons/icon9.png" class="icon" />
+ </view>
+ <view class="fyui-cell__bd">瀹堟硶鎵胯</view>
+ <view class="fyui-cell__ft"></view>
+ </view>
<view class="fyui-cell fyui-cell_select title" bindtap="goto" data-index="0">
<view class="fyui-cell__hd">
- <image src="/res/icons/icon5.png" class="icon" />
+ <image src="/res/icons/icon8.png" class="icon" />
</view>
<view class="fyui-cell__bd">鐩戞祴鏁版嵁</view>
<view class="fyui-cell__ft"></view>
diff --git a/pages/mUser/personalauthentication/personalauthentication.js b/pages/mUser/personalauthentication/personalauthentication.js
index ad7b13b..fe5c645 100644
--- a/pages/mUser/personalauthentication/personalauthentication.js
+++ b/pages/mUser/personalauthentication/personalauthentication.js
@@ -3,6 +3,7 @@
import authservice from '../../../service/authservice'
import bInputCheck from '../../../base/behaviors/bInputCheck'
import bLoadingToast from '../../../base/behaviors/bLoadingToast'
+import $f from "../../../service/baserequest";
const app = getApp()
@@ -12,6 +13,8 @@
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ icon1: $f.baseIconUrl + 'res/companyinfo-1.png',
+
idTypes: [
{value: '0', name: '韬唤璇�'},
],
@@ -34,6 +37,7 @@
options: [
{name: '鏈�夋嫨', value: '-1'},
{name: '韬唤璇�', value: '0'},
+ {name: '鍏朵粬', value: '1'},
]
},
{
diff --git a/pages/mUser/personalauthentication/personalauthentication.wxml b/pages/mUser/personalauthentication/personalauthentication.wxml
index f7656df..f0e736f 100644
--- a/pages/mUser/personalauthentication/personalauthentication.wxml
+++ b/pages/mUser/personalauthentication/personalauthentication.wxml
@@ -1,7 +1,7 @@
<!--pages/mUser/personalauthentication/personalauthentication.wxml-->
<mp-toptips type="error" msg="{{errorMsg}}" show="{{errorMsg}}" delay="2000"></mp-toptips>
<view class="page">
- <image class="banner-bg" src="/res/icons/companyinfo-1.png" mode="widthFix"></image>
+ <image class="banner-bg" src="{{icon1}}" mode="widthFix"></image>
<view class="tips">璇蜂粩缁嗘鏌ヤ互涓嬩俊鎭紝纭鏄惁姝g‘锛岃皟鏁村畬鎴愬悗鎻愪氦瀹屾垚璁よ瘉锛堝叾涓甫*鐨勪负蹇呭~椤癸紝鍏朵綑涓洪�夊~椤癸級</view>
<view class="page__bd">
<!-- <view class="top-card">
diff --git a/pages/mUser/sceneauthentication/industrial/index.js b/pages/mUser/sceneauthentication/industrial/index.js
new file mode 100644
index 0000000..8a72889
--- /dev/null
+++ b/pages/mUser/sceneauthentication/industrial/index.js
@@ -0,0 +1,309 @@
+import $f from '../../../../service/baserequest';
+import authservice from '../../../../service/authservice';
+import deviceservice from '../../../../service/deviceservice';
+import userservice from '../../../../service/userservice';
+import bLoadingToast from '../../../../base/behaviors/bLoadingToast';
+import moment from '../../../../utils/moment.min';
+
+const app = getApp();
+
+function newDevice() {
+ return [
+ {
+ name: 'id',
+ id: 'vpId',
+ input: true,
+ value: '',
+ noValue: false,
+ required: false,
+ show: false,
+ },
+ {
+ name: '浼佷笟id',
+ id: 'ibGuid',
+ input: true,
+ value: '',
+ noValue: false,
+ required: false,
+ show: false,
+ },
+ {
+ name: '璁捐椋庨噺',
+ id: 'vpAirVolume',
+ type: 'number',
+ input: true,
+ value: '',
+ noValue: false,
+ required: false,
+ unit: '绔嬫柟绫�/灏忔椂',
+ },
+ {
+ name: '鍚搁檮鍓傚悕绉�',
+ id: 'vpAbsorbentName',
+ input: true,
+ value: '',
+ noValue: false,
+ required: false,
+ },
+ {
+ name: '濉厖閲�',
+ id: 'vpAbsorbentAmount',
+ type: 'number',
+ input: true,
+ value: '',
+ noValue: false,
+ required: false,
+ unit: '鍏枻',
+ },
+ {
+ name: '鏇存崲鍛ㄦ湡',
+ id: 'vpPeriodUnit',
+ type: 'picker',
+ pickerMode: 'selector',
+ value: '',
+ noValue: false,
+ selectIndex: 0,
+ options: [
+ { name: '姣忓懆', value: '姣忓懆' },
+ { name: '姣忔湀', value: '姣忔湀' },
+ { name: '姣忓搴�', value: '姣忓搴�' },
+ { name: '姣忓勾', value: '姣忓勾' },
+ ],
+ required: false,
+ },
+ {
+ name: '鏇存崲娆℃暟',
+ id: 'vpPeriodCount',
+ type: 'number',
+ input: true,
+ value: '',
+ noValue: false,
+ required: false,
+ unit: '娆�',
+ show: true,
+ },
+ {
+ name: '姣忔鏇存崲閲�',
+ id: 'vpPeriodWeight',
+ type: 'number',
+ input: true,
+ value: '',
+ noValue: false,
+ required: false,
+ unit: '鍏枻',
+ },
+ {
+ name: '鏈�鏂版洿鎹㈡椂闂�',
+ id: 'vpChangeTime',
+ type: 'picker',
+ pickerMode: 'date',
+ value: moment().format('YYYY-MM-DD'),
+ noValue: false,
+ required: false,
+ },
+ ];
+}
+
+Page({
+ behaviors: [bLoadingToast],
+ data: {
+ icon1: $f.baseIconUrl + 'res/companyinfo-1.png',
+ selfCheck: {
+ // ibAdsorbentCorrect: false,
+ // ibPeriodCorrect: false,
+ // ibHasContract: false,
+ // ibKeepContract: false,
+ },
+ hasDevice: false,
+ baseMsg: [],
+ deviceMsg: [],
+ },
+
+ /**
+ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
+ */
+ onLoad(options) {
+ this.setData({
+ sceneType: app.globalData.userInfo.extension2,
+ });
+ this.getOpenerEventChannel().on('acceptDataFromOpenerPage', data => {
+ this.setData({
+ authStatus: data.authStatus,
+ });
+ });
+ const deviceMsg = [newDevice()];
+ this.setData({ deviceMsg });
+ this.getBaseInfo();
+ },
+
+ getBaseInfo() {
+ var that = this;
+ userservice.getBaseInfo(
+ app.globalData.accessToken.userId,
+ {
+ success(data) {
+ if (data.specialInfo != null) {
+ const checkboxValue = [];
+ data.specialInfo.ibAdsorbentCorrect
+ ? checkboxValue.push('ibAdsorbentCorrect')
+ : '';
+ data.specialInfo.ibPeriodCorrect
+ ? checkboxValue.push('ibPeriodCorrect')
+ : '';
+ data.specialInfo.ibHasContract
+ ? checkboxValue.push('ibHasContract')
+ : '';
+ data.specialInfo.ibKeepContract
+ ? checkboxValue.push('ibKeepContract')
+ : '';
+ that.setData({
+ hasDevice: data.specialInfo.ibHasAbsorbTechnique,
+ selfCheck: {
+ ibAdsorbentCorrect: data.specialInfo.ibAdsorbentCorrect,
+ ibPeriodCorrect: data.specialInfo.ibPeriodCorrect,
+ ibHasContract: data.specialInfo.ibHasContract,
+ ibKeepContract: data.specialInfo.ibKeepContract,
+ },
+ checkboxValue,
+ });
+ }
+ },
+ },
+ app.globalData.accessToken.openId,
+ );
+ deviceservice.getVOCPurifyDeviceInfo(app.globalData.accessToken.userId, {
+ success(data) {
+ const { deviceMsg } = that.data;
+ const value = data.length - deviceMsg.length;
+ if (value > 0) {
+ for (let i = 0; i < value; i++) {
+ deviceMsg.push(newDevice());
+ }
+ }
+ for (let i = 0; i < data.length; i++) {
+ const d = data[i];
+ const device = deviceMsg[i];
+ for (let y = 0; y < device.length; y++) {
+ const e = device[y];
+ e.value = d[e.id];
+ if (e.options) {
+ for (let i = 0; i < e.options.length; i++) {
+ const o = e.options[i];
+ if (o.value == e.value) {
+ e.selectIndex = i;
+ break;
+ }
+ }
+ }
+ }
+ }
+ that.setData({ deviceMsg });
+ },
+ });
+ },
+
+ handleSwitchChange(e) {
+ this.setData({ hasDevice: e.detail.value });
+ },
+
+ onCheckBoxChange(e) {
+ console.log('onCheckBoxChange', e);
+ const { value } = e.detail;
+ const { selfCheck } = this.data;
+ value.forEach(v => {
+ selfCheck[v] = true;
+ });
+ this.setData({ selfCheck, checkboxValue: value });
+ },
+
+ onNewDevice() {
+ const { deviceMsg } = this.data;
+ deviceMsg.push(newDevice());
+ this.setData({ deviceMsg });
+ console.log(deviceMsg);
+ },
+
+ onDeleteDevice(e) {
+ const { index } = e.currentTarget.dataset;
+ const { deviceMsg } = this.data;
+ deviceMsg.splice(index, 1);
+ this.setData({ deviceMsg });
+ console.log(deviceMsg);
+ },
+
+ onDeviceChange(e) {
+ const { index } = e.currentTarget.dataset;
+ const msg = e.detail;
+ this.setData({
+ [`deviceMsg[${index}]`]: msg,
+ });
+ },
+
+ onSubmit(e) {
+ console.log(e);
+ let info = e.detail;
+ const { deviceMsg, selfCheck, hasDevice } = this.data;
+ info = { ...info, ibHasAbsorbTechnique: hasDevice };
+ info = { ...info, ...selfCheck };
+ console.log(info);
+ // 涓婁紶鍩烘湰淇℃伅
+ const sceneInfoStr = JSON.stringify(info);
+ if (hasDevice) {
+ // 涓婁紶澶勭悊璁炬柦淇℃伅
+ console.log(deviceMsg);
+ const deviceList = [];
+ deviceMsg.forEach(d => {
+ const device = {};
+ d.forEach(e => {
+ device[e.id] = e.value;
+ });
+ device.vpChangeTime = moment(device.vpChangeTime).format();
+ deviceList.push(device);
+ });
+
+ this.loadStart();
+ authservice.authScene(
+ app.globalData.accessToken.openId,
+ app.globalData.userInfo.extension2,
+ sceneInfoStr,
+ {
+ success(res) {
+ deviceservice.uploadVOCDevice(
+ app.globalData.accessToken.userId,
+ deviceList,
+ {
+ success(res) {
+ wx.navigateBack({
+ delta: 1,
+ });
+ },
+ finally() {
+ this.loadComplete();
+ },
+ },
+ );
+ },
+ fail() {
+ this.loadComplete();
+ },
+ },
+ );
+ } else {
+ authservice.authScene(
+ app.globalData.accessToken.openId,
+ app.globalData.userInfo.extension2,
+ sceneInfoStr,
+ {
+ success(res) {
+ wx.navigateBack({
+ delta: 1,
+ });
+ },
+ fail() {
+ this.loadComplete();
+ },
+ },
+ );
+ }
+ },
+});
diff --git a/pages/mUser/sceneauthentication/industrial/index.json b/pages/mUser/sceneauthentication/industrial/index.json
new file mode 100644
index 0000000..ac7615e
--- /dev/null
+++ b/pages/mUser/sceneauthentication/industrial/index.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "鐜繚绠$悊璁よ瘉",
+ "usingComponents": {
+ "c-scene-info": "../../baseC/cSceneInfo/cSceneInfo",
+ "mp-cells": "/component/cells/cells",
+ "input-cell": "/component/inputcell/inputcell",
+ "mp-icon": "/component/icon/icon",
+ "mp-toptips": "/component/toptips/toptips",
+ "mp-checkboxgroup": "/component/checkboxgroup/checkboxgroup",
+ "mp-radiogroup": "/component/radiogroup/radiogroup",
+ "c-form": "/component/form/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/mUser/sceneauthentication/industrial/index.wxml b/pages/mUser/sceneauthentication/industrial/index.wxml
new file mode 100644
index 0000000..cc87766
--- /dev/null
+++ b/pages/mUser/sceneauthentication/industrial/index.wxml
@@ -0,0 +1,88 @@
+<import src="../../baseC/template-inputcell.wxml" />
+
+<view class="page">
+ <image class="banner-bg" src="{{icon1}}" mode="widthFix"></image>
+ <view class="tips"
+ >璇蜂粩缁嗘鏌ヤ互涓嬩俊鎭紝纭鏄惁姝g‘锛岃皟鏁村畬鎴愬悗鎻愪氦瀹屾垚璁よ瘉锛堝叾涓甫*鐨勪负蹇呭~椤癸紝鍏朵綑涓洪�夊~椤癸級</view
+ >
+ <!-- <view class="item-title-1">浼佷笟鍩烘湰淇℃伅</view> -->
+ <c-scene-info sceneType="{{sceneType}}" bindonSubmit="onSubmit">
+ <block slot>
+ <t-cell title="閲囩敤鏇存崲寮忓惛闄勫鐞嗗伐鑹�">
+ <t-switch
+ bindchange="handleSwitchChange"
+ value="{{hasDevice}}"
+ label="{{['鏄�', '鍚�']}}"
+ slot="note"
+ />
+ </t-cell>
+ <block wx:if="{{hasDevice}}">
+ <view class="item-title-1">鍚堣鎬х‘璁�</view>
+ <t-checkbox-group
+ t-class="theme-card"
+ value="{{checkboxValue}}"
+ bind:change="onCheckBoxChange"
+ >
+ <t-checkbox
+ t-class="t-class-checkbox"
+ value="ibAdsorbentCorrect"
+ label="鍚搁檮鍓傚~鍏呴噺绗﹀悎璁捐鏂囦欢"
+ />
+ <t-checkbox
+ t-class="t-class-checkbox"
+ value="ibPeriodCorrect"
+ label="鍚搁檮鍓傛洿鎹㈠懆鏈熺鍚堣璁℃枃浠�"
+ />
+ <t-checkbox
+ t-class="t-class-checkbox"
+ value="ibHasContract"
+ label="鏈夎喘涔板惛闄勫墏鍜屽簾鍚搁檮鍓傚鐞嗙殑鐩稿叧鍚堝悓銆佺エ鎹�"
+ />
+ <t-checkbox
+ t-class="t-class-checkbox"
+ value="ibKeepContract"
+ label="鐩稿叧鍚堝悓銆佺エ鎹槸鍚︿繚瀛�3骞�"
+ />
+ </t-checkbox-group>
+ <!-- <template is="sceneInfo" data="{{ msg: baseMsg }}" /> -->
+ <block wx:for="{{deviceMsg}}" wx:key="index">
+ <view class="item-title-1">
+ <view>澶勭悊璁炬柦{{index + 1}}</view>
+ <t-icon
+ wx:if="{{index > 0}}"
+ name="close-circle-filled"
+ size="48rpx"
+ data-index="{{index}}"
+ bind:click="onDeleteDevice"
+ />
+ </view>
+ <c-form form="{{item}}" data-index="{{index}}" bind:itemChange="onDeviceChange"></c-form>
+ <!-- <template is="sceneInfo" data="{{ msg: item }}" /> -->
+ <!-- <view style="padding: 0 10px;background-color: white;">
+ <mp-cells>
+ <input-cell
+ wx:for="{{item}}"
+ wx:for-index="index2"
+ wx:for-item="device"
+ wx:key="index2"
+ data-index="{{[index, index2]}}"
+ id="{{device.id}}"
+ item="{{device}}"
+ bindpassValue="changeMsg"
+ ></input-cell>
+ </mp-cells>
+ </view> -->
+ </block>
+ <view style="display: flex; justify-content: center; padding: 24rpx">
+ <t-button
+ theme="primary"
+ icon="add"
+ size="medium"
+ bindtap="onNewDevice"
+ >鏂板澶勭悊璁炬柦</t-button
+ >
+ </view>
+ </block>
+ </block>
+ </c-scene-info>
+</view>
diff --git a/pages/mUser/sceneauthentication/industrial/index.wxss b/pages/mUser/sceneauthentication/industrial/index.wxss
new file mode 100644
index 0000000..24a07d9
--- /dev/null
+++ b/pages/mUser/sceneauthentication/industrial/index.wxss
@@ -0,0 +1,41 @@
+@import '../../baseC/template-inputcell.wxss';
+
+.t-class-checkbox {
+ --td-checkbox-font-size: 30rpx
+}
+
+.tips {
+ position: relative;
+ color: white;
+ padding: 16px;
+ font-size: 14px;
+ font-weight: 550;
+}
+
+.banner-bg {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 0;
+ /* background-color: aqua; */
+}
+
+.item-title-1 {
+ width: 90%;
+ display: flex;
+ justify-content: space-between;
+ padding: 12rpx 32rpx;
+ color: var(--fyui-text-color_2);
+}
+
+.theme-card {
+ /* border-radius: 24rpx; */
+ /* margin: 12rpx 32rpx; */
+ overflow: hidden;
+}
+
+.btn-add {
+ background: white;
+}
\ No newline at end of file
diff --git a/pages/mUser/sceneauthentication/sceneauthentication.js b/pages/mUser/sceneauthentication/sceneauthentication.js
index 8a75ed4..5f6500b 100644
--- a/pages/mUser/sceneauthentication/sceneauthentication.js
+++ b/pages/mUser/sceneauthentication/sceneauthentication.js
@@ -1,5 +1,5 @@
// pages/mUser/sceneauthentication/sceneauthentication.js
-
+import $f from "../../../service/baserequest";
const app = getApp()
@@ -9,7 +9,7 @@
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
-
+ icon1: $f.baseIconUrl + 'res/companyinfo-1.png'
},
/**
@@ -23,6 +23,11 @@
this.setData({
authStatus: data.authStatus
})
+ if (data.barTitle) {
+ wx.setNavigationBarTitle({
+ title: data.barTitle,
+ });
+ }
})
},
diff --git a/pages/mUser/sceneauthentication/sceneauthentication.wxml b/pages/mUser/sceneauthentication/sceneauthentication.wxml
index a217bf1..87e084c 100644
--- a/pages/mUser/sceneauthentication/sceneauthentication.wxml
+++ b/pages/mUser/sceneauthentication/sceneauthentication.wxml
@@ -1,6 +1,6 @@
<!--pages/mUser/sceneauthentication/sceneauthentication.wxml-->
<view class="page">
- <image class="banner-bg" src="/res/icons/companyinfo-1.png" mode="widthFix"></image>
+ <image class="banner-bg" src="{{icon1}}" mode="widthFix"></image>
<view class="tips">璇蜂粩缁嗘鏌ヤ互涓嬩俊鎭紝纭鏄惁姝g‘锛岃皟鏁村畬鎴愬悗鎻愪氦瀹屾垚璁よ瘉锛堝叾涓甫*鐨勪负蹇呭~椤癸紝鍏朵綑涓洪�夊~椤癸級</view>
<c-scene-info sceneType="{{sceneType}}" bindonSubmit="onSubmit"></c-scene-info>
</view>
diff --git a/pages/mUser/userlogin/userlogin.js b/pages/mUser/userlogin/userlogin.js
index fa5d547..215ce20 100644
--- a/pages/mUser/userlogin/userlogin.js
+++ b/pages/mUser/userlogin/userlogin.js
@@ -2,9 +2,15 @@
// import bLogin from '../behaviors/bLogin'
// import $f from "../../../service/baserequest"
-const bLogin = require('../behaviors/bLogin')
-const $f = require("../../../service/baserequest")
-const app = getApp()
+const bLogin = require('../behaviors/bLogin');
+const $f = require('../../../service/baserequest');
+const app = getApp();
+
+const tmplIds = [
+ 'zPNMzF5WsshniJyl83DD-u7MyVoUozOc2kjK8dGZcSA',
+ 'zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU',
+ 'dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w',
+];
Page({
behaviors: [bLogin],
@@ -22,46 +28,38 @@
onLoad: function (options) {
wx.getStorage({
key: 'agree',
- success: (res) => {
+ success: res => {
this.setData({
- agree: res.data
- })
- }
- })
+ agree: res.data,
+ });
+ },
+ });
wx.getStorage({
key: 'userProfile',
- success: (res) => {
+ success: res => {
this.setData({
- userProfile: res.data
- })
+ userProfile: res.data,
+ });
},
- })
+ });
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
*/
- onReady: function () {
-
- },
+ onReady: function () {},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
*/
- onShow: function () {
-
- },
+ onShow: function () {},
loginWx() {
- var that = this
- if (!this.waitAgree()) return
+ var that = this;
+ if (!this.waitAgree()) return;
if (app.globalData.userProfile) {
wx.requestSubscribeMessage({
- tmplIds: [
- '6JQFOJ12yBvKfRg_duSdwKiH5_J3LpICmz3Li-L1Cr8',
- 'zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU',
- 'dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w'
- ],
+ tmplIds: tmplIds,
success(res) {
console.log(res);
},
@@ -69,42 +67,35 @@
console.log(e);
},
complete() {
- that.loginPw(app.globalData.userProfile)
- }
- })
+ that.loginPw(app.globalData.userProfile);
+ },
+ });
} else {
wx.getUserProfile({
lang: 'zh_CN',
desc: '鐢ㄤ簬鏄剧ず锛屾彁绀虹敤鎴峰綋鍓嶅凡鐧诲綍',
- success: (res) => {
+ success: res => {
console.log(res);
wx.setStorage({
data: res.userInfo,
key: 'userProfile',
- })
- this.loginPw(res.userInfo)
+ });
+ this.loginPw(res.userInfo);
},
complete() {
wx.requestSubscribeMessage({
- tmplIds: [
- '6JQFOJ12yBvKfRg_duSdwKiH5_J3LpICmz3Li-L1Cr8',
- 'zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU',
- 'dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w'
- ],
+ tmplIds: tmplIds,
success(res) {
console.log(res);
},
fail(e) {
console.log(e);
},
- complete() {
- }
- })
- }
- })
+ complete() {},
+ });
+ },
+ });
}
-
-
},
_onLoginFail(e) {
@@ -113,18 +104,14 @@
title: '鏈粦瀹氳处鍙�',
duration: 1000,
icon: 'none',
- })
- })
+ });
+ });
},
gotoLogin(toast) {
- if (!this.waitAgree()) return
+ if (!this.waitAgree()) return;
wx.requestSubscribeMessage({
- tmplIds: [
- '6JQFOJ12yBvKfRg_duSdwKiH5_J3LpICmz3Li-L1Cr8',
- 'zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU',
- 'dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w'
- ],
+ tmplIds: tmplIds,
success(res) {
console.log(res);
},
@@ -134,38 +121,38 @@
complete() {
wx.navigateTo({
url: '/pages/mUser/userloginpw/userloginpw',
- success: (result) => {
+ success: result => {
if (typeof toast === 'function') {
- toast()
+ toast();
}
},
- fail: (res) => {},
- complete: (res) => {},
- })
- }
- })
+ fail: res => {},
+ complete: res => {},
+ });
+ },
+ });
},
checkboxChange(e) {
- var a = !this.data.agree
+ var a = !this.data.agree;
this.setData({
- agree: a
- })
+ agree: a,
+ });
wx.setStorage({
key: 'agree',
- data: a
- })
+ data: a,
+ });
},
waitAgree() {
if (this.data.agree) {
- return true
+ return true;
} else {
wx.showToast({
title: '闃呰骞跺悓鎰忔潯娆�',
- icon: 'none'
- })
- return false
+ icon: 'none',
+ });
+ return false;
}
},
@@ -173,22 +160,22 @@
wx.showLoading({
title: ' 鎵撳紑涓�',
mask: true,
- })
+ });
wx.downloadFile({
url: app.globalData.agreement,
success: function (res) {
- wx.hideLoading()
- const filePath = res.tempFilePath
+ wx.hideLoading();
+ const filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
success: function (res) {
- console.log('鎵撳紑鏂囨。鎴愬姛')
+ console.log('鎵撳紑鏂囨。鎴愬姛');
},
fail(error) {
console.log(error);
- }
- })
- }
- })
- }
-})
\ No newline at end of file
+ },
+ });
+ },
+ });
+ },
+});
diff --git a/pages/mUser/userregistercompany/userregistercompany.js b/pages/mUser/userregistercompany/userregistercompany.js
index 7b6bd13..a650818 100644
--- a/pages/mUser/userregistercompany/userregistercompany.js
+++ b/pages/mUser/userregistercompany/userregistercompany.js
@@ -1,81 +1,73 @@
-// pages/mUser/userregistercompany/userregistercompany.js
-const userservice = require("../../../service/userservice")
-const app = getApp()
+import { sceneTypes1 } from '../../../data/sceneTypes';
+const userservice = require('../../../service/userservice');
+const app = getApp();
Page({
-
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- sceneTypes: [
- {value: '1', name: '椁愰ギ'},
- {value: '7', name: '姹戒慨'},
- {value: '6', name: '宸ヤ笟浼佷笟' },
- {value: '2', name: '宸ュ湴'},
- {value: '3', name: '鐮佸ご'},
- {value: '4', name: '鍫嗗満'},
- {value: '5', name: '鎼呮媽绔�' },
- ],
+ sceneTypes: sceneTypes1,
sceneTypeIndex: 0,
imgFiles: [],
- msg: [{
- name: "鐢ㄦ埛鍚嶇О",
- id: "username",
+ msg: [
+ {
+ name: '鐢ㄦ埛鍚嶇О',
+ id: 'username',
input: true,
- value: "",
+ value: '',
noValue: false,
},
{
- name: "鏂板瘑鐮�",
- id: "password",
+ name: '鏂板瘑鐮�',
+ id: 'password',
input: true,
type: 'password',
maxLength: 20,
- value: "",
- noValue: false
+ value: '',
+ noValue: false,
},
{
- name: "纭瀵嗙爜",
- id: "number",
+ name: '纭瀵嗙爜',
+ id: 'number',
input: true,
type: 'password',
placeholder: '璇峰啀娆$‘璁ゅ瘑鐮�',
maxLength: 20,
- value: "",
+ value: '',
noValue: false,
},
{
- name: "浼佷笟鍚嶇О",
- id: "department",
+ name: '浼佷笟鍚嶇О',
+ id: 'department',
input: true,
value: '',
noValue: false,
},
{
- name: "浼佷笟鍦板潃",
- id: "address",
+ name: '浼佷笟鍦板潃',
+ id: 'address',
input: true,
value: '',
noValue: false,
},
{
- name: "鑱旂郴鏂瑰紡",
- id: "contract",
+ name: '鑱旂郴鏂瑰紡',
+ id: 'contract',
input: true,
value: '',
noValue: false,
- required: false
+ required: false,
},
{
- name: "淇$敤浠g爜",
- id: "code",
+ name: '淇$敤浠g爜',
+ id: 'code',
input: true,
- value: "",
+ value: '',
noValue: false,
- required: false
+ required: false,
},
],
},
@@ -83,48 +75,46 @@
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
- onLoad(options) {
-
- },
+ onLoad(options) {},
changeSceneType(e) {
- let i = e.detail.value
+ let i = e.detail.value;
this.setData({
- sceneTypeIndex: i
- })
+ sceneTypeIndex: i,
+ });
},
changeMsg(e) {
- let id = e.detail.params.id
- let value = e.detail.params.value
- let msg = this.data.msg
- let msgLength = msg.length
+ let id = e.detail.params.id;
+ let value = e.detail.params.value;
+ let msg = this.data.msg;
+ let msgLength = msg.length;
for (let i = 0; i < msgLength; i++) {
if (msg[i].id === id) {
- let path = "msg[" + i + "].value"
- let nPath = "msg[" + i + "].noValue"
+ let path = 'msg[' + i + '].value';
+ let nPath = 'msg[' + i + '].noValue';
this.setData({
[path]: value,
- [nPath]: false
- })
+ [nPath]: false,
+ });
}
}
},
uploadFile(file) {
- let data = file.detail.newFiles
+ let data = file.detail.newFiles;
data.forEach(element => {
- element.loading = false
+ element.loading = false;
});
this.setData({
- imgFiles: data
- })
+ imgFiles: data,
+ });
},
onSubmit: function () {
- if (!this.submitCheck()) return
+ if (!this.submitCheck()) return;
- let msg = this.data.msg
+ let msg = this.data.msg;
let info = {
sceneType: this.data.sceneTypes[this.data.sceneTypeIndex].value,
userName: msg[0].value,
@@ -132,118 +122,118 @@
department: msg[3].value,
address: msg[4].value,
telephone: msg[5].value,
- orgCode: msg[6].value
- }
+ orgCode: msg[6].value,
+ };
wx.showLoading({
title: '娉ㄥ唽涓�',
mask: true,
- })
+ });
setTimeout(() => {
- wx.hideLoading()
+ wx.hideLoading();
}, 10000);
- var that = this
+ var that = this;
userservice.register(info, {
success(res) {
if (res.success) {
app.globalData.accessToken = {
userId: res.userId,
suserId: res.suserId,
- }
- that.getUserInfo()
+ };
+ that.getUserInfo();
} else {
wx.hideLoading({
- success: (res) => {
+ success: res => {
wx.showToast({
title: '鐢ㄦ埛鍚嶇О閲嶅',
duration: 2000,
icon: 'error',
mask: true,
- })
+ });
},
- fail: (res) => {},
- complete: (res) => {},
- })
+ fail: res => {},
+ complete: res => {},
+ });
}
- }
- })
+ },
+ });
},
/**
* 淇℃伅瀹屾暣搴︽鏌�
*/
submitCheck() {
- let msg = this.data.msg
- let msgLength = msg.length
+ let msg = this.data.msg;
+ let msgLength = msg.length;
//纭淇℃伅瀹屾暣搴�
for (let i = 0; i < msgLength; i++) {
- if (msg[i].required != false && msg[i].value === "") {
- let error = msg[i].name + "涓嶅彲涓虹┖"
- let path = "msg[" + i + "].noValue"
+ if (msg[i].required != false && msg[i].value === '') {
+ let error = msg[i].name + '涓嶅彲涓虹┖';
+ let path = 'msg[' + i + '].noValue';
this.setData({
errorMsg: error,
- [path]: true
- })
+ [path]: true,
+ });
wx.pageScrollTo({
duration: 300,
scrollTop: 0,
// selector:"#" + msg[i].id,
- })
- return false
+ });
+ return false;
}
}
//瀵嗙爜涓�鑷存�х‘璁�
if (msg[1].value != msg[2].value) {
- let error = "涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鑷�"
+ let error = '涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鑷�';
this.setData({
errorMsg: error,
- })
- return false
+ });
+ return false;
}
//瀵嗙爜澶嶆潅搴︾‘璁�
- var pwError
- var pw = msg[1].value
- var regex1 = /[a-zA-Z]/
- var regex2 = /[0-9]/
- var r = regex1.test(pw) && regex2.test(pw)
+ var pwError;
+ var pw = msg[1].value;
+ var regex1 = /[a-zA-Z]/;
+ var regex2 = /[0-9]/;
+ var r = regex1.test(pw) && regex2.test(pw);
console.log('regex:' + r);
if (pw.length < 6) {
- pwError = '瀵嗙爜浣嶆暟鏈�灏�6浣�'
+ pwError = '瀵嗙爜浣嶆暟鏈�灏�6浣�';
} else if (!r) {
- pwError = '瀵嗙爜蹇呴』鍖呭惈瀛楁瘝鍜屾暟瀛�'
+ pwError = '瀵嗙爜蹇呴』鍖呭惈瀛楁瘝鍜屾暟瀛�';
}
if (pwError) {
this.setData({
errorMsg: pwError,
- })
- return false
+ });
+ return false;
}
- return true
+ return true;
},
getUserInfo() {
userservice.getUserInfo(app.globalData.accessToken.userId, {
success(data) {
- app.globalData.accessToken.userName = data.acountname
- app.globalData.accessToken.password = data.acountname
+ app.globalData.accessToken.userName = data.acountname;
+ app.globalData.accessToken.password = data.acountname;
wx.setStorage({
key: 'accessToken',
data: app.globalData.accessToken,
- })
- app.globalData.userInfo = data
+ });
+ app.globalData.userInfo = data;
wx.setStorage({
key: 'userInfo',
data: data,
- success: (result) => {
+ success: result => {
wx.switchTab({
url: '/pages/home/home',
- })
- }
- })
- }
- })
+ });
+ },
+ });
+ },
+ });
},
-})
\ No newline at end of file
+});
diff --git a/project.config.json b/project.config.json
index 6975eb0..348ecc1 100644
--- a/project.config.json
+++ b/project.config.json
@@ -1,9 +1,5 @@
{
"description": "椤圭洰閰嶇疆鏂囦欢锛岃瑙佹枃妗o細https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
- "packOptions": {
- "ignore": [],
- "include": []
- },
"setting": {
"urlCheck": false,
"es6": true,
@@ -23,7 +19,6 @@
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
- "useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
@@ -35,7 +30,6 @@
"userConfirmedUseCompilerModuleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
- "useApiHostProcess": true,
"enableEngineNative": false,
"userConfirmedBundleSwitch": false,
"minifyWXSS": true,
@@ -46,17 +40,20 @@
"ignoreUploadUnusedFiles": false,
"useStaticServer": true,
"minifyWXML": true,
- "ignoreDevUnusedFiles": false
+ "ignoreDevUnusedFiles": false,
+ "condition": false
},
"compileType": "miniprogram",
- "libVersion": "2.26.0",
- "appid": "wx5758efcebb0774de",
- "projectname": "ep-law-abiding",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
- "condition": {}
+ "condition": {},
+ "packOptions": {
+ "ignore": [],
+ "include": []
+ },
+ "appid": "wx5758efcebb0774de"
}
\ No newline at end of file
diff --git a/res/icons/avator_sys.png b/res/icons/avator_sys.png
deleted file mode 100644
index f35bb23..0000000
--- a/res/icons/avator_sys.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/btn_bg_1.png b/res/icons/btn_bg_1.png
deleted file mode 100644
index 7be9883..0000000
--- a/res/icons/btn_bg_1.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/btn_bg_2.png b/res/icons/btn_bg_2.png
deleted file mode 100644
index 8ea19cf..0000000
--- a/res/icons/btn_bg_2.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/change_icon.jpg b/res/icons/change_icon.jpg
deleted file mode 100644
index c60372a..0000000
--- a/res/icons/change_icon.jpg
+++ /dev/null
Binary files differ
diff --git a/res/icons/companyinfo-1.png b/res/icons/companyinfo-1.png
deleted file mode 100644
index 5fb8c79..0000000
--- a/res/icons/companyinfo-1.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/con_lib.png b/res/icons/con_lib.png
deleted file mode 100644
index de3ac38..0000000
--- a/res/icons/con_lib.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/con_lib_bg.png b/res/icons/con_lib_bg.png
deleted file mode 100644
index a35a13a..0000000
--- a/res/icons/con_lib_bg.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/con_pro.png b/res/icons/con_pro.png
deleted file mode 100644
index 130bef5..0000000
--- a/res/icons/con_pro.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/con_pro_bg.png b/res/icons/con_pro_bg.png
deleted file mode 100644
index 04fab95..0000000
--- a/res/icons/con_pro_bg.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/con_qa.png b/res/icons/con_qa.png
deleted file mode 100644
index efd9de0..0000000
--- a/res/icons/con_qa.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/con_qa_bg.png b/res/icons/con_qa_bg.png
deleted file mode 100644
index 015b8f8..0000000
--- a/res/icons/con_qa_bg.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/icon8.png b/res/icons/icon8.png
new file mode 100644
index 0000000..d11ff64
--- /dev/null
+++ b/res/icons/icon8.png
Binary files differ
diff --git a/res/icons/icon9.png b/res/icons/icon9.png
new file mode 100644
index 0000000..f981990
--- /dev/null
+++ b/res/icons/icon9.png
Binary files differ
diff --git a/res/icons/learn_1.png b/res/icons/learn_1.png
deleted file mode 100644
index 0df5b35..0000000
--- a/res/icons/learn_1.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/learn_2.png b/res/icons/learn_2.png
deleted file mode 100644
index 6ab25af..0000000
--- a/res/icons/learn_2.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/temp_pic_1.png b/res/icons/temp_pic_1.png
deleted file mode 100644
index bd44b8a..0000000
--- a/res/icons/temp_pic_1.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/txt_1.png b/res/icons/txt_1.png
deleted file mode 100644
index b5b2930..0000000
--- a/res/icons/txt_1.png
+++ /dev/null
Binary files differ
diff --git a/res/icons/wm_assessment.png b/res/icons/wm_assessment.png
deleted file mode 100644
index 07acf6d..0000000
--- a/res/icons/wm_assessment.png
+++ /dev/null
Binary files differ
diff --git a/service/baserequest.js b/service/baserequest.js
index 35bca96..77324b1 100644
--- a/service/baserequest.js
+++ b/service/baserequest.js
@@ -5,91 +5,97 @@
* success: function(data),
* page: function(page, totalPage)
* fail: function(error)
- * }
+ * }
*/
-const { duration } = require("../utils/moment.min.js");
-const util = require("../utils/util.js")
+const util = require('../utils/util.js');
-const originProperties = ['url', 'data', 'header', 'method', 'success', 'fail', 'complete'];
-// const baseUrl = "http://192.168.1.12:8080"
+// const baseUrl = "http://192.168.0.123:8080"
// const baseUrl = "https://fyami.com.cn:447"
-const baseUrl = "https://fyami.com.cn"
+const baseUrl = 'https://fyami.com.cn';
-const bu = "https://fyami.com.cn"
+const bu = 'https://fyami.com.cn';
// const bu = "https://fyami.com.cn:447"
-const basePicUrl = `${bu}/images/`
-const baseIconUrl = `${bu}/images/weixin/eplaw/`
-const baseFileUrl = `${bu}/meeting/file/`
+const basePicUrl = `${bu}/images/`;
+const baseIconUrl = `${bu}/images/weixin/eplaw/`;
+const baseFileUrl = `${bu}/meeting/file/`;
+// const mode = 'debug';
+const mode = 'prod';
function request(fun, hostUrl) {
- const bUrl = hostUrl ? hostUrl : baseUrl
+ const bUrl = hostUrl ? hostUrl : baseUrl;
if (fun.params != undefined) {
- var param = ""
+ var param = '';
Object.keys(fun.params).forEach(key => {
- var value = fun.params[key]
- if (param == "") {
- param += key + "=" + value
+ var value = fun.params[key];
+ if (param == '') {
+ param += key + '=' + value;
} else {
- param += "&" + key + "=" + value
+ param += '&' + key + '=' + value;
}
});
- var url = fun.url
- fun.url = bUrl + url + "?" + param
+ var url = fun.url;
+ fun.url = bUrl + url + '?' + param;
} else {
- var url = fun.url
- fun.url = bUrl + url
+ var url = fun.url;
+ fun.url = bUrl + url;
}
- var fun1 = util.deepCopy(fun)
+ var fun1 = util.deepCopy(fun);
fun1.success = function (res) {
- console.log("|------------------------------------------------------------------------------------------------------------");
- console.log("|--璁块棶: ", fun.url);
- console.log("|--缁撴灉: ", res);
+ if (mode == 'debug') {
+ console.log(
+ '|------------------------------------------------------------------------------------------------------------',
+ );
+ console.log('|--璁块棶: ', fun.url);
+ console.log('|--缁撴灉: ', res);
+ }
if (res.statusCode == 200) {
if (fun.onHead) {
- fun.onHead(res.header)
+ fun.onHead(res.header);
}
- fun.success(res.data)
+ fun.success(res.data);
} else {
- fun.fail(res.statusCode)
+ fun.fail(res.statusCode);
}
// if(res.data.success) {
// var head = res.data['head']
// if (head != undefined && fun.page != undefined) {
// fun.page(head.page, head.totalPage)
// }
- // fun.success(res.data.data)
+ // fun.success(res.data.data)
// } else {
// fun.fail(res.data)
// }
- }
+ };
fun1.fail = function (error) {
- console.log("--------------璇锋眰閿欒----------------" + fun.url);
- console.log(error);
+ if (mode == 'debug') {
+ console.log('--------------璇锋眰閿欒----------------' + fun.url);
+ console.log(error);
+ }
wx.showToast({
title: '璇锋眰澶辫触',
icon: 'none',
- duration: 2000
- })
+ duration: 2000,
+ });
if (fun.fail) {
- fun.fail(error)
+ fun.fail(error);
}
- }
- fun1.complete = fun.complete
- wx.request(fun1)
+ };
+ fun1.complete = fun.complete;
+ wx.request(fun1);
}
module.exports = {
get: function (fun, hostUrl) {
- fun['method'] = 'GET'
- request(fun, hostUrl)
+ fun['method'] = 'GET';
+ request(fun, hostUrl);
},
post: function (fun, hostUrl) {
- fun['method'] = 'POST'
- request(fun, hostUrl)
+ fun['method'] = 'POST';
+ request(fun, hostUrl);
},
basePicUrl: basePicUrl,
baseUrl: baseUrl,
baseFileUrl: baseFileUrl,
- baseIconUrl: baseIconUrl
-}
\ No newline at end of file
+ baseIconUrl: baseIconUrl,
+};
diff --git a/service/configservice.js b/service/configservice.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/service/configservice.js
diff --git a/service/deviceservice.js b/service/deviceservice.js
index d699b77..a077d00 100644
--- a/service/deviceservice.js
+++ b/service/deviceservice.js
@@ -1,4 +1,6 @@
-const $f = require('./baserequest')
+import moment from '../utils/moment.min';
+const $f = require('./baserequest');
+const util = require('../utils/util');
module.exports = {
//鑾峰彇鍑�鍖栬澶囦俊鎭�
@@ -6,12 +8,12 @@
let cb = {
url: `/device/purify/info`,
params: {
- userId: userId
- }
- }
- Object.assign(cb, fun)
+ userId: userId,
+ },
+ };
+ Object.assign(cb, fun);
- $f.get(cb)
+ $f.get(cb);
},
//鑾峰彇鐩戞祴璁惧淇℃伅
@@ -19,12 +21,12 @@
let cb = {
url: `/device/monitor/info`,
params: {
- userId: userId
- }
- }
- Object.assign(cb, fun)
+ userId: userId,
+ },
+ };
+ Object.assign(cb, fun);
- $f.get(cb)
+ $f.get(cb);
},
//鑾峰彇闈欏畨椁愰ギ鐩戞祴鏁版嵁
@@ -33,16 +35,50 @@
url: `/device/fume/jingan/value`,
params: {
userId: userId,
- }
- }
+ },
+ };
if (sT && sT != '') {
- cb.params.startTime = sT
+ cb.params.startTime = sT;
}
if (eT && eT != '') {
- cb.params.endTime = eT
+ cb.params.endTime = eT;
}
- Object.assign(cb, fun)
+ Object.assign(cb, fun);
- $f.get(cb)
+ $f.get(cb);
},
-}
\ No newline at end of file
+
+ // 涓婁紶voc澶勭悊璁惧淇℃伅
+ uploadVOCDevice(userId, deviceList, fun) {
+ let cb = {
+ url: `/device/voc/upload`,
+ params: {
+ userId: userId,
+ },
+ data: deviceList,
+ };
+ Object.assign(cb, fun);
+ $f.post(cb);
+ },
+
+ //鑾峰彇voc鍑�鍖栬澶囦俊鎭�
+ getVOCPurifyDeviceInfo: function (userId, fun) {
+ let cb = {
+ url: `/device/voc/purify/info`,
+ params: {
+ userId: userId,
+ },
+ };
+ Object.assign(cb, fun);
+
+ let fun1 = util.deepCopy(cb);
+ fun1.success = function (res) {
+ res.forEach(r => {
+ r.vpChangeTime = moment(r.vpChangeTime).format('YYYY-MM-DD');
+ });
+ cb.success(res);
+ };
+
+ $f.get(fun1);
+ },
+};
diff --git a/service/ledgerservice.js b/service/ledgerservice.js
index a91f93b..7c522e5 100644
--- a/service/ledgerservice.js
+++ b/service/ledgerservice.js
@@ -1,6 +1,6 @@
-const Multipart = require('../utils/Multipart.min')
-const $f = require('./baserequest')
-const util = require('../utils/util')
+const Multipart = require('../utils/Multipart.min');
+const $f = require('./baserequest');
+const util = require('../utils/util');
module.exports = {
//鑾峰彇鍙拌处绫诲瀷
@@ -9,57 +9,60 @@
url: `/ledger/${userId}/summary`,
params: {
sceneType: sceneType,
- time: time
+ time: time,
},
- }
- Object.assign(cb, fun)
+ };
+ Object.assign(cb, fun);
- let fun1 = util.deepCopy(cb)
+ let fun1 = util.deepCopy(cb);
fun1.success = function (res) {
res.forEach(r => {
- r.iconUrl = $f.basePicUrl + r.iconUrl
+ r.iconUrl = $f.basePicUrl + r.iconUrl;
});
- cb.success(res)
- }
- $f.get(fun1)
+ cb.success(res);
+ };
+ $f.get(fun1);
},
//涓婁紶鍙拌处
uploadLedger: function (userId, ledger, paths, fun) {
- const fields = [{
- name: 'params',
- value: JSON.stringify([ledger])
- }]
- const files = []
+ const fields = [
+ {
+ name: 'params',
+ value: JSON.stringify([ledger]),
+ },
+ ];
+ const files = [];
paths.forEach(p => {
files.push({
name: 'images',
- filePath: p
- })
+ filePath: p,
+ });
});
console.log(files);
let p = new Multipart({
fields,
- files
- }).submit($f.baseUrl + `/ledger/${userId}/upload`)
+ files,
+ }).submit($f.baseUrl + `/ledger/${userId}/upload`);
p.then(res => {
- fun.success(res)
- })
+ fun.success(res);
+ });
},
// 涓婁紶涓嶆秹鍙婂彴璐�
- uploadNoLedger: function(userId, time, ledgerIdList, fun) {
+ uploadNoLedger: function (userId, time, remark, ledgerIdList, fun) {
let cb = {
url: '/ledger/upload/noLedger',
params: {
userId: userId,
- time: time
+ time: time,
+ remark: remark,
},
data: ledgerIdList,
- }
- Object.assign(cb, fun)
+ };
+ Object.assign(cb, fun);
- $f.post(cb)
+ $f.post(cb);
},
//鑾峰彇鍙拌处璇︽儏
@@ -69,25 +72,25 @@
params: {
sceneType: sceneType,
},
- }
+ };
if (ledgerSubTypeId) {
- cb.params.ledgerSubTypeId = ledgerSubTypeId
+ cb.params.ledgerSubTypeId = ledgerSubTypeId;
}
if (time) {
- cb.params.time = time
+ cb.params.time = time;
}
- Object.assign(cb, fun)
+ Object.assign(cb, fun);
- let fun1 = util.deepCopy(cb)
+ let fun1 = util.deepCopy(cb);
fun1.success = function (res) {
res.forEach(r => {
r.path1 = r.path1.split(';').map((value, index) => {
- return $f.basePicUrl + value
- })
+ return $f.basePicUrl + value;
+ });
});
- cb.success(res)
- }
-
- $f.get(fun1)
+ cb.success(res);
+ };
+
+ $f.get(fun1);
},
-}
\ No newline at end of file
+};
diff --git a/service/notificationservice.js b/service/notificationservice.js
index d0b72de..dda5606 100644
--- a/service/notificationservice.js
+++ b/service/notificationservice.js
@@ -24,4 +24,22 @@
}
$f.get(fun1)
},
+ // 鏇存柊閫氱煡闃呰鐘舵��
+ updateReadState(userId, data, fun) {
+ let cb = {
+ url: `/notifications/${userId}/readState`,
+ data: data,
+ };
+ Object.assign(cb, fun);
+
+ $f.post(cb);
+ },
+
+ getUnReadNoticeCount(userId, fun) {
+ let cb = {
+ url: `/notifications/${userId}/unread`,
+ }
+ Object.assign(cb, fun)
+ $f.get(cb)
+ }
}
\ No newline at end of file
diff --git a/service/scheduleservice.js b/service/scheduleservice.js
index 90a664e..e5c6413 100644
--- a/service/scheduleservice.js
+++ b/service/scheduleservice.js
@@ -1,5 +1,6 @@
-const $f = require('./baserequest')
-const util = require('../utils/util')
+const $f = require('./baserequest');
+const util = require('../utils/util');
+const app = getApp();
module.exports = {
//鑾峰彇鎵�鏈夌幆淇濇棩绋�
@@ -10,9 +11,53 @@
params: {
userId: userId,
},
- }
- Object.assign(cb, fun)
+ };
+ Object.assign(cb, fun);
- wx.request(cb)
+ wx.request(cb);
},
-}
\ No newline at end of file
+
+ // 鑾峰彇鏃ョ▼
+ getSchedules: function ({ startTime, endTime, type }, fun) {
+ let cb = {
+ url: `/schedule/get`,
+ data: {
+ userId: app.globalData.accessToken.userId,
+ startTime: startTime,
+ endTime: endTime,
+ type: type,
+ },
+ };
+ Object.assign(cb, fun);
+
+ $f.post(cb);
+ },
+
+ // 绛炬敹瀹屾垚鏃ョ▼
+ completeSchedule: function ({ id }, fun) {
+ let cb = {
+ url: `/schedule/complete`,
+ params: {
+ userId: app.globalData.accessToken.userId,
+ id,
+ },
+ };
+ Object.assign(cb, fun);
+
+ $f.post(cb);
+ },
+
+ // 鎾ら攢瀹屾垚鏃ョ▼
+ revokeSchedule: function ({recordId}, fun) {
+ let cb = {
+ url: `/schedule/revoke`,
+ params: {
+ userId: app.globalData.accessToken.userId,
+ recordId,
+ },
+ };
+ Object.assign(cb, fun);
+
+ $f.post(cb);
+ }
+};
diff --git a/service/selfpatrolservice.js b/service/selfpatrolservice.js
new file mode 100644
index 0000000..b21d782
--- /dev/null
+++ b/service/selfpatrolservice.js
@@ -0,0 +1,132 @@
+const Multipart = require('../utils/Multipart.min');
+const $f = require('./baserequest');
+const util = require('../utils/util');
+
+module.exports = {
+ /**
+ * 鑾峰彇鍙戝竷缁欑敤鎴风殑鑷贰鏌ヤ换鍔�
+ * @param {*} userId
+ * @param {*} date
+ * @param {*} fun
+ */
+ getTask: function (userId, date, fun) {
+ let cb = {
+ url: '/selfPatrol/task/uploaded',
+ params: {
+ userId: userId,
+ date: date,
+ },
+ };
+ Object.assign(cb, fun);
+
+ $f.get(cb);
+ },
+
+ /**
+ * 鑾峰彇鑷贰鏌ヤ换鍔′笂浼犺褰�
+ * @param {*} taskId
+ * @param {*} fun
+ */
+ getTaskRecord: function (taskId, fun) {
+ let cb = {
+ url: '/selfPatrol/task/record',
+ params: {
+ taskId: taskId,
+ },
+ };
+ Object.assign(cb, fun);
+
+ let fun1 = util.deepCopy(cb);
+ fun1.success = function (res) {
+ res.data.forEach(r => {
+ r.iconUrl = $f.basePicUrl + r.iconUrl;
+ });
+ cb.success(res);
+ };
+
+ $f.get(fun1);
+ },
+
+ //涓婁紶鑷贰鏌�
+ uploadSelfPatrol: function (userId, taskId, selfPatrol, paths, fun) {
+ const fields = [
+ {
+ name: 'params',
+ value: JSON.stringify([selfPatrol]),
+ },
+ {
+ name: 'userId',
+ value: userId,
+ },
+ {
+ name: 'taskId',
+ value: taskId,
+ },
+ ];
+ const files = [];
+ paths.forEach(p => {
+ files.push({
+ name: 'images',
+ filePath: p,
+ });
+ });
+ console.log(files);
+ let p = new Multipart({
+ fields,
+ files,
+ }).submit($f.baseUrl + `/selfPatrol/task/record/upload`);
+ p.then(res => {
+ fun.success(res);
+ });
+ },
+
+ // 涓婁紶涓嶆秹鍙婅嚜宸℃煡
+ uploadNoSelfPatrol: function (
+ userId,
+ taskId,
+ time,
+ remark,
+ ledgerIdList,
+ fun,
+ ) {
+ let cb = {
+ url: '/selfPatrol/task/record/upload/noInvolved',
+ params: {
+ userId: userId,
+ time: time,
+ taskId: taskId,
+ remark: remark,
+ },
+ data: ledgerIdList,
+ };
+ Object.assign(cb, fun);
+
+ $f.post(cb);
+ },
+
+ //鑾峰彇鑷贰鏌ヨ鎯�
+ getSelfPatrolDetail: function (userId, subTypeId, taskId, fun) {
+ let cb = {
+ url: `/selfPatrol/record/detail`,
+ params: {
+ userId: userId,
+ subTypeId: subTypeId,
+ taskId: taskId,
+ },
+ };
+ Object.assign(cb, fun);
+
+ let fun1 = util.deepCopy(cb);
+ fun1.success = function (res) {
+ if (res.success) {
+ const r = res.data;
+ r.path1 = r.path1.split(';').map((value, index) => {
+ return $f.basePicUrl + value;
+ });
+ }
+ cb.success(res);
+ };
+
+ $f.get(fun1);
+ },
+};
diff --git a/service/userservice.js b/service/userservice.js
index 056d9ca..0ae6646 100644
--- a/service/userservice.js
+++ b/service/userservice.js
@@ -34,7 +34,7 @@
$f.get(cb)
},
//鑾峰彇鐢ㄦ埛鍩虹淇℃伅
- getBaseInfo: function (userId, fun, wxUserId) {
+ getBaseInfo: function (userId, fun, wxUserId) {
let cb = {
url: `/userInfo/baseInfo`,
params: {
diff --git a/style/animation.wxss b/style/animation.wxss
new file mode 100644
index 0000000..29782ce
--- /dev/null
+++ b/style/animation.wxss
@@ -0,0 +1,17 @@
+@keyframes myfirst
+{
+ 0% {background: red; left:0px; top:0px;}
+ 25% {background: yellow; left:200px; top:0px;}
+ 50% {background: blue; left:200px; top:200px;}
+ 75% {background: green; left:0px; top:200px;}
+ 100% {background: red; left:0px; top:0px;}
+}
+
+@-webkit-keyframes myfirst /* Safari 涓� Chrome */
+{
+ 0% {background: red; left:0px; top:0px;}
+ 25% {background: yellow; left:200px; top:0px;}
+ 50% {background: blue; left:200px; top:200px;}
+ 75% {background: green; left:0px; top:200px;}
+ 100% {background: red; left:0px; top:0px;}
+}
\ No newline at end of file
diff --git a/utils/animation.js b/utils/animation.js
new file mode 100644
index 0000000..f8da5a6
--- /dev/null
+++ b/utils/animation.js
@@ -0,0 +1,164 @@
+/**
+ * z杞村爢鍙犲垪琛ㄥ睍寮�鏀剁缉鍔ㄧ敾
+ * 鍫嗗彔椤圭被鍚嶄负 `${this.selector}-${index}`锛屽垪琛ㄥ鍣ㄧ被鍚嶄负`${this.selector}-wrap`
+ * @param {*} options
+ */
+function ZTranslate(options) {
+ let { content, selector, size, margin } = options;
+ this.content = content;
+ this.selector = selector;
+ this.size = size;
+ this.margin = margin;
+ this.toggleList = [];
+ this.expanded = false;
+
+ this.init();
+}
+
+ZTranslate.prototype = {
+ init() {
+ this.keyframes = [];
+ let len = 0;
+ for (let i = 0; i < this.size; i++) {
+ let keyframe = [];
+ keyframe.push({
+ translateY: '0px',
+ top: i * 3 + 'px',
+ left: i * 2 + 'px',
+ right: 0 - i * 2 + 'px',
+ ease: 'ease',
+ });
+ this._getEndY(i, res => {
+ len += res + this.margin * (i == 0 ? 0 : 1);
+ let translateY = len - res + 'px';
+ keyframe.push({
+ translateY: translateY,
+ top: '0px',
+ left: '0px',
+ right: '0px',
+ ease: 'ease',
+ });
+
+ if (i == this.size - 1) {
+ this.wrapKeyframe = [
+ { height: '0px', ease: 'ease' },
+ { height: len + 'px', ease: 'ease' },
+ ];
+ }
+ });
+ this.keyframes.push(keyframe);
+ }
+ },
+
+ expand(callback) {
+ if (this.toggleList.length < this.size) return;
+ this.content.animate(`${this.selector}-wrap`, this.wrapKeyframe, 200);
+ let length = this.keyframes.length;
+ for (let i = 0; i < this.keyframes.length; i++) {
+ const k = this.keyframes[i];
+ this.content.animate(
+ `${this.selector}-${i}`,
+ k,
+ 200,
+ function () {
+ if (i == length - 1 && typeof callback === 'function') {
+ callback();
+ }
+ }.bind(this.content),
+ );
+ }
+ this.expanded = true;
+ },
+
+ collapse(callback) {
+ if (this.toggleList.length < this.size) return;
+ this.content.animate(
+ `${this.selector}-wrap`,
+ [...this.wrapKeyframe].reverse(),
+ 200,
+ );
+ let length = this.keyframes.length;
+ for (let i = 0; i < this.keyframes.length; i++) {
+ const k = this.keyframes[i];
+ this.content.animate(
+ `${this.selector}-${i}`,
+ [...k].reverse(),
+ 200,
+ function () {
+ if (i == length - 1 && typeof callback === 'function') {
+ callback();
+ }
+ }.bind(this.content),
+ );
+ }
+ this.expanded = false;
+ },
+
+ slideOut(i, callback) {
+ const selector = `${this.selector}-${i}`;
+ const keyframe = this._getCurrentKeyframe(i);
+ this.content.animate(
+ selector,
+ [
+ { ...keyframe, translateX: '0%' },
+ { ...keyframe, translateX: '100%' },
+ ],
+ 250,
+ function () {
+ this.clearAnimation(selector, { translateX: true }, () => {
+ if (typeof callback === 'function') {
+ callback();
+ }
+ });
+ }.bind(this.content),
+ );
+ },
+
+ slideIn(i, callback) {
+ const selector = `${this.selector}-${i}`;
+ const keyframe = this._getCurrentKeyframe(i);
+ this.content.animate(
+ selector,
+ [
+ { ...keyframe, translateX: '100%' },
+ { ...keyframe, translateX: '0%' },
+ ],
+ 250,
+ function () {
+ this.clearAnimation(selector, { translateX: true }, () => {
+ if (typeof callback === 'function') {
+ callback();
+ }
+ });
+ }.bind(this.content),
+ );
+ },
+
+ // 鑾峰彇鍔ㄧ敾缁撴潫Y杞翠綅缃�
+ _getEndY(index, callback) {
+ wx.createSelectorQuery()
+ .in(this.content)
+ .select(`${this.selector}-${index}`)
+ .boundingClientRect(res => {
+ callback(res.height);
+ this.toggleList.push(true);
+ })
+ .exec();
+ },
+
+ _getCurrentKeyframe(i) {
+ let keyframe;
+ if (this.expanded) {
+ keyframe = this.keyframes[i][1];
+ } else {
+ keyframe = this.keyframes[i][0];
+ }
+ return keyframe;
+ },
+};
+
+function animation1(options) {
+ return new ZTranslate(options);
+}
+
+export { animation1 };
diff --git a/utils/util.js b/utils/util.js
index 3aa9e77..7b753dd 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -1,79 +1,88 @@
-const moment = require('./moment.min')
-
-
+const moment = require('./moment.min');
const formatTime = date => {
- const time = moment(date)
- const now = moment()
+ const time = moment(date);
+ const now = moment();
- const timeYear = time.year()
- const timeMonth = time.month() + 1
- const timeDay = time.date()
+ const timeYear = time.year();
+ const timeMonth = time.month() + 1;
+ const timeDay = time.date();
- const thisYear = now.year()
- const thisMonth = now.month() + 1
- const thisDay = now.date()
+ const thisYear = now.year();
+ const thisMonth = now.month() + 1;
+ const thisDay = now.date();
if (timeYear < thisYear) {
- return time.format('YYYY-MM-DD')
+ return time.format('YYYY-MM-DD');
} else if (timeMonth < thisMonth) {
- return time.format('MM-DD')
+ return time.format('MM-DD');
} else if (timeDay < thisDay) {
if (timeDay + 1 == thisDay) {
- return '鏄ㄥぉ'
+ return '鏄ㄥぉ';
} else {
- return time.format('MM-DD')
+ return time.format('MM-DD');
}
} else {
- return time.fromNow()
+ return time.fromNow();
}
-}
+};
const formatNumber = n => {
- n = n.toString()
- return n[1] ? n : '0' + n
-}
+ n = n.toString();
+ return n[1] ? n : '0' + n;
+};
const navContentHeight = function () {
//鑳跺泭楂樺害
- const capsuleHeight = wx.getMenuButtonBoundingClientRect().bottom - wx.getMenuButtonBoundingClientRect().top
+ const capsuleHeight =
+ wx.getMenuButtonBoundingClientRect().bottom -
+ wx.getMenuButtonBoundingClientRect().top;
//鑳跺泭涓婅竟妗嗚窛椤堕儴璺濈
- const capsuleTop = wx.getMenuButtonBoundingClientRect().top
+ const capsuleTop = wx.getMenuButtonBoundingClientRect().top;
//鐘舵�佹爮楂樺害
- const statusBarHeight = wx.getSystemInfoSync().statusBarHeight
+ const statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
//鑽泭涓婅竟璺濈姸鎬佹爮涓嬭竟鐨勮窛绂伙紝鍗宠嵂鍥婂湪瀵艰埅鍐呭鏍忎腑鐨勪笂涓嬭竟璺�
- const capsuleGap = capsuleTop - statusBarHeight
+ const capsuleGap = capsuleTop - statusBarHeight;
//瀵艰埅鍐呭鏍忕殑楂樺害鍔ㄦ�佽绠�
- const navContentHeight = capsuleGap * 2 + capsuleHeight
+ const navContentHeight = capsuleGap * 2 + capsuleHeight;
- return navContentHeight + statusBarHeight
-}
+ return navContentHeight + statusBarHeight;
+};
const deepCopy = function (obj) {
- let b1 = typeof obj
- if (b1 != 'object' || (obj instanceof Array) || obj == null) {
+ let b1 = typeof obj;
+ if (b1 != 'object' || obj == null) {
return obj;
}
- var newobj = {};
- for (var attr in obj) {
- newobj[attr] = this.deepCopy(obj[attr]);
+ let newobj;
+ if (obj instanceof Array) {
+ newobj = [];
+ obj.forEach(e => {
+ newobj.push(this.deepCopy(e));
+ });
+ } else {
+ newobj = {};
+ for (var attr in obj) {
+ newobj[attr] = this.deepCopy(obj[attr]);
+ }
}
return newobj;
-}
+};
const lastMonth = function (year, month) {
- var lM = month - 1
- var lY = year
+ var lM = month - 1;
+ var lY = year;
if (lM <= 0) {
- lM += 12
- lY -= 1
+ lM += 12;
+ lY -= 1;
}
- return [lY, lM]
-}
+ return [lY, lM];
+};
module.exports = {
formatTime: formatTime,
navContentHeight: navContentHeight,
deepCopy: deepCopy,
- lastMonth: lastMonth
-}
\ No newline at end of file
+ lastMonth: lastMonth,
+ formatNumber: formatNumber,
+};
--
Gitblit v1.9.3