Merge branch 'front-styles' of ssh://git.ma-al.com:8822/goc_daniel/b2b into translate
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
<CategoryMenu />
|
||||
<div class="w-full flex flex-col items-center gap-4">
|
||||
<UTable :data="productsList" :columns="columns" class="flex-1 w-full" :ui="{
|
||||
root: 'max-w-100wv overflow-auto!' }" />
|
||||
root: 'max-w-100wv overflow-auto!'
|
||||
}" />
|
||||
<UPagination v-model:page="page" :total="total" :items-per-page="perPage" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -152,7 +153,7 @@ async function fetchProductList() {
|
||||
}
|
||||
}
|
||||
|
||||
function goToProduct(productId: number) {
|
||||
function goToProduct(productId: number, linkRewrite: string) {
|
||||
let path = {
|
||||
name: route.name,
|
||||
params: route.params,
|
||||
@@ -161,7 +162,7 @@ function goToProduct(productId: number) {
|
||||
localStorage.setItem('back_from_product', JSON.stringify(path))
|
||||
router.push({
|
||||
name: 'customer-product-details',
|
||||
params: { product_id: productId }
|
||||
params: { product_id: productId, link_rewrite: linkRewrite }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -280,7 +281,7 @@ const columns: TableColumn<Product>[] = [
|
||||
cell: ({ row }) => {
|
||||
return h(UButton, {
|
||||
onClick: () => {
|
||||
goToProduct(row.original.product_id)
|
||||
goToProduct(row.original.product_id, row.original.link_rewrite)
|
||||
},
|
||||
class: 'cursor-pointer',
|
||||
color: 'info',
|
||||
|
||||
@@ -69,8 +69,9 @@
|
||||
|
||||
<div v-else-if="productStore.productDescription" class="space-y-7.5">
|
||||
<div class="grid grid-cols-1 md:grid-cols-6 h-full w-full gap-6">
|
||||
<img class="md:col-span-2 rounded-md" :src="productStore.productDescription.image_link"
|
||||
:alt="productStore.productDescription.name" @onError="(e: Event) => {
|
||||
<img
|
||||
class="md:col-span-2 rounded-md bg-white rounded-md border border-(--border-light) dark:border-(--border-dark)"
|
||||
:src="productStore.productDescription.image_link" :alt="productStore.productDescription.name" @error="(e: Event) => {
|
||||
const target = e.target as HTMLImageElement
|
||||
target.src = errorImg
|
||||
}">
|
||||
@@ -78,13 +79,13 @@
|
||||
<div class="space-y-7.5">
|
||||
<div>
|
||||
<p v-if="!isTranslations" class="text-[25px] font-bold text-black dark:text-white">
|
||||
{{ productStore.productDescription.name }}
|
||||
{{ productStore.productDescription.name || 'Product name not provided' }}
|
||||
</p>
|
||||
<div class="" v-if="isTranslations">
|
||||
<p>Title:</p>
|
||||
<UTextarea :rows="1" v-model="productStore.productDescription.name" autoresize :ui="{
|
||||
root: 'w-full bg-inherit!',
|
||||
base: 'text-2xl! bg-inherit!',
|
||||
root: 'w-full bg-white!',
|
||||
base: 'text-2xl!',
|
||||
}" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -97,9 +98,17 @@
|
||||
}" />
|
||||
</div>
|
||||
|
||||
<div class="" v-if="isTranslations">
|
||||
<p>Link rewrite:</p>
|
||||
<UTextarea :rows="1" v-model="productStore.productDescription.link_rewrite" autoresize :ui="{
|
||||
root: 'w-full bg-white!'
|
||||
}" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p v-if="!isTranslations" v-html="productStore.productDescription.description_short"
|
||||
class="text-black dark:text-white"></p>
|
||||
<p v-if="!isTranslations"
|
||||
v-html="productStore.productDescription.description_short || 'No short description available'"
|
||||
class="text-black dark:text-white" />
|
||||
<div class="" v-if="isTranslations">
|
||||
<p>Short description:</p>
|
||||
<ProductEditor v-model="productStore.productDescription.description_short" />
|
||||
@@ -107,19 +116,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-[10px]">
|
||||
<div class="flex items-center gap-1">
|
||||
<div class="space-y-2.5">
|
||||
<div v-if="productStore.productDescription.available_now" class="flex items-center gap-1">
|
||||
<UIcon name="lets-icons:done-ring-round-fill"
|
||||
class="text-[20px] light:text-(--accent-green-light) dark:text-(--accent-green-dark)" />
|
||||
<p>
|
||||
{{ productStore.productDescription.available_now || 'Available now' }}
|
||||
{{ productStore.productDescription.available_now }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-1">
|
||||
<div v-if="productStore.productDescription.delivery_in_stock" class="flex items-center gap-1">
|
||||
<UIcon name="marketeq:car-shipping"
|
||||
class="text-[25px] light:text-(--accent-green-light) dark:text-(--accent-green-dark)" />
|
||||
<p>
|
||||
{{ productStore.productDescription.delivery_in_stock || 'Delivery information' }}
|
||||
{{ productStore.productDescription.delivery_in_stock }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -132,15 +141,18 @@
|
||||
}">
|
||||
<template #description>
|
||||
<ProductEditor v-if="isTranslations" v-model="productStore.productDescription.description" />
|
||||
<p v-else v-html="productStore.productDescription.description" class="text-black dark:text-white"></p>
|
||||
<p v-else v-html="productStore.productDescription.description || 'No description available'"
|
||||
class="text-black dark:text-white" />
|
||||
</template>
|
||||
|
||||
<template #usage>
|
||||
<ProductEditor v-if="isTranslations" v-model="productStore.productDescription.usage" />
|
||||
<p v-else v-html="productStore.productDescription.usage" class="text-black dark:text-white"></p>
|
||||
<p v-else v-html="productStore.productDescription.usage || 'No usage information available'"
|
||||
class="text-black dark:text-white" />
|
||||
</template>
|
||||
</UTabs>
|
||||
</div>
|
||||
<div class=""></div>
|
||||
</div>
|
||||
</component>
|
||||
</template>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Country/Currency
|
||||
</span>
|
||||
<span v-if="country" class="font-medium dark:text-white text-black">
|
||||
{{ country?.name }} / {{ country?.ps_currency }}
|
||||
{{ country?.name || 'Country' }} / {{ country?.ps_currency || 'Currency' }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<UEditor v-slot="{ editor }" v-model="localValue" content-type="html"
|
||||
:ui="{ base: 'p-8 sm:px-16', root: 'p-2' }"
|
||||
class="min-w-full border rounded-md border-(--border-light)" placeholder="Write there ...">
|
||||
class="min-w-full border rounded-md bg-white! border-(--border-light)" placeholder="Write there ...">
|
||||
<UEditorToolbar :editor="editor" :items="toolbarItems" class="sm:px-8 flex-wrap!">
|
||||
<template #link>
|
||||
<EditorLinkPopover :editor="editor" auto-open />
|
||||
|
||||
Reference in New Issue
Block a user