refactor: css of pay success

This commit is contained in:
Thanaphon Frappet 2024-12-02 14:57:24 +07:00
parent afb9ddf424
commit 552f13abe4
2 changed files with 17 additions and 13 deletions

View file

@ -28,6 +28,11 @@ defineProps<{
code: string; code: string;
status?: Step; status?: Step;
imgUrl?: string; imgUrl?: string;
installmentInfo?: {
total: number;
paid?: number;
};
paySuccess: boolean;
}>(); }>();
// NOTE: Function // NOTE: Function
@ -35,6 +40,7 @@ defineProps<{
<template> <template>
<q-expansion-item <q-expansion-item
dense dense
:class="{ 'status-unpaid': !paySuccess }"
class="overflow-hidden" class="overflow-hidden"
switch-toggle-side switch-toggle-side
style="border-radius: var(--radius-2)" style="border-radius: var(--radius-2)"
@ -175,6 +181,12 @@ defineProps<{
</q-expansion-item> </q-expansion-item>
</template> </template>
<style scoped> <style scoped>
.status-unpaid {
opacity: 0.5;
filter: grayscale(90%);
pointer-events: none;
}
:deep(i.q-icon.mdi.mdi-chevron-down-circle.q-expansion-item__toggle-icon) { :deep(i.q-icon.mdi.mdi-chevron-down-circle.q-expansion-item__toggle-icon) {
color: hsl(var(--text-mute)); color: hsl(var(--text-mute));
} }

View file

@ -281,7 +281,7 @@ function getInstallmentInfo() {
data.value?.quotation.payCondition === 'Full' || data.value?.quotation.payCondition === 'Full' ||
data.value?.quotation.payCondition === 'BillFull' data.value?.quotation.payCondition === 'BillFull'
) { ) {
return null; return undefined;
} }
const total = data.value?.quotation.paySplitCount || 0; const total = data.value?.quotation.paySplitCount || 0;
@ -614,13 +614,11 @@ function isInstallmentPaySuccess(installmentNo: number) {
)" )"
:key="value" :key="value"
> >
{{ getInstallmentInfo() }}
<ProductExpansion <ProductExpansion
:class="{ :installment-info="getInstallmentInfo()"
'status-unpaid': !isInstallmentPaySuccess( :pay-success="
value.productService.installmentNo, isInstallmentPaySuccess(value.productService.installmentNo)
), "
}"
:status=" :status="
value.stepStatus?.find((v) => v.step === pageState.currentStep) value.stepStatus?.find((v) => v.step === pageState.currentStep)
" "
@ -743,12 +741,6 @@ function isInstallmentPaySuccess(installmentNo: number) {
</div> </div>
</template> </template>
<style scoped> <style scoped>
.status-unpaid {
opacity: 0.5;
filter: grayscale(90%);
pointer-events: none;
}
.status-color { .status-color {
--_color: var(--gray-0); --_color: var(--gray-0);
border-color: hsla(var(--_color)); border-color: hsla(var(--_color));