@uxda/appkit 1.0.0
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 +8 -0
- package/README.md +147 -0
- package/babel.config.js +12 -0
- package/dist/appkit.css +3 -0
- package/dist/index.js +1755 -0
- package/dist/styles.css +1 -0
- package/package.json +73 -0
- package/project.config.json +15 -0
- package/project.tt.json +13 -0
- package/rollup.config.js +55 -0
- package/src/Appkit.ts +41 -0
- package/src/balance/api/endpoints.ts +108 -0
- package/src/balance/api/index.ts +25 -0
- package/src/balance/components/AccountView.vue +519 -0
- package/src/balance/components/BalanceCard.vue +181 -0
- package/src/balance/components/BalanceReminder.vue +82 -0
- package/src/balance/components/ConsumptionFilter.vue +176 -0
- package/src/balance/components/ConsumptionRules.vue +70 -0
- package/src/balance/components/DateFilter.vue +219 -0
- package/src/balance/components/index.ts +9 -0
- package/src/balance/index.ts +1 -0
- package/src/balance/types.ts +92 -0
- package/src/global.ts +7 -0
- package/src/index.ts +51 -0
- package/src/main.scss +1 -0
- package/src/payment/README.md +0 -0
- package/src/payment/api/config.ts +8 -0
- package/src/payment/api/endpoints.ts +75 -0
- package/src/payment/api/index.ts +25 -0
- package/src/payment/components/AmountPicker.vue +109 -0
- package/src/payment/components/RechargeView.vue +146 -0
- package/src/payment/components/UserAgreement.vue +111 -0
- package/src/payment/components/index.ts +16 -0
- package/src/payment/consts.ts +1 -0
- package/src/payment/index.ts +1 -0
- package/src/payment/services/index.ts +17 -0
- package/src/payment/services/invoke-recharge.ts +25 -0
- package/src/payment/services/request-payment.ts +32 -0
- package/src/payment/types.ts +24 -0
- package/src/shared/components/AppDrawer.vue +53 -0
- package/src/shared/components/PageHeader.vue +75 -0
- package/src/shared/components/index.ts +7 -0
- package/src/shared/http/Http.ts +124 -0
- package/src/shared/http/index.ts +2 -0
- package/src/shared/http/types.ts +100 -0
- package/src/shared/index.ts +3 -0
- package/src/shared/weixin/index.ts +1 -0
- package/src/shared/weixin/payment.ts +37 -0
- package/src/styles/vars.scss +4 -0
- package/tsconfig.json +30 -0
- package/types/global.d.ts +22 -0
- package/types/vue.d.ts +10 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nut-popup
|
|
3
|
+
pop-class="balance-reminder-popup"
|
|
4
|
+
round
|
|
5
|
+
teleport="#app"
|
|
6
|
+
:visible="modelValue"
|
|
7
|
+
:close-on-click-overlay="false">
|
|
8
|
+
<div class="balance-reminder">
|
|
9
|
+
<div class="body">
|
|
10
|
+
<h2>操作失败</h2>
|
|
11
|
+
<p>您的账户余额可能不足,请充值后再进行查询</p>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="footer">
|
|
14
|
+
<div class="col">
|
|
15
|
+
<nut-button
|
|
16
|
+
class="cancel-button"
|
|
17
|
+
@click="emit('update:modelValue', false)"
|
|
18
|
+
shape="square" block>取消</nut-button>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="col">
|
|
21
|
+
<nut-button
|
|
22
|
+
shape="square" block
|
|
23
|
+
class="recharge-button"
|
|
24
|
+
@click="emit('recharge')">去充值</nut-button>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</nut-popup>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
interface BalanceReminderProps {
|
|
33
|
+
modelValue: boolean
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const emit = defineEmits(['recharge', 'update:modelValue'])
|
|
37
|
+
|
|
38
|
+
withDefaults(
|
|
39
|
+
defineProps<BalanceReminderProps>(), {
|
|
40
|
+
modelValue: () => false
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style lang="scss">
|
|
46
|
+
.balance-reminder-popup {
|
|
47
|
+
width: 80%;
|
|
48
|
+
}
|
|
49
|
+
.balance-reminder {
|
|
50
|
+
h2 {
|
|
51
|
+
font-size: 18px;
|
|
52
|
+
font-weight: bold;
|
|
53
|
+
}
|
|
54
|
+
.body {
|
|
55
|
+
height: 120px;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
padding: 2em;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
text-align: center;
|
|
64
|
+
}
|
|
65
|
+
.footer {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: row;
|
|
68
|
+
justify-content: stretch;
|
|
69
|
+
align-items: center;
|
|
70
|
+
.col {
|
|
71
|
+
flex-grow: 1;
|
|
72
|
+
padding: 6px;
|
|
73
|
+
}
|
|
74
|
+
.nut-button {
|
|
75
|
+
border: 0;
|
|
76
|
+
}
|
|
77
|
+
.recharge-button {
|
|
78
|
+
color: #060;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="consumption-filter">
|
|
3
|
+
<div class="consumption-filter-title">选择筛选项</div>
|
|
4
|
+
<div class="consumption-filter-content">
|
|
5
|
+
<template v-for="(item, index) in filterSections" :key="index">
|
|
6
|
+
<div class="title">{{ item.title }}</div>
|
|
7
|
+
<div class="info">
|
|
8
|
+
<div
|
|
9
|
+
v-for="(it, i) in item.data"
|
|
10
|
+
@click="() => onFilterSectionClick(index, it)"
|
|
11
|
+
:class="getItemClass(index, it)"
|
|
12
|
+
class="info-item"
|
|
13
|
+
:key="i">
|
|
14
|
+
{{ it }}
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="consumption-filter-btn spa-between">
|
|
20
|
+
<div class="btn" @click="reset">重置</div>
|
|
21
|
+
<div class="btn confirm" @click="onOkClick">确定</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="consumption-filter-bottom"></div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
import { reactive } from 'vue'
|
|
29
|
+
import {
|
|
30
|
+
type ConsumptionDirection,
|
|
31
|
+
type ConsumptionPosition,
|
|
32
|
+
type ConsumptionType,
|
|
33
|
+
consumptionDirections,
|
|
34
|
+
consumptionPositions,
|
|
35
|
+
consumptionTypes
|
|
36
|
+
} from '../types'
|
|
37
|
+
|
|
38
|
+
type ConsumptionFilterModelValue = [
|
|
39
|
+
ConsumptionPosition | '全部',
|
|
40
|
+
ConsumptionDirection | '全部',
|
|
41
|
+
ConsumptionType | '全部',
|
|
42
|
+
]
|
|
43
|
+
type MixteValues =
|
|
44
|
+
ConsumptionPosition |
|
|
45
|
+
ConsumptionDirection |
|
|
46
|
+
ConsumptionType | '全部'
|
|
47
|
+
|
|
48
|
+
interface ConsumptionFilterProps {
|
|
49
|
+
modelValue: ConsumptionFilterModelValue
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const props = withDefaults(
|
|
53
|
+
defineProps<ConsumptionFilterProps>(), {
|
|
54
|
+
modelValue: () => ['全部', '全部', '全部']
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
const emit = defineEmits(['complete'])
|
|
58
|
+
|
|
59
|
+
const result = reactive<ConsumptionFilterModelValue>(props.modelValue)
|
|
60
|
+
|
|
61
|
+
const filterSections = [
|
|
62
|
+
{
|
|
63
|
+
title: '类型',
|
|
64
|
+
data: consumptionPositions,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
title: '收入/支出',
|
|
68
|
+
data: consumptionDirections,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
title: '明细类型',
|
|
72
|
+
data: consumptionTypes,
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
const getItemClass = (index: number, value) => result[index] === value ? ['current'] : ['']
|
|
77
|
+
|
|
78
|
+
const onFilterSectionClick = (index: number, value: MixteValues) => {
|
|
79
|
+
result[index] = value
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const reset = () => {
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const onOkClick = () => {
|
|
86
|
+
emit('complete', result)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
</script>
|
|
91
|
+
<style lang="scss">
|
|
92
|
+
.consumption-filter {
|
|
93
|
+
height: 100%;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
width: 100%;
|
|
97
|
+
&-title {
|
|
98
|
+
height: 44px;
|
|
99
|
+
line-height: 44px;
|
|
100
|
+
font-size: 17px;
|
|
101
|
+
color: #353535;
|
|
102
|
+
background: #f5f5f5;
|
|
103
|
+
text-align: center;
|
|
104
|
+
}
|
|
105
|
+
&-content {
|
|
106
|
+
flex: 1;
|
|
107
|
+
margin: 15px;
|
|
108
|
+
overflow-y: scroll;
|
|
109
|
+
color: #353535;
|
|
110
|
+
font-size: 13px;
|
|
111
|
+
.title {
|
|
112
|
+
opacity: 0.6;
|
|
113
|
+
line-height: 18px;
|
|
114
|
+
}
|
|
115
|
+
.info {
|
|
116
|
+
display: grid;
|
|
117
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
118
|
+
grid-gap: 10px;
|
|
119
|
+
margin: 10px 0;
|
|
120
|
+
&-item {
|
|
121
|
+
height: 30px;
|
|
122
|
+
line-height: 30px;
|
|
123
|
+
border: 1px solid #ccc;
|
|
124
|
+
border-radius: 6px;
|
|
125
|
+
text-align: center;
|
|
126
|
+
}
|
|
127
|
+
.current {
|
|
128
|
+
border: 1px solid;
|
|
129
|
+
border-image-source: linear-gradient(
|
|
130
|
+
180deg,
|
|
131
|
+
rgba(239, 208, 130, 0.8) 0%,
|
|
132
|
+
rgba(255, 185, 120, 0.8) 100%
|
|
133
|
+
);
|
|
134
|
+
background: linear-gradient(
|
|
135
|
+
180deg,
|
|
136
|
+
rgba(239, 208, 130, 0.8) 0%,
|
|
137
|
+
rgba(255, 185, 120, 0.8) 100%
|
|
138
|
+
),
|
|
139
|
+
linear-gradient(180deg, #fff7e3 0%, #fefde6 100%);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
&-btn {
|
|
144
|
+
margin: 0 15px;
|
|
145
|
+
display: flex;
|
|
146
|
+
justify-content: space-between;
|
|
147
|
+
align-items: center;
|
|
148
|
+
.btn {
|
|
149
|
+
flex: 1;
|
|
150
|
+
height: 40px;
|
|
151
|
+
line-height: 40px;
|
|
152
|
+
text-align: center;
|
|
153
|
+
border: 1px solid #ccc;
|
|
154
|
+
box-sizing: border-box;
|
|
155
|
+
color: #666;
|
|
156
|
+
font-size: 16px;
|
|
157
|
+
border-radius: 6px;
|
|
158
|
+
}
|
|
159
|
+
.confirm {
|
|
160
|
+
margin-left: 11px;
|
|
161
|
+
color: #000;
|
|
162
|
+
border: none;
|
|
163
|
+
background: linear-gradient(
|
|
164
|
+
90deg,
|
|
165
|
+
#ffebc1 0%,
|
|
166
|
+
#ffd7a7 52.29%,
|
|
167
|
+
#ffb875 100%
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
&-bottom {
|
|
172
|
+
height: 32px;
|
|
173
|
+
background: #fff;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="consumption-rules">
|
|
3
|
+
<div class="title">规则说明</div>
|
|
4
|
+
<div class="desc">
|
|
5
|
+
<div class="desc-title">【云豆】</div>
|
|
6
|
+
<div>
|
|
7
|
+
1、云豆系大道云平台为用户提供的数字化商品,用于大道云平台上的产品权益抵扣使用。
|
|
8
|
+
</div>
|
|
9
|
+
<div>
|
|
10
|
+
人民币与云豆的兑换比例:1人民币=10云豆。云豆购买成功过后不可转让或者逆向兑换。
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
2、云豆的使用范围:云豆可用于抵扣AI审批单笔权益、电子签约单笔权益、蜂鸟周转系统单笔权益等,具体抵扣标准详细见各产品页面。
|
|
14
|
+
</div>
|
|
15
|
+
<div class="desc-title">【小云豆】</div>
|
|
16
|
+
<div>
|
|
17
|
+
1、小云豆系大道云平台单方面为用户赠送的数字化商品,用于大道云平台上的指定产品权益抵扣使用。小云豆仅用于指定的产品权益抵扣使用。小云豆与云豆之间不能相互转换,也无法逆向兑换成人民币。
|
|
18
|
+
</div>
|
|
19
|
+
<div>
|
|
20
|
+
2、小云豆的使用范围:小云豆可用于抵扣AI审批单笔权益、电子签约单笔权益、蜂鸟周转系统单笔权益等,具体抵扣标准详细见各产品页面。
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="know" @click="emit('complete')">我知道了</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
|
|
29
|
+
const emit = defineEmits(['complete'])
|
|
30
|
+
|
|
31
|
+
</script>
|
|
32
|
+
<style lang="scss">
|
|
33
|
+
.consumption-rules {
|
|
34
|
+
.title {
|
|
35
|
+
line-height: 16px;
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
color: #1a1a1a;
|
|
38
|
+
font-size: 16px;
|
|
39
|
+
text-align: center;
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
.desc {
|
|
43
|
+
flex: 1;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
line-height: 21px;
|
|
46
|
+
color: #666;
|
|
47
|
+
overflow-y: scroll;
|
|
48
|
+
margin: 10px 0;
|
|
49
|
+
&-title {
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
.know {
|
|
54
|
+
background: linear-gradient(
|
|
55
|
+
90deg,
|
|
56
|
+
#ffebc1 0%,
|
|
57
|
+
#ffd7a7 52.29%,
|
|
58
|
+
#ffb875 100%
|
|
59
|
+
);
|
|
60
|
+
height: 30px;
|
|
61
|
+
line-height: 30px;
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
color: #353535;
|
|
64
|
+
border-radius: 15px;
|
|
65
|
+
width: 130px;
|
|
66
|
+
margin: 0 auto;
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,219 @@
|
|
|
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
|
+
{{ formatDate(result.from) }}
|
|
12
|
+
</div>
|
|
13
|
+
<div class="line">-</div>
|
|
14
|
+
<div
|
|
15
|
+
class="item"
|
|
16
|
+
:class="focused === 'to' ? 'current' : ''"
|
|
17
|
+
@click="switchDateInput('to')">
|
|
18
|
+
{{ formatDate(result.to) }}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="buttons spa-between">
|
|
23
|
+
<div class="btn" @click="resetTime">重置</div>
|
|
24
|
+
<div class="btn confirm" @click="onOkClick">确定</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="bottom"></div>
|
|
27
|
+
</div>
|
|
28
|
+
<nut-datepicker
|
|
29
|
+
v-model="focusedDate"
|
|
30
|
+
v-model:visible="datePickerOpen"
|
|
31
|
+
:min-date="minDate"
|
|
32
|
+
:max-date="maxDate"
|
|
33
|
+
:is-show-chinese="false"
|
|
34
|
+
:three-dimensional="false"
|
|
35
|
+
@confirm="onDatePickerComplete"></nut-datepicker>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script lang="ts" setup>
|
|
39
|
+
import { reactive, ref } from 'vue'
|
|
40
|
+
|
|
41
|
+
type DateFilterProps = {
|
|
42
|
+
from: string,
|
|
43
|
+
to: string,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const props = defineProps<DateFilterProps>()
|
|
47
|
+
|
|
48
|
+
const emit = defineEmits(['complete'])
|
|
49
|
+
const result = reactive<DateFilterProps>({...props})
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 目前激活的日期输入框
|
|
53
|
+
*/
|
|
54
|
+
const focused = ref<string>('from')
|
|
55
|
+
const focusedDate = ref<any>(props.from)
|
|
56
|
+
|
|
57
|
+
const minDate = ref<any>()
|
|
58
|
+
const maxDate = ref<Date>(new Date())
|
|
59
|
+
const datePickerOpen = ref<boolean>(false)
|
|
60
|
+
|
|
61
|
+
function resetTime() {
|
|
62
|
+
result.from = props.from
|
|
63
|
+
result.from = props.to
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function onOkClick() {
|
|
67
|
+
emit('complete', result)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function formatDate (date: string) {
|
|
71
|
+
const [year, month, day] = date.split('-')
|
|
72
|
+
return year + '年' + month + '月' + day + '日'
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function onDatePickerComplete ({ selectedValue, selectedOptions }) {
|
|
76
|
+
console.log('onDatePickerComfirm_______________________', selectedValue, selectedOptions)
|
|
77
|
+
let time = selectedOptions.map((val: any) => val.text).join('-')
|
|
78
|
+
if (focused.value === 'from') {
|
|
79
|
+
// 如果选择的时间比结束时间大,结束时间改为开始时间
|
|
80
|
+
result.from = new Date(time) > new Date(result.to)
|
|
81
|
+
? result.to
|
|
82
|
+
: time
|
|
83
|
+
} else {
|
|
84
|
+
result.to = time
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 切换时间逻辑:初始化时有时间,默认聚焦开始时间
|
|
90
|
+
* 当选择开始时间大于结束时间,结束时间改为开始时间
|
|
91
|
+
* 时间选择器都要小于当前时间,结束时间的时间选择器要以开始时间为最小值,
|
|
92
|
+
*/
|
|
93
|
+
function switchDateInput (shift: string) {
|
|
94
|
+
// 要设置一下结束时间的起始值 开始时间往前倒5年
|
|
95
|
+
if (shift === 'from') {
|
|
96
|
+
let time = result.from
|
|
97
|
+
.split('-')
|
|
98
|
+
.map(Number)
|
|
99
|
+
minDate.value = new Date(time[0] - 5, 1, 1)
|
|
100
|
+
} else {
|
|
101
|
+
let time = result.from
|
|
102
|
+
.split('-')
|
|
103
|
+
.map(Number)
|
|
104
|
+
minDate.value = new Date(time[0], time[1] - 1, time[2])
|
|
105
|
+
}
|
|
106
|
+
focusedDate.value = new Date(result[shift])
|
|
107
|
+
focused.value = shift
|
|
108
|
+
datePickerOpen.value = true
|
|
109
|
+
}
|
|
110
|
+
</script>
|
|
111
|
+
<style lang="scss">
|
|
112
|
+
.consumption-date-filter {
|
|
113
|
+
height: 100%;
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
width: 100%;
|
|
117
|
+
.date-filter-header {
|
|
118
|
+
text-align: center;
|
|
119
|
+
height: 44px;
|
|
120
|
+
line-height: 44px;
|
|
121
|
+
color: #353535;
|
|
122
|
+
font-size: 17px;
|
|
123
|
+
background-color: #f5f5f5;
|
|
124
|
+
}
|
|
125
|
+
.content {
|
|
126
|
+
flex: 1;
|
|
127
|
+
margin: 15px;
|
|
128
|
+
overflow-y: scroll;
|
|
129
|
+
color: #353535;
|
|
130
|
+
font-size: 13px;
|
|
131
|
+
.title {
|
|
132
|
+
opacity: 0.6;
|
|
133
|
+
line-height: 18px;
|
|
134
|
+
}
|
|
135
|
+
.info {
|
|
136
|
+
display: grid;
|
|
137
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
138
|
+
grid-gap: 10px;
|
|
139
|
+
margin: 10px 0;
|
|
140
|
+
.item {
|
|
141
|
+
height: 30px;
|
|
142
|
+
line-height: 30px;
|
|
143
|
+
border: 1px solid #ccc;
|
|
144
|
+
border-radius: 6px;
|
|
145
|
+
text-align: center;
|
|
146
|
+
}
|
|
147
|
+
.current {
|
|
148
|
+
border: 1px solid;
|
|
149
|
+
border-image-source: linear-gradient(
|
|
150
|
+
180deg,
|
|
151
|
+
rgba(239, 208, 130, 0.8) 0%,
|
|
152
|
+
rgba(255, 185, 120, 0.8) 100%
|
|
153
|
+
);
|
|
154
|
+
background: linear-gradient(
|
|
155
|
+
180deg,
|
|
156
|
+
rgba(239, 208, 130, 0.8) 0%,
|
|
157
|
+
rgba(255, 185, 120, 0.8) 100%
|
|
158
|
+
),
|
|
159
|
+
linear-gradient(180deg, #fff7e3 0%, #fefde6 100%);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
.buttons {
|
|
164
|
+
margin: 0 15px;
|
|
165
|
+
display: flex;
|
|
166
|
+
justify-content: space-between;
|
|
167
|
+
align-items: center;
|
|
168
|
+
.btn {
|
|
169
|
+
flex: 1;
|
|
170
|
+
height: 40px;
|
|
171
|
+
line-height: 40px;
|
|
172
|
+
text-align: center;
|
|
173
|
+
border: 1px solid #ccc;
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
color: #666;
|
|
176
|
+
font-size: 16px;
|
|
177
|
+
border-radius: 6px;
|
|
178
|
+
}
|
|
179
|
+
.confirm {
|
|
180
|
+
margin-left: 11px;
|
|
181
|
+
color: #000;
|
|
182
|
+
border: none;
|
|
183
|
+
background: linear-gradient(
|
|
184
|
+
90deg,
|
|
185
|
+
#ffebc1 0%,
|
|
186
|
+
#ffd7a7 52.29%,
|
|
187
|
+
#ffb875 100%
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
.time {
|
|
192
|
+
display: flex;
|
|
193
|
+
justify-content: start;
|
|
194
|
+
align-items: center;
|
|
195
|
+
margin: 10px 0 30px 0;
|
|
196
|
+
.line {
|
|
197
|
+
margin: 0 8px;
|
|
198
|
+
}
|
|
199
|
+
.item {
|
|
200
|
+
height: 30px;
|
|
201
|
+
line-height: 30px;
|
|
202
|
+
padding: 0 15px;
|
|
203
|
+
font-size: 13px;
|
|
204
|
+
color: #353535;
|
|
205
|
+
border: 1px solid transparent;
|
|
206
|
+
box-sizing: border-box;
|
|
207
|
+
background: rgba(#f5f5f5, 0.8);
|
|
208
|
+
border-radius: 6px;
|
|
209
|
+
}
|
|
210
|
+
.current {
|
|
211
|
+
border: 1px solid #353535;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
.bottom {
|
|
215
|
+
height: 32px;
|
|
216
|
+
background: #fff;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components'
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
|
|
2
|
+
export const consumptionTypes = [
|
|
3
|
+
'全部',
|
|
4
|
+
'充值',
|
|
5
|
+
'缴费',
|
|
6
|
+
'返额',
|
|
7
|
+
'增加',
|
|
8
|
+
'扣减',
|
|
9
|
+
'消耗',
|
|
10
|
+
'退回'
|
|
11
|
+
] as const
|
|
12
|
+
|
|
13
|
+
export type ConsumptionType = typeof consumptionTypes[number]
|
|
14
|
+
|
|
15
|
+
export const consumptionPositions = [
|
|
16
|
+
'全部',
|
|
17
|
+
'云豆',
|
|
18
|
+
'小云豆',
|
|
19
|
+
] as const
|
|
20
|
+
|
|
21
|
+
export type ConsumptionPosition = typeof consumptionPositions[number]
|
|
22
|
+
|
|
23
|
+
export const consumptionDirections = [
|
|
24
|
+
'全部',
|
|
25
|
+
'收入',
|
|
26
|
+
'支出',
|
|
27
|
+
] as const
|
|
28
|
+
|
|
29
|
+
export type ConsumptionDirection = typeof consumptionDirections[number]
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 账户流水
|
|
33
|
+
*/
|
|
34
|
+
export type Consumption = {
|
|
35
|
+
/**
|
|
36
|
+
* 数量
|
|
37
|
+
*/
|
|
38
|
+
amount: number
|
|
39
|
+
/**
|
|
40
|
+
* 交易名称
|
|
41
|
+
*/
|
|
42
|
+
title: string
|
|
43
|
+
/**
|
|
44
|
+
* 交易说明
|
|
45
|
+
*/
|
|
46
|
+
description: string
|
|
47
|
+
/**
|
|
48
|
+
* 交易时间
|
|
49
|
+
**/
|
|
50
|
+
time: number,
|
|
51
|
+
/**
|
|
52
|
+
* 交易类型类型
|
|
53
|
+
*/
|
|
54
|
+
type: ConsumptionType,
|
|
55
|
+
/**
|
|
56
|
+
* 账户类型
|
|
57
|
+
*/
|
|
58
|
+
position: ConsumptionPosition
|
|
59
|
+
/**
|
|
60
|
+
* 收入/支出
|
|
61
|
+
*/
|
|
62
|
+
direction: ConsumptionDirection
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 账户流水筛选项
|
|
67
|
+
*/
|
|
68
|
+
export type ConsumptionFiltering = Pick<Consumption, 'type' | 'position' | 'direction'> & {
|
|
69
|
+
dateFrom: string,
|
|
70
|
+
dateTo: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type ConsumptionGroup = {
|
|
74
|
+
date: string,
|
|
75
|
+
consumptions: Consumption[]
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type ConsumptionGroups = {
|
|
79
|
+
list: ConsumptionGroup[]
|
|
80
|
+
from: string,
|
|
81
|
+
to: string,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type Privilege = {
|
|
85
|
+
title: string,
|
|
86
|
+
amount: number
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type Balance = {
|
|
90
|
+
total: number,
|
|
91
|
+
privileges: Privilege[]
|
|
92
|
+
}
|
package/src/global.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import { components as paymentComponents } from './payment/components'
|
|
3
|
+
import {
|
|
4
|
+
Grid,
|
|
5
|
+
GridItem,
|
|
6
|
+
Button,
|
|
7
|
+
Checkbox,
|
|
8
|
+
Popup,
|
|
9
|
+
OverLay,
|
|
10
|
+
Icon,
|
|
11
|
+
DatePicker,
|
|
12
|
+
} from '@nutui/nutui-taro'
|
|
13
|
+
import { type AppKitOptions, useAppKitOptions } from './Appkit'
|
|
14
|
+
|
|
15
|
+
const nutComponents = [
|
|
16
|
+
Grid,
|
|
17
|
+
GridItem,
|
|
18
|
+
Button,
|
|
19
|
+
Checkbox,
|
|
20
|
+
Popup,
|
|
21
|
+
OverLay,
|
|
22
|
+
Icon,
|
|
23
|
+
DatePicker,
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
const appComponents = {
|
|
27
|
+
...paymentComponents
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const AppKit = {
|
|
31
|
+
install (app: App, options: AppKitOptions) {
|
|
32
|
+
const appKitOptions = useAppKitOptions()
|
|
33
|
+
appKitOptions.token = options.token
|
|
34
|
+
appKitOptions.baseUrl = options.baseUrl
|
|
35
|
+
nutComponents.forEach(component => {
|
|
36
|
+
app.use(component)
|
|
37
|
+
})
|
|
38
|
+
Object.entries(appComponents).forEach(([name, component]) => {
|
|
39
|
+
app.component(name, component)
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default AppKit
|
|
45
|
+
|
|
46
|
+
export * from './payment'
|
|
47
|
+
export * from './balance'
|
|
48
|
+
export * from './shared'
|
|
49
|
+
export {
|
|
50
|
+
type AppKitOptions
|
|
51
|
+
}
|
package/src/main.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url(./styles/vars.scss);
|