+
Загрузить следующие...
diff --git a/src/components/wishlists/WishListListView.vue b/src/components/wishlists/WishListListView.vue
new file mode 100644
index 0000000..36a6268
--- /dev/null
+++ b/src/components/wishlists/WishListListView.vue
@@ -0,0 +1,174 @@
+
+
+
+
+
+
+
+
+
+
+
+
Вишлисты
+
+
+
+
+
+
Сперва нужно выбрать Пространство.
+ router.go(0))">
+ Перейти
+
+
+
+
+
Кажется, в этом пространстве еще нет вишлистов
+ создайте один.
+
+
+
+
+
+
+
+
+
+
+
+ {{ wishlist.name }}
+
+
{{ wishlist.description }}
+
+
+
+ {{ wishlist.owner.firstName.substring(0, 1) }}
+
+
{{ wishlist.owner.firstName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/wishlists/WishlistCreationView.vue b/src/components/wishlists/WishlistCreationView.vue
new file mode 100644
index 0000000..4c9f4d0
--- /dev/null
+++ b/src/components/wishlists/WishlistCreationView.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+ Название
+
+
+
+ Описание
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/wishlists/WishlistExternalView.vue b/src/components/wishlists/WishlistExternalView.vue
new file mode 100644
index 0000000..6fa8948
--- /dev/null
+++ b/src/components/wishlists/WishlistExternalView.vue
@@ -0,0 +1,217 @@
+
+
+
+
+
+
+
+
+
+ Ваше имя
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Вишлист {{ wishlist.name }}
+
+
{{ wishlist.description }}
+
+
+
+ {{ wishlist.owner.firstName.substring(0, 1) }}
+
+
{{ wishlist.owner.firstName }}
+
+
+
+
+
+
+
+
+
+
+
+
{{ formatAmount(item.price) }} ₽
+
{{ item.description }}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/wishlists/WishlistItemCreationView.vue b/src/components/wishlists/WishlistItemCreationView.vue
new file mode 100644
index 0000000..4eb6cfb
--- /dev/null
+++ b/src/components/wishlists/WishlistItemCreationView.vue
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+ Название
+
+
+
+ Описание
+
+
+
+ Ссылка на товар
+
+
+
+
+ ₽
+
+ .00
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/wishlists/WishlistView.vue b/src/components/wishlists/WishlistView.vue
new file mode 100644
index 0000000..de17757
--- /dev/null
+++ b/src/components/wishlists/WishlistView.vue
@@ -0,0 +1,462 @@
+
+
+
+
+
+
+
+
+
+
или укажите ссылку
+
+ Ссылка
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ссылка
+
+
+
+ {{ !copied ? 'Копировать' : 'Скопировано!' }}
+
+
+
+
+
+
+
+
+
Вишлист {{ wishlist.name }}
+ Поделиться
+
+
+
+
+
{{ wishlist.description }}
+
+
+
+
+ {{ wishlist.owner.firstName.substring(0, 1) }}
+
+
{{ wishlist.owner.firstName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ item.name }}
+
+
+
+
+
+
+
+
{{ formatAmount(item.price) }} ₽
+
{{ item.description }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Не забронировано
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/models/WishList.ts b/src/models/WishList.ts
new file mode 100644
index 0000000..94e6a0f
--- /dev/null
+++ b/src/models/WishList.ts
@@ -0,0 +1,22 @@
+
+export class WishList {
+ id: string
+ name: string
+ description: string
+ isPrivate: boolean
+ items: WishlistItem[]
+ updatedAt: Date
+ createdAt: Date
+}
+
+export class WishlistItem {
+ id: string
+ name: string
+ description: string
+ price: number
+ link: string
+ images: string[]
+ updatedAt: Date
+ createdAt: Date
+ imagesWithLinks: []
+}
\ No newline at end of file
diff --git a/src/router/index.ts b/src/router/index.ts
index dff18fc..8b35195 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -16,11 +16,17 @@ import SpacesList from "@/components/spaces/SpacesList.vue";
import SpaceInventationView from "@/components/spaces/SpaceInventationView.vue";
import About from "@/components/faq/About.vue";
import OnboardingView from "@/components/onboarding/OnboardingView.vue";
+import WishListListView from "@/components/wishlists/WishListListView.vue";
+import WishlistView from "@/components/wishlists/WishlistView.vue";
+import WishlistExternalView from "@/components/wishlists/WishlistExternalView.vue";
const routes = [
{path: '/login', component: LoginView},
{path: '/register', component: RegisterView},
{path: '/', name: 'Budgets Main', component: BudgetList, meta: {requiresAuth: true}},
+ {path: '/wishlists', name: 'Wishlists', component: WishListListView, meta: {requiresAuth: true}},
+ {path: '/wishlists/:id', name: 'Wishlist view', component: WishlistView, meta: {requiresAuth: true}},
+ {path: '/mywishlist/:id', name: 'Wishlist view export', component: WishlistExternalView},
// {path: '/onboarding', name: 'Onboarding', component: OnboardingView, meta: {requiresAuth: true}},
{path: '/about', name: 'About', component: About, meta: {requiresAuth: true}},
{path: '/analytics', name: 'Analytics', component: AnalyticsView, meta: {requiresAuth: true}},
diff --git a/src/services/StaticService.ts b/src/services/StaticService.ts
new file mode 100644
index 0000000..45ec28b
--- /dev/null
+++ b/src/services/StaticService.ts
@@ -0,0 +1,13 @@
+import {useSpaceStore} from "@/stores/spaceStore";
+import apiClient from "@/services/axiosSetup";
+
+export const uploadStatic = async ( wishlistItemId: string, file) => {
+ const spaceStore = useSpaceStore()
+ const form = new FormData();
+ form.append("file", file);
+ return await apiClient.post(`/static/${spaceStore.space?.id}/wishlists/${wishlistItemId}`, form)
+ .then((res) => res.data)
+ .catch((err) => {
+ throw err;
+ })
+}
\ No newline at end of file
diff --git a/src/services/WishListService.ts b/src/services/WishListService.ts
new file mode 100644
index 0000000..2c6c0b5
--- /dev/null
+++ b/src/services/WishListService.ts
@@ -0,0 +1,118 @@
+import {useSpaceStore} from "@/stores/spaceStore";
+import apiClient from "@/services/axiosSetup";
+import {WishList, WishlistItem} from "@/models/WishList";
+
+export const getWishlists = async () => {
+ const spaceStore = useSpaceStore();
+ return await apiClient.get(`/spaces/${spaceStore.space?.id}/wishlists`)
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ });
+}
+
+export const getWishlist = async (id: string) => {
+ const spaceStore = useSpaceStore();
+ return await apiClient.get(`/spaces/${spaceStore.space?.id}/wishlists/${id}`).then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ })
+}
+export const getWishlistExternal = async (id: string) => {
+ return await apiClient.get(`/wishlistexternal/${id}`).then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ })
+}
+export const reserveWishlistItem = async (wishlistId: string, wishlistItemId: string, reservedBy: string, aidCookie: string) => {
+ const form = new FormData();
+ form.append("reservedBy", reservedBy);
+ return await apiClient.post(`/wishlistexternal/${wishlistId}/${wishlistItemId}/reserve/_create`, {
+ 'aid': aidCookie,
+ 'name': reservedBy
+ }, {headers: {"Content-Type": "application/json"}})
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ })
+}
+
+
+export const cancelReserveWishlistItem = async (wishlistId: string, wishlistItemId: string, reservedBy = null, aidCookie = null) => {
+ if (reservedBy) {
+ return await apiClient.post(`/wishlistexternal/${wishlistId}/${wishlistItemId}/reserve/_cancel`, {
+ 'aid': aidCookie,
+ 'name': reservedBy
+ }, {headers: {"Content-Type": "application/json"}})
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ })
+ } else {
+ const spaceStore = useSpaceStore();
+ return await apiClient.post(`/spaces/${spaceStore.space?.id}/wishlists/${wishlistId}/${wishlistItemId}/reserve/_cancel`, {
+ 'aid': aidCookie,
+ 'name': reservedBy
+ }, {headers: {"Content-Type": "application/json"}})
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ })
+ }
+
+}
+
+export const createWishlistRequest = async (data: WishList) => {
+ const spaceStore = useSpaceStore();
+ return await apiClient.post(`/spaces/${spaceStore.space?.id}/wishlists`, data)
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ });
+}
+
+export const updateWishlistRequest = async (data: WishList) => {
+ const spaceStore = useSpaceStore();
+ return await apiClient.patch(`/spaces/${spaceStore.space?.id}/wishlists/${data.id}`, data)
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ });
+}
+
+export const addWishListItemRequest = async (wishlistId: string, data: WishlistItem) => {
+ const spaceStore = useSpaceStore();
+ return await apiClient.post(`/spaces/${spaceStore.space?.id}/wishlists/${wishlistId}/items`, data)
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ });
+}
+
+export const updateWishListItemRequest = async (wishlistId: string, data: WishlistItem) => {
+ const spaceStore = useSpaceStore();
+ return await apiClient.patch(`/spaces/${spaceStore.space?.id}/wishlists/${wishlistId}/items/${data.id}`, data)
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ });
+}
+
+export const deleteWishListItemRequest = async (wishlistId: string, data: WishlistItem) => {
+ const spaceStore = useSpaceStore();
+ return await apiClient.delete(`/spaces/${spaceStore.space?.id}/wishlists/${wishlistId}/items/${data.id}`)
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err;
+ });
+}
+
+
+export const deleteWishlistRequest = async (data: string) => {
+ const spaceStore = useSpaceStore();
+ return await apiClient.delete(`/spaces/${spaceStore.space?.id}/wishlists/${data}`)
+ .then((data: any) => data.data)
+ .catch((err) => {
+ throw err
+ })
+}