@uxda/appkit 1.2.72 → 4.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 +7 -7
- package/README.md +187 -187
- package/babel.config.js +12 -12
- package/dist/appkit.css +7 -501
- package/dist/index.js +58 -85
- package/package.json +78 -78
- package/project.config.json +15 -15
- package/project.tt.json +13 -13
- package/rollup.config.mjs +54 -54
- package/src/Appkit.ts +65 -65
- package/src/balance/api/endpoints.ts +126 -126
- package/src/balance/api/index.ts +82 -82
- package/src/balance/components/AccountView.vue +748 -748
- package/src/balance/components/BalanceCard.vue +209 -209
- package/src/balance/components/BalanceReminder.vue +85 -85
- package/src/balance/components/ConsumptionFilter.vue +218 -218
- package/src/balance/components/ConsumptionRules.vue +68 -68
- package/src/balance/components/DateFilter.vue +235 -235
- package/src/balance/components/SecondBalance.vue +71 -71
- package/src/balance/components/Tip.vue +45 -45
- package/src/balance/components/index.ts +9 -9
- package/src/balance/types.ts +90 -90
- 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/ocr-id/index.vue +114 -114
- package/src/components/ocr-id/types.d.ts +12 -12
- package/src/global.ts +6 -6
- package/src/index.ts +88 -88
- package/src/main.scss +1 -1
- package/src/notice/api/endpoints.ts +17 -17
- package/src/notice/api/index.ts +82 -82
- package/src/notice/components/LoginSetting.vue +112 -112
- package/src/notice/components/NoticeBanner.vue +243 -243
- package/src/notice/components/NoticeEntry.vue +99 -99
- package/src/notice/components/NoticeList.vue +278 -315
- package/src/notice/components/NoticePopup.vue +163 -161
- package/src/notice/components/index.ts +6 -6
- 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 +103 -103
- package/src/payment/api/index.ts +71 -71
- package/src/payment/components/AmountPicker.vue +93 -93
- package/src/payment/components/RechargeResult.vue +69 -69
- package/src/payment/components/RechargeView.vue +154 -154
- package/src/payment/components/RightsPicker.vue +105 -105
- package/src/payment/components/TradeView.vue +298 -298
- package/src/payment/components/UserAgreement.vue +141 -141
- 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 +58 -58
- package/src/payment/types.ts +28 -28
- package/src/register/components/SelfRegistration.vue +227 -227
- package/src/register/components/index.ts +2 -2
- package/src/shared/components/AppDrawer.vue +58 -58
- package/src/shared/components/DeviceVersion.vue +67 -67
- package/src/shared/components/EmptyView.vue +33 -33
- package/src/shared/components/PageHeader.vue +79 -79
- package/src/shared/components/index.ts +5 -5
- package/src/shared/composables/index.ts +2 -2
- package/src/shared/composables/useSafeArea.ts +46 -46
- package/src/shared/composables/useTabbar.ts +24 -24
- package/src/shared/http/Http.ts +135 -135
- package/src/shared/http/index.ts +1 -1
- package/src/shared/http/types.ts +157 -157
- package/src/shared/index.ts +3 -3
- package/src/shared/weixin/payment.ts +38 -38
- package/src/styles/fonts.scss +2 -2
- package/src/styles/vars.scss +3 -3
- package/tsconfig.json +30 -30
- package/types/global.d.ts +21 -21
- package/types/vue.d.ts +10 -10
- package/dist/main.css +0 -3
- package/dist/styles.css +0 -1
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="view recharge-view">
|
|
3
|
-
<view class="flex-grow">
|
|
4
|
-
<amount-picker :items="amounts"
|
|
5
|
-
:selected="state.selected"
|
|
6
|
-
@change="onAmountSelect" />
|
|
7
|
-
</view>
|
|
8
|
-
<view class="amount-footer">
|
|
9
|
-
<view class="agreement">
|
|
10
|
-
<nut-checkbox v-model="state.agreed">我已阅读并同意<a class="link inline" @click="onAgreementLinkClick">《大道云平台云豆充值服务协议》</a></nut-checkbox>
|
|
11
|
-
</view>
|
|
12
|
-
<nut-button block
|
|
13
|
-
shape="square"
|
|
14
|
-
:loading="state.buttonLoading"
|
|
15
|
-
@click="onPayClick"
|
|
16
|
-
class="recharge-button">立即充值</nut-button>
|
|
17
|
-
</view>
|
|
18
|
-
<app-drawer
|
|
19
|
-
v-model="state.agreementOpen"
|
|
20
|
-
title="充值协议">
|
|
21
|
-
<user-agreement />
|
|
22
|
-
</app-drawer>
|
|
23
|
-
</view>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script lang="ts" setup>
|
|
27
|
-
import { onMounted, reactive, ref } from 'vue'
|
|
28
|
-
import AmountPicker from './AmountPicker.vue'
|
|
29
|
-
import UserAgreement from './UserAgreement.vue'
|
|
30
|
-
import { AppDrawer } from '../../shared'
|
|
31
|
-
import { useHttp, endpoints } from '../api'
|
|
32
|
-
import { requestPayment } from '../services'
|
|
33
|
-
import Taro from '@tarojs/taro'
|
|
34
|
-
|
|
35
|
-
// 充值用户界面
|
|
36
|
-
// 配置了必须的属性后
|
|
37
|
-
// 自动获取支付套餐包列表
|
|
38
|
-
// 并发起微信支付
|
|
39
|
-
export interface RechargeViewProps {
|
|
40
|
-
/**
|
|
41
|
-
* 应用
|
|
42
|
-
**/
|
|
43
|
-
app: string,
|
|
44
|
-
/**
|
|
45
|
-
* 充值场景
|
|
46
|
-
*/
|
|
47
|
-
// stage?: string, // 这个参数暂时不用
|
|
48
|
-
/**
|
|
49
|
-
* 租户
|
|
50
|
-
*/
|
|
51
|
-
tenant: string
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const props = defineProps<RechargeViewProps>()
|
|
55
|
-
|
|
56
|
-
const emit = defineEmits<{
|
|
57
|
-
(event: 'complete', value: boolean): void
|
|
58
|
-
}>()
|
|
59
|
-
|
|
60
|
-
const state = reactive({
|
|
61
|
-
agreed: false,
|
|
62
|
-
selected: 0,
|
|
63
|
-
agreementOpen: false,
|
|
64
|
-
buttonLoading: false,
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
const amounts = ref<any[]>([])
|
|
68
|
-
|
|
69
|
-
const onAgreementLinkClick = ($event) => {
|
|
70
|
-
state.agreementOpen = true
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const onAmountSelect = (selected: number) => {
|
|
74
|
-
state.selected = selected
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
onMounted(() => {
|
|
78
|
-
const $http = useHttp()
|
|
79
|
-
$http.get<any[]>(endpoints.获取充值金额列表, {
|
|
80
|
-
app: props.app,
|
|
81
|
-
// stage: 'aiApproveRecharge', // 支付场景
|
|
82
|
-
tenant: props.tenant
|
|
83
|
-
}).then(response => {
|
|
84
|
-
amounts.value = response
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
const onPayClick = () => {
|
|
89
|
-
if (!state.agreed) {
|
|
90
|
-
Taro.showToast({
|
|
91
|
-
title: '请勾选《大道云平台云豆充值协议》',
|
|
92
|
-
icon: 'none',
|
|
93
|
-
})
|
|
94
|
-
return false
|
|
95
|
-
}
|
|
96
|
-
state.buttonLoading = true
|
|
97
|
-
wx.login({
|
|
98
|
-
success ({code}: {code: string}) {
|
|
99
|
-
requestPayment({
|
|
100
|
-
amount: amounts.value[state.selected].amount,
|
|
101
|
-
app: props.app, // 'crm',
|
|
102
|
-
tenant: props.tenant, // '17454646',
|
|
103
|
-
user: code
|
|
104
|
-
}).then(result => {
|
|
105
|
-
state.buttonLoading = false
|
|
106
|
-
if (result) {
|
|
107
|
-
emit('complete', true)
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
}
|
|
113
|
-
</script>
|
|
114
|
-
|
|
115
|
-
<style lang="scss">
|
|
116
|
-
.recharge-view {
|
|
117
|
-
height: 100%;
|
|
118
|
-
display: flex;
|
|
119
|
-
flex-direction: column;
|
|
120
|
-
.flex-grow {
|
|
121
|
-
flex-grow: 1;
|
|
122
|
-
}
|
|
123
|
-
.amount-footer {
|
|
124
|
-
padding: 10px;
|
|
125
|
-
padding-bottom: 20px;
|
|
126
|
-
.agreement {
|
|
127
|
-
font-size: 12px;
|
|
128
|
-
display: flex;
|
|
129
|
-
justify-content: center;
|
|
130
|
-
align-items: cebter;
|
|
131
|
-
height: 40px;
|
|
132
|
-
}
|
|
133
|
-
.recharge-button {
|
|
134
|
-
background: linear-gradient(90deg, #FFEBC1 0%, #FFD7A7 52.29%, #FFB875 100%);
|
|
135
|
-
color: #353535;
|
|
136
|
-
margin: 12px 0;
|
|
137
|
-
border: 0;
|
|
138
|
-
border-radius: 8px;
|
|
139
|
-
}
|
|
140
|
-
.nut-checkbox {
|
|
141
|
-
line-height: 40px;
|
|
142
|
-
}
|
|
143
|
-
.nut-checkbox__label {
|
|
144
|
-
margin-left: 8px;
|
|
145
|
-
flex: flex;
|
|
146
|
-
font-size: 12px;
|
|
147
|
-
}
|
|
148
|
-
.link {
|
|
149
|
-
display: inline;
|
|
150
|
-
color: #FD6701;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="view recharge-view">
|
|
3
|
+
<view class="flex-grow">
|
|
4
|
+
<amount-picker :items="amounts"
|
|
5
|
+
:selected="state.selected"
|
|
6
|
+
@change="onAmountSelect" />
|
|
7
|
+
</view>
|
|
8
|
+
<view class="amount-footer">
|
|
9
|
+
<view class="agreement">
|
|
10
|
+
<nut-checkbox v-model="state.agreed">我已阅读并同意<a class="link inline" @click="onAgreementLinkClick">《大道云平台云豆充值服务协议》</a></nut-checkbox>
|
|
11
|
+
</view>
|
|
12
|
+
<nut-button block
|
|
13
|
+
shape="square"
|
|
14
|
+
:loading="state.buttonLoading"
|
|
15
|
+
@click="onPayClick"
|
|
16
|
+
class="recharge-button">立即充值</nut-button>
|
|
17
|
+
</view>
|
|
18
|
+
<app-drawer
|
|
19
|
+
v-model="state.agreementOpen"
|
|
20
|
+
title="充值协议">
|
|
21
|
+
<user-agreement />
|
|
22
|
+
</app-drawer>
|
|
23
|
+
</view>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import { onMounted, reactive, ref } from 'vue'
|
|
28
|
+
import AmountPicker from './AmountPicker.vue'
|
|
29
|
+
import UserAgreement from './UserAgreement.vue'
|
|
30
|
+
import { AppDrawer } from '../../shared'
|
|
31
|
+
import { useHttp, endpoints } from '../api'
|
|
32
|
+
import { requestPayment } from '../services'
|
|
33
|
+
import Taro from '@tarojs/taro'
|
|
34
|
+
|
|
35
|
+
// 充值用户界面
|
|
36
|
+
// 配置了必须的属性后
|
|
37
|
+
// 自动获取支付套餐包列表
|
|
38
|
+
// 并发起微信支付
|
|
39
|
+
export interface RechargeViewProps {
|
|
40
|
+
/**
|
|
41
|
+
* 应用
|
|
42
|
+
**/
|
|
43
|
+
app: string,
|
|
44
|
+
/**
|
|
45
|
+
* 充值场景
|
|
46
|
+
*/
|
|
47
|
+
// stage?: string, // 这个参数暂时不用
|
|
48
|
+
/**
|
|
49
|
+
* 租户
|
|
50
|
+
*/
|
|
51
|
+
tenant: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const props = defineProps<RechargeViewProps>()
|
|
55
|
+
|
|
56
|
+
const emit = defineEmits<{
|
|
57
|
+
(event: 'complete', value: boolean): void
|
|
58
|
+
}>()
|
|
59
|
+
|
|
60
|
+
const state = reactive({
|
|
61
|
+
agreed: false,
|
|
62
|
+
selected: 0,
|
|
63
|
+
agreementOpen: false,
|
|
64
|
+
buttonLoading: false,
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const amounts = ref<any[]>([])
|
|
68
|
+
|
|
69
|
+
const onAgreementLinkClick = ($event) => {
|
|
70
|
+
state.agreementOpen = true
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const onAmountSelect = (selected: number) => {
|
|
74
|
+
state.selected = selected
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
const $http = useHttp()
|
|
79
|
+
$http.get<any[]>(endpoints.获取充值金额列表, {
|
|
80
|
+
app: props.app,
|
|
81
|
+
// stage: 'aiApproveRecharge', // 支付场景
|
|
82
|
+
tenant: props.tenant
|
|
83
|
+
}).then(response => {
|
|
84
|
+
amounts.value = response
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const onPayClick = () => {
|
|
89
|
+
if (!state.agreed) {
|
|
90
|
+
Taro.showToast({
|
|
91
|
+
title: '请勾选《大道云平台云豆充值协议》',
|
|
92
|
+
icon: 'none',
|
|
93
|
+
})
|
|
94
|
+
return false
|
|
95
|
+
}
|
|
96
|
+
state.buttonLoading = true
|
|
97
|
+
wx.login({
|
|
98
|
+
success ({code}: {code: string}) {
|
|
99
|
+
requestPayment({
|
|
100
|
+
amount: amounts.value[state.selected].amount,
|
|
101
|
+
app: props.app, // 'crm',
|
|
102
|
+
tenant: props.tenant, // '17454646',
|
|
103
|
+
user: code
|
|
104
|
+
}).then(result => {
|
|
105
|
+
state.buttonLoading = false
|
|
106
|
+
if (result) {
|
|
107
|
+
emit('complete', true)
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<style lang="scss">
|
|
116
|
+
.recharge-view {
|
|
117
|
+
height: 100%;
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
.flex-grow {
|
|
121
|
+
flex-grow: 1;
|
|
122
|
+
}
|
|
123
|
+
.amount-footer {
|
|
124
|
+
padding: 10px;
|
|
125
|
+
padding-bottom: 20px;
|
|
126
|
+
.agreement {
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
display: flex;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
align-items: cebter;
|
|
131
|
+
height: 40px;
|
|
132
|
+
}
|
|
133
|
+
.recharge-button {
|
|
134
|
+
background: linear-gradient(90deg, #FFEBC1 0%, #FFD7A7 52.29%, #FFB875 100%);
|
|
135
|
+
color: #353535;
|
|
136
|
+
margin: 12px 0;
|
|
137
|
+
border: 0;
|
|
138
|
+
border-radius: 8px;
|
|
139
|
+
}
|
|
140
|
+
.nut-checkbox {
|
|
141
|
+
line-height: 40px;
|
|
142
|
+
}
|
|
143
|
+
.nut-checkbox__label {
|
|
144
|
+
margin-left: 8px;
|
|
145
|
+
flex: flex;
|
|
146
|
+
font-size: 12px;
|
|
147
|
+
}
|
|
148
|
+
.link {
|
|
149
|
+
display: inline;
|
|
150
|
+
color: #FD6701;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
</style>
|
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<nut-grid
|
|
3
|
-
class="trade-picker"
|
|
4
|
-
:column-num="3"
|
|
5
|
-
:gutter="10"
|
|
6
|
-
:border="false">
|
|
7
|
-
<nut-grid-item
|
|
8
|
-
class="tile"
|
|
9
|
-
v-for="(amount, index) in items"
|
|
10
|
-
:class="{selected: state.selected === index}"
|
|
11
|
-
@click="() => onGridItemClick(index)"
|
|
12
|
-
:key="index">
|
|
13
|
-
<div class="tag">{{ amount.paymentDesc }}</div>
|
|
14
|
-
<h4 class="token-line number">{{ amount.priceRightNum }}笔</h4>
|
|
15
|
-
<h5>¥<span class="number">{{ amount.paymentAmount }}</span></h5>
|
|
16
|
-
</nut-grid-item>
|
|
17
|
-
</nut-grid>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script lang="ts" setup>
|
|
21
|
-
import { reactive } from 'vue'
|
|
22
|
-
|
|
23
|
-
// 充值金额选取
|
|
24
|
-
|
|
25
|
-
export type Amount = {
|
|
26
|
-
id: string,
|
|
27
|
-
paymentAmount: number
|
|
28
|
-
paymentDesc: string
|
|
29
|
-
priceRightNum: number
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface AmountPickerProps {
|
|
33
|
-
items: Amount[],
|
|
34
|
-
selected?: number
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const emit = defineEmits<{
|
|
38
|
-
(event: 'change', selected: number): void
|
|
39
|
-
}>()
|
|
40
|
-
|
|
41
|
-
withDefaults(
|
|
42
|
-
defineProps<AmountPickerProps>(),
|
|
43
|
-
{
|
|
44
|
-
items: () => [],
|
|
45
|
-
selected: () => 0
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
const state = reactive({
|
|
50
|
-
selected: 0
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const onGridItemClick = (index: number) => {
|
|
54
|
-
state.selected = index
|
|
55
|
-
emit('change', state.selected)
|
|
56
|
-
}
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<style lang="scss">
|
|
60
|
-
.trade-picker {
|
|
61
|
-
padding: 14px 0 14px 14px;
|
|
62
|
-
.nut-grid-item__content {
|
|
63
|
-
border: solid 2px transparent;
|
|
64
|
-
background: linear-gradient(#f5f5f5, #f5f5f5) padding-box,
|
|
65
|
-
linear-gradient(to bottom, #cccccc88, #cccccc88) border-box;
|
|
66
|
-
border-radius: 5px;
|
|
67
|
-
}
|
|
68
|
-
.tile {
|
|
69
|
-
height: 80px;
|
|
70
|
-
position: relative;
|
|
71
|
-
overflow: hidden;
|
|
72
|
-
&.selected {
|
|
73
|
-
.nut-grid-item__content {
|
|
74
|
-
background: linear-gradient(#FFF7E3, #FEFDE6) padding-box,
|
|
75
|
-
linear-gradient(to bottom, #efd082, #ffb877) border-box;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
.tag{
|
|
79
|
-
position: absolute;
|
|
80
|
-
left: 0;
|
|
81
|
-
top: 0;
|
|
82
|
-
background: linear-gradient(90deg, #FD6701 0%, #FF9349 100%);
|
|
83
|
-
color: #fff;
|
|
84
|
-
font-size: 10px;
|
|
85
|
-
padding:0 10px;
|
|
86
|
-
line-height: 17px;
|
|
87
|
-
height: 17px;;
|
|
88
|
-
border-radius: 10px 100px 100px 0px;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
h4.token-line {
|
|
92
|
-
color: #FD6701;
|
|
93
|
-
font-weight: 600;
|
|
94
|
-
line-height: 25px;
|
|
95
|
-
font-size: 18px;
|
|
96
|
-
}
|
|
97
|
-
h5 {
|
|
98
|
-
line-height: 18px;
|
|
99
|
-
color: #353535;
|
|
100
|
-
font-weight: 600;
|
|
101
|
-
opacity: 0.6;
|
|
102
|
-
margin-top: 4px;
|
|
103
|
-
font-size: 12px;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<nut-grid
|
|
3
|
+
class="trade-picker"
|
|
4
|
+
:column-num="3"
|
|
5
|
+
:gutter="10"
|
|
6
|
+
:border="false">
|
|
7
|
+
<nut-grid-item
|
|
8
|
+
class="tile"
|
|
9
|
+
v-for="(amount, index) in items"
|
|
10
|
+
:class="{selected: state.selected === index}"
|
|
11
|
+
@click="() => onGridItemClick(index)"
|
|
12
|
+
:key="index">
|
|
13
|
+
<div class="tag">{{ amount.paymentDesc }}</div>
|
|
14
|
+
<h4 class="token-line number">{{ amount.priceRightNum }}笔</h4>
|
|
15
|
+
<h5>¥<span class="number">{{ amount.paymentAmount }}</span></h5>
|
|
16
|
+
</nut-grid-item>
|
|
17
|
+
</nut-grid>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
import { reactive } from 'vue'
|
|
22
|
+
|
|
23
|
+
// 充值金额选取
|
|
24
|
+
|
|
25
|
+
export type Amount = {
|
|
26
|
+
id: string,
|
|
27
|
+
paymentAmount: number
|
|
28
|
+
paymentDesc: string
|
|
29
|
+
priceRightNum: number
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface AmountPickerProps {
|
|
33
|
+
items: Amount[],
|
|
34
|
+
selected?: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const emit = defineEmits<{
|
|
38
|
+
(event: 'change', selected: number): void
|
|
39
|
+
}>()
|
|
40
|
+
|
|
41
|
+
withDefaults(
|
|
42
|
+
defineProps<AmountPickerProps>(),
|
|
43
|
+
{
|
|
44
|
+
items: () => [],
|
|
45
|
+
selected: () => 0
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
const state = reactive({
|
|
50
|
+
selected: 0
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const onGridItemClick = (index: number) => {
|
|
54
|
+
state.selected = index
|
|
55
|
+
emit('change', state.selected)
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style lang="scss">
|
|
60
|
+
.trade-picker {
|
|
61
|
+
padding: 14px 0 14px 14px;
|
|
62
|
+
.nut-grid-item__content {
|
|
63
|
+
border: solid 2px transparent;
|
|
64
|
+
background: linear-gradient(#f5f5f5, #f5f5f5) padding-box,
|
|
65
|
+
linear-gradient(to bottom, #cccccc88, #cccccc88) border-box;
|
|
66
|
+
border-radius: 5px;
|
|
67
|
+
}
|
|
68
|
+
.tile {
|
|
69
|
+
height: 80px;
|
|
70
|
+
position: relative;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
&.selected {
|
|
73
|
+
.nut-grid-item__content {
|
|
74
|
+
background: linear-gradient(#FFF7E3, #FEFDE6) padding-box,
|
|
75
|
+
linear-gradient(to bottom, #efd082, #ffb877) border-box;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
.tag{
|
|
79
|
+
position: absolute;
|
|
80
|
+
left: 0;
|
|
81
|
+
top: 0;
|
|
82
|
+
background: linear-gradient(90deg, #FD6701 0%, #FF9349 100%);
|
|
83
|
+
color: #fff;
|
|
84
|
+
font-size: 10px;
|
|
85
|
+
padding:0 10px;
|
|
86
|
+
line-height: 17px;
|
|
87
|
+
height: 17px;;
|
|
88
|
+
border-radius: 10px 100px 100px 0px;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
h4.token-line {
|
|
92
|
+
color: #FD6701;
|
|
93
|
+
font-weight: 600;
|
|
94
|
+
line-height: 25px;
|
|
95
|
+
font-size: 18px;
|
|
96
|
+
}
|
|
97
|
+
h5 {
|
|
98
|
+
line-height: 18px;
|
|
99
|
+
color: #353535;
|
|
100
|
+
font-weight: 600;
|
|
101
|
+
opacity: 0.6;
|
|
102
|
+
margin-top: 4px;
|
|
103
|
+
font-size: 12px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
106
|
</style>
|