feat: add product card UI

This commit is contained in:
oat_dev 2024-06-10 17:42:37 +07:00
parent eb643fe06f
commit 0c2ba9e3aa
5 changed files with 52 additions and 3 deletions

BIN
public/product-group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB

BIN
public/product-type.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

View file

@ -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>

View file

@ -12,7 +12,7 @@ withDefaults(
date?: Date;
}>(),
{
color: 'var(--brand-2)',
color: 'var(--brand-1)',
},
);
</script>

View file

@ -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>