@uxda/appkit 1.2.8 → 1.2.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 (66) 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 +289 -71
  5. package/dist/index.js +862 -341
  6. package/dist/styles.css +1 -0
  7. package/package.json +78 -78
  8. package/project.config.json +15 -15
  9. package/project.tt.json +13 -13
  10. package/rollup.config.mjs +54 -54
  11. package/src/Appkit.ts +65 -65
  12. package/src/balance/api/endpoints.ts +125 -122
  13. package/src/balance/api/index.ts +82 -82
  14. package/src/balance/components/AccountView.vue +754 -649
  15. package/src/balance/components/BalanceCard.vue +209 -209
  16. package/src/balance/components/BalanceReminder.vue +83 -83
  17. package/src/balance/components/ConsumptionFilter.vue +218 -218
  18. package/src/balance/components/ConsumptionRules.vue +68 -68
  19. package/src/balance/components/DateFilter.vue +235 -235
  20. package/src/balance/components/SecondBalance.vue +71 -71
  21. package/src/balance/components/Tip.vue +46 -0
  22. package/src/balance/components/index.ts +9 -9
  23. package/src/balance/types.ts +90 -88
  24. package/src/components/dd-area/index.vue +222 -222
  25. package/src/components/dd-icon/doc.md +21 -21
  26. package/src/components/dd-icon/index.vue +23 -23
  27. package/src/components/dd-selector/index.vue +124 -124
  28. package/src/components/ocr-id/index.vue +110 -110
  29. package/src/components/ocr-id/types.d.ts +12 -12
  30. package/src/global.ts +6 -6
  31. package/src/index.ts +88 -86
  32. package/src/main.scss +1 -1
  33. package/src/payment/api/config.ts +7 -7
  34. package/src/payment/api/endpoints.ts +103 -78
  35. package/src/payment/api/index.ts +71 -71
  36. package/src/payment/components/AmountPicker.vue +93 -93
  37. package/src/payment/components/RechargeResult.vue +66 -54
  38. package/src/payment/components/RechargeView.vue +154 -154
  39. package/src/payment/components/RightsPicker.vue +106 -0
  40. package/src/payment/components/TradeView.vue +298 -0
  41. package/src/payment/components/UserAgreement.vue +141 -141
  42. package/src/payment/components/index.ts +22 -19
  43. package/src/payment/index.ts +5 -5
  44. package/src/payment/services/index.ts +16 -16
  45. package/src/payment/services/invoke-recharge.ts +25 -25
  46. package/src/payment/services/request-payment.ts +58 -31
  47. package/src/payment/types.ts +28 -23
  48. package/src/register/components/SelfRegistration.vue +227 -227
  49. package/src/register/components/index.ts +2 -2
  50. package/src/shared/components/AppDrawer.vue +58 -58
  51. package/src/shared/components/EmptyView.vue +33 -33
  52. package/src/shared/components/PageHeader.vue +79 -79
  53. package/src/shared/components/index.ts +6 -6
  54. package/src/shared/composables/index.ts +2 -2
  55. package/src/shared/composables/useSafeArea.ts +43 -43
  56. package/src/shared/composables/useTabbar.ts +24 -24
  57. package/src/shared/http/Http.ts +126 -126
  58. package/src/shared/http/index.ts +1 -1
  59. package/src/shared/http/types.ts +157 -157
  60. package/src/shared/index.ts +3 -3
  61. package/src/shared/weixin/payment.ts +38 -38
  62. package/src/styles/fonts.scss +2 -2
  63. package/src/styles/vars.scss +3 -3
  64. package/tsconfig.json +30 -30
  65. package/types/global.d.ts +21 -21
  66. package/types/vue.d.ts +10 -10
@@ -1,21 +1,21 @@
1
- # ddIcon 空内容展示
2
- ### 使用iconfont图标
3
-
4
- #
5
- ## 使用
6
-
7
- ``` javascript
8
- import ddIcon from '~/components/ddIcon/index.vue'
9
- ```
10
- ``` html
11
- <dd-icon name="icon-arrow" size="11px" color="#DFDFDF" />
12
- ```
13
-
14
- ## Prop
15
-
16
- | 字段 | 说明 | 类型 | 默认值 |
17
- |-----------|-------------|---------|----------|
18
- | name | icon名称 | string | '' |
19
- | color | icon颜色 | string | inherit |
20
- | size | icon字体大小 | string | 16px |
21
- | weight | icon字体字重 | string | normal |
1
+ # ddIcon 空内容展示
2
+ ### 使用iconfont图标
3
+
4
+ #
5
+ ## 使用
6
+
7
+ ``` javascript
8
+ import ddIcon from '~/components/ddIcon/index.vue'
9
+ ```
10
+ ``` html
11
+ <dd-icon name="icon-arrow" size="11px" color="#DFDFDF" />
12
+ ```
13
+
14
+ ## Prop
15
+
16
+ | 字段 | 说明 | 类型 | 默认值 |
17
+ |-----------|-------------|---------|----------|
18
+ | name | icon名称 | string | '' |
19
+ | color | icon颜色 | string | inherit |
20
+ | size | icon字体大小 | string | 16px |
21
+ | weight | icon字体字重 | string | normal |
@@ -1,23 +1,23 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
- const props = withDefaults(
4
- defineProps<{
5
- name: string
6
- color?: string
7
- size?: string
8
- weight?: string
9
- }>(),
10
- {
11
- color: 'inherit',
12
- size: '16px',
13
- weight: 'normal',
14
- }
15
- )
16
- const styles = computed(() => {
17
- return `color: ${props.color}; font-size: ${props.size}; font-weight: ${props.weight};`
18
- })
19
- </script>
20
-
21
- <template>
22
- <view class="iconfont" :class="name" :style="styles"></view>
23
- </template>
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ const props = withDefaults(
4
+ defineProps<{
5
+ name: string
6
+ color?: string
7
+ size?: string
8
+ weight?: string
9
+ }>(),
10
+ {
11
+ color: 'inherit',
12
+ size: '16px',
13
+ weight: 'normal',
14
+ }
15
+ )
16
+ const styles = computed(() => {
17
+ return `color: ${props.color}; font-size: ${props.size}; font-weight: ${props.weight};`
18
+ })
19
+ </script>
20
+
21
+ <template>
22
+ <view class="iconfont" :class="name" :style="styles"></view>
23
+ </template>
@@ -1,124 +1,124 @@
1
- <!--* NAME: index-->
2
- <!--* AUTHOR: yanglong-->
3
- <!--* UPDATE: 2022-02-23 09:33-->
4
- <!--* TIP: 微信原生实现单列选择器-->
5
- <script setup lang="ts">
6
- import { computed, ref, watch } from 'vue'
7
- import DdIcon from '../dd-icon/index.vue'
8
-
9
- interface Option {
10
- label?: string
11
- value?: string
12
- }
13
- interface PropsType {
14
- value?: string
15
- options?: Option[]
16
- placeholder?: string
17
- rightIcon?: boolean
18
- disabled?: boolean
19
- }
20
-
21
- const props = withDefaults(defineProps<PropsType>(), {
22
- value: '',
23
- options: () => [],
24
- placeholder: '请选择',
25
- rightIcon: true,
26
- disabled: false,
27
- })
28
-
29
- const currentIndex = ref<number>()
30
- const currentLabel = ref<string>()
31
-
32
- const emit = defineEmits(['update:value','change', 'cancel'])
33
- function onChange(e) {
34
- const index = e.detail.value as number
35
- const item = props.options[index]
36
- if (item === void 0) return
37
- currentIndex.value = index
38
- currentLabel.value = item.label
39
- emit('update:value', item.value)
40
- emit('change', item)
41
- }
42
-
43
- // 通过value查询item index
44
- function findIndexByValue(value: string) {
45
- if (value == undefined) return undefined
46
- const index = props.options.findIndex((item: Option)=> item.value == value)
47
- return index >= 0 ? index : undefined
48
- }
49
-
50
- function onCancel(e) {
51
- emit('cancel', e)
52
- }
53
-
54
- watch(
55
- () => props,
56
- () => {
57
- init()
58
- },
59
- {
60
- deep: true,
61
- immediate: true,
62
- }
63
- )
64
-
65
- function init() {
66
- currentIndex.value = findIndexByValue(props.value)
67
- currentLabel.value = currentIndex.value >= 0 ? props.options[currentIndex.value]?.label : ''
68
- }
69
- </script>
70
-
71
- <template>
72
- <picker
73
- mode="selector"
74
- :range="props.options"
75
- range-key="label"
76
- :value="currentIndex"
77
- @cancel="onCancel"
78
- @change="onChange"
79
- style="flex: 1"
80
- :disabled="props.disabled">
81
- <slot name="content">
82
- <div class="dd-selector">
83
- <div class="dd-selector-value">
84
- <div
85
- :class="
86
- currentIndex >= 0 && !props.disabled
87
- ? 'dd-selector-value'
88
- : 'dd-selector-label'
89
- ">
90
- {{ currentLabel || props.placeholder }}
91
- </div>
92
- <div>
93
- <slot name="tips"></slot>
94
- </div>
95
- </div>
96
- <slot name="icon">
97
- <DdIcon
98
- v-if="props.rightIcon"
99
- name="icon-arrow"
100
- size="11px"
101
- :color="
102
- currentIndex >= 0 && !props.disabled ? '#353535' : '#DFDFDF'
103
- "
104
- class="icon-arrow" />
105
- </slot>
106
- </div>
107
- </slot>
108
- </picker>
109
- </template>
110
-
111
- <style lang="scss">
112
- .dd-selector {
113
- display: flex;
114
- justify-content: flex-end;
115
- align-items: center;
116
- &-value {
117
- text-align: right;
118
- color: black;
119
- }
120
- &-label {
121
- color: var(--placeholder-color);
122
- }
123
- }
124
- </style>
1
+ <!--* NAME: index-->
2
+ <!--* AUTHOR: yanglong-->
3
+ <!--* UPDATE: 2022-02-23 09:33-->
4
+ <!--* TIP: 微信原生实现单列选择器-->
5
+ <script setup lang="ts">
6
+ import { computed, ref, watch } from 'vue'
7
+ import DdIcon from '../dd-icon/index.vue'
8
+
9
+ interface Option {
10
+ label?: string
11
+ value?: string
12
+ }
13
+ interface PropsType {
14
+ value?: string
15
+ options?: Option[]
16
+ placeholder?: string
17
+ rightIcon?: boolean
18
+ disabled?: boolean
19
+ }
20
+
21
+ const props = withDefaults(defineProps<PropsType>(), {
22
+ value: '',
23
+ options: () => [],
24
+ placeholder: '请选择',
25
+ rightIcon: true,
26
+ disabled: false,
27
+ })
28
+
29
+ const currentIndex = ref<number>()
30
+ const currentLabel = ref<string>()
31
+
32
+ const emit = defineEmits(['update:value','change', 'cancel'])
33
+ function onChange(e) {
34
+ const index = e.detail.value as number
35
+ const item = props.options[index]
36
+ if (item === void 0) return
37
+ currentIndex.value = index
38
+ currentLabel.value = item.label
39
+ emit('update:value', item.value)
40
+ emit('change', item)
41
+ }
42
+
43
+ // 通过value查询item index
44
+ function findIndexByValue(value: string) {
45
+ if (value == undefined) return undefined
46
+ const index = props.options.findIndex((item: Option)=> item.value == value)
47
+ return index >= 0 ? index : undefined
48
+ }
49
+
50
+ function onCancel(e) {
51
+ emit('cancel', e)
52
+ }
53
+
54
+ watch(
55
+ () => props,
56
+ () => {
57
+ init()
58
+ },
59
+ {
60
+ deep: true,
61
+ immediate: true,
62
+ }
63
+ )
64
+
65
+ function init() {
66
+ currentIndex.value = findIndexByValue(props.value)
67
+ currentLabel.value = currentIndex.value >= 0 ? props.options[currentIndex.value]?.label : ''
68
+ }
69
+ </script>
70
+
71
+ <template>
72
+ <picker
73
+ mode="selector"
74
+ :range="props.options"
75
+ range-key="label"
76
+ :value="currentIndex"
77
+ @cancel="onCancel"
78
+ @change="onChange"
79
+ style="flex: 1"
80
+ :disabled="props.disabled">
81
+ <slot name="content">
82
+ <div class="dd-selector">
83
+ <div class="dd-selector-value">
84
+ <div
85
+ :class="
86
+ currentIndex >= 0 && !props.disabled
87
+ ? 'dd-selector-value'
88
+ : 'dd-selector-label'
89
+ ">
90
+ {{ currentLabel || props.placeholder }}
91
+ </div>
92
+ <div>
93
+ <slot name="tips"></slot>
94
+ </div>
95
+ </div>
96
+ <slot name="icon">
97
+ <DdIcon
98
+ v-if="props.rightIcon"
99
+ name="icon-arrow"
100
+ size="11px"
101
+ :color="
102
+ currentIndex >= 0 && !props.disabled ? '#353535' : '#DFDFDF'
103
+ "
104
+ class="icon-arrow" />
105
+ </slot>
106
+ </div>
107
+ </slot>
108
+ </picker>
109
+ </template>
110
+
111
+ <style lang="scss">
112
+ .dd-selector {
113
+ display: flex;
114
+ justify-content: flex-end;
115
+ align-items: center;
116
+ &-value {
117
+ text-align: right;
118
+ color: black;
119
+ }
120
+ &-label {
121
+ color: var(--placeholder-color);
122
+ }
123
+ }
124
+ </style>
@@ -1,111 +1,111 @@
1
- <script setup lang="ts">
2
- import Taro from '@tarojs/taro'
3
- import { OcrResultType } from './types'
4
- import { useAppKitOptions } from '../../Appkit'
5
-
6
- const emits = defineEmits(['ocr'])
7
-
8
- const appKitOptions = useAppKitOptions()
9
-
10
- // 压缩图片
11
- async function taroImgCompress(src: string, quality = 80) {
12
- return new Promise((resolve, reject) => {
13
- Taro.compressImage({
14
- src: src,
15
- quality: quality,
16
- success: (res) => {
17
- resolve(res)
18
- },
19
- fail: (res) => {
20
- reject(res)
21
- },
22
- })
23
- })
24
- }
25
-
26
- // 压缩质量
27
- function getCompressQuality(size: number) {
28
- let quality = 100
29
- const curSize = size / (1024 * 1024)
30
- if (curSize > 6) {
31
- quality = quality - ((curSize - 6) / curSize) * 100
32
- }
33
- return quality
34
- }
35
-
36
- // 清除字符串内空格
37
- function allTrim(str: string) {
38
- return str.replace(/\s+/g, '')
39
- }
40
-
41
- // 拍照识别
42
- async function ocrIDCard() {
43
- let ocrResult: OcrResultType = null
44
- try {
45
- const csRes = await Taro.chooseImage({
46
- count: 1,
47
- })
48
- let {path, size} = csRes.tempFiles[0]
49
- const compressImg: any = (await taroImgCompress(path, getCompressQuality(size)))
50
- const filePath = compressImg?.tempFilePath ?? path
51
- Taro.showLoading({title: '身份证识别中..',})
52
- const session = appKitOptions.token()
53
- const baseUrl = appKitOptions.baseUrl()
54
- const upRes: any = await Taro.uploadFile({
55
- url: baseUrl + '/hkapprove/ocr/idcard',
56
- filePath,
57
- name: 'file',
58
- formData: {
59
- objectNo: `min${Date.now()}`,
60
- side: 'face',
61
- },
62
- header: {
63
- sessionKey: session || '',
64
- token: session || '',
65
- },
66
- })
67
- Taro.hideLoading()
68
- const res = JSON.parse(upRes.data)
69
- if (res.code === '200') {
70
- ocrResult = {
71
- faceInfo: {
72
- name: allTrim(res.result?.faceInfo?.name || ''),
73
- certNo: allTrim(res.result?.faceInfo?.num || ''),
74
- address: allTrim(res.result?.faceInfo?.address || ''),
75
- },
76
- fileUploadVO: res.result?.fileUploadVO || {},
77
- }
78
- if (!ocrResult.faceInfo.name && !ocrResult.faceInfo.certNo) {
79
- Taro.showToast({title: '识别失败,请重试', icon: 'none'})
80
- }
81
- } else {
82
- Taro.showToast({
83
- title: res.msg,
84
- icon: 'error',
85
- })
86
- }
87
- } catch (err) {
88
- Taro.hideLoading()
89
- console.log(err)
90
- }
91
- emits('ocr', ocrResult)
92
- }
93
- </script>
94
-
95
- <template>
96
- <div class="ocr-id" @click="ocrIDCard">
97
- <slot name="icon">
98
- <img class="ocr-id__img" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgZmlsbD0ibm9uZSI+PHBhdGggb3BhY2l0eT0iLjAxIiBmaWxsLXJ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yLjI3NnYxNy4wMjRjMCAxLjI1NCAxLjEzOSAyLjI3NiAyLjUzNiAyLjI3NmgzMC44N2MxLjM5NyAwIDIuNTM1LTEuMDIyIDIuNTM1LTIuMjc2VjIxLjU5NmMwLS41MDMuNDU0LS45MSAxLjAxNC0uOTFzMS4wMTUuNDA3IDEuMDE1LjkxVjMxLjgxYy0uMDAzIDIuMjYtMi4wNSA0LjEtNC41NjcgNC4xSDQuNTY0QzIuMDQ5IDM1LjkxIDAgMzQuMDcgMCAzMS44MTF6IiBmaWxsPSIjNEJDQjkzIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi4xNzQgMjEuNzc4YzAtNC44NyAzLjcwNS04LjgzIDguMjYtOC44MyA0LjU1NiAwIDguMjYyIDMuOTYgOC4yNjIgOC44M3MtMy43MDYgOC44MzItOC4yNjEgOC44MzJjLTQuNTU2IDAtOC4yNjEtMy45NjItOC4yNjEtOC44MzJ6bTEuNzc5LjEzYzAgMy43OTYgMi45MDcgNi44ODMgNi40ODIgNi44ODMgMy41NzQgMCA2LjQ4MS0zLjA4NyA2LjQ4MS02Ljg4M3MtMi45MDctNi44ODMtNi40ODItNi44ODNjLTMuNTc0IDAtNi40ODEgMy4wODctNi40ODEgNi44ODN6IiBmaWxsPSIjNEJDQjkzIi8+PC9zdmc+"/>
99
- </slot>
100
- </div>
101
- </template>
102
-
103
- <style lang="scss">
104
- .ocr-id {
105
-
106
- &__img {
107
- width: 20px;
108
- height: 20px;
109
- }
110
- }
1
+ <script setup lang="ts">
2
+ import Taro from '@tarojs/taro'
3
+ import { OcrResultType } from './types'
4
+ import { useAppKitOptions } from '../../Appkit'
5
+
6
+ const emits = defineEmits(['ocr'])
7
+
8
+ const appKitOptions = useAppKitOptions()
9
+
10
+ // 压缩图片
11
+ async function taroImgCompress(src: string, quality = 80) {
12
+ return new Promise((resolve, reject) => {
13
+ Taro.compressImage({
14
+ src: src,
15
+ quality: quality,
16
+ success: (res) => {
17
+ resolve(res)
18
+ },
19
+ fail: (res) => {
20
+ reject(res)
21
+ },
22
+ })
23
+ })
24
+ }
25
+
26
+ // 压缩质量
27
+ function getCompressQuality(size: number) {
28
+ let quality = 100
29
+ const curSize = size / (1024 * 1024)
30
+ if (curSize > 6) {
31
+ quality = quality - ((curSize - 6) / curSize) * 100
32
+ }
33
+ return quality
34
+ }
35
+
36
+ // 清除字符串内空格
37
+ function allTrim(str: string) {
38
+ return str.replace(/\s+/g, '')
39
+ }
40
+
41
+ // 拍照识别
42
+ async function ocrIDCard() {
43
+ let ocrResult: OcrResultType = null
44
+ try {
45
+ const csRes = await Taro.chooseImage({
46
+ count: 1,
47
+ })
48
+ let {path, size} = csRes.tempFiles[0]
49
+ const compressImg: any = (await taroImgCompress(path, getCompressQuality(size)))
50
+ const filePath = compressImg?.tempFilePath ?? path
51
+ Taro.showLoading({title: '身份证识别中..',})
52
+ const session = appKitOptions.token()
53
+ const baseUrl = appKitOptions.baseUrl()
54
+ const upRes: any = await Taro.uploadFile({
55
+ url: baseUrl + '/hkapprove/ocr/idcard',
56
+ filePath,
57
+ name: 'file',
58
+ formData: {
59
+ objectNo: `min${Date.now()}`,
60
+ side: 'face',
61
+ },
62
+ header: {
63
+ sessionKey: session || '',
64
+ token: session || '',
65
+ },
66
+ })
67
+ Taro.hideLoading()
68
+ const res = JSON.parse(upRes.data)
69
+ if (res.code === '200') {
70
+ ocrResult = {
71
+ faceInfo: {
72
+ name: allTrim(res.result?.faceInfo?.name || ''),
73
+ certNo: allTrim(res.result?.faceInfo?.num || ''),
74
+ address: allTrim(res.result?.faceInfo?.address || ''),
75
+ },
76
+ fileUploadVO: res.result?.fileUploadVO || {},
77
+ }
78
+ if (!ocrResult.faceInfo.name && !ocrResult.faceInfo.certNo) {
79
+ Taro.showToast({title: '识别失败,请重试', icon: 'none'})
80
+ }
81
+ } else {
82
+ Taro.showToast({
83
+ title: res.msg,
84
+ icon: 'error',
85
+ })
86
+ }
87
+ } catch (err) {
88
+ Taro.hideLoading()
89
+ console.log(err)
90
+ }
91
+ emits('ocr', ocrResult)
92
+ }
93
+ </script>
94
+
95
+ <template>
96
+ <div class="ocr-id" @click="ocrIDCard">
97
+ <slot name="icon">
98
+ <img class="ocr-id__img" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgZmlsbD0ibm9uZSI+PHBhdGggb3BhY2l0eT0iLjAxIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQwIDB2NDBIMFYwaDQweiIgZmlsbD0iI0M0QzRDNCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzMuMDQ0IDE3LjM2M2MuOTYgMCAxLjczOS0uNzkgMS43MzktMS43NjYgMC0uOTc1LS43NzktMS43NjYtMS43NC0xLjc2Ni0uOTYgMC0xLjczOC43OS0xLjczOCAxLjc2NnMuNzc4IDEuNzY2IDEuNzM5IDEuNzY2eiIgZmlsbD0iIzRCQ0I5MyIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMCAzMS44MTJWMTQuNzg4YzAtMi4yNTggMi4wNDktNC4wOTcgNC41NjQtNC4wOTdoMy44NDRsMS4xMzYtMy42NThDOS44ODggNS45MTMgMTEuMjM3IDUgMTIuNTQ4IDVIMjcuNDVjMS4zOSAwIDIuNjguODc2IDMuMDEgMi4wNDRsMS4xMzMgMy42NDdoMy44NDRjMi41MTUgMCA0LjU2NCAxLjgzOSA0LjU2NCA0LjA5N3YxLjczOWMwIC41MDMtLjQ1NC45MS0xLjAxNC45MXMtMS4wMTQtLjQwNy0xLjAxNC0uOTF2LTEuNzRjMC0xLjI1My0xLjEzOS0yLjI3NS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ot>
100
+ </div>
101
+ </template>
102
+
103
+ <style lang="scss">
104
+ .ocr-id {
105
+
106
+ &__img {
107
+ width: 20px;
108
+ height: 20px;
109
+ }
110
+ }
111
111
  </style>
@@ -1,13 +1,13 @@
1
- export type OcrResultType = {
2
- faceInfo: {
3
- name: string
4
- certNo: string
5
- address: string
6
- }
7
- fileUploadVO: {
8
- fileKey: string
9
- fileUrl: string
10
- objectNo: string
11
- thumbnailUrl?: string
12
- }
1
+ export type OcrResultType = {
2
+ faceInfo: {
3
+ name: string
4
+ certNo: string
5
+ address: string
6
+ }
7
+ fileUploadVO: {
8
+ fileKey: string
9
+ fileUrl: string
10
+ objectNo: string
11
+ thumbnailUrl?: string
12
+ }
13
13
  } | null
package/src/global.ts CHANGED
@@ -1,7 +1,7 @@
1
- const globalData: any = {
2
-
3
- }
4
-
5
- export {
6
- globalData
1
+ const globalData: any = {
2
+
3
+ }
4
+
5
+ export {
6
+ globalData
7
7
  }