@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,190 +1,190 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="view recharge-view">
|
|
3
|
-
<view class="flex-grow">
|
|
4
|
-
<amount-picker :items="amounts" :selected="state.selected" @change="onAmountSelect" />
|
|
5
|
-
</view>
|
|
6
|
-
<view class="amount-footer">
|
|
7
|
-
<view class="agreement">
|
|
8
|
-
<nut-checkbox v-model="state.agreed">我已阅读并同意<a class="link inline"
|
|
9
|
-
@click="onAgreementLinkClick">《大道云平台云豆充值服务协议》</a></nut-checkbox>
|
|
10
|
-
</view>
|
|
11
|
-
<nut-button block shape="square" :loading="state.buttonLoading" @click="onPayClick"
|
|
12
|
-
class="recharge-button">立即充值</nut-button>
|
|
13
|
-
</view>
|
|
14
|
-
</view>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script lang="ts" setup>
|
|
18
|
-
import { onMounted, reactive, ref } from 'vue'
|
|
19
|
-
import AmountPicker from './AmountPicker.vue'
|
|
20
|
-
import { useHttp, endpoints } from '../api'
|
|
21
|
-
import { requestBrandWCPay, requestPayment } from '../services'
|
|
22
|
-
import Taro, { showToast, useRouter } from '@tarojs/taro'
|
|
23
|
-
import { isWechat } from '../../shared/composables/useDeviceEnv'
|
|
24
|
-
|
|
25
|
-
// 充值用户界面
|
|
26
|
-
// 配置了必须的属性后
|
|
27
|
-
// 自动获取支付套餐包列表
|
|
28
|
-
// 并发起微信支付
|
|
29
|
-
export interface RechargeViewProps {
|
|
30
|
-
/**
|
|
31
|
-
* 应用
|
|
32
|
-
**/
|
|
33
|
-
app: string,
|
|
34
|
-
/**
|
|
35
|
-
* 充值场景
|
|
36
|
-
*/
|
|
37
|
-
// stage?: string, // 这个参数暂时不用
|
|
38
|
-
/**
|
|
39
|
-
* 租户
|
|
40
|
-
*/
|
|
41
|
-
tenant: string,
|
|
42
|
-
/**
|
|
43
|
-
* h5支付完成后跳转地址
|
|
44
|
-
*/
|
|
45
|
-
payFinishJumpUrl?: ''
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const props = defineProps<RechargeViewProps>()
|
|
49
|
-
const { params } = useRouter()
|
|
50
|
-
|
|
51
|
-
const emit = defineEmits<{
|
|
52
|
-
(event: 'complete', value: boolean): void,
|
|
53
|
-
(event: 'agree'): void,
|
|
54
|
-
}>()
|
|
55
|
-
|
|
56
|
-
const state = reactive({
|
|
57
|
-
agreed: false,
|
|
58
|
-
selected: 0,
|
|
59
|
-
agreementOpen: false,
|
|
60
|
-
buttonLoading: false,
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
const amounts = ref<any[]>([])
|
|
64
|
-
|
|
65
|
-
const onAgreementLinkClick = (e) => {
|
|
66
|
-
e.preventDefault()
|
|
67
|
-
e.stopImmediatePropagation()
|
|
68
|
-
emit('agree')
|
|
69
|
-
// state.agreementOpen = true
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const onAmountSelect = (selected: number) => {
|
|
73
|
-
state.selected = selected
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
onMounted(async () => {
|
|
77
|
-
const $http = useHttp({ Appcode: props.app !== 'cloudkitPro' ? props.app : '', Tenant: props.tenant })
|
|
78
|
-
|
|
79
|
-
$http.get<any[]>(endpoints.获取充值金额列表, {
|
|
80
|
-
app: props.app,
|
|
81
|
-
tenant: props.tenant
|
|
82
|
-
}).then(response => {
|
|
83
|
-
amounts.value = response
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
const onPayClick = () => {
|
|
88
|
-
if (!state.agreed) {
|
|
89
|
-
showToast({
|
|
90
|
-
title: '请勾选《大道云平台云豆充值协议》',
|
|
91
|
-
icon: 'none',
|
|
92
|
-
})
|
|
93
|
-
return false
|
|
94
|
-
}
|
|
95
|
-
state.buttonLoading = true
|
|
96
|
-
|
|
97
|
-
if (Taro.getEnv() === 'WEB') {
|
|
98
|
-
if (!isWechat()) {
|
|
99
|
-
showToast({
|
|
100
|
-
title: '请使用微信浏览器打开',
|
|
101
|
-
icon: 'none',
|
|
102
|
-
})
|
|
103
|
-
state.buttonLoading = false
|
|
104
|
-
return false
|
|
105
|
-
}
|
|
106
|
-
requestBrandWCPay({
|
|
107
|
-
amount: amounts.value[state.selected].amount,
|
|
108
|
-
app: 'cloudkitProMp',
|
|
109
|
-
tenant: props.tenant,
|
|
110
|
-
accountAuthFlag: false,
|
|
111
|
-
channelCode: 'centergzh',
|
|
112
|
-
payFinishJumpUrl: props.payFinishJumpUrl,
|
|
113
|
-
fromMini: !!params.from
|
|
114
|
-
}).then(result => {
|
|
115
|
-
console.log(result, '------requestBrandWCPay')
|
|
116
|
-
state.buttonLoading = false
|
|
117
|
-
if (typeof result === 'boolean' && result) {
|
|
118
|
-
window.location.href = props.payFinishJumpUrl as string
|
|
119
|
-
} else {
|
|
120
|
-
emit('complete', result)
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
} else {
|
|
124
|
-
wx.login({
|
|
125
|
-
success({ code }: { code: string }) {
|
|
126
|
-
requestPayment({
|
|
127
|
-
amount: amounts.value[state.selected].amount,
|
|
128
|
-
app: props.app,
|
|
129
|
-
tenant: props.tenant,
|
|
130
|
-
user: code
|
|
131
|
-
}).then(result => {
|
|
132
|
-
state.buttonLoading = false
|
|
133
|
-
if (result) {
|
|
134
|
-
emit('complete', true)
|
|
135
|
-
}
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
</script>
|
|
142
|
-
|
|
143
|
-
<style lang="scss">
|
|
144
|
-
.recharge-view {
|
|
145
|
-
height: 100%;
|
|
146
|
-
display: flex;
|
|
147
|
-
flex-direction: column;
|
|
148
|
-
--nut-primary-color: #017fff;
|
|
149
|
-
|
|
150
|
-
.flex-grow {
|
|
151
|
-
flex-grow: 1;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.amount-footer {
|
|
155
|
-
padding: 10px;
|
|
156
|
-
padding-bottom: 20px;
|
|
157
|
-
|
|
158
|
-
.agreement {
|
|
159
|
-
font-size: 12px;
|
|
160
|
-
display: flex;
|
|
161
|
-
justify-content: center;
|
|
162
|
-
align-items: cebter;
|
|
163
|
-
height: 40px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.recharge-button {
|
|
167
|
-
background: linear-gradient(90deg, #FFEBC1 0%, #FFD7A7 52.29%, #FFB875 100%);
|
|
168
|
-
color: #353535;
|
|
169
|
-
margin: 12px 0;
|
|
170
|
-
border: 0;
|
|
171
|
-
border-radius: 8px;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.nut-checkbox {
|
|
175
|
-
line-height: 40px;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.nut-checkbox__label {
|
|
179
|
-
margin-left: 8px;
|
|
180
|
-
flex: flex;
|
|
181
|
-
font-size: 12px;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.link {
|
|
185
|
-
display: inline;
|
|
186
|
-
color: #FD6701;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="view recharge-view">
|
|
3
|
+
<view class="flex-grow">
|
|
4
|
+
<amount-picker :items="amounts" :selected="state.selected" @change="onAmountSelect" />
|
|
5
|
+
</view>
|
|
6
|
+
<view class="amount-footer">
|
|
7
|
+
<view class="agreement">
|
|
8
|
+
<nut-checkbox v-model="state.agreed">我已阅读并同意<a class="link inline"
|
|
9
|
+
@click="onAgreementLinkClick">《大道云平台云豆充值服务协议》</a></nut-checkbox>
|
|
10
|
+
</view>
|
|
11
|
+
<nut-button block shape="square" :loading="state.buttonLoading" @click="onPayClick"
|
|
12
|
+
class="recharge-button">立即充值</nut-button>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { onMounted, reactive, ref } from 'vue'
|
|
19
|
+
import AmountPicker from './AmountPicker.vue'
|
|
20
|
+
import { useHttp, endpoints } from '../api'
|
|
21
|
+
import { requestBrandWCPay, requestPayment } from '../services'
|
|
22
|
+
import Taro, { showToast, useRouter } from '@tarojs/taro'
|
|
23
|
+
import { isWechat } from '../../shared/composables/useDeviceEnv'
|
|
24
|
+
|
|
25
|
+
// 充值用户界面
|
|
26
|
+
// 配置了必须的属性后
|
|
27
|
+
// 自动获取支付套餐包列表
|
|
28
|
+
// 并发起微信支付
|
|
29
|
+
export interface RechargeViewProps {
|
|
30
|
+
/**
|
|
31
|
+
* 应用
|
|
32
|
+
**/
|
|
33
|
+
app: string,
|
|
34
|
+
/**
|
|
35
|
+
* 充值场景
|
|
36
|
+
*/
|
|
37
|
+
// stage?: string, // 这个参数暂时不用
|
|
38
|
+
/**
|
|
39
|
+
* 租户
|
|
40
|
+
*/
|
|
41
|
+
tenant: string,
|
|
42
|
+
/**
|
|
43
|
+
* h5支付完成后跳转地址
|
|
44
|
+
*/
|
|
45
|
+
payFinishJumpUrl?: ''
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const props = defineProps<RechargeViewProps>()
|
|
49
|
+
const { params } = useRouter()
|
|
50
|
+
|
|
51
|
+
const emit = defineEmits<{
|
|
52
|
+
(event: 'complete', value: boolean): void,
|
|
53
|
+
(event: 'agree'): void,
|
|
54
|
+
}>()
|
|
55
|
+
|
|
56
|
+
const state = reactive({
|
|
57
|
+
agreed: false,
|
|
58
|
+
selected: 0,
|
|
59
|
+
agreementOpen: false,
|
|
60
|
+
buttonLoading: false,
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const amounts = ref<any[]>([])
|
|
64
|
+
|
|
65
|
+
const onAgreementLinkClick = (e) => {
|
|
66
|
+
e.preventDefault()
|
|
67
|
+
e.stopImmediatePropagation()
|
|
68
|
+
emit('agree')
|
|
69
|
+
// state.agreementOpen = true
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const onAmountSelect = (selected: number) => {
|
|
73
|
+
state.selected = selected
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
onMounted(async () => {
|
|
77
|
+
const $http = useHttp({ Appcode: props.app !== 'cloudkitPro' ? props.app : '', Tenant: props.tenant })
|
|
78
|
+
|
|
79
|
+
$http.get<any[]>(endpoints.获取充值金额列表, {
|
|
80
|
+
app: props.app,
|
|
81
|
+
tenant: props.tenant
|
|
82
|
+
}).then(response => {
|
|
83
|
+
amounts.value = response
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const onPayClick = () => {
|
|
88
|
+
if (!state.agreed) {
|
|
89
|
+
showToast({
|
|
90
|
+
title: '请勾选《大道云平台云豆充值协议》',
|
|
91
|
+
icon: 'none',
|
|
92
|
+
})
|
|
93
|
+
return false
|
|
94
|
+
}
|
|
95
|
+
state.buttonLoading = true
|
|
96
|
+
|
|
97
|
+
if (Taro.getEnv() === 'WEB') {
|
|
98
|
+
if (!isWechat()) {
|
|
99
|
+
showToast({
|
|
100
|
+
title: '请使用微信浏览器打开',
|
|
101
|
+
icon: 'none',
|
|
102
|
+
})
|
|
103
|
+
state.buttonLoading = false
|
|
104
|
+
return false
|
|
105
|
+
}
|
|
106
|
+
requestBrandWCPay({
|
|
107
|
+
amount: amounts.value[state.selected].amount,
|
|
108
|
+
app: 'cloudkitProMp',
|
|
109
|
+
tenant: props.tenant,
|
|
110
|
+
accountAuthFlag: false,
|
|
111
|
+
channelCode: 'centergzh',
|
|
112
|
+
payFinishJumpUrl: props.payFinishJumpUrl,
|
|
113
|
+
fromMini: !!params.from
|
|
114
|
+
}).then(result => {
|
|
115
|
+
console.log(result, '------requestBrandWCPay')
|
|
116
|
+
state.buttonLoading = false
|
|
117
|
+
if (typeof result === 'boolean' && result) {
|
|
118
|
+
window.location.href = props.payFinishJumpUrl as string
|
|
119
|
+
} else {
|
|
120
|
+
emit('complete', result)
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
} else {
|
|
124
|
+
wx.login({
|
|
125
|
+
success({ code }: { code: string }) {
|
|
126
|
+
requestPayment({
|
|
127
|
+
amount: amounts.value[state.selected].amount,
|
|
128
|
+
app: props.app,
|
|
129
|
+
tenant: props.tenant,
|
|
130
|
+
user: code
|
|
131
|
+
}).then(result => {
|
|
132
|
+
state.buttonLoading = false
|
|
133
|
+
if (result) {
|
|
134
|
+
emit('complete', true)
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</script>
|
|
142
|
+
|
|
143
|
+
<style lang="scss">
|
|
144
|
+
.recharge-view {
|
|
145
|
+
height: 100%;
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
--nut-primary-color: #017fff;
|
|
149
|
+
|
|
150
|
+
.flex-grow {
|
|
151
|
+
flex-grow: 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.amount-footer {
|
|
155
|
+
padding: 10px;
|
|
156
|
+
padding-bottom: 20px;
|
|
157
|
+
|
|
158
|
+
.agreement {
|
|
159
|
+
font-size: 12px;
|
|
160
|
+
display: flex;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
align-items: cebter;
|
|
163
|
+
height: 40px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.recharge-button {
|
|
167
|
+
background: linear-gradient(90deg, #FFEBC1 0%, #FFD7A7 52.29%, #FFB875 100%);
|
|
168
|
+
color: #353535;
|
|
169
|
+
margin: 12px 0;
|
|
170
|
+
border: 0;
|
|
171
|
+
border-radius: 8px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.nut-checkbox {
|
|
175
|
+
line-height: 40px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.nut-checkbox__label {
|
|
179
|
+
margin-left: 8px;
|
|
180
|
+
flex: flex;
|
|
181
|
+
font-size: 12px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.link {
|
|
185
|
+
display: inline;
|
|
186
|
+
color: #FD6701;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
</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>
|