@uxda/appkit 4.2.82 → 4.2.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.mjs +7 -7
- package/README.md +187 -187
- package/babel.config.js +12 -12
- package/dist/appkit.css +41 -3
- package/dist/index.js +994 -535
- package/package.json +81 -81
- package/project.config.json +15 -15
- package/project.tt.json +13 -13
- package/rollup.config.mjs +77 -77
- package/src/Appkit.ts +67 -67
- package/src/balance/api/endpoints.ts +133 -133
- package/src/balance/api/index.ts +112 -106
- package/src/balance/components/AccountView.vue +773 -773
- package/src/balance/components/BalanceCard.vue +210 -210
- package/src/balance/components/BalanceReminder.vue +84 -84
- package/src/balance/components/ConsumptionFilter.vue +218 -218
- package/src/balance/components/ConsumptionRules.vue +68 -68
- package/src/balance/components/DateFilter.vue +259 -259
- package/src/balance/components/DateRange.vue +111 -111
- package/src/balance/components/ListFilter.vue +62 -62
- package/src/balance/components/ListFilterPicker.vue +191 -191
- package/src/balance/components/PromoterCard.vue +310 -310
- package/src/balance/components/SecondBalance.vue +77 -77
- package/src/balance/components/Tip.vue +45 -45
- package/src/balance/components/index.ts +8 -8
- package/src/balance/types.ts +99 -99
- package/src/components/bt-cropper/index.vue +730 -730
- package/src/components/bt-cropper/utils/calcCropper.js +42 -42
- package/src/components/bt-cropper/utils/calcImagePosition.js +23 -23
- package/src/components/bt-cropper/utils/calcImageSize.js +37 -37
- package/src/components/bt-cropper/utils/calcPointDistance.js +12 -12
- package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -7
- package/src/components/bt-cropper/utils/ratio.js +3 -3
- package/src/components/bt-cropper/utils/tools.js +25 -25
- package/src/components/dd-area/index.vue +225 -225
- package/src/components/dd-icon/doc.md +21 -21
- package/src/components/dd-icon/index.vue +23 -23
- package/src/components/dd-notice-bar/index.vue +78 -78
- package/src/components/dd-search/doc.md +34 -34
- package/src/components/dd-search/index.vue +168 -168
- package/src/components/dd-selector/index.vue +124 -124
- package/src/components/dd-skeleton/doc.md +19 -19
- package/src/components/dd-skeleton/index.vue +36 -36
- package/src/global.ts +6 -6
- package/src/index.ts +93 -93
- package/src/main.scss +1 -1
- package/src/notice/api/endpoints.ts +54 -17
- package/src/notice/api/index.ts +115 -106
- package/src/notice/components/NoticeBanner.vue +247 -247
- package/src/notice/components/NoticeEntry.vue +99 -99
- package/src/notice/components/NoticeList.vue +311 -311
- package/src/notice/components/NoticeList2.vue +243 -0
- package/src/notice/components/NoticePopup.vue +163 -163
- package/src/notice/components/index.ts +6 -5
- package/src/notice/components/useCommonList.ts +86 -86
- package/src/notice/components/useNotice.ts +35 -35
- package/src/notice/index.ts +1 -1
- package/src/notice/types.ts +25 -25
- package/src/payment/api/config.ts +7 -7
- package/src/payment/api/endpoints.ts +95 -95
- package/src/payment/api/index.ts +101 -101
- package/src/payment/components/AmountPicker.vue +90 -90
- package/src/payment/components/RechargeResult.vue +69 -69
- package/src/payment/components/RechargeView.vue +190 -190
- package/src/payment/components/RightsPicker.vue +105 -105
- package/src/payment/components/TradeView.vue +363 -363
- package/src/payment/components/UserAgreement.vue +234 -234
- package/src/payment/components/index.ts +22 -22
- package/src/payment/index.ts +5 -5
- package/src/payment/services/index.ts +16 -16
- package/src/payment/services/invoke-recharge.ts +25 -25
- package/src/payment/services/request-payment.ts +130 -130
- package/src/payment/types.ts +32 -32
- package/src/register/components/SelfRegistration.vue +233 -233
- package/src/register/components/index.ts +2 -2
- package/src/scenarios/components/SharePoster.vue +364 -364
- package/src/scenarios/components/index.ts +2 -2
- package/src/scenarios/components/poster-paste.vue +93 -93
- package/src/scenarios/components/share-poster.md +273 -273
- package/src/shared/components/AppDrawer.vue +53 -53
- package/src/shared/components/AppVerify.vue +128 -128
- package/src/shared/components/DeviceVersion.vue +78 -78
- package/src/shared/components/EmptyView.vue +33 -33
- package/src/shared/components/OcrBusinessLicense.vue +137 -137
- package/src/shared/components/OcrIcon.vue +229 -229
- package/src/shared/components/PageHeader.vue +84 -84
- package/src/shared/components/index.ts +8 -8
- package/src/shared/composables/index.ts +9 -9
- package/src/shared/composables/useAmount.ts +46 -46
- package/src/shared/composables/useCountdown.ts +46 -46
- package/src/shared/composables/useCrypto.ts +76 -76
- package/src/shared/composables/useDeviceEnv.ts +11 -11
- package/src/shared/composables/useDragBox.ts +97 -97
- package/src/shared/composables/useEncode.ts +43 -43
- package/src/shared/composables/useLogger.ts +131 -131
- package/src/shared/composables/useSafeArea.ts +46 -46
- package/src/shared/composables/useTabbar.ts +24 -24
- package/src/shared/composables/useUpload.ts +61 -61
- package/src/shared/composables/useValidator.ts +32 -32
- package/src/shared/composables/useWxAuth.ts +48 -48
- package/src/shared/http/Http.ts +148 -146
- package/src/shared/http/index.ts +1 -1
- package/src/shared/http/types.ts +163 -160
- package/src/shared/index.ts +8 -8
- package/src/shared/weixin/index.ts +9 -9
- package/src/shared/weixin/jssdk.ts +103 -103
- package/src/shared/weixin/payment.ts +38 -38
- package/src/styles/vars.scss +3 -3
- package/src/user/api/endpoints.ts +17 -17
- package/src/user/api/index.ts +117 -111
- package/src/user/components/LoginSetting.vue +114 -114
- package/src/user/components/UserAuth.vue +220 -220
- package/src/user/components/UserBinding.vue +277 -277
- package/src/user/components/UserBindingSuccess.vue +80 -80
- package/src/user/components/UserEntry.vue +139 -139
- package/src/user/components/UserFeedback.vue +427 -427
- package/src/user/components/UserFeedbackEntry.vue +175 -175
- package/src/user/components/UserHeadCrop.vue +65 -65
- package/src/user/components/UserInfo.vue +708 -708
- package/src/user/components/UserResourceEmpty.vue +75 -75
- package/src/user/components/index.ts +23 -23
- package/src/user/index.ts +1 -1
- package/src/utils/utils.ts +28 -28
- package/tsconfig.json +30 -30
- package/types/global.d.ts +22 -22
- package/types/vue.d.ts +10 -10
- /package/dist/assets/{asset-DcH8Kg-2 → asset-3B_CoPto} +0 -0
|
@@ -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 =
|
|
68
|
-
currentIndex.value >= 0 ? (props.options[currentIndex.value] || {}).label : ''
|
|
69
|
-
}
|
|
70
|
-
</script>
|
|
71
|
-
|
|
72
|
-
<template>
|
|
73
|
-
<picker
|
|
74
|
-
mode="selector"
|
|
75
|
-
:range="props.options"
|
|
76
|
-
range-key="label"
|
|
77
|
-
:value="currentIndex"
|
|
78
|
-
@cancel="onCancel"
|
|
79
|
-
@change="onChange"
|
|
80
|
-
style="flex: 1"
|
|
81
|
-
:disabled="props.disabled"
|
|
82
|
-
>
|
|
83
|
-
<slot name="content">
|
|
84
|
-
<div class="dd-selector">
|
|
85
|
-
<div class="dd-selector-value">
|
|
86
|
-
<div
|
|
87
|
-
:class="
|
|
88
|
-
currentIndex >= 0 && !props.disabled ? 'dd-selector-value' : 'dd-selector-label'
|
|
89
|
-
"
|
|
90
|
-
>
|
|
91
|
-
{{ currentLabel || props.placeholder }}
|
|
92
|
-
</div>
|
|
93
|
-
<div>
|
|
94
|
-
<slot name="tips"></slot>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
<slot name="icon">
|
|
98
|
-
<DdIcon
|
|
99
|
-
v-if="props.rightIcon"
|
|
100
|
-
name="icon-arrow"
|
|
101
|
-
size="11px"
|
|
102
|
-
:color="currentIndex >= 0 && !props.disabled ? '#353535' : '#DFDFDF'"
|
|
103
|
-
class="icon-arrow"
|
|
104
|
-
/>
|
|
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 =
|
|
68
|
+
currentIndex.value >= 0 ? (props.options[currentIndex.value] || {}).label : ''
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<template>
|
|
73
|
+
<picker
|
|
74
|
+
mode="selector"
|
|
75
|
+
:range="props.options"
|
|
76
|
+
range-key="label"
|
|
77
|
+
:value="currentIndex"
|
|
78
|
+
@cancel="onCancel"
|
|
79
|
+
@change="onChange"
|
|
80
|
+
style="flex: 1"
|
|
81
|
+
:disabled="props.disabled"
|
|
82
|
+
>
|
|
83
|
+
<slot name="content">
|
|
84
|
+
<div class="dd-selector">
|
|
85
|
+
<div class="dd-selector-value">
|
|
86
|
+
<div
|
|
87
|
+
:class="
|
|
88
|
+
currentIndex >= 0 && !props.disabled ? 'dd-selector-value' : 'dd-selector-label'
|
|
89
|
+
"
|
|
90
|
+
>
|
|
91
|
+
{{ currentLabel || props.placeholder }}
|
|
92
|
+
</div>
|
|
93
|
+
<div>
|
|
94
|
+
<slot name="tips"></slot>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
<slot name="icon">
|
|
98
|
+
<DdIcon
|
|
99
|
+
v-if="props.rightIcon"
|
|
100
|
+
name="icon-arrow"
|
|
101
|
+
size="11px"
|
|
102
|
+
:color="currentIndex >= 0 && !props.disabled ? '#353535' : '#DFDFDF'"
|
|
103
|
+
class="icon-arrow"
|
|
104
|
+
/>
|
|
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,19 +1,19 @@
|
|
|
1
|
-
# ddSkeleton 骨架屏
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
## 使用
|
|
5
|
-
|
|
6
|
-
``` javascript
|
|
7
|
-
import ddSkeleton from '~/components/ddSkeleton/index.vue'
|
|
8
|
-
```
|
|
9
|
-
``` html
|
|
10
|
-
<dd-skeleton @onSuccess="onSuccess" />
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Prop
|
|
14
|
-
|
|
15
|
-
| 字段 | 说明 | 类型 | 默认值 |
|
|
16
|
-
|-----------|-------------|---------|----------|
|
|
17
|
-
| row | 大骨架个数 | number | 3 |
|
|
18
|
-
| shortRow | 短骨架的行数 | string | 2 |
|
|
19
|
-
| longRow | 长骨架的行数 | string | 3 |
|
|
1
|
+
# ddSkeleton 骨架屏
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
## 使用
|
|
5
|
+
|
|
6
|
+
``` javascript
|
|
7
|
+
import ddSkeleton from '~/components/ddSkeleton/index.vue'
|
|
8
|
+
```
|
|
9
|
+
``` html
|
|
10
|
+
<dd-skeleton @onSuccess="onSuccess" />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Prop
|
|
14
|
+
|
|
15
|
+
| 字段 | 说明 | 类型 | 默认值 |
|
|
16
|
+
|-----------|-------------|---------|----------|
|
|
17
|
+
| row | 大骨架个数 | number | 3 |
|
|
18
|
+
| shortRow | 短骨架的行数 | string | 2 |
|
|
19
|
+
| longRow | 长骨架的行数 | string | 3 |
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
interface PropType {
|
|
3
|
-
row?: number
|
|
4
|
-
shortRow?: string
|
|
5
|
-
longRow?: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
withDefaults(defineProps<PropType>(), {
|
|
9
|
-
row: 3,
|
|
10
|
-
shortRow: '2',
|
|
11
|
-
longRow: '4',
|
|
12
|
-
})
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<template>
|
|
16
|
-
<div class="dd-skeleton">
|
|
17
|
-
<div class="dd-skeleton__item" v-for="(item, key) in row" :key="key">
|
|
18
|
-
<nut-skeleton
|
|
19
|
-
width="40%"
|
|
20
|
-
height="15px"
|
|
21
|
-
animated
|
|
22
|
-
v-if="Number(shortRow) > 0"
|
|
23
|
-
:row="shortRow"
|
|
24
|
-
></nut-skeleton>
|
|
25
|
-
<nut-skeleton width="100%" height="15px" title animated :row="longRow"></nut-skeleton>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<style lang="scss">
|
|
31
|
-
.dd-skeleton {
|
|
32
|
-
&__item {
|
|
33
|
-
margin-top: 10px;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface PropType {
|
|
3
|
+
row?: number
|
|
4
|
+
shortRow?: string
|
|
5
|
+
longRow?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
withDefaults(defineProps<PropType>(), {
|
|
9
|
+
row: 3,
|
|
10
|
+
shortRow: '2',
|
|
11
|
+
longRow: '4',
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="dd-skeleton">
|
|
17
|
+
<div class="dd-skeleton__item" v-for="(item, key) in row" :key="key">
|
|
18
|
+
<nut-skeleton
|
|
19
|
+
width="40%"
|
|
20
|
+
height="15px"
|
|
21
|
+
animated
|
|
22
|
+
v-if="Number(shortRow) > 0"
|
|
23
|
+
:row="shortRow"
|
|
24
|
+
></nut-skeleton>
|
|
25
|
+
<nut-skeleton width="100%" height="15px" title animated :row="longRow"></nut-skeleton>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<style lang="scss">
|
|
31
|
+
.dd-skeleton {
|
|
32
|
+
&__item {
|
|
33
|
+
margin-top: 10px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</style>
|
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
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import { App } from 'vue'
|
|
2
|
-
import { components as paymentComponents } from './payment/components'
|
|
3
|
-
import { services as paymentServices } from './payment'
|
|
4
|
-
import { jssdkServices } from './shared'
|
|
5
|
-
import // Grid,
|
|
6
|
-
// GridItem,
|
|
7
|
-
// Button,
|
|
8
|
-
// Checkbox,
|
|
9
|
-
// Popup,
|
|
10
|
-
// OverLay,
|
|
11
|
-
// DatePicker,
|
|
12
|
-
// Form,
|
|
13
|
-
// FormItem,
|
|
14
|
-
// Cell,
|
|
15
|
-
// CellGroup,
|
|
16
|
-
// Dialog
|
|
17
|
-
'@nutui/nutui-taro'
|
|
18
|
-
import { type AppKitOptions, useAppKitOptions, DollarApp } from './Appkit'
|
|
19
|
-
import { PaymentParams, RechargeParams } from './payment/types'
|
|
20
|
-
import './main.scss'
|
|
21
|
-
|
|
22
|
-
const nutComponents = [
|
|
23
|
-
// Grid,
|
|
24
|
-
// GridItem,
|
|
25
|
-
// Button,
|
|
26
|
-
// Checkbox,
|
|
27
|
-
// Popup,
|
|
28
|
-
// OverLay,
|
|
29
|
-
// DatePicker,
|
|
30
|
-
// Form,
|
|
31
|
-
// FormItem,
|
|
32
|
-
// Cell,
|
|
33
|
-
// CellGroup,
|
|
34
|
-
// Dialog
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
const appComponents = {
|
|
38
|
-
...paymentComponents,
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const services = [...paymentServices, ...jssdkServices]
|
|
42
|
-
|
|
43
|
-
const $app: DollarApp = {
|
|
44
|
-
setToken: (token: () => string) => {
|
|
45
|
-
const appKitOptions = useAppKitOptions()
|
|
46
|
-
appKitOptions.token = token
|
|
47
|
-
},
|
|
48
|
-
setTempToken: (token: () => string) => {
|
|
49
|
-
const appKitOptions = useAppKitOptions()
|
|
50
|
-
appKitOptions.tempToken = token
|
|
51
|
-
},
|
|
52
|
-
requestPayment: (options: PaymentParams) => {},
|
|
53
|
-
invokeRecharge: (options: RechargeParams) => {},
|
|
54
|
-
getSdkConfig: (appCode: string, url: string) => {},
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
services.forEach((service) => {
|
|
58
|
-
service.install($app)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
export function useAppKit(): DollarApp {
|
|
62
|
-
return $app
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const AppKit = {
|
|
66
|
-
install(app: App, options: AppKitOptions) {
|
|
67
|
-
const appKitOptions = useAppKitOptions()
|
|
68
|
-
appKitOptions.app = options.app
|
|
69
|
-
appKitOptions.tenant = options.tenant
|
|
70
|
-
appKitOptions.token = options.token
|
|
71
|
-
appKitOptions.baseUrl = options.baseUrl
|
|
72
|
-
appKitOptions[401] = options[401]
|
|
73
|
-
appKitOptions.gray = options.gray
|
|
74
|
-
|
|
75
|
-
nutComponents.forEach((component) => {
|
|
76
|
-
app.use(component)
|
|
77
|
-
})
|
|
78
|
-
// Object.entries(appComponents).forEach(([name, component]) => {
|
|
79
|
-
// app.component(name, component)
|
|
80
|
-
// })
|
|
81
|
-
},
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export default AppKit
|
|
85
|
-
|
|
86
|
-
export * from './payment'
|
|
87
|
-
export * from './balance'
|
|
88
|
-
export * from './shared'
|
|
89
|
-
export * from './register'
|
|
90
|
-
export * from './notice'
|
|
91
|
-
export * from './user'
|
|
92
|
-
export * from './scenarios'
|
|
93
|
-
export { type AppKitOptions }
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import { components as paymentComponents } from './payment/components'
|
|
3
|
+
import { services as paymentServices } from './payment'
|
|
4
|
+
import { jssdkServices } from './shared'
|
|
5
|
+
import // Grid,
|
|
6
|
+
// GridItem,
|
|
7
|
+
// Button,
|
|
8
|
+
// Checkbox,
|
|
9
|
+
// Popup,
|
|
10
|
+
// OverLay,
|
|
11
|
+
// DatePicker,
|
|
12
|
+
// Form,
|
|
13
|
+
// FormItem,
|
|
14
|
+
// Cell,
|
|
15
|
+
// CellGroup,
|
|
16
|
+
// Dialog
|
|
17
|
+
'@nutui/nutui-taro'
|
|
18
|
+
import { type AppKitOptions, useAppKitOptions, DollarApp } from './Appkit'
|
|
19
|
+
import { PaymentParams, RechargeParams } from './payment/types'
|
|
20
|
+
import './main.scss'
|
|
21
|
+
|
|
22
|
+
const nutComponents = [
|
|
23
|
+
// Grid,
|
|
24
|
+
// GridItem,
|
|
25
|
+
// Button,
|
|
26
|
+
// Checkbox,
|
|
27
|
+
// Popup,
|
|
28
|
+
// OverLay,
|
|
29
|
+
// DatePicker,
|
|
30
|
+
// Form,
|
|
31
|
+
// FormItem,
|
|
32
|
+
// Cell,
|
|
33
|
+
// CellGroup,
|
|
34
|
+
// Dialog
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
const appComponents = {
|
|
38
|
+
...paymentComponents,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const services = [...paymentServices, ...jssdkServices]
|
|
42
|
+
|
|
43
|
+
const $app: DollarApp = {
|
|
44
|
+
setToken: (token: () => string) => {
|
|
45
|
+
const appKitOptions = useAppKitOptions()
|
|
46
|
+
appKitOptions.token = token
|
|
47
|
+
},
|
|
48
|
+
setTempToken: (token: () => string) => {
|
|
49
|
+
const appKitOptions = useAppKitOptions()
|
|
50
|
+
appKitOptions.tempToken = token
|
|
51
|
+
},
|
|
52
|
+
requestPayment: (options: PaymentParams) => {},
|
|
53
|
+
invokeRecharge: (options: RechargeParams) => {},
|
|
54
|
+
getSdkConfig: (appCode: string, url: string) => {},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
services.forEach((service) => {
|
|
58
|
+
service.install($app)
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
export function useAppKit(): DollarApp {
|
|
62
|
+
return $app
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const AppKit = {
|
|
66
|
+
install(app: App, options: AppKitOptions) {
|
|
67
|
+
const appKitOptions = useAppKitOptions()
|
|
68
|
+
appKitOptions.app = options.app
|
|
69
|
+
appKitOptions.tenant = options.tenant
|
|
70
|
+
appKitOptions.token = options.token
|
|
71
|
+
appKitOptions.baseUrl = options.baseUrl
|
|
72
|
+
appKitOptions[401] = options[401]
|
|
73
|
+
appKitOptions.gray = options.gray
|
|
74
|
+
|
|
75
|
+
nutComponents.forEach((component) => {
|
|
76
|
+
app.use(component)
|
|
77
|
+
})
|
|
78
|
+
// Object.entries(appComponents).forEach(([name, component]) => {
|
|
79
|
+
// app.component(name, component)
|
|
80
|
+
// })
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default AppKit
|
|
85
|
+
|
|
86
|
+
export * from './payment'
|
|
87
|
+
export * from './balance'
|
|
88
|
+
export * from './shared'
|
|
89
|
+
export * from './register'
|
|
90
|
+
export * from './notice'
|
|
91
|
+
export * from './user'
|
|
92
|
+
export * from './scenarios'
|
|
93
|
+
export { type AppKitOptions }
|
package/src/main.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import url(./styles/vars.scss);
|
|
1
|
+
@import url(./styles/vars.scss);
|
|
2
2
|
@import url(./styles/fonts.scss);
|
|
@@ -1,17 +1,54 @@
|
|
|
1
|
-
import { HttpEndpoints } from '../../shared/http'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { HttpEndpoints } from '../../shared/http'
|
|
2
|
+
import dayjs from 'dayjs'
|
|
3
|
+
|
|
4
|
+
// 字段映射表
|
|
5
|
+
const mappings = {}
|
|
6
|
+
|
|
7
|
+
const endpointsList: HttpEndpoints = {
|
|
8
|
+
消息列表: {
|
|
9
|
+
path: '/cas/msg/queryUserMsg',
|
|
10
|
+
translate: (data: any) => {
|
|
11
|
+
data.pageNum = data.page || 1
|
|
12
|
+
return data
|
|
13
|
+
},
|
|
14
|
+
transform: (response: any) => {
|
|
15
|
+
const data = response.list.map((row) => {
|
|
16
|
+
row['标题'] = row.title == row.context ? '' : row.title
|
|
17
|
+
row['内容'] = row.context
|
|
18
|
+
row['时间'] = row.receiveTime && dayjs(row.receiveTime).format('YYYY-MM-DD HH:mm:ss')
|
|
19
|
+
row['已读'] = row.isRead == '1'
|
|
20
|
+
row['是公告'] = row.msgType == '3'
|
|
21
|
+
return row
|
|
22
|
+
})
|
|
23
|
+
return data
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
全部已读: {
|
|
27
|
+
path: '/cas/msg/read-all',
|
|
28
|
+
translate: (data: any) => data,
|
|
29
|
+
transform: (result: any) => transformRow(result, mappings),
|
|
30
|
+
},
|
|
31
|
+
已读: {
|
|
32
|
+
path: '/cas/msg/read',
|
|
33
|
+
translate: (data: any) => data,
|
|
34
|
+
transform: (result: any) => transformRow(result, mappings),
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const endpoints = Object.fromEntries(
|
|
39
|
+
Object.entries(endpointsList).map(([name, def]) => [name, def.path])
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
const translates = Object.fromEntries(
|
|
43
|
+
Object.entries(endpointsList).map(([, def]) => [def.path, def.translate])
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
const transforms = Object.fromEntries(
|
|
47
|
+
Object.entries(endpointsList).map(([, def]) => [def.path, def.transform])
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
const transformRow = (row: any, mappings: any) => {
|
|
51
|
+
return Object.fromEntries(Object.entries(row).map(([k, v]) => [mappings[k] || k, v]))
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { endpoints, translates, transforms }
|