@uxda/appkit 4.0.3 → 4.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/.eslintrc.mjs +7 -7
  2. package/README.md +187 -187
  3. package/babel.config.js +12 -12
  4. package/dist/appkit.css +144 -5
  5. package/dist/index.js +730 -248
  6. package/package.json +75 -80
  7. package/project.config.json +15 -15
  8. package/project.tt.json +13 -13
  9. package/rollup.config.mjs +56 -56
  10. package/src/Appkit.ts +65 -65
  11. package/src/balance/api/endpoints.ts +126 -126
  12. package/src/balance/api/index.ts +82 -82
  13. package/src/balance/components/AccountView.vue +748 -748
  14. package/src/balance/components/BalanceCard.vue +205 -209
  15. package/src/balance/components/BalanceReminder.vue +85 -85
  16. package/src/balance/components/ConsumptionFilter.vue +218 -218
  17. package/src/balance/components/ConsumptionRules.vue +68 -68
  18. package/src/balance/components/DateFilter.vue +226 -226
  19. package/src/balance/components/DateRange.vue +62 -0
  20. package/src/balance/components/ListFilter.vue +40 -0
  21. package/src/balance/components/ListFilterPicker.vue +195 -0
  22. package/src/balance/components/SecondBalance.vue +71 -71
  23. package/src/balance/components/Tip.vue +45 -45
  24. package/src/balance/components/index.ts +13 -9
  25. package/src/balance/types.ts +91 -90
  26. package/src/components/bt-cropper/index.vue +774 -774
  27. package/src/components/bt-cropper/utils/calcCropper.js +42 -42
  28. package/src/components/bt-cropper/utils/calcImagePosition.js +23 -23
  29. package/src/components/bt-cropper/utils/calcImageSize.js +37 -37
  30. package/src/components/bt-cropper/utils/calcPointDistance.js +12 -12
  31. package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -7
  32. package/src/components/bt-cropper/utils/ratio.js +3 -3
  33. package/src/components/bt-cropper/utils/tools.js +25 -25
  34. package/src/components/dd-area/index.vue +225 -225
  35. package/src/components/dd-icon/doc.md +21 -21
  36. package/src/components/dd-icon/index.vue +23 -23
  37. package/src/components/dd-notice-bar/index.vue +78 -78
  38. package/src/components/dd-search/doc.md +34 -34
  39. package/src/components/dd-search/index.vue +168 -168
  40. package/src/components/dd-selector/index.vue +124 -124
  41. package/src/components/dd-skeleton/doc.md +19 -19
  42. package/src/components/dd-skeleton/index.vue +36 -36
  43. package/src/components/ocr-id/index.vue +114 -114
  44. package/src/components/ocr-id/types.d.ts +12 -12
  45. package/src/global.ts +6 -6
  46. package/src/index.ts +89 -89
  47. package/src/main.scss +1 -1
  48. package/src/notice/api/endpoints.ts +17 -17
  49. package/src/notice/api/index.ts +82 -82
  50. package/src/notice/components/NoticeBanner.vue +243 -243
  51. package/src/notice/components/NoticeEntry.vue +99 -99
  52. package/src/notice/components/NoticeList.vue +315 -315
  53. package/src/notice/components/NoticePopup.vue +161 -161
  54. package/src/notice/components/index.ts +5 -5
  55. package/src/notice/components/useCommonList.ts +86 -86
  56. package/src/notice/components/useNotice.ts +35 -35
  57. package/src/notice/index.ts +1 -1
  58. package/src/notice/types.ts +25 -25
  59. package/src/payment/api/config.ts +7 -7
  60. package/src/payment/api/endpoints.ts +103 -103
  61. package/src/payment/api/index.ts +71 -71
  62. package/src/payment/components/AmountPicker.vue +93 -93
  63. package/src/payment/components/RechargeResult.vue +69 -69
  64. package/src/payment/components/RechargeView.vue +154 -154
  65. package/src/payment/components/RightsPicker.vue +105 -105
  66. package/src/payment/components/TradeView.vue +298 -298
  67. package/src/payment/components/UserAgreement.vue +234 -234
  68. package/src/payment/components/index.ts +22 -22
  69. package/src/payment/index.ts +5 -5
  70. package/src/payment/services/index.ts +16 -16
  71. package/src/payment/services/invoke-recharge.ts +25 -25
  72. package/src/payment/services/request-payment.ts +58 -58
  73. package/src/payment/types.ts +28 -28
  74. package/src/register/components/SelfRegistration.vue +254 -254
  75. package/src/register/components/index.ts +2 -2
  76. package/src/shared/components/AppDrawer.vue +58 -58
  77. package/src/shared/components/AppVerify.vue +84 -0
  78. package/src/shared/components/DeviceVersion.vue +68 -68
  79. package/src/shared/components/EmptyView.vue +33 -33
  80. package/src/shared/components/OcrIcon.vue +119 -0
  81. package/src/shared/components/PageHeader.vue +79 -79
  82. package/src/shared/components/index.ts +7 -5
  83. package/src/shared/composables/index.ts +6 -5
  84. package/src/shared/composables/useCountdown.ts +46 -46
  85. package/src/shared/composables/useDragBox.ts +97 -97
  86. package/src/shared/composables/useEncode.ts +43 -43
  87. package/src/shared/composables/useSafeArea.ts +46 -46
  88. package/src/shared/composables/useTabbar.ts +24 -24
  89. package/src/shared/composables/useUpload.ts +55 -0
  90. package/src/shared/composables/useValidator.ts +31 -31
  91. package/src/shared/http/Http.ts +136 -136
  92. package/src/shared/http/index.ts +1 -1
  93. package/src/shared/http/types.ts +157 -157
  94. package/src/shared/index.ts +3 -3
  95. package/src/shared/weixin/payment.ts +38 -38
  96. package/src/styles/fonts.scss +2 -2
  97. package/src/styles/vars.scss +3 -3
  98. package/src/user/api/endpoints.ts +17 -17
  99. package/src/user/api/index.ts +87 -87
  100. package/src/user/components/LoginSetting.vue +114 -114
  101. package/src/user/components/UserBinding.vue +307 -307
  102. package/src/user/components/UserBindingSuccess.vue +80 -80
  103. package/src/user/components/UserEntry.vue +142 -142
  104. package/src/user/components/UserFeedback.vue +440 -440
  105. package/src/user/components/UserFeedbackEntry.vue +192 -192
  106. package/src/user/components/UserHeadCrop.vue +65 -65
  107. package/src/user/components/UserInfo.vue +632 -632
  108. package/src/user/components/UserResourceEmpty.vue +75 -75
  109. package/src/user/components/index.ts +21 -21
  110. package/src/user/index.ts +1 -1
  111. package/tsconfig.json +30 -30
  112. package/types/global.d.ts +21 -21
  113. package/types/vue.d.ts +10 -10
  114. package/dist/assets/asset-3B_CoPto +0 -1
@@ -1,226 +1,226 @@
1
- <template>
2
- <div class="consumption-date-filter">
3
- <div class="date-filter-header">日期选择</div>
4
- <div class="content">
5
- <div class="title">自定义</div>
6
- <div class="time">
7
- <div
8
- class="item"
9
- :class="focused === 'from' ? 'current' : ''"
10
- @click="switchDateInput('from')"
11
- >
12
- {{ formatDate(result.from) }}
13
- </div>
14
- <div class="line">-</div>
15
- <div class="item" :class="focused === 'to' ? 'current' : ''" @click="switchDateInput('to')">
16
- {{ formatDate(result.to) }}
17
- </div>
18
- </div>
19
- </div>
20
- <div class="buttons spa-between">
21
- <div class="btn" @click="reset">重置</div>
22
- <div class="btn confirm" @click="onOkClick">确定</div>
23
- </div>
24
- <div class="bottom"></div>
25
- </div>
26
- <nut-popup v-model:visible="datePickerOpen" position="bottom">
27
- <nut-date-picker
28
- v-model="focusedDate"
29
- :min-date="minDate"
30
- :max-date="maxDate"
31
- :is-show-chinese="false"
32
- :three-dimensional="false"
33
- @cancel="datePickerOpen = false"
34
- @confirm="onDatePickerComplete"
35
- ></nut-date-picker>
36
- </nut-popup>
37
- </template>
38
-
39
- <script lang="ts" setup>
40
- import { reactive, ref, watch } from 'vue'
41
-
42
- type DateFilterProps = {
43
- from: string
44
- to: string
45
- }
46
-
47
- const props = defineProps<DateFilterProps>()
48
-
49
- const emit = defineEmits(['complete', 'reset'])
50
-
51
- watch(
52
- () => `${props.from}${props.to}`,
53
- () => {
54
- result.from = props.from
55
- result.to = props.to
56
- }
57
- )
58
-
59
- /**
60
- * 日期范围结果
61
- */
62
- const result = reactive<DateFilterProps>({ ...props })
63
-
64
- /**
65
- * 目前激活的日期输入框
66
- */
67
- const focused = ref<string>('from')
68
- const focusedDate = ref<any>(props.from)
69
-
70
- const minDate = ref<any>()
71
- const maxDate = ref<Date>(new Date())
72
- const datePickerOpen = ref<boolean>(false)
73
-
74
- /**
75
- * 日期重置
76
- */
77
- function reset() {
78
- emit('reset')
79
- }
80
-
81
- /**
82
- * 确认,提交新时间
83
- */
84
- function onOkClick() {
85
- emit('complete', result)
86
- }
87
-
88
- function formatDate(date: string) {
89
- const [year, month, day] = date.split('-')
90
- return year + '年' + month + '月' + day + '日'
91
- }
92
-
93
- function onDatePickerComplete({ selectedValue, selectedOptions }) {
94
- let time = selectedOptions.map((val: any) => val.text).join('-')
95
- if (focused.value === 'from') {
96
- // 如果选择的时间比结束时间大,结束时间改为开始时间
97
- result.from = new Date(time) > new Date(result.to) ? result.to : time
98
- } else {
99
- result.to = time
100
- }
101
- datePickerOpen.value = false
102
- }
103
-
104
- /**
105
- * 切换时间逻辑:初始化时有时间,默认聚焦开始时间
106
- * 当选择开始时间大于结束时间,结束时间改为开始时间
107
- * 时间选择器都要小于当前时间,结束时间的时间选择器要以开始时间为最小值,
108
- */
109
- function switchDateInput(shift: string) {
110
- // 要设置一下结束时间的起始值 开始时间往前倒5年
111
- if (shift === 'from') {
112
- let time = result.from.split('-').map(Number)
113
- minDate.value = new Date(time[0] - 5, 1, 1)
114
- } else {
115
- let time = result.from.split('-').map(Number)
116
- minDate.value = new Date(time[0], time[1] - 1, time[2])
117
- }
118
- focusedDate.value = new Date(result[shift])
119
- focused.value = shift
120
- datePickerOpen.value = true
121
- }
122
- </script>
123
- <style lang="scss">
124
- .consumption-date-filter {
125
- height: 100%;
126
- display: flex;
127
- flex-direction: column;
128
- width: 100%;
129
- .date-filter-header {
130
- text-align: center;
131
- height: 44px;
132
- line-height: 44px;
133
- color: #353535;
134
- font-size: 17px;
135
- background-color: #f5f5f5;
136
- }
137
- .content {
138
- flex: 1;
139
- margin: 15px;
140
- overflow-y: scroll;
141
- color: #353535;
142
- font-size: 13px;
143
- .title {
144
- opacity: 0.6;
145
- line-height: 18px;
146
- }
147
- .info {
148
- display: grid;
149
- grid-template-columns: 1fr 1fr 1fr;
150
- grid-gap: 10px;
151
- margin: 10px 0;
152
- .item {
153
- height: 30px;
154
- line-height: 30px;
155
- border: 1px solid #ccc;
156
- border-radius: 6px;
157
- text-align: center;
158
- }
159
- .current {
160
- border: 1px solid;
161
- border-image-source: linear-gradient(
162
- 180deg,
163
- rgba(239, 208, 130, 0.8) 0%,
164
- rgba(255, 185, 120, 0.8) 100%
165
- );
166
- background: linear-gradient(
167
- 180deg,
168
- rgba(239, 208, 130, 0.8) 0%,
169
- rgba(255, 185, 120, 0.8) 100%
170
- ),
171
- linear-gradient(180deg, #fff7e3 0%, #fefde6 100%);
172
- }
173
- }
174
- }
175
- .buttons {
176
- margin: 0 15px;
177
- display: flex;
178
- justify-content: space-between;
179
- align-items: center;
180
- .btn {
181
- flex: 1;
182
- height: 40px;
183
- line-height: 40px;
184
- text-align: center;
185
- border: 1px solid #ccc;
186
- box-sizing: border-box;
187
- color: #666;
188
- font-size: 16px;
189
- border-radius: 6px;
190
- }
191
- .confirm {
192
- margin-left: 11px;
193
- color: #000;
194
- border: none;
195
- background: linear-gradient(90deg, #ffebc1 0%, #ffd7a7 52.29%, #ffb875 100%);
196
- }
197
- }
198
- .time {
199
- display: flex;
200
- justify-content: flex-start;
201
- align-items: center;
202
- margin: 10px 0 30px 0;
203
- .line {
204
- margin: 0 8px;
205
- }
206
- .item {
207
- height: 30px;
208
- line-height: 30px;
209
- padding: 0 15px;
210
- font-size: 13px;
211
- color: #353535;
212
- border: 1px solid transparent;
213
- box-sizing: border-box;
214
- background: rgba(#f5f5f5, 0.8);
215
- border-radius: 6px;
216
- }
217
- .current {
218
- border: 1px solid #353535;
219
- }
220
- }
221
- .bottom {
222
- height: 32px;
223
- background: #fff;
224
- }
225
- }
226
- </style>
1
+ <template>
2
+ <div class="consumption-date-filter">
3
+ <div class="date-filter-header">日期选择</div>
4
+ <div class="content">
5
+ <div class="title">自定义</div>
6
+ <div class="time">
7
+ <div
8
+ class="item"
9
+ :class="focused === 'from' ? 'current' : ''"
10
+ @click="switchDateInput('from')"
11
+ >
12
+ {{ formatDate(result.from) }}
13
+ </div>
14
+ <div class="line">-</div>
15
+ <div class="item" :class="focused === 'to' ? 'current' : ''" @click="switchDateInput('to')">
16
+ {{ formatDate(result.to) }}
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <div class="buttons spa-between">
21
+ <div class="btn" @click="reset">重置</div>
22
+ <div class="btn confirm" @click="onOkClick">确定</div>
23
+ </div>
24
+ <div class="bottom"></div>
25
+ </div>
26
+ <nut-popup v-model:visible="datePickerOpen" position="bottom">
27
+ <nut-date-picker
28
+ v-model="focusedDate"
29
+ :min-date="minDate"
30
+ :max-date="maxDate"
31
+ :is-show-chinese="false"
32
+ :three-dimensional="false"
33
+ @cancel="datePickerOpen = false"
34
+ @confirm="onDatePickerComplete"
35
+ ></nut-date-picker>
36
+ </nut-popup>
37
+ </template>
38
+
39
+ <script lang="ts" setup>
40
+ import { reactive, ref, watch } from 'vue'
41
+
42
+ type DateFilterProps = {
43
+ from: string
44
+ to: string
45
+ }
46
+
47
+ const props = defineProps<DateFilterProps>()
48
+
49
+ const emit = defineEmits(['complete', 'reset'])
50
+
51
+ watch(
52
+ () => `${props.from}${props.to}`,
53
+ () => {
54
+ result.from = props.from
55
+ result.to = props.to
56
+ }
57
+ )
58
+
59
+ /**
60
+ * 日期范围结果
61
+ */
62
+ const result = reactive<DateFilterProps>({ ...props })
63
+
64
+ /**
65
+ * 目前激活的日期输入框
66
+ */
67
+ const focused = ref<string>('from')
68
+ const focusedDate = ref<any>(props.from)
69
+
70
+ const minDate = ref<any>()
71
+ const maxDate = ref<Date>(new Date())
72
+ const datePickerOpen = ref<boolean>(false)
73
+
74
+ /**
75
+ * 日期重置
76
+ */
77
+ function reset() {
78
+ emit('reset')
79
+ }
80
+
81
+ /**
82
+ * 确认,提交新时间
83
+ */
84
+ function onOkClick() {
85
+ emit('complete', result)
86
+ }
87
+
88
+ function formatDate(date: string) {
89
+ const [year, month, day] = date.split('-')
90
+ return year + '年' + month + '月' + day + '日'
91
+ }
92
+
93
+ function onDatePickerComplete({ selectedValue, selectedOptions }) {
94
+ let time = selectedOptions.map((val: any) => val.text).join('-')
95
+ if (focused.value === 'from') {
96
+ // 如果选择的时间比结束时间大,结束时间改为开始时间
97
+ result.from = new Date(time) > new Date(result.to) ? result.to : time
98
+ } else {
99
+ result.to = time
100
+ }
101
+ datePickerOpen.value = false
102
+ }
103
+
104
+ /**
105
+ * 切换时间逻辑:初始化时有时间,默认聚焦开始时间
106
+ * 当选择开始时间大于结束时间,结束时间改为开始时间
107
+ * 时间选择器都要小于当前时间,结束时间的时间选择器要以开始时间为最小值,
108
+ */
109
+ function switchDateInput(shift: string) {
110
+ // 要设置一下结束时间的起始值 开始时间往前倒5年
111
+ if (shift === 'from') {
112
+ let time = result.from.split('-').map(Number)
113
+ minDate.value = new Date(time[0] - 5, 1, 1)
114
+ } else {
115
+ let time = result.from.split('-').map(Number)
116
+ minDate.value = new Date(time[0], time[1] - 1, time[2])
117
+ }
118
+ focusedDate.value = new Date(result[shift])
119
+ focused.value = shift
120
+ datePickerOpen.value = true
121
+ }
122
+ </script>
123
+ <style lang="scss">
124
+ .consumption-date-filter {
125
+ height: 100%;
126
+ display: flex;
127
+ flex-direction: column;
128
+ width: 100%;
129
+ .date-filter-header {
130
+ text-align: center;
131
+ height: 44px;
132
+ line-height: 44px;
133
+ color: #353535;
134
+ font-size: 17px;
135
+ background-color: #f5f5f5;
136
+ }
137
+ .content {
138
+ flex: 1;
139
+ margin: 15px;
140
+ overflow-y: scroll;
141
+ color: #353535;
142
+ font-size: 13px;
143
+ .title {
144
+ opacity: 0.6;
145
+ line-height: 18px;
146
+ }
147
+ .info {
148
+ display: grid;
149
+ grid-template-columns: 1fr 1fr 1fr;
150
+ grid-gap: 10px;
151
+ margin: 10px 0;
152
+ .item {
153
+ height: 30px;
154
+ line-height: 30px;
155
+ border: 1px solid #ccc;
156
+ border-radius: 6px;
157
+ text-align: center;
158
+ }
159
+ .current {
160
+ border: 1px solid;
161
+ border-image-source: linear-gradient(
162
+ 180deg,
163
+ rgba(239, 208, 130, 0.8) 0%,
164
+ rgba(255, 185, 120, 0.8) 100%
165
+ );
166
+ background: linear-gradient(
167
+ 180deg,
168
+ rgba(239, 208, 130, 0.8) 0%,
169
+ rgba(255, 185, 120, 0.8) 100%
170
+ ),
171
+ linear-gradient(180deg, #fff7e3 0%, #fefde6 100%);
172
+ }
173
+ }
174
+ }
175
+ .buttons {
176
+ margin: 0 15px;
177
+ display: flex;
178
+ justify-content: space-between;
179
+ align-items: center;
180
+ .btn {
181
+ flex: 1;
182
+ height: 40px;
183
+ line-height: 40px;
184
+ text-align: center;
185
+ border: 1px solid #ccc;
186
+ box-sizing: border-box;
187
+ color: #666;
188
+ font-size: 16px;
189
+ border-radius: 6px;
190
+ }
191
+ .confirm {
192
+ margin-left: 11px;
193
+ color: #000;
194
+ border: none;
195
+ background: linear-gradient(90deg, #ffebc1 0%, #ffd7a7 52.29%, #ffb875 100%);
196
+ }
197
+ }
198
+ .time {
199
+ display: flex;
200
+ justify-content: flex-start;
201
+ align-items: center;
202
+ margin: 10px 0 30px 0;
203
+ .line {
204
+ margin: 0 8px;
205
+ }
206
+ .item {
207
+ height: 30px;
208
+ line-height: 30px;
209
+ padding: 0 15px;
210
+ font-size: 13px;
211
+ color: #353535;
212
+ border: 1px solid transparent;
213
+ box-sizing: border-box;
214
+ background: rgba(#f5f5f5, 0.8);
215
+ border-radius: 6px;
216
+ }
217
+ .current {
218
+ border: 1px solid #353535;
219
+ }
220
+ }
221
+ .bottom {
222
+ height: 32px;
223
+ background: #fff;
224
+ }
225
+ }
226
+ </style>
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <div class="date-range" @click="openDateFilter" v-show="filtering.to">
3
+ <div class="text number">{{ dateRangeDisplay }}</div>
4
+ <img
5
+ style="margin-top: -2px"
6
+ class="time-icon"
7
+ src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-down.png"
8
+ />
9
+ </div>
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import { computed, reactive } from 'vue'
14
+ import { useNutshell } from '@uxda/nutshell/taro'
15
+ import DateFilter from './DateFilter.vue'
16
+ import dayjs from 'dayjs'
17
+
18
+ const $n = useNutshell()
19
+
20
+ const filtering = reactive({
21
+ from: dayjs().add(-3, 'M').format('YYYY-MM-DD'),
22
+ to: dayjs().format('YYYY-MM-DD'),
23
+ })
24
+
25
+ const openDateFilter = () => {
26
+ $n.sheet({
27
+ component: DateFilter,
28
+ props: {
29
+ from: '2024-08-01',
30
+ to: '2024-08-31',
31
+ }
32
+ })
33
+ }
34
+
35
+ const dateRangeDisplay = computed(() => {
36
+ let startTime = (filtering.from || '').replace(/-/g, '.').substring(2)
37
+ let endTime = (filtering.to || '').replace(/-/g, '.').substring(2)
38
+ return startTime + ' - ' + endTime
39
+ })
40
+
41
+ </script>
42
+
43
+ <style lang="scss">
44
+ .date-range {
45
+ height: 22px;
46
+ padding-right: 5px;
47
+ flex: 1;
48
+ display: flex;
49
+ align-items: center;
50
+ .text {
51
+ width: fit-content;
52
+ white-space: nowrap;
53
+ }
54
+ .time-icon {
55
+ display: block;
56
+ font-size: 0;
57
+ width: 12px;
58
+ height: 12px;
59
+ margin-left: 4px;
60
+ }
61
+ }
62
+ </style>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <div class="list-filter" @click="openPicker">
3
+ <span class="text">筛选</span>
4
+ <img
5
+ class="icon"
6
+ src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-select-icon.png"
7
+ />
8
+ </div>
9
+ </template>
10
+
11
+ <script lang="ts" setup>
12
+ import { computed, reactive } from 'vue'
13
+ import { useNutshell } from '@uxda/nutshell/taro'
14
+ import ListFilterPicker from './ListFilterPicker.vue'
15
+
16
+ const $n = useNutshell()
17
+
18
+ const openPicker = () => {
19
+ $n.sheet({
20
+ component: ListFilterPicker,
21
+
22
+ })
23
+ }
24
+ </script>
25
+
26
+ <style lang="scss">
27
+ .list-filter {
28
+ display: flex;
29
+ align-items: center;
30
+ height: 22px;
31
+ padding-left: 5px;
32
+ .icon {
33
+ display: block;
34
+ font-size: 0;
35
+ width: 12px;
36
+ height: 12px;
37
+ margin-left: 4px;
38
+ }
39
+ }
40
+ </style>