diff --git a/app/controllers/Application.java b/app/controllers/Application.java index 038dd9214..9e061036b 100644 --- a/app/controllers/Application.java +++ b/app/controllers/Application.java @@ -417,7 +417,7 @@ public static void product(String client, String uuid, String language){ defaultAdditions = DataBaseQueries.checkIsAdditionDefaultToProduct(product); product.defaultAdditions = defaultAdditions; } - System.out.println("request.params qr_uuid.isEmpty() in Product => " + qr_uuid); + System.out.println("request.params qr_uuid.isEmpty() in Product => " + product.isQuantityVisible); Translation.setTranslationForProduct(language, product); Translation.setTranslationForShop(language, shop); @@ -842,4 +842,10 @@ public static void shopLanding(){ public static void qrCode(String client){ renderTemplate("Application/qrCode.html"); } + public static void qrWizard(String client){ + renderTemplate("Application/qrWizard.html"); + } + public static void testPage(String client){ + renderTemplate("Application/testPage.html"); + } } \ No newline at end of file diff --git a/app/controllers/OrderAPI.java b/app/controllers/OrderAPI.java index 78f687df5..2d315d462 100644 --- a/app/controllers/OrderAPI.java +++ b/app/controllers/OrderAPI.java @@ -180,6 +180,9 @@ public static void create(String client, String chosenLanguage) throws Exception OrderItemListResult orderItemListResult = _parseOrderItemsList(shoppingCart.items, order); order.items = orderItemListResult.orderItemList; + order.items.stream() + .forEach(orderItemDTO -> reduceProductQuantity(orderItemDTO)); + DeliveryDTO delivery = shop.delivery; System.out.println("deliveryType in order creating => " + shoppingCart.deliveryType); if(shoppingCart.deliveryType != null){ @@ -298,6 +301,14 @@ public static void create(String client, String chosenLanguage) throws Exception } } + private static void reduceProductQuantity(OrderItemDTO orderItemDTO) { + ProductDTO product = ProductDTO.findById(orderItemDTO.productUuid); + if (product.quantity > 0) { + product.quantity = product.quantity - orderItemDTO.quantity; + product.save(); + } + } + private static void validationShoppingCart(String jsonCart, ShoppingCartDTO shoppingCart) throws ParseException { if (jsonCart.isEmpty() || shoppingCart == null) { return; diff --git a/app/controllers/ProductAPI.java b/app/controllers/ProductAPI.java index 77bc4de0a..b341fb6e8 100644 --- a/app/controllers/ProductAPI.java +++ b/app/controllers/ProductAPI.java @@ -21,7 +21,7 @@ public class ProductAPI extends AuthController { public static void create(String client, String name, String description, - Double price, File fake, Integer mainPhotoIndex, + Double price, Integer quantity, Boolean isQuantityVisible, File fake, Integer mainPhotoIndex, String category, Integer sortOrder, Boolean isActive, Double oldPrice, Integer wholesaleCount, Double wholesalePrice, String nameUk, String descriptionUk, String nameEn, String descriptionEn) throws Exception { @@ -45,17 +45,18 @@ public static void create(String client, String name, String description, images.add(productImage); } - CategoryDTO cat = CategoryDTO.findById(category); - ProductDTO product = new ProductDTO(name, description, price, images, shop, cat, wholesaleCount, wholesalePrice); + CategoryDTO categoryDTO = CategoryDTO.findById(category); + ProductDTO product = new ProductDTO(name, description, price, images, shop, categoryDTO, wholesaleCount, wholesalePrice); product.mainImage = images.get(mainPhotoIndex); product.isActive = isActive; product.sortOrder = sortOrder; product.oldPrice = oldPrice; product.wholesaleCount = wholesaleCount; product.wholesalePrice = wholesalePrice; + product.quantity = quantity == null ? 0 : quantity; + product.isQuantityVisible = isQuantityVisible; product = product.save(); - List properties = ProductPropertyDTO.find("byCategoryUuidAndProductUuidIsNull", product.categoryUuid).fetch(); for(ProductPropertyDTO property : properties) { ProductPropertyDTO propertyNew = new ProductPropertyDTO(); @@ -157,8 +158,8 @@ public static void list(String client, int page) throws Exception { renderJSON(json); } - public static void update(String client, String uuid, String name, String description, Double price, Upload photo, - Integer sortOrder, Boolean isActive, Double oldPrice, String properties, Integer wholesaleCount, Double wholesalePrice) throws Exception { + public static void update(String client, String uuid, String name, String description, Double price, Integer quantity, Boolean isQuantityVisible, + Upload photo, Integer sortOrder, Boolean isActive, Double oldPrice, String properties, Integer wholesaleCount, Double wholesalePrice) throws Exception { ShopDTO shop = ShopDTO.find("byDomain", client).first(); if (shop == null) { shop = ShopDTO.find("byDomain", "localhost").first(); @@ -211,6 +212,8 @@ public static void update(String client, String uuid, String name, String descri product.wholesaleCount = wholesaleCount; product.wholesalePrice = wholesalePrice; + product.quantity = quantity; + product.isQuantityVisible = isQuantityVisible; product.save(); diff --git a/app/controllers/UserAPI.java b/app/controllers/UserAPI.java index de09854cf..8764b1b81 100644 --- a/app/controllers/UserAPI.java +++ b/app/controllers/UserAPI.java @@ -45,7 +45,6 @@ public static void register(String email, String password, String passwordConfir forbidden(reason); } - if (user != null && user.isGoogleSignIn) { UserDTO userWithGivenPhone = UserDTO.find("byPhone", phone).first(); if(userWithGivenPhone != null) { diff --git a/app/controllers/UserDashBoardAPI.java b/app/controllers/UserDashBoardAPI.java index 98908614d..68afeb3b5 100644 --- a/app/controllers/UserDashBoardAPI.java +++ b/app/controllers/UserDashBoardAPI.java @@ -1,5 +1,6 @@ package controllers; +import jobs.AdditionalSettingForShop; import models.*; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; @@ -78,6 +79,9 @@ public static void createShop() throws Exception{ shop.googleMapsApiKey = "AIzaSyAuKg9jszEEgoGfUlIqmd4n9czbQsgcYRM"; visualSettings.shop = shop; + AdditionalSettingForShop additionalSettingForShop = new AdditionalSettingForShop(); + additionalSettingForShop.setWorkingTime(shop); + _appendDomainToList(user.wizard.shopDomain); shop.save(); renderJSON(json(shop)); diff --git a/app/controllers/WizardAPI.java b/app/controllers/WizardAPI.java index 3b8694f88..55edd908f 100644 --- a/app/controllers/WizardAPI.java +++ b/app/controllers/WizardAPI.java @@ -67,11 +67,14 @@ public static void upDateWizardDetails() throws Exception{ } public static void checkDomainNameAvailability() throws Exception{ - String domain = request.params.get("shopDomain").toLowerCase(); - + JSONParser parser = new JSONParser(); + JSONObject jsonBody = (JSONObject) parser.parse(params.get("body")); + System.out.println(" checkDomainNameAvailability => " + jsonBody); + String domain = (String) jsonBody.get("domain"); + System.out.println("checkDomainNameAvailability => " + domain); String domainPath; if (Application.isDevEnv) { domainPath = ".localhost"; @@ -82,24 +85,34 @@ public static void checkDomainNameAvailability() throws Exception{ } if(isDomainNameInvalid(domain)){ - JsonResponse jsonResponse = new JsonResponse(420, "назва не повинна містити: !, _"); + JsonResponse jsonResponse = new JsonResponse(421, "Назва не повинна містити: !, _"); renderJSON(jsonResponse); } String authorizationHeader = request.headers.get("authorization").value(); String userId = getUserIdFromAuthorization(authorizationHeader); System.out.println("String userId " + userId); + UserDTO user = UserDTO.find("byUuid", userId).first(); + String shopName = (String) jsonBody.get("shopName"); + System.out.println("shopName => " + shopName); ShopDTO shop = ShopDTO.find("byDomain", domain).first(); if (shop == null){ - String reason = "адреса доступна"; - JsonResponse jsonResponse = new JsonResponse(421, reason); - UserDTO user = UserDTO.find("byUuid", userId).first(); + String reason = "Адреса доступна"; + JsonResponse jsonResponse = new JsonResponse(420, reason); + if (user.wizard == null){ + WizardDTO wizardDTO = new WizardDTO(); + wizardDTO.user = user; + user.wizard = wizardDTO; + wizardDTO.save(); + } user.wizard.shopDomain = domain; + user.wizard.shopName = shopName; + user.wizard.save(); renderJSON(jsonResponse); } String reason = "адреса недоступна"; - JsonResponse jsonResponse = new JsonResponse(420, reason); + JsonResponse jsonResponse = new JsonResponse(421, reason); renderJSON(jsonResponse); } @@ -112,9 +125,20 @@ private static boolean isDomainNameInvalid(String domainName) { } public static void setShopContactInfo() throws Exception{ - String cityName = request.params.get("cityName"); - String streetName = request.params.get("streetName"); - String buildingNumber = request.params.get("buildingNumber"); + String cityName, streetName, buildingNumber; + cityName = request.params.get("cityName"); + streetName = request.params.get("streetName"); + buildingNumber = request.params.get("buildingNumber"); + + JSONParser parser = new JSONParser(); + JSONObject jsonBody = (JSONObject) parser.parse(params.get("body")); + System.out.println("setShopContactInfo jsonBody\n" + jsonBody); + + if (jsonBody != null){ + cityName = (String) jsonBody.get("city"); + streetName = (String) jsonBody.get("street"); + buildingNumber = (String) jsonBody.get("house"); + } System.out.println("setShopContactInfo\n" + cityName + "\n" + streetName + "\n" + buildingNumber); @@ -125,34 +149,36 @@ public static void setShopContactInfo() throws Exception{ UserDTO user = UserDTO.find("byUuid", userId).first(); System.out.println("setShopContactInfo get userDTO\n" + userId); - if(cityName != null){ + if(cityName != null && !cityName.isEmpty()){ user.wizard.cityName = cityName; } - if(streetName != null){ + if(streetName != null && !streetName.isEmpty()){ user.wizard.streetName = streetName; } - if(buildingNumber != null){ + if(buildingNumber != null && !buildingNumber.isEmpty()){ user.wizard.buildingNumber =buildingNumber; } user.wizard.save(); - renderJSON(json(user.wizard)); + renderJSON(json(new JsonResponse(103, "save"))); } public static void setVariantsOfDeliveryAndPaymentTypes() throws Exception{ + String authorizationHeader = request.headers.get("authorization").value(); + String userId = getUserIdFromAuthorization(authorizationHeader); + UserDTO user = UserDTO.find("byUuid", userId).first(); JSONParser parser = new JSONParser(); JSONObject jsonBody = (JSONObject) parser.parse(params.get("body")); boolean courierDelivery = (boolean) jsonBody.get("courierDelivery"); boolean postDepartment = (boolean) jsonBody.get("postDepartment"); boolean selfTake = (boolean) jsonBody.get("selfTake"); - boolean payCash = true; - boolean payOnline = false; - String authorizationHeader = request.headers.get("authorization").value(); - String userId = getUserIdFromAuthorization(authorizationHeader); - UserDTO user = UserDTO.find("byUuid", userId).first(); - System.out.println("setVariantsOfDeliveryAndPaymentTypes\n" + user.givenName); + boolean payCash = false, payOnline = false; + if (jsonBody.get("payCash") != null) payCash = (boolean) jsonBody.get("payCash"); + if (jsonBody.get("payOnline") != null) payOnline = (boolean) jsonBody.get("payOnline"); + + System.out.println("setVariantsOfDeliveryAndPaymentTypes\n" + jsonBody + user.givenName); user.wizard.courierDelivery = courierDelivery; user.wizard.postDepartment = postDepartment; @@ -206,7 +232,7 @@ public static void signUp() throws Exception { if (user != null) { System.out.println("user.with.email.already.exist"); String reason = Messages.get("user.with.email.already.exist"); - JsonResponse jsonResponse = new JsonResponse(420, reason); + JsonResponse jsonResponse = new JsonResponse(421, reason); renderJSON(jsonResponse); } diff --git a/app/jobs/AdditionalSettingForShop.java b/app/jobs/AdditionalSettingForShop.java index 3b197f963..9224ef74c 100644 --- a/app/jobs/AdditionalSettingForShop.java +++ b/app/jobs/AdditionalSettingForShop.java @@ -14,38 +14,38 @@ public AdditionalSettingForShop(){ } - public void setWorkkingTime(ShopDTO shop){ + public void setWorkingTime(ShopDTO shop){ if(shop.monStartTime == null) { - shop.monStartTime = "1970-01-01T05:00:00.000Z"; - shop.monEndTime = "1970-01-01T15:00:00.000Z"; + shop.monStartTime = "04:20"; + shop.monEndTime = "16:20"; } if(shop.tueStartTime == null) { - shop.tueStartTime = "1970-01-01T05:00:00.000Z"; - shop.tueEndTime = "1970-01-01T15:00:00.000Z"; + shop.tueStartTime = "04:20"; + shop.tueEndTime = "16:20"; } if(shop.wedStartTime == null) { - shop.wedStartTime = "1970-01-01T05:00:00.000Z"; - shop.wedEndTime = "1970-01-01T15:00:00.000Z"; + shop.wedStartTime = "04:20"; + shop.wedEndTime = "16:20"; } if(shop.thuStartTime == null) { - shop.thuStartTime = "1970-01-01T05:00:00.000Z"; - shop.thuEndTime = "1970-01-01T15:00:00.000Z"; + shop.thuStartTime = "04:20"; + shop.thuEndTime = "16:20"; } if(shop.friStartTime == null) { - shop.friStartTime = "1970-01-01T05:00:00.000Z"; - shop.friEndTime = "1970-01-01T15:00:00.000Z"; + shop.friStartTime = "04:20"; + shop.friEndTime = "16:20"; } if(shop.satStartTime == null) { - shop.satStartTime = "1970-01-01T05:00:00.000Z"; - shop.satEndTime = "1970-01-01T15:00:00.000Z"; + shop.satStartTime = "04:20"; + shop.satEndTime = "16:20"; } if(shop.sunStartTime == null) { - shop.sunStartTime = "1970-01-01T05:00:00.000Z"; - shop.sunEndTime = "1970-01-01T15:00:00.000Z"; + shop.sunStartTime = "04:20"; + shop.sunEndTime = "16:20"; } } diff --git a/app/jobs/WisehandsSetup.java b/app/jobs/WisehandsSetup.java index 03377cfc7..b9f683f70 100644 --- a/app/jobs/WisehandsSetup.java +++ b/app/jobs/WisehandsSetup.java @@ -44,13 +44,12 @@ public void doJob() throws Exception { boolean hasPages = listsPage.size() != 0; AdditionalSettingForShop additionalSettingForShop = new AdditionalSettingForShop(); - additionalSettingForShop.setWorkkingTime(shop); + additionalSettingForShop.setWorkingTime(shop); shop = shop.save(); if (!hasPages){ additionalSettingForShop.setPageListForFooter(shop); } } - } private void createShop(String shopName, String domain) { diff --git a/app/models/ProductDTO.java b/app/models/ProductDTO.java index a7b78165b..b2d1aadd1 100644 --- a/app/models/ProductDTO.java +++ b/app/models/ProductDTO.java @@ -1,12 +1,16 @@ package models; import com.google.gson.annotations.Expose; +import json.shoppingcart.LineItem; import org.hibernate.annotations.GenericGenerator; import play.db.jpa.GenericModel; +import util.ShoppingCartUtil; import javax.persistence.*; import java.util.ArrayList; import java.util.List; +import java.util.Optional; + @Entity public class ProductDTO extends GenericModel { @@ -59,6 +63,12 @@ public class ProductDTO extends GenericModel { @Expose public Double wholesalePrice; + @Expose + public int quantity; + + @Expose + public Boolean isQuantityVisible = false; + @Expose @OneToOne public ProductImage mainImage; @@ -138,12 +148,28 @@ public String formatDecimalOldPrice() { if (number != null) { float epsilon = 0.004f; // 4 tenths of a cent if (Math.abs(Math.round(number) - number) < epsilon) { - return String.format("%10.0f", number) + " " + "uah"; // sdb + return String.format("%10.0f", number) + " " + "₴"; // sdb } else { - return String.format("%10.2f", number) + " " + "uah"; // dj_segfault + return String.format("%10.2f", number) + " " + "₴"; // dj_segfault } } return ""; } + public int getProductQuantity() { + List cart = ShoppingCartDTO.findAll(); + List lineItems = cart.get(cart.size() - 1).items; + + LineItem _lineItem = lineItems.stream() + .filter(lineItem -> this.uuid.equals(lineItem.productId)) + .findAny() + .orElse(null); + if (_lineItem != null) { + return this.quantity - _lineItem.quantity; + } else { + return this.quantity; + } + + } + } diff --git a/app/models/UserDTO.java b/app/models/UserDTO.java index 19448d110..123c23192 100644 --- a/app/models/UserDTO.java +++ b/app/models/UserDTO.java @@ -82,6 +82,7 @@ public UserDTO(String givenName, String familyName, String phone, String email, this.phone = phone; this.email = email; this.password = password; + this.token = UUID.randomUUID().toString(); } } diff --git a/app/services/ShopServiceImpl.java b/app/services/ShopServiceImpl.java index 36ae698d3..384853f09 100644 --- a/app/services/ShopServiceImpl.java +++ b/app/services/ShopServiceImpl.java @@ -69,7 +69,7 @@ public ShopDTO createShop(String name, String domain, UserDTO user) { shop.googleMapsApiKey = WISEHANDS_MAPS_KEY; AdditionalSettingForShop additionalSettingForShop = new AdditionalSettingForShop(); - additionalSettingForShop.setWorkkingTime(shop); + additionalSettingForShop.setWorkingTime(shop); shop = shop.save(); additionalSettingForShop.setPageListForFooter(shop); diff --git a/app/views/Application/category.html b/app/views/Application/category.html index 9c3579912..3c81e3055 100644 --- a/app/views/Application/category.html +++ b/app/views/Application/category.html @@ -87,6 +87,17 @@ font-size: 1.5rem; padding-left: 0.5rem; } + .product-quantity { + display: flex; + flex-direction: row; + } + .item-card-price { + display: flex; + align-items: baseline; + } + .item-card-list-action .product-quantity p { + font-size: 12px; + } @media screen and (min-width: 1500px) { .all-category-cards, .category-nav { max-width: 1300px; @@ -212,8 +223,15 @@

${_product.name}

-

${_product.formatDecimal()} uah

-

${_product.formatDecimalOldPrice()}

+
+

${_product.formatDecimal()}

+

${_product.formatDecimalOldPrice()}

+ #{if _product.quantity} +
+

(${_product.quantity} &{'page.product.quantity.psc'})

+
+ #{/if} +
@@ -259,8 +277,14 @@

${_product.name
-

${_product.formatDecimal()} uah

+

${_product.formatDecimal()}

${_product.formatDecimalOldPrice()}

+ #{if _product.quantity} +
+

&{'page.product.quantity'}

+

${_product.quantity} &{'page.product.quantity.psc'}

+
+ #{/if}
@@ -280,56 +304,7 @@

${_product.name

- #{if shop.visualSettingsDTO.isFooterOn} #{footer-shop /} diff --git a/app/views/Application/product.html b/app/views/Application/product.html index 548c26770..23319013b 100644 --- a/app/views/Application/product.html +++ b/app/views/Application/product.html @@ -82,6 +82,9 @@ .product-info h2 { font-weight: 500; + overflow-wrap: anywhere; + line-height: 2rem; + max-height: 6rem; } .add-components { @@ -274,7 +277,7 @@ margin-right: .5rem; } - .total-additions-price, .total-product-price { + .quantity-container, .total-additions-price, .total-product-price { display: flex; } @@ -556,7 +559,9 @@ document.querySelector(".cart-float").style.display = 'none'; } - function buyStart(product) { + + + function addProductToCart(product) { if (!window.IS_SHOP_OPENED) { if (window.MESSAGE) { toastr.warning(MESSAGE); @@ -564,6 +569,22 @@ return; } + let quantityContainer = document.querySelector("#product-quantity-container"); + let quantity = document.querySelector("#product-quantity"); + let buttonContainerAddProduct = document.querySelector("#add-product-to-cart"); + + let productQuantity = quantity.textContent; + let difference = Number(productQuantity) - 1; + if (difference == 0){ + buttonContainerAddProduct.disabled = true; + quantityContainer.style.display = "none"; + document.querySelector('#product-is-over').style.display = 'block'; + + } else { + quantity.innerHTML = difference; + } + + console.log('quantityContainer => ', Number(quantityContainer) - 1); fetch('/api/cart?uuid=' + product.uuid + '&qr_uuid=' + product.qrUuid + '&additionList=' + JSON.stringify(additionList), { method: 'POST' @@ -603,19 +624,30 @@

${product.name}

${product.description}

- +
&{'page.product.price'}
+ #{if product.isQuantityVisible} +

&{'page.product.if.quantity.zero'}

+ +
+ &{'page.product.quantity'} +

${product.getProductQuantity()}

+
+ #{/if} + #{if product.selectedAdditions || product.defaultAdditions}
&{'page.product.additions.label'}:
#{/if} - -
+
@@ -779,6 +811,11 @@

${shop.shopName}

const totalSpan = document.querySelector('.total-span'); const additionsTotalPriceContainer = document.querySelector('.additions-total-price'); + const productIsOver = document.querySelector('#product-is-over'); + if (productIsOver !== null) { + productIsOver.style.display = 'none'; + } + (() => { const orderTimeList = document.querySelectorAll('[time]'); orderTimeList.forEach(item => { diff --git a/app/views/Application/qrCode.html b/app/views/Application/qrCode.html index 9c3225db7..b48df10b0 100644 --- a/app/views/Application/qrCode.html +++ b/app/views/Application/qrCode.html @@ -1,6 +1,6 @@ + #{set shop:shop /} #{set language:language /} - @@ -21,18 +21,750 @@ - - - + + -dasddddddddddddddddddd + + + + + +
+
+
+

QR-код меню: поділись своїм цифровим меню в QR-коді зі своїми клієнтами

+ + +
+

Створити QR-код меню

+ +
+
+
+
+ qrcode +
+
+
+

Як створити QR-код меню

+ +

Для створення простого QR-коду з безконтактним меню потрібно всього 3 хвилини за 3 простих кроки.

+ +
+
+
+ +
+

Створіть магазин

+ +

Введіть назву своєї компанії для створення сайту, де ви надалі зможете створювати свої QR-коди. Добавте товари і створюйте відповідний QR-код для Вашого меню.

+ +
+
+
+ +
+

Роздрукуйте QR-код

+ +

Завантажте свій QR-код, роздрукуйте і користуйтесь! Ви можете завантажити QR-код у декількох форматах, ми рекомендуємо PNG для кращої якості друку

+ +
+
+
+ +
+

Розмістіть його

+ +

Щойно ваш новий QR-код буде надрукований, розмістіть його там, де люди зможуть легко його відсканувати. Наприклад, на столиках, плакатах, вікнах вашого ресторану або навіть на ваших серветках!

+ +
+
+
+
+ qrcode2 +
+
+

Ми полегшимо Вам життя

+ +
+
+
+ +
+

Багаторазовий QR-код

+ +

Змінюйте вміст свого QR-коду стільки разів, скільки вам потрібно. Змінюйте своє меню кожного дня, якщо це необхідно. Немає обмежень по кількості змін вашого меню в QR-коді.

+ +
+
+
+ +
+

Декілька QR-кодів

+ +

Створюйте QR-коди для кожного столу у Вашому закладі, для зручного обслуговування клієнтів.

+ +
+
+
+ +
+

Більші можливості

+ +

Спростіть для своїх клієнтів вибір з різних категорій продуктів або мов. Дозвольте Вашим клієнтам оплату через Paypal. Отримайте більше відгуків за допомогою функції Google Review.

+ +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/Application/qrWizard.html b/app/views/Application/qrWizard.html new file mode 100644 index 000000000..5fb6f885f --- /dev/null +++ b/app/views/Application/qrWizard.html @@ -0,0 +1,1211 @@ +#{set shop:shop /} +#{set language:language /} + + + + + + + Створення QR-коду + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

1

+

Реєстрація

+
+
+

2

+

Назва

+
+
+

3

+

Контакти

+
+
+

4

+

Налаштування

+
+
+
+
+ img + img + img + img +
+
+
+
+ +
+
+

Реєстрація

+ +
+
+

Ім'я

+ + +
+
+

Прізвище

+ + +
+
+

Номер телефону

+ + +
+
+

Email

+ +

Error message

+ +
+
+

Пароль

+ + +
+
+

Реєструючись, ви погоджуєтесь з умовами Публічної оферти та Умовами надання послуг WiseStore +

+
+
+ + + + + + +
+ + +
+
+ +
+
+ + + + \ No newline at end of file diff --git a/app/views/Application/shop.html b/app/views/Application/shop.html index 64eb667cc..812f9061d 100644 --- a/app/views/Application/shop.html +++ b/app/views/Application/shop.html @@ -87,6 +87,16 @@ .no-items-store img { width: 300px; } + .item-card-price { + display: flex; + align-items: baseline; + } + .product-quantity { + display: flex; + } + .item-card-list-action .product-quantity p { + font-size: 12px; + } @media screen and (min-width: 1500px) { .center-container, .cart-float { max-width: 1300px; @@ -218,8 +228,15 @@

${_product.name}

-

${_product.formatDecimal()} uah

-

${_product.formatDecimalOldPrice()}

+
+

${_product.formatDecimal()}

+

${_product.formatDecimalOldPrice()}

+ #{if _product.isQuantityVisible} +
+

(${_product.quantity} &{'page.product.quantity.psc'})

+
+ #{/if} +
@@ -263,8 +280,14 @@

${_product.name
-

${_product.formatDecimal()} uah

+

${_product.formatDecimal()}

${_product.formatDecimalOldPrice()}

+ #{if _product.quantity} +
+

&{'page.product.quantity'}

+

${_product.quantity} &{'page.product.quantity.psc'}

+
+ #{/if}
diff --git a/app/views/Application/testPage.html b/app/views/Application/testPage.html new file mode 100644 index 000000000..d8af595fa --- /dev/null +++ b/app/views/Application/testPage.html @@ -0,0 +1,319 @@ + + + + + + + test page + + + + + + + + + + + + + + + +
+
+ + +
+ +
+
+ +
+
+
+

Lorem ipsum dolor sit amet

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec efficitur, nulla id tincidunt venenatis, augue sapien pretium dui, et ultrices mi justo vel sapien. Vestibulum in porttitor velit, ut condimentum lacus. Aliquam at consectetur ligula.

+

Cras ligula lorem, posuere et turpis vel, iaculis facilisis erat. Praesent dui elit, accumsan a eros et, faucibus vulputate tortor. Etiam sit amet pellentesque sapien. Sed imperdiet hendrerit nunc eu porttitor. Pellentesque et tincidunt nunc, at consectetur orci. Sed et metus eget enim interdum laoreet. Vivamus semper tempus erat ac fringilla. Cras consectetur, odio eu dignissim finibus, erat magna vestibulum metus, non pulvinar nulla elit vitae urna.

+
+
+
+ +
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Donec efficitur, nulla id tincidunt venenatis, augue sapien pretium dui, et ultrices mi justo vel sapien.

+
+
+
+ +
+ +
+ + +
+
+
+
+ +

Customer

+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec efficitur, nulla id tincidunt venenatis, augue sapien pretium dui, et ultrices mi justo vel sapien. Pellentesque et tincidunt nunc, at consectetur orci. Sed et metus eget enim interdum laoreet. Vivamus semper tempus erat ac fringilla. Cras consectetur, odio eu dignissim finibus, erat magna vestibulum metus, non pulvinar nulla elit vitae urna.

+
+
+ +
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/app/views/Application/uaNewWizard.html b/app/views/Application/uaNewWizard.html index 44237a7d8..e00652609 100644 --- a/app/views/Application/uaNewWizard.html +++ b/app/views/Application/uaNewWizard.html @@ -374,8 +374,6 @@ -moz-animation-delay: 0.793s; } - - @keyframes orbit { 0% { opacity: 1; @@ -864,14 +862,14 @@

Створення магазину

const wizardForms = document.querySelectorAll('section'); const currentStepIndicators = document.querySelectorAll('.step'); + const previousActionButton = document.querySelector('.previous-step-button'); const nextActionButton = document.querySelector('.next-step-button'); - const requiredFields = document.querySelectorAll('[required]'); const circleLoadingAnimation = document.querySelector('.circle-loading-animation'); const form = document.querySelector('form'); - + const requiredFields = document.querySelectorAll('[required]'); requiredFields.forEach(requiredField => { requiredField.addEventListener('input', event => event.target.setCustomValidity('')); }); diff --git a/conf/messages.en_US b/conf/messages.en_US index 502454d36..7693bcf6e 100644 --- a/conf/messages.en_US +++ b/conf/messages.en_US @@ -106,6 +106,9 @@ page.product.main.label = Main page.product.additions.label = Additions page.product.additions.price = Additions price page.product.price = Price: +page.product.quantity = Quantity: +page.product.quantity.psc = psc. +page.product.if.quantity.zero = This product is over page.product.buy = Buy page.product.add.to.basket = Product added to cart page.product.about.product = About diff --git a/conf/messages.uk_UA b/conf/messages.uk_UA index 4a668de08..019442c1d 100644 --- a/conf/messages.uk_UA +++ b/conf/messages.uk_UA @@ -104,6 +104,10 @@ page.product.main.label = Головна page.product.additions.label = Додатки page.product.additions.cost = Вартість додатків: page.product.price = Вартість: +page.product.quantity = Кількість: +page.product.quantity.psc = шт. +page.product.if.quantity.zero = Товар закінчився + page.product.buy = Купити page.product.add.to.basket = Товар додано в кошик page.product.about.product = Про товар diff --git a/conf/routes b/conf/routes index b2ab79531..e21e372ee 100644 --- a/conf/routes +++ b/conf/routes @@ -318,6 +318,9 @@ PUT {client}/api/translation/save TranslationBucketAP * {client}/server-error Application.serverError * {client}/dashboard Application.userDashboard * {client}/qrCode Application.qrCode +* {client}/qrWizard Application.qrWizard +* {client}/testPage Application.testPage + * {client}/termsofservice Application.termsofservice diff --git a/wisehands/admin/js/controllers/EditProductController.js b/wisehands/admin/js/controllers/EditProductController.js index 715455924..18739a5f5 100644 --- a/wisehands/admin/js/controllers/EditProductController.js +++ b/wisehands/admin/js/controllers/EditProductController.js @@ -78,7 +78,7 @@ angular.module('WiseHands') .then(function successCallback(response) { $scope.product = response.data; - + $scope.product.quantity ? $scope.checked = true : $scope.checked = false; console.log("$scope.product property :" , response.data); $scope.activeShop = localStorage.getItem('activeShop'); @@ -282,6 +282,8 @@ angular.module('WiseHands') fd.append('name', $scope.product.name); fd.append('description', $scope.product.description); fd.append('price', $scope.product.price); + fd.append('quantity', $scope.product.quantity); + fd.append('isQuantityVisible', $scope.product.isQuantityVisible); fd.append('isActive', $scope.product.isActive); fd.append('oldPrice', $scope.product.oldPrice); fd.append('sortOrder', $scope.product.sortOrder); diff --git a/wisehands/admin/js/controllers/SubmitNewProductController.js b/wisehands/admin/js/controllers/SubmitNewProductController.js index e45c9defe..800829284 100644 --- a/wisehands/admin/js/controllers/SubmitNewProductController.js +++ b/wisehands/admin/js/controllers/SubmitNewProductController.js @@ -242,6 +242,8 @@ angular.module('WiseHands') fd.append('name', getProductName()); fd.append('description', getProductDescription()); fd.append('price', $scope.product.price); + fd.append('quantity', $scope.product.quantity); + fd.append('isQuantityVisible', $scope.product.isQuantityVisible); fd.append('mainPhotoIndex', $scope.product.mainPhoto); fd.append('category', $scope.selectedCategoryId); fd.append('isActive', $scope.product.isActive); diff --git a/wisehands/admin/partials/addNewProduct.html b/wisehands/admin/partials/addNewProduct.html index a33d74e39..2b729a05c 100644 --- a/wisehands/admin/partials/addNewProduct.html +++ b/wisehands/admin/partials/addNewProduct.html @@ -38,6 +38,13 @@

{{'editProduct.general' | translate}}

+ + + + + + +

{{'translationPage.title' | translate}}

@@ -83,6 +90,8 @@

{{'addNewProduct.category' | translate}}

{{'editProduct.properties' | translate}}

+ +
diff --git a/wisehands/admin/partials/editProduct.html b/wisehands/admin/partials/editProduct.html index f4f523c95..b6c94617c 100644 --- a/wisehands/admin/partials/editProduct.html +++ b/wisehands/admin/partials/editProduct.html @@ -58,6 +58,14 @@

{{'editProduct.properties' | translate}}

+ + + + + + + +
diff --git a/wisehands/admin/resources/locale-en_US.json b/wisehands/admin/resources/locale-en_US.json index 7634fa8a8..6135c9995 100644 --- a/wisehands/admin/resources/locale-en_US.json +++ b/wisehands/admin/resources/locale-en_US.json @@ -222,6 +222,7 @@ "addNewProduct.add": "Add Product", "addNewProduct.productName": "Name", "addNewProduct.productPrice": "Price", + "addNewProduct.addQuantity": "Enter the quantity of goods", "addNewProduct.productWholesaleCount": "Quantity of goods for wholesale", "addNewProduct.productWholesalePrice": "The price of one product for wholesale", "addNewProduct.productDescription": "Description", @@ -231,6 +232,7 @@ "addNewProduct.showInShop": "Display product in shop for clients", "addNewProduct.isShowInShop": "Product is shown to the clients", "addNewProduct.isNotShowInShop": "Product is not shown to the client", + "addNewProduct.showInQrMenu": "Show product in QR-menu", "addNewProduct.oldPrice": "Price without discount", "addNewProduct.save": "Save", "addNewShops.add": "Add new shop", @@ -303,6 +305,9 @@ "editProduct.additionPrice": "Price", "editProduct.additionImage": "Additional option image", "editProduct.additionAddPhoto": "Add image", + "editProduct.setQuantity": "Enter quantity of products", + "editProduct.showQuantity": "Show quantity in product page", + "payment.payment": "Payment", "payment.paymentTypeCash": "Cash", "payment.paymentTypeOnline": "Online", diff --git a/wisehands/admin/resources/locale-pl_PL.json b/wisehands/admin/resources/locale-pl_PL.json index 4a2f3308b..1dd100503 100644 --- a/wisehands/admin/resources/locale-pl_PL.json +++ b/wisehands/admin/resources/locale-pl_PL.json @@ -228,6 +228,7 @@ "addNewProduct.add": "Dodaj produkt", "addNewProduct.productName": "Nazwa", "addNewProduct.productPrice": "Cena", + "addNewProduct.addQuantity": " Wprowadź ilość towarów", "addNewProduct.productWholesaleCount": "Ilość towaru do sprzedaży hurtowej", "addNewProduct.productWholesalePrice": "Cena jednego produktu do sprzedaży hurtowej", "addNewProduct.productDescription": "Opis", @@ -237,6 +238,7 @@ "addNewProduct.ShowInShop": "Pokaż produkt w sklepie dla klientów", "addNewProduct.isShowInShop": "Produkt jest pokazywany klientom", "addNewProduct.isNotShowInShop": "Produkt nie jest pokazywany klientom", + "addNewProduct.showInQrMenu": "Pokaż produkt w menu QR", "addNewProduct.oldPrice": "Сena bez rabatu", "addNewProduct.save": "Zapisać", "displayOrder": "Kolejność wyświetlania", @@ -305,6 +307,9 @@ "editProduct.additionPrice": "Cena opcji", "editProduct.additionImage": "Obraz opciji", "editProduct.additionAddPhoto": "Dodaj obraz", + "editProduct.setQuantity": "Wprowadź ilość produktów", + "editProduct.showQuantity": "Pokaż ilość towarów", + "payment.payment": "Płatność", "payment.paymentTypeCash": "Gotówką", "payment.paymentTypeOnline": "Online", diff --git a/wisehands/admin/resources/locale-uk_UA.json b/wisehands/admin/resources/locale-uk_UA.json index 75453eea9..1473ee821 100644 --- a/wisehands/admin/resources/locale-uk_UA.json +++ b/wisehands/admin/resources/locale-uk_UA.json @@ -229,6 +229,7 @@ "addNewProduct.productWholesaleCount": "Кількість товарів для оптової торгівлі", "addNewProduct.productWholesalePrice": "Ціна одного товару для оптової торгівлі", "addNewProduct.productPrice": "Ціна", + "addNewProduct.addQuantity": "Ввести кількість товару", "addNewProduct.productDescription": "Опис", "addNewProduct.showMoreButton": "Показати більше", "addNewProduct.showLessButton": "Показати менше", @@ -237,6 +238,7 @@ "addNewProduct.showInShop": "Показувати клієнтам товар в магазині", "addNewProduct.isShowInShop": "Товар показується клієнтам", "addNewProduct.isNotShowInShop": "Товар не показується клієнтам", + "addNewProduct.showInQrMenu": "Показувати товар в QR-меню", "addNewProduct.oldPrice": "Ціна без знижки", "addNewProduct.save": "Зберегти", "displayOrder": "Порядок відображення", @@ -303,6 +305,9 @@ "editProduct.optionName": "Назва опції", "editProduct.optionPrice": "Ціна опції", "editProduct.addAddition": "Додати опцію до товару (наприклад, до піци - рукола або томати)", + "editProduct.setQuantity": "Ввести кількість товару", + "editProduct.showQuantity": "Показувати кількість товарів у магазині", + "payment.payment": "Оплата", "payment.paymentTypeCash": "Готівка", "payment.paymentTypeOnline": "Онлайн", diff --git a/wisehands/landing/eye1.jpg b/wisehands/landing/eye1.jpg new file mode 100644 index 000000000..3f8ba9e3b Binary files /dev/null and b/wisehands/landing/eye1.jpg differ diff --git a/wisehands/landing/eyeTest.jpg b/wisehands/landing/eyeTest.jpg new file mode 100644 index 000000000..43c15abc2 Binary files /dev/null and b/wisehands/landing/eyeTest.jpg differ diff --git a/wisehands/landing/images/qr_wizard_1.svg b/wisehands/landing/images/qr_wizard_1.svg new file mode 100644 index 000000000..3e26ec0cf --- /dev/null +++ b/wisehands/landing/images/qr_wizard_1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wisehands/landing/images/qr_wizard_2.svg b/wisehands/landing/images/qr_wizard_2.svg new file mode 100644 index 000000000..d0aa5b086 --- /dev/null +++ b/wisehands/landing/images/qr_wizard_2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wisehands/landing/images/qr_wizard_3.svg b/wisehands/landing/images/qr_wizard_3.svg new file mode 100644 index 000000000..19949f7f3 --- /dev/null +++ b/wisehands/landing/images/qr_wizard_3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wisehands/landing/images/qr_wizard_4.svg b/wisehands/landing/images/qr_wizard_4.svg new file mode 100644 index 000000000..d2f57dbaf --- /dev/null +++ b/wisehands/landing/images/qr_wizard_4.svg @@ -0,0 +1 @@ +printing invoices \ No newline at end of file diff --git a/wisehands/landing/images/qrcode1.jpg b/wisehands/landing/images/qrcode1.jpg new file mode 100644 index 000000000..612749fe1 Binary files /dev/null and b/wisehands/landing/images/qrcode1.jpg differ diff --git a/wisehands/landing/images/qrcode2.jpg b/wisehands/landing/images/qrcode2.jpg new file mode 100644 index 000000000..22c0e94a3 Binary files /dev/null and b/wisehands/landing/images/qrcode2.jpg differ diff --git a/wisehands/landing/test1.jpg b/wisehands/landing/test1.jpg new file mode 100644 index 000000000..ff6ef14a6 Binary files /dev/null and b/wisehands/landing/test1.jpg differ diff --git a/wisehands/landing/test11.jpg b/wisehands/landing/test11.jpg new file mode 100644 index 000000000..193cca43d Binary files /dev/null and b/wisehands/landing/test11.jpg differ diff --git a/wisehands/landing/test3.jpg b/wisehands/landing/test3.jpg new file mode 100644 index 000000000..a7ea57809 Binary files /dev/null and b/wisehands/landing/test3.jpg differ diff --git a/wisehands/shop/css/shop.css b/wisehands/shop/css/shop.css index 649fc3f30..cc34f31dc 100644 --- a/wisehands/shop/css/shop.css +++ b/wisehands/shop/css/shop.css @@ -47,6 +47,9 @@ flex-basis: calc(33.3% - 1rem); margin: 0 0.5rem; } +.card-block { + padding: 1rem; +} .item-img { width: 100%; } @@ -55,6 +58,9 @@ }*/ .item-card-title { height: 6rem; + display: flex; + flex-direction: column; + justify-content: space-between; } .item-card-text { height: 3.5rem; @@ -130,18 +136,24 @@ } .item-card-action-price { display: flex; + flex-direction: column; align-items: baseline; - margin-top: auto; + margin: 5px 0; } .item-card-action-price .current-price { font-size: 20px; } + +.item-card-action-price .product-quantity p { + font-size: 12px; +} .currency { font-size: 16px; } .item-card-list-action p, .item-card-action-price p { - margin: 0 0.5rem 0 0; + margin: 0 5px 0 0; font-size: 20px; + text-align: right; } .item-card-list-action i, .item-card-action i { font-size: 2rem; @@ -287,7 +299,7 @@ text-overflow: ellipsis; position: relative; text-align: left; - margin-right: -1em; + overflow-wrap: anywhere; } .headerCentering:before { @@ -528,6 +540,9 @@ main { } } @media screen and (max-width: 768px) { + .card-block { + padding: 0.5rem; + } .grid-view { display: none; } @@ -616,6 +631,13 @@ main { align-items: center; /* height: 40px;*/ } + + .item-card-list-action p, .item-card-action-price p { + text-align: left; + } + .item-card-action-price .current-price { + font-size: 18px; + } .item-card-list-action i { margin: 0 0.5rem 0.5rem 0; }