feat: add product card UI
This commit is contained in:
parent
eb643fe06f
commit
0c2ba9e3aa
5 changed files with 52 additions and 3 deletions
BIN
public/product-group.png
Normal file
BIN
public/product-group.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9 KiB |
BIN
public/product-type.png
Normal file
BIN
public/product-type.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 962 B |
|
|
@ -0,0 +1,43 @@
|
|||
<script setup lang="ts">
|
||||
import AppBox from 'components/app/AppBox.vue';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
label: string;
|
||||
color?: string;
|
||||
isType?: boolean;
|
||||
}>(),
|
||||
{
|
||||
color: 'var(--brand-1)',
|
||||
isType: false,
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="q-pa-lg full-width rounded column items-center hover-card"
|
||||
:style="`border:2px dashed ${isType ? 'var(--purple-11)' : 'var(--pink-6)'}`"
|
||||
@click="console.log('clicked!')"
|
||||
>
|
||||
<q-img
|
||||
style="height: 140px; max-width: 170px"
|
||||
:src="isType ? 'product-type.png' : 'product-group.png'"
|
||||
/>
|
||||
|
||||
<div
|
||||
class="items-center rounded q-px-lg q-mt-md"
|
||||
:style="`border:1px solid ${isType ? 'var(--purple-11)' : 'var(--pink-6)'};background-color: ${isType ? 'var(--purple-11)' : 'var(--pink-6)'}`"
|
||||
>
|
||||
<div class="text-white">+ {{ $t(label) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.hover-card:hover {
|
||||
cursor: pointer;
|
||||
opacity: 0.8;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -12,7 +12,7 @@ withDefaults(
|
|||
date?: Date;
|
||||
}>(),
|
||||
{
|
||||
color: 'var(--brand-2)',
|
||||
color: 'var(--brand-1)',
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ import { ref } from 'vue';
|
|||
import AppBox from 'components/app/AppBox.vue';
|
||||
import ProductCardComponent from 'src/components/04_product-service/ProductCardComponent.vue';
|
||||
import StatCard from 'components/StatCardComponent.vue';
|
||||
|
||||
import NewProductCardCompoent from 'components/04_product-service/NewProductCardComponent.vue';
|
||||
const cardData = ref({
|
||||
title: 'งาน MCU',
|
||||
subtitle: 'G00000000001',
|
||||
color: 'var(--brand-2)',
|
||||
color: 'var(--pink-6)',
|
||||
status: true,
|
||||
date: new Date(),
|
||||
});
|
||||
|
|
@ -95,6 +95,12 @@ const inputSearch = ref<string>('');
|
|||
:color="cardData.color"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<NewProductCardCompoent
|
||||
:label="'กลุ่มสินค้าและบริการ'"
|
||||
:isType="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</AppBox>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue