From 1c72c8dac64852b23a2ad6a3b4d39e9aa1e88033 Mon Sep 17 00:00:00 2001 From: thuongtruong1009 Date: Sat, 4 Jun 2022 23:20:38 +0700 Subject: [PATCH 1/5] fix cart data --- src/components/CProductCard.vue | 2 +- src/components/head/CBList.vue | 4 +- src/components/head/CBMenuCategories.vue | 2 +- src/data/cart.json | 630 +++++----- src/data/category.json | 1422 ++++++++++++++++++++++ src/pages/buyer/cart.vue | 1 - src/pages/buyer/cart_nhap.vue | 3 +- src/pages/product/[product].vue | 2 +- src/pages/search/[keyword].vue | 2 +- src/services/product-request.js | 4 +- src/stores/cart.ts | 6 +- 11 files changed, 1717 insertions(+), 361 deletions(-) create mode 100644 src/data/category.json diff --git a/src/components/CProductCard.vue b/src/components/CProductCard.vue index d249b43..f4f40d1 100644 --- a/src/components/CProductCard.vue +++ b/src/components/CProductCard.vue @@ -8,7 +8,7 @@ import { handleError } from '~/helpers/error' import { handleDate } from '~/utils/date' import { productStatus } from '~/utils/status' import { sliceText } from '~/utils/textHandle' -import { getResources} from '~/utils/resources' +import { getResources } from '~/utils/resources' import ShopRequest from '~/services/shop-request' import ProductRequest from '~/services/product-request' diff --git a/src/components/head/CBList.vue b/src/components/head/CBList.vue index 3d899b0..323baab 100644 --- a/src/components/head/CBList.vue +++ b/src/components/head/CBList.vue @@ -35,9 +35,7 @@ const cartPayload = reactive({ }) watchEffect(async() => { const { data: cartData } = await CartRequest.getCart({ params: { limit: cartPayload.limit, page: cartPayload.page } }) - cart.result = cartData.data - cart.payget = cartData.data[0] - cart.product = cartData.data[0].product + cart.result = cartData }) const handleDelete = async(id) => { removeItemByIndex(cart.result, id, 1) diff --git a/src/components/head/CBMenuCategories.vue b/src/components/head/CBMenuCategories.vue index 291f37b..b5a5f32 100644 --- a/src/components/head/CBMenuCategories.vue +++ b/src/components/head/CBMenuCategories.vue @@ -6,7 +6,7 @@ const { t } = useI18n() const product = useProduct() watch(async() => { - const { data } = await ProductRequest.getCategoriesChildrenById(0) + const { data } = await ProductRequest.getCategoriesChildrenById() product.category = data }) diff --git a/src/data/cart.json b/src/data/cart.json index 2fa68b8..d1b1de2 100644 --- a/src/data/cart.json +++ b/src/data/cart.json @@ -1,356 +1,294 @@ { "status": true, - "data": { - "current_page": 1, - "data": [ - { - "quantity": 4, - "user_id": 1, - "shop_id": 1, - "product_id": 1, - "product_model_id": 1, - "total_price": 2000, - "final_total_price": 2000, - "shop": { - "id": 1, - "name": "Shop odede" - }, - "product": { - "id": 1, - "name": "Samsung Galaxy A53 5G | A52s 5G (8GB+128GB\/256GB) with 1 Year Warranty by Samsung", - "description": "", - "weight": "500", - "sold": 0, - "images": [ - "93bc5fa42886e635fd9f103d03c9c31d", - "6085df7be931e1ef9d79ce125cacdb8b" - ], - "videos": [], - "variations": [ - { - "name": "Colour", - "options": [ - "Awesome Black", - "Awesome White" - ] - }, - { - "name": "Model", - "options": [ - "A52s 8GB+128GB", - "A53 8GB+128GB" - ] - } - ], - "created_at": "2022-05-19 15:07:43", - "shop_id": 1, - "brand_id": 1, - "status_id": 1, - "models": [ - { - "id": 2, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 0, - 1 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 3, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 1, - 0 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 4, - "sku": "", - "price": "500", - "stock": 50, - "variation_index": [ - 1, - 1 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 1, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 0, - 0 - ], - "is_default": false, - "product_id": 1 - } - ] - }, - "product_model": { - "id": 1, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 0, - 0 - ], - "is_default": false, - "product_id": 1 - } + "data": [ + { + "quantity": 1, + "user_id": 2, + "shop_id": 1, + "product_id": 1, + "product_model_id": 2, + "total_price": 296, + "final_total_price": 296, + "shop": { + "id": 1, + "name": "Shop of User 01" }, - { - "quantity": 4, - "user_id": 1, + "product": { + "id": 1, + "name": "Samsung Galaxy A53 5G | A52s 5G (8GB+128GB\/256GB) with 1 Year Warranty by Samsung", + "description": "Samsung A52s 5G Key Specs:\\nDisplay : 6.5 inches (Super AMOLED,120Hz)\\nCPU : Octa-core (4x2.4 GHz Kryo 670 & 4x1.9 GHz Kryo 670)\\nMain Camera : 64MP + 12MP + 5MP + 5MP\\nSelfie Camera : 32MP\\nRAM : 8GB\\nStorage : 128GB\/256GB\\nBattery Capacity : 4500 mAh (Fast Charging 25W)\\n\\nFor more details, please check at :\\nhttps:\/\/www.samsung.com\/sg\/smartphones\/galaxy-a\/galaxy-a52s-5g-awesomemint-256gb-sm-a528blgixsp\/\\n\\nSamsung A53 5G Key Specs :\\nDisplay : 6.5 inches (Super AMOLED,120Hz)\\nCPU : Octa-core (2x2.4 GHz Cortex-A78 & 6x2.0 GHz Cortex-A55)\\nMain Camera : 64MP + 12MP + 5MP + 5MP\\nSelfie Camera : 32MP\\nRAM : 8GB\\nStorage : 128GB\/256GB\\nBattery Capacity : 5000 mAh (Fast Charging 25W)\\n\\nFor more details,please check at\\nhttps:\/\/www.samsung.com\/sg\/smartphones\/galaxy-a\/galaxy-a53-5g-awesome-blue-128gb-sm-a536elbgxsp\/\\n\\n-All products are 100% authentic.\\n-Local Singapore set.\\n-All products are sourced from authorised dealers,official stores and telcos (M1,Singtel,Starhub & etc).\\n-Some products are unsealed to check for manufacturer defect.\\n-All products warranty based on manufactured date.\\n-Some products might less than 1 year warranty due to activation policy from dealers or telcos.\\n-If you wish to purchase Samsung Care+,please request by leave a message when placing order.\\n-Telcos receipt or official dealers receipt will be provided if available.\\n-Store soft copy receipt can be issue upon request.\\n-For products that comes with manufacturer warranty,buyer must contact manufacturer or visit manufacturer\u2019s service center for repair\/exchange or any technical support.\\n-All products sold are not exchangeable and not refundable.", + "weight": "500", + "avg_rating": "0", + "sold": 0, + "images": [ + "demo-93bc5fa42886e635fd9f103d03c9c31d", + "demo-6085df7be931e1ef9d79ce125cacdb8b" + ], + "videos": [], + "variations": [ + { + "name": "Colour", + "options": [ + "Awesome Black", + "Awesome White" + ] + }, + { + "name": "Model", + "options": [ + "A52s 8GB+128GB", + "A53 8GB+128GB" + ] + } + ], + "created_at": "2022-06-04 07:14:57", "shop_id": 1, - "product_id": 1, - "product_model_id": 2, - "total_price": 2000, - "final_total_price": 2000, - "shop": { - "id": 1, - "name": "Shop odede" - }, - "product": { - "id": 1, - "name": "Samsung Galaxy A53 5G | A52s 5G (8GB+128GB\/256GB) with 1 Year Warranty by Samsung", - "description": "", - "weight": "500", - "sold": 0, - "images": [ - "93bc5fa42886e635fd9f103d03c9c31d", - "6085df7be931e1ef9d79ce125cacdb8b" - ], - "videos": [], - "variations": [ - { - "name": "Colour", - "options": [ - "Awesome Black", - "Awesome White" - ] - }, - { - "name": "Model", - "options": [ - "A52s 8GB+128GB", - "A53 8GB+128GB" - ] - } - ], - "created_at": "2022-05-19 15:07:43", - "shop_id": 1, - "brand_id": 1, - "status_id": 1, - "models": [ - { - "id": 2, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 0, - 1 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 3, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 1, - 0 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 4, - "sku": "", - "price": "500", - "stock": 50, - "variation_index": [ - 1, - 1 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 1, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 0, - 0 - ], - "is_default": false, - "product_id": 1 - } - ] - }, - "product_model": { - "id": 2, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 0, - 1 - ], - "is_default": false, - "product_id": 1 - } + "brand_id": 1, + "status_id": 1, + "models": [ + { + "id": 1, + "sku": "", + "price": "516", + "stock": 5, + "variation_index": [ + 0, + 0 + ], + "is_default": false, + "product_id": 1 + }, + { + "id": 2, + "sku": "", + "price": "296", + "stock": 5, + "variation_index": [ + 0, + 1 + ], + "is_default": false, + "product_id": 1 + }, + { + "id": 3, + "sku": "", + "price": "406", + "stock": 5, + "variation_index": [ + 1, + 0 + ], + "is_default": false, + "product_id": 1 + }, + { + "id": 4, + "sku": "", + "price": "515", + "stock": 50, + "variation_index": [ + 1, + 1 + ], + "is_default": false, + "product_id": 1 + } + ] }, - { - "quantity": 1, - "user_id": 1, - "shop_id": 1, - "product_id": 1, - "product_model_id": 3, - "total_price": 500, - "final_total_price": 500, - "shop": { - "id": 1, - "name": "Shop odede" - }, - "product": { - "id": 1, - "name": "Samsung Galaxy A53 5G | A52s 5G (8GB+128GB\/256GB) with 1 Year Warranty by Samsung", - "description": "", - "weight": "500", - "sold": 0, - "images": [ - "93bc5fa42886e635fd9f103d03c9c31d", - "6085df7be931e1ef9d79ce125cacdb8b" - ], - "videos": [], - "variations": [ - { - "name": "Colour", - "options": [ - "Awesome Black", - "Awesome White" - ] - }, - { - "name": "Model", - "options": [ - "A52s 8GB+128GB", - "A53 8GB+128GB" - ] - } - ], - "created_at": "2022-05-19 15:07:43", - "shop_id": 1, - "brand_id": 1, - "status_id": 1, - "models": [ - { - "id": 2, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 0, - 1 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 3, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 1, - 0 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 4, - "sku": "", - "price": "500", - "stock": 50, - "variation_index": [ - 1, - 1 - ], - "is_default": false, - "product_id": 1 - }, - { - "id": 1, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 0, - 0 - ], - "is_default": false, - "product_id": 1 - } - ] - }, - "product_model": { - "id": 3, - "sku": "", - "price": "500", - "stock": 5, - "variation_index": [ - 1, - 0 - ], - "is_default": false, - "product_id": 1 - } + "product_model": { + "id": 2, + "sku": "", + "price": "296", + "stock": 5, + "variation_index": [ + 0, + 1 + ], + "is_default": false, + "product_id": 1 + } + }, + { + "quantity": 2, + "user_id": 2, + "shop_id": 3, + "product_id": 3, + "product_model_id": 8, + "total_price": 119.8, + "final_total_price": 119.8, + "shop": { + "id": 3, + "name": "Blinkfyre" + }, + "product": { + "id": 3, + "name": "\u3010SG\u3011 Gateron KS-9 Mechanical Keyboard Switch", + "description": "Local SG Seller \u2013 Fast Delivery \u2013 Buy with Confidence!\\nNote: Not compatible with Outemu hot-swap PCB (e.g. Tecware Phantom RGB), as it has a narrower socket that only accept Outemu switches.\\nMinimum order 30 pcs, can mix and match.\\nContact us if you would like to have switch tester kit with 9 type of Gateron switches.\\n\u3010Gateron White Switch\u3011\\nType: Linear\\nActuation Force: 35 gf\\nActuation Distance: 2.0 mm\\nTravel Distance: 4.0 mm\\nDescription: The white switch has the lightest actuation force amongst the linear switches. The smooth nature of the Gateron allows it to be triggered with very light force, making it effortless to type.\\n\u3010Gateron Red Switch\u3011\\nType: Linear\\nActuation Force: 45 gf\\nActuation Distance: 2.0 mm\\nTravel Distance: 4.0 mm\\nDescription: Gateron red is the most commonly used Gateron switch because it is a linear switch, making the typing sound quieter. The pressure is more moderate, light, and prolonged periods of typing will not feel tired.\\n\u3010Gateron Yellow Switch\u3011\\nType: Linear\\nActuation Force: 50 gf\\nActuation Distance: 2.0 mm\\nTravel Distance: 4.0 mm\\nDescription: The design of the Gateron yellow switch is the same as the red switch, but the departure strength is 5g bigger, which seems small but does offer a difference in feeling. The feedback of the yellow switch is more rigid, but it doesn\u2019t need heavy force to be triggered.\\n\u3010Gateron Black Switch\u3011\\nType: Linear\\nActuation Force: 60 gf\\nActuation Distance: 2.0 mm\\nTravel Distance: 4.0 mm\\nDescription: The black switch is a linear switch with the greatest strength amongst standard mass-produced switches. Those who like mechanical keyboards with a stronger trigger force will likely prefer the Gateron black switch.\\n\u3010Gateron Brown Switch\u3011\\nType: Tactile\\nActuation Force: 55 gf\\nActuation Distance: 2.0 mm\\nTravel Distance: 4.0 mm\\nDescription: Gateron brown switch has the characteristics of both the red and blue switches. The vertical press still feels smooth, but also has the feeling of a bump. The sound is relatively quiet and will not disturb the surrounding environment.\\n\u3010Gateron Blue Switch\u3011\\nType: Clicky\\nActuation Force: 60 gf\\nActuation Distance: 2.3 mm\\nTravel Distance: 4.0 mm\\nDescription: Gateron Blue has a unique clicky touch feel and a louder sound. It still has the characteristics of the Gateron Switch and is smooth with tactile feedback. This structure can let you type for a long period and not get tired. It\u2019s ideal for games and typing.\\n\u3010Gateron Green Switch\u3011\\nType: Clicky\\nActuation Force: 80 gf\\nActuation Distance: 2.3 mm\\nTravel Distance: 4.0 mm\\nDescription: Gateron Green switch is seen by many as an upgraded version of Gateron Blue switch. 80g of press force is 20g higher than the Blue switch. The green switch has stronger feedback and a harder rebound.", + "weight": "50", + "avg_rating": "0", + "sold": 0, + "images": [ + "demo-4cc279abec8e74f480bc3968989be311" + ], + "videos": [], + "variations": [ + { + "name": "Switch Type", + "options": [ + "Gateron White", + "Gateron Red" + ] + } + ], + "created_at": "2022-06-04 07:14:57", + "shop_id": 3, + "brand_id": 1, + "status_id": 1, + "models": [ + { + "id": 7, + "sku": "", + "price": "59.9", + "stock": 50, + "variation_index": [ + 0 + ], + "is_default": false, + "product_id": 3 + }, + { + "id": 8, + "sku": "", + "price": "59.9", + "stock": 50, + "variation_index": [ + 1 + ], + "is_default": false, + "product_id": 3 + } + ] + }, + "product_model": { + "id": 8, + "sku": "", + "price": "59.9", + "stock": 50, + "variation_index": [ + 1 + ], + "is_default": false, + "product_id": 3 } - ], - "first_page_url": "http:\/\/tp-o.tk\/api\/v2\/user\/cart?page=1", - "from": 1, - "last_page": 1, - "last_page_url": "http:\/\/tp-o.tk\/api\/v2\/user\/cart?page=1", - "links": [ - { - "url": null, - "label": "« Previous", - "active": false + }, + { + "quantity": 3, + "user_id": 2, + "shop_id": 6, + "product_id": 8, + "product_model_id": 19, + "total_price": 21, + "final_total_price": 21, + "shop": { + "id": 6, + "name": "BAGSWORLDSG" }, - { - "url": "http:\/\/tp-o.tk\/api\/v2\/user\/cart?page=1", - "label": "1", - "active": true + "product": { + "id": 8, + "name": "SG M330 ultra silent Black wireless gaming working work ergonomic mouse mice accessories", + "description": "Meet M330 Silent Plus\\nGet all your work done without missing a beat or disturbing people around you. Silent Mice have the same click feel without the click noise\u2014over 90 percent noise reduction.* Say hello to the silent one in the room and goodbye to your last annoying click. Your family and friends will thank you\\nM330 Black wireless gaming working work ergonomic mouse mice accessories\\naccessories mice wireless mouse wireless gaming mice computer mouse ergonomic mouse wireless bluetooth wireless gaming mouse wireless mouse", + "weight": "700", + "avg_rating": "0", + "sold": 0, + "images": [ + "demo-7c311a63d50279bbce830f1eb219d501", + "demo-b8183953f66801b0b6fd0ffdddf07872" + ], + "videos": [], + "variations": [ + { + "name": "Colour", + "options": [ + "Black M330", + "White M330" + ] + }, + { + "name": "Quantity", + "options": [ + "1 Pack", + "2 Packs" + ] + } + ], + "created_at": "2022-06-04 07:14:57", + "shop_id": 6, + "brand_id": 1, + "status_id": 1, + "models": [ + { + "id": 17, + "sku": "", + "price": "8", + "stock": 50, + "variation_index": [ + 0, + 0 + ], + "is_default": false, + "product_id": 8 + }, + { + "id": 18, + "sku": "", + "price": "16", + "stock": 50, + "variation_index": [ + 0, + 1 + ], + "is_default": false, + "product_id": 8 + }, + { + "id": 19, + "sku": "", + "price": "7", + "stock": 50, + "variation_index": [ + 1, + 0 + ], + "is_default": false, + "product_id": 8 + }, + { + "id": 20, + "sku": "", + "price": "14", + "stock": 50, + "variation_index": [ + 1, + 1 + ], + "is_default": false, + "product_id": 8 + } + ] }, - { - "url": null, - "label": "Next »", - "active": false + "product_model": { + "id": 19, + "sku": "", + "price": "7", + "stock": 50, + "variation_index": [ + 1, + 0 + ], + "is_default": false, + "product_id": 8 } - ], - "next_page_url": null, - "path": "http:\/\/tp-o.tk\/api\/v2\/user\/cart", - "per_page": "10", - "prev_page_url": null, - "to": 3, - "total": 3 - } + } + ] } \ No newline at end of file diff --git a/src/data/category.json b/src/data/category.json new file mode 100644 index 0000000..fd8388b --- /dev/null +++ b/src/data/category.json @@ -0,0 +1,1422 @@ +{ + "status": true, + "data": [ + { + "id": 1, + "name": "Clothes", + "number_of_items": 0, + "number_of_children": 7, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 2, + "name": "Jean", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 1, + "children": [] + }, + { + "id": 7, + "name": "Sweaters & Cardigans", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 1, + "children": [] + }, + { + "id": 13, + "name": "Pants", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 1, + "children": [] + }, + { + "id": 14, + "name": "Shorts", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 1, + "children": [] + }, + { + "id": 3, + "name": "Hoodies & Sweatshirts", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 1, + "children": [ + { + "id": 4, + "name": "Hoodies", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 3, + "children": [] + }, + { + "id": 5, + "name": "Sweatshirts", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 3, + "children": [] + }, + { + "id": 6, + "name": "Other", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 3, + "children": [] + } + ] + }, + { + "id": 8, + "name": "Suits", + "number_of_items": 0, + "number_of_children": 4, + "cover_image": null, + "parent_id": 1, + "children": [ + { + "id": 9, + "name": "Suit Sets", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 8, + "children": [] + }, + { + "id": 10, + "name": "Suit Jackets & Blazers", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 8, + "children": [] + }, + { + "id": 11, + "name": "Suit Paints", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 8, + "children": [] + }, + { + "id": 12, + "name": "Suit Vests & Waistcoats", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 8, + "children": [] + } + ] + }, + { + "id": 15, + "name": "Innerwear & Underwear", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 1, + "children": [ + { + "id": 16, + "name": "Underwear", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 15, + "children": [] + }, + { + "id": 17, + "name": "Undershirts", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 15, + "children": [] + }, + { + "id": 18, + "name": "Thermal Innerwear", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 15, + "children": [] + } + ] + } + ] + }, + { + "id": 19, + "name": "Beauty", + "number_of_items": 0, + "number_of_children": 7, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 33, + "name": "Perfumes & Fragrance", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 19, + "children": [] + }, + { + "id": 20, + "name": "Hand, Foot & Nail Care", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 19, + "children": [ + { + "id": 21, + "name": "Hand Care", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 20, + "children": [] + }, + { + "id": 22, + "name": "Foot Care", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 20, + "children": [] + }, + { + "id": 23, + "name": "Nail Care", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 20, + "children": [] + } + ] + }, + { + "id": 24, + "name": "Hair Care", + "number_of_items": 0, + "number_of_children": 4, + "cover_image": null, + "parent_id": 19, + "children": [ + { + "id": 25, + "name": "Shampoo", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 24, + "children": [] + }, + { + "id": 26, + "name": "Hair Color", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 24, + "children": [] + }, + { + "id": 27, + "name": "Hair Treatment", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 24, + "children": [] + }, + { + "id": 28, + "name": "Hair Styling", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 24, + "children": [] + } + ] + }, + { + "id": 29, + "name": "Men's Care", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 19, + "children": [ + { + "id": 30, + "name": "Bath & Body Care", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 29, + "children": [] + }, + { + "id": 31, + "name": "Skincare", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 29, + "children": [] + }, + { + "id": 32, + "name": "Hair Care", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 29, + "children": [] + } + ] + }, + { + "id": 34, + "name": "Makeup", + "number_of_items": 0, + "number_of_children": 5, + "cover_image": null, + "parent_id": 19, + "children": [ + { + "id": 35, + "name": "Other", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 34, + "children": [] + }, + { + "id": 36, + "name": "Face", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 34, + "children": [] + }, + { + "id": 37, + "name": "Eyes", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 34, + "children": [] + }, + { + "id": 38, + "name": "Lips", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 34, + "children": [] + }, + { + "id": 39, + "name": "Makeup Removers", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 34, + "children": [] + } + ] + }, + { + "id": 40, + "name": "Beauty Tools", + "number_of_items": 0, + "number_of_children": 2, + "cover_image": null, + "parent_id": 19, + "children": [ + { + "id": 41, + "name": "Makeup Accessories", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 40, + "children": [] + }, + { + "id": 42, + "name": "Hair Removal Tools", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 40, + "children": [] + } + ] + }, + { + "id": 43, + "name": "Skincare", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 19, + "children": [ + { + "id": 44, + "name": "Facial Cleanser", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 43, + "children": [] + }, + { + "id": 45, + "name": "Toner", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 43, + "children": [] + }, + { + "id": 46, + "name": "Facial Oil", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 43, + "children": [] + } + ] + } + ] + }, + { + "id": 47, + "name": "Health", + "number_of_items": 0, + "number_of_children": 4, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 59, + "name": "Other", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 47, + "children": [] + }, + { + "id": 48, + "name": "Food Supplement", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 47, + "children": [ + { + "id": 49, + "name": "Weight Management", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 48, + "children": [] + }, + { + "id": 50, + "name": "Beauty Supplement", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 48, + "children": [] + }, + { + "id": 51, + "name": "Fitness", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 48, + "children": [] + } + ] + }, + { + "id": 52, + "name": "Medical Supplies", + "number_of_items": 0, + "number_of_children": 2, + "cover_image": null, + "parent_id": 47, + "children": [ + { + "id": 53, + "name": "Health Monitors & Tests", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 52, + "children": [] + }, + { + "id": 54, + "name": "Scale & Body Fat Analyzers", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 52, + "children": [] + } + ] + }, + { + "id": 55, + "name": "Personal Care", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 47, + "children": [ + { + "id": 56, + "name": "Eye Care", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 55, + "children": [] + }, + { + "id": 57, + "name": "Ear Care", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 55, + "children": [] + }, + { + "id": 58, + "name": "Oral Care", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 55, + "children": [] + } + ] + } + ] + }, + { + "id": 60, + "name": "Home Appliances", + "number_of_items": 0, + "number_of_children": 4, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 70, + "name": "Batteries", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 60, + "children": [] + }, + { + "id": 71, + "name": "Remote Controls", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 60, + "children": [] + }, + { + "id": 61, + "name": "TVs & Accessories", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 60, + "children": [ + { + "id": 62, + "name": "TVs", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 61, + "children": [] + }, + { + "id": 63, + "name": "TV Antennas", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 61, + "children": [] + }, + { + "id": 64, + "name": "TV Brackets", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 61, + "children": [] + } + ] + }, + { + "id": 65, + "name": "Kitchen Appliances", + "number_of_items": 0, + "number_of_children": 4, + "cover_image": null, + "parent_id": 60, + "children": [ + { + "id": 66, + "name": "Kettles", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 65, + "children": [] + }, + { + "id": 67, + "name": "Wine Fridges", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 65, + "children": [] + }, + { + "id": 68, + "name": "Coffee Machine & Accessories", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 65, + "children": [] + }, + { + "id": 69, + "name": "Mixers", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 65, + "children": [] + } + ] + } + ] + }, + { + "id": 72, + "name": "Mobile & Gadgets", + "number_of_items": 0, + "number_of_children": 5, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 73, + "name": "Sim Cards", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 72, + "children": [] + }, + { + "id": 74, + "name": "Tablets", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 72, + "children": [] + }, + { + "id": 75, + "name": "Mobiles Phones", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 72, + "children": [] + }, + { + "id": 76, + "name": "Wearable Devices", + "number_of_items": 0, + "number_of_children": 2, + "cover_image": null, + "parent_id": 72, + "children": [ + { + "id": 77, + "name": "VR Devices", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 76, + "children": [] + }, + { + "id": 78, + "name": "GPS Trackers", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 76, + "children": [] + } + ] + }, + { + "id": 79, + "name": "Accessories", + "number_of_items": 0, + "number_of_children": 5, + "cover_image": null, + "parent_id": 72, + "children": [ + { + "id": 80, + "name": "Mobile Flashes & Selfie Lights", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 79, + "children": [] + }, + { + "id": 81, + "name": "USB & Mobile Fans", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 79, + "children": [] + }, + { + "id": 82, + "name": "Phone Grips", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 79, + "children": [] + }, + { + "id": 83, + "name": "Memory Card", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 79, + "children": [] + }, + { + "id": 84, + "name": "Screen Protector", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 79, + "children": [] + } + ] + } + ] + }, + { + "id": 85, + "name": "Audio", + "number_of_items": 0, + "number_of_children": 5, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 86, + "name": "EarPhones, Headphones & Headsets", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 85, + "children": [] + }, + { + "id": 92, + "name": "Microphone", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 85, + "children": [] + }, + { + "id": 93, + "name": "Amplifiers & Mixers", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 85, + "children": [] + }, + { + "id": 87, + "name": "Media Player", + "number_of_items": 0, + "number_of_children": 4, + "cover_image": null, + "parent_id": 85, + "children": [ + { + "id": 88, + "name": "MP3 & MP4 Players", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 87, + "children": [] + }, + { + "id": 89, + "name": "CD, DVD, & Blu-ray Players", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 87, + "children": [] + }, + { + "id": 90, + "name": "Voice Recorders", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 87, + "children": [] + }, + { + "id": 91, + "name": "Radio & Cassette Players", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 87, + "children": [] + } + ] + }, + { + "id": 94, + "name": "Home Audio & Speakers", + "number_of_items": 0, + "number_of_children": 2, + "cover_image": null, + "parent_id": 85, + "children": [ + { + "id": 95, + "name": "Speakers", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 94, + "children": [] + }, + { + "id": 96, + "name": "AV Receivers", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 94, + "children": [] + } + ] + } + ] + }, + { + "id": 97, + "name": "Pets", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 98, + "name": "Pet Food", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 97, + "children": [ + { + "id": 99, + "name": "Dog Food", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 98, + "children": [] + }, + { + "id": 100, + "name": "Cat Food", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 98, + "children": [] + }, + { + "id": 101, + "name": "Bird feed", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 98, + "children": [] + } + ] + }, + { + "id": 102, + "name": "Pet Accessories", + "number_of_items": 0, + "number_of_children": 2, + "cover_image": null, + "parent_id": 97, + "children": [ + { + "id": 103, + "name": "Bowls & Feeders", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 102, + "children": [] + }, + { + "id": 104, + "name": "Leashes, Collars & Harnesses", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 102, + "children": [] + } + ] + }, + { + "id": 105, + "name": "Pet Clothing & Accessories", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 97, + "children": [ + { + "id": 106, + "name": "Pet Clothing", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 105, + "children": [] + }, + { + "id": 107, + "name": "Boots, Socks & Paw Protectors", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 105, + "children": [] + }, + { + "id": 108, + "name": "Hats", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 105, + "children": [] + } + ] + } + ] + }, + { + "id": 109, + "name": "Gaming & Consoles", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 114, + "name": "Console Accessories", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 109, + "children": [] + }, + { + "id": 110, + "name": "Console Machines", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 109, + "children": [ + { + "id": 111, + "name": "Playstation", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 110, + "children": [] + }, + { + "id": 112, + "name": "Xbox", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 110, + "children": [] + }, + { + "id": 113, + "name": "Nintendo DS", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 110, + "children": [] + } + ] + }, + { + "id": 115, + "name": "Video Games", + "number_of_items": 0, + "number_of_children": 4, + "cover_image": null, + "parent_id": 109, + "children": [ + { + "id": 116, + "name": "Playstation", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 115, + "children": [] + }, + { + "id": 117, + "name": "Xbox", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 115, + "children": [] + }, + { + "id": 118, + "name": "Nintendo DS", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 115, + "children": [] + }, + { + "id": 119, + "name": "PC Game", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 115, + "children": [] + } + ] + } + ] + }, + { + "id": 120, + "name": "Stationery", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 121, + "name": "Writing & Correction", + "number_of_items": 0, + "number_of_children": 4, + "cover_image": null, + "parent_id": 120, + "children": [ + { + "id": 122, + "name": "Pens & Inks", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 121, + "children": [] + }, + { + "id": 123, + "name": "Pencils", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 121, + "children": [] + }, + { + "id": 124, + "name": "Eraser & Correction Supplies", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 121, + "children": [] + }, + { + "id": 125, + "name": "Highlighters", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 121, + "children": [] + } + ] + }, + { + "id": 126, + "name": "School & Office Equipment", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 120, + "children": [ + { + "id": 127, + "name": "Calculator", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 126, + "children": [] + }, + { + "id": 128, + "name": "Clips, Pins & Tasks", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 126, + "children": [] + }, + { + "id": 129, + "name": "Rulers, Protractors & Stencils", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 126, + "children": [] + } + ] + }, + { + "id": 130, + "name": "Notebooks & Papers", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 120, + "children": [ + { + "id": 131, + "name": "Bookmarks", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 130, + "children": [] + }, + { + "id": 132, + "name": "Printing & Photocopy Paper", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 130, + "children": [] + }, + { + "id": 133, + "name": "Memo & Sticky Notes", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 130, + "children": [] + } + ] + } + ] + }, + { + "id": 134, + "name": "Computers & Accessories", + "number_of_items": 0, + "number_of_children": 6, + "cover_image": null, + "parent_id": null, + "children": [ + { + "id": 139, + "name": "Monitors", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 134, + "children": [] + }, + { + "id": 153, + "name": "Laptops", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 134, + "children": [] + }, + { + "id": 135, + "name": "Desktop Computers", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 134, + "children": [ + { + "id": 136, + "name": "Desktop PC", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 135, + "children": [] + }, + { + "id": 137, + "name": "Mini PC", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 135, + "children": [] + }, + { + "id": 138, + "name": "Server PC", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 135, + "children": [] + } + ] + }, + { + "id": 140, + "name": "Desktop & Laptop Components", + "number_of_items": 0, + "number_of_children": 5, + "cover_image": null, + "parent_id": 134, + "children": [ + { + "id": 141, + "name": "Fans & Heatsinks", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 140, + "children": [] + }, + { + "id": 142, + "name": "Processors", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 140, + "children": [] + }, + { + "id": 143, + "name": "Graphics Cards", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 140, + "children": [] + }, + { + "id": 144, + "name": "RAM", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 140, + "children": [] + }, + { + "id": 145, + "name": "PC Cases", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 140, + "children": [] + } + ] + }, + { + "id": 146, + "name": "Data Storage", + "number_of_items": 0, + "number_of_children": 3, + "cover_image": null, + "parent_id": 134, + "children": [ + { + "id": 147, + "name": "Hard Drives", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 146, + "children": [] + }, + { + "id": 148, + "name": "SSD", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 146, + "children": [] + }, + { + "id": 149, + "name": "Hard Disk Casing & Docking", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 146, + "children": [] + } + ] + }, + { + "id": 150, + "name": "Keyboards & Mice", + "number_of_items": 0, + "number_of_children": 2, + "cover_image": null, + "parent_id": 134, + "children": [ + { + "id": 151, + "name": "Mice", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 150, + "children": [] + }, + { + "id": 152, + "name": "Keyboards", + "number_of_items": 0, + "number_of_children": 0, + "cover_image": null, + "parent_id": 150, + "children": [] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/pages/buyer/cart.vue b/src/pages/buyer/cart.vue index 2b0a033..48a23e6 100644 --- a/src/pages/buyer/cart.vue +++ b/src/pages/buyer/cart.vue @@ -39,7 +39,6 @@ onMounted(async() => { const { data: cartData } = await CartRequest.getCart({ params: { limit: payget.limit, page: payget.page } }) loading.isLoading = false cart.result = cartData.data - cart.payget = cartData.data[0] }) // --------------------------------------------- diff --git a/src/pages/buyer/cart_nhap.vue b/src/pages/buyer/cart_nhap.vue index 2b0a033..ffa519d 100644 --- a/src/pages/buyer/cart_nhap.vue +++ b/src/pages/buyer/cart_nhap.vue @@ -38,8 +38,7 @@ onMounted(async() => { loading.isLoading = true const { data: cartData } = await CartRequest.getCart({ params: { limit: payget.limit, page: payget.page } }) loading.isLoading = false - cart.result = cartData.data - cart.payget = cartData.data[0] + cart.result = cartData }) // --------------------------------------------- diff --git a/src/pages/product/[product].vue b/src/pages/product/[product].vue index 216daa9..7a88dbe 100644 --- a/src/pages/product/[product].vue +++ b/src/pages/product/[product].vue @@ -13,7 +13,7 @@ import { handleError } from '~/helpers/error' import { handleDate } from '~/utils/date' import { productStatus } from '~/utils/status' import { getResources } from '~/utils/resources' -import { splitText } from '~/utils/textHandle' + import ShopRequest from '~/services/shop-request' import ProductRequest from '~/services/product-request' import AccountRequest from '~/services/account-request' diff --git a/src/pages/search/[keyword].vue b/src/pages/search/[keyword].vue index 78936c8..92771c2 100644 --- a/src/pages/search/[keyword].vue +++ b/src/pages/search/[keyword].vue @@ -48,7 +48,7 @@ const priceMax = ref(1000) const tags = reactive(['shopping', 'new_products', 'accessories', 'sales']) const regime = ref('grid') -const onChangeRegime = (type) => { +const onChangeRegime = (type: any) => { regime.value = String(type) } diff --git a/src/services/product-request.js b/src/services/product-request.js index 9581a3e..fa47059 100644 --- a/src/services/product-request.js +++ b/src/services/product-request.js @@ -41,8 +41,8 @@ class ProductRequest { return AxiosInstance.get(url) } - getCategoriesChildrenById(id) { - const url = `/products/categories/${id}/children` + getCategoriesChildrenById() { + const url = '/products/categories/tree' return AxiosInstance.get(url) } diff --git a/src/stores/cart.ts b/src/stores/cart.ts index f3a3932..09f92b8 100644 --- a/src/stores/cart.ts +++ b/src/stores/cart.ts @@ -3,8 +3,8 @@ import { ref } from 'vue' export const useCart = defineStore('cart', () => { const result = ref([]) - const payget = ref([]) - const product = ref([]) + // const payget = ref([]) + // const product = ref([]) const payload = ref([]) - return { result, payget, product, payload } + return { result, payload } }) From 437d9c5b24408eae457f165d064344e4e7195c95 Mon Sep 17 00:00:00 2001 From: thuongtruong1009 Date: Sun, 5 Jun 2022 00:32:03 +0700 Subject: [PATCH 2/5] fix model option choosen --- src/pages/product/[product].vue | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/pages/product/[product].vue b/src/pages/product/[product].vue index 7a88dbe..089d2a6 100644 --- a/src/pages/product/[product].vue +++ b/src/pages/product/[product].vue @@ -82,13 +82,24 @@ watchEffect(async() => { const minStock = Math.min(...valuesStock) productStock.value = `${minStock} - ${maxStock}` }) -function getModelStock(array, option) { +function getModelStock(array, outer, inner) { array.map((element) => { - if (JSON.stringify(element.variation_index) === JSON.stringify(option)) { - productStock.value = element.stock - productPrice.value = element.price - payloadCart.product_model_id = element.id + if (element.variation_index.length === 2) { + if (JSON.stringify(element.variation_index) === JSON.stringify([outer, inner])) { + productStock.value = element.stock + productPrice.value = element.price + payloadCart.product_model_id = element.id + } } + if (element.variation_index.length === 1) { + const option = [element.variation_index[0], element.variation_index[0]] + if (JSON.stringify(option) === JSON.stringify([outer, inner])) { + productStock.value = element.stock + productPrice.value = element.price + payloadCart.product_model_id = element.id + } + } + return '' }) } @@ -219,7 +230,7 @@ const onvisitShop = () => {
-

+

{{ option }}

From 0c667c1a9cb0c42d774c3291db6a58e58c25092c Mon Sep 17 00:00:00 2001 From: thuongtruong1009 Date: Sun, 5 Jun 2022 10:54:15 +0700 Subject: [PATCH 3/5] binding active color with choosen option --- src/data/order.json | 227 +++++++++++++++++++++++++++++ src/data/review.json | 34 +++++ src/pages/buyer/account/orders.vue | 8 +- src/pages/product/[product].vue | 12 +- src/utils/arrayHandle.ts | 3 +- 5 files changed, 277 insertions(+), 7 deletions(-) create mode 100644 src/data/order.json create mode 100644 src/data/review.json diff --git a/src/data/order.json b/src/data/order.json new file mode 100644 index 0000000..5105eec --- /dev/null +++ b/src/data/order.json @@ -0,0 +1,227 @@ +{ + "status": true, + "data": { + "current_page": 1, + "data": [ + { + "id": 1, + "name": "[\u2705SG Ready Stock] \ud83d\udd25 60\/80\/100x40\/50cm Nordic Study Table Laptop Home Office Desks Computer Modern Writing Table", + "variations": [ + "60x40cm Curve White" + ], + "quantity": 2, + "total": "45.8", + "grand_total": "45.8", + "created_at": "2022-06-04 07:14:57", + "user_id": 2, + "product_id": 4, + "product_model_id": null, + "received_address_id": 3, + "pickup_address_id": 5, + "status_id": 4, + "shop_id": 4, + "product": { + "id": 4, + "name": "[\u2705SG Ready Stock] \ud83d\udd25 Premium Foldable Baby High Chair\/ Feeding Chair\/ Low Chair\/ Adjustable Infant Toddlers Dining Seat", + "description": "Feature\\n1) Washable Food Tray Only\\n2) Washable PU Leather Seat Cover Only\\n3) Chair Colour ( Pink \/ Blue \/ Grey ) + Food Tray + Seat Cover + Wheel\\n4) Foldable for Space Saving\\n\ud83c\udf1fProduct Highlights\ud83c\udf1f\\n\ud83c\udd93\ud83c\udd93 Washable PU Leather Seat Cover\\n\ud83c\udd93\ud83c\udd93 Washable Dining Food Tray\\n\ud83c\udd93\ud83c\udd93 Multi-range Adjustment\\n\u2705 Adjustable Height\\n\u2705 Lightweight, Foldable & Portable\\n\u2705 Adjustable Safety belt included\\n\u2705 Suitable age start from 6 month to 5 years\\n\u2705 Sustain for baby weight up to 25kg\\n\u2705 Multipurpose adjustable dining chair\\n\u2705 Light weight for easy carrying\\n\u2705 Premium Material Surface - Easy to wipe clean\\n#haby #highchair # multifunction #foodtray #adjustable #safety #Premium #Baby #Singapore #Local", + "weight": "2500", + "avg_rating": "4", + "sold": 2, + "images": [ + "demo-5d428c67197abda913f95b5e29da189f" + ], + "videos": [], + "variations": [ + { + "name": "Colour", + "options": [ + "Blue", + "Pink" + ] + } + ], + "created_at": "2022-06-04 07:14:57", + "shop_id": 4, + "brand_id": 1, + "status_id": 1 + }, + "received_address": { + "id": 3, + "full_name": "User 02", + "phone": "0338620999", + "state": "XXX", + "city": "YYY", + "town": "ZZZ", + "address": "Address 01 of User 02", + "is_home": true + }, + "pickup_address": { + "id": 5, + "full_name": "Yasuo", + "phone": "0338623589", + "state": "Thu Duc", + "city": "TP.HCM", + "town": "Cat Lai", + "address": "286\/3", + "is_home": false + } + }, + { + "id": 2, + "name": "Canvas bag female Korean Bag New Ladies Messenger Bag Canvas Literary Solid Color Single Tote Bag College and Middle School", + "variations": [ + "White" + ], + "quantity": 1, + "total": "2.76", + "grand_total": "2.76", + "created_at": "2022-06-04 07:14:57", + "user_id": 2, + "product_id": 13, + "product_model_id": null, + "received_address_id": 3, + "pickup_address_id": 10, + "status_id": 4, + "shop_id": 9, + "product": { + "id": 13, + "name": "Blackdot GT Smart Watch Series 1 Waterproof With 60 Days Standby Battery, One Touch Control, App Notifications", + "description": "\u2705Blackdot GT Watch Series has arrived. #MOVESMART\\nAVAILABLE NOW | Grab your GT watches now from our store.\\nBlackdot GT Watch Series was launched on 26 April 2020. This multi-functional GT SmartWatch is compatible with iOS 9.0 and above, Android 4.4 and above.\\n\u2705Product Features:\\nControls: One Touch Control\\nWater Resistant: Yes(IP68) Not recommended during shower or swimming.\\nSupporting Devices: All Bluetooth Enabled Devices\\nAPP: WoFit(Available in Play Store & App Store)\\n\u2705Product Functions:\\nStep Count\\nHeart Rate Monitor\\nBlood Pressure Monitor\\nFitness Tracker(Running, Climbing, Cycling, Football, Rope)\\nSleep Monitor\\nStop Watch\\nAlarm Function\\nFind Device\\nNotifications: Yes(Whats.App, Face.book, Inst.agram, etc.)\\n\u2705Product Specifications:\\nColors Available: Black & Grey\\nDisplay:1.3 inches TFT\\nDisplay Color: Color\\nCamera: Not Available\\nStandby time: 60 Days\\nWorking Time: 18 Days\\nCertificate: CE ROHS FCC\\n\u2705What is inside the box:\\n1 x Smart Watch\\n1 x USB Charging Cable\\n1 x User Manual\\n\u2705Warranty\/Return Policy\\nBlackdot GT Smart Watch Series 1 has a warranty of 1 month. Physical damages caused by the user will not be considered for warranty or replacement. For replacement or refund, the item must be returned to us. You can visit our office or post the item back to us. We are 24\/7 available and feel free to contact us at any time.\\n\u00a9Blackdot Technologies Pte Ltd\\n#SmartWatch #Blackdot #FitnessTracker", + "weight": "200", + "avg_rating": "0", + "sold": 1, + "images": [ + "demo-fc8f0f0ee474d6c94b895b0ae19811a3", + "demo-c8602c9bc1c254b54767d4e5cea10629" + ], + "videos": [], + "variations": [ + { + "name": "Colour", + "options": [ + "Black", + "Grey" + ] + } + ], + "created_at": "2022-06-04 07:14:57", + "shop_id": 8, + "brand_id": 1, + "status_id": 1 + }, + "received_address": { + "id": 3, + "full_name": "User 02", + "phone": "0338620999", + "state": "XXX", + "city": "YYY", + "town": "ZZZ", + "address": "Address 01 of User 02", + "is_home": true + }, + "pickup_address": { + "id": 10, + "full_name": "Noctune", + "phone": "07642391875", + "state": "District 3", + "city": "TP.HCM", + "town": "Vo Thi Sau", + "address": "7\/4", + "is_home": false + } + }, + { + "id": 3, + "name": "novita Hot\/Cold Water Dispenser W28 - The WaterStation + Free Gift", + "variations": [ + "Arctic White", + "HydroNano\u2122" + ], + "quantity": 5, + "total": "8945", + "grand_total": "8945", + "created_at": "2022-06-04 07:14:57", + "user_id": 2, + "product_id": 19, + "product_model_id": null, + "received_address_id": 3, + "pickup_address_id": 13, + "status_id": 3, + "shop_id": 12, + "product": { + "id": 19, + "name": "Mysleep Hotel Grade 10\"inch \/ 10\"inch-26cm Imported Knitted Spring and Pocketed Spring Mattress | FREE&Next Day Delivery", + "description": "Is your current mattress affecting your Quality of Sleep? \ud83e\udd71\ud83d\ude2a\ud83d\ude34\\n\ud83e\uddd0 Are you looking for an affordable High-Quality Premium Hotel Grade Mattress? Good news!\\n\ud83e\udd73 We have sold and delivered over 1000 pcs of Mattress monthly to Our Happy Customers. Hit us up and we will recommend the most suitable mattress for your requirements.\\n\u2705 \ud835\uddd9\ud835\udde5\ud835\uddd8\ud835\uddd8 \ud835\udfee\ud835\ude05 \ud835\udde0\ud835\ude06\ud835\ude00\ud835\uddf9\ud835\uddf2\ud835\uddf2\ud835\uddfd \ud835\udfed\ud835\udfec\ud835\udfec% \ud835\udde6\ud835\ude06\ud835\uddfb\ud835\ude01\ud835\uddf5\ud835\uddf2\ud835\ude01\ud835\uddf6\ud835\uddf0 \ud835\udddf\ud835\uddee\ud835\ude01\ud835\uddf2\ud835\ude05 \ud835\udde3\ud835\uddf6\ud835\uddf9\ud835\uddf9\ud835\uddfc\ud835\ude04 (\ud835\uddea\ud835\uddfc\ud835\uddff\ud835\ude01\ud835\uddf5 $\ud835\udff4\ud835\udfec) \ud835\ude04\ud835\uddf6\ud835\ude01\ud835\uddf5 \ud835\uddee \ud835\uddfa\ud835\uddf6\ud835\uddfb. \ud835\ude00\ud835\uddfd\ud835\uddf2\ud835\uddfb\ud835\uddf1\ud835\uddf6\ud835\uddfb\ud835\uddf4 \ud835\uddfc\ud835\uddf3 $\ud835\udff2\ud835\udfec\ud835\udfec\\n\u2705 \ud835\uddd9\ud835\udde5\ud835\uddd8\ud835\uddd8 \ud835\uddd7\ud835\uddf2\ud835\uddf9\ud835\uddf6\ud835\ude03\ud835\uddf2\ud835\uddff\ud835\ude06\\nVisit us at any of our outlets islandwide and test our mattress today:\\n\ud83d\udccd \ud835\udddd\ud835\ude02\ud835\uddff\ud835\uddfc\ud835\uddfb\ud835\uddf4 \ud835\udde2\ud835\ude02\ud835\ude01\ud835\uddf9\ud835\uddf2\ud835\ude01 (The Furniture Mall)\\nLocation: 10 Toh Guan Road, #01-29 The Furniture Mall S(608838)\\n\u2705 PK - 8250 4068 (English & Malay)\\n\u2705 Annie - 8269 7642 (Chinese & Malay)\\n\u23f0 Mon-Sat (From 11.30am-8pm) | Sun&PH (From 11.30am-7pm)\\n------\\n\ud83d\udccd \ud835\udde8\ud835\uddef\ud835\uddf6 \ud835\udde2\ud835\ude02\ud835\ude01\ud835\uddf9\ud835\uddf2\ud835\ude01 (\ud835\udde2\ud835\ude05\ud835\uddf9\ud835\uddf2\ud835\ude06 \ud835\uddd5\ud835\uddf6\ud835\ude07\ud835\udddb\ud835\ude02\ud835\uddef)\\nLocation: 71 Ubi Road 1, #10-39 Oxley BizHub S(408732)\\n\u2705 Samantha - 9001 9891 (Chinese & English)\\n\u2705 Kelvin - 8750 0475 (English & Chinese)\\n\u23f0 Mon-Sat (From 11am-8pm) | Sun&PH (From 11am-6pm)\\n--------\\n\ud83d\udccd \ud835\udde6\ud835\uddf2\ud835\uddfa\ud835\uddef\ud835\uddee\ud835\ude04\ud835\uddee\ud835\uddfb\ud835\uddf4 \ud835\udde2\ud835\ude02\ud835\ude01\ud835\uddf9\ud835\uddf2\ud835\ude01 \/ \ud835\uddea\ud835\uddee\ud835\uddff\ud835\uddf2\ud835\uddf5\ud835\uddfc\ud835\ude02\ud835\ude00\ud835\uddf2 (\ud835\udde1\ud835\uddfc\ud835\uddff\ud835\ude01\ud835\uddf5 \ud835\udddf\ud835\uddf6\ud835\uddfb\ud835\uddf8 \ud835\uddd5\ud835\ude02\ud835\uddf6\ud835\uddf9\ud835\uddf1\ud835\uddf6\ud835\uddfb\ud835\uddf4)\\nLocation: 10 Admiralty Street, #05-89 North Link Building S(757695)\\n\u2705 Agnes - 8398 3878 (Chinese & Malay)\\n\u2705 Joey - 8816 8562 (English & Malay)\\n\u23f0 Mon-Sat (From 9am-6pm) | Sun&PH (From 11am-6pm)\\n--------\\n*Policy*\\n1. You are required to inspect the Product for any defects when you take delivery of it.\\n2. Except as otherwise expressly provided herein, we shall not accept the return of a Product that has been delivered\\nunless it is with our prior written consent and agreement. Only a return authorised by us will be accepted and\\nour acceptance of any return of a Product shall be subject to such terms and conditions as we may prescribe at our sole and absolute discretion.\\n3. Cost of transportation to and from the dealer is to be bear by the purchaser of this invoice & the transportation and\\nservice charge will be from $70 onwards. Except as otherwise expressly provided herein, we shall not accept the return of a Product that has been delivered unless it is with our prior written consent and agreement. Only a return authorized\\nby us will be accepted and our acceptance of any return of a Product shall be subject to such terms and conditions as\\nwe may prescribe at our sole and absolute discretion.\\n(Warranty covered on spring unit only)\\n\u2013 This mattress has been manufactured under strict quality control and is guaranteed against any defects as a result of normal use within 10 years for Bonnell Spring and 12 years for Pocketed Spring from the date of purchase.\\n\u2013 The material covering this mattress is not covered by this guarantee and damage caused by accident, misuse or\\ntampered is also not covered by this warranty.", + "weight": "15000", + "avg_rating": "0", + "sold": 0, + "images": [ + "demo-7a63c042a894d3d27724d5901d75befb", + "demo-713b8696e36d70a5e243b4cbb9830db6" + ], + "videos": [], + "variations": [ + { + "name": "Hotel Series", + "options": [ + "Single 10\" Spring", + "S.Single 10\" Spring" + ] + } + ], + "created_at": "2022-06-04 07:14:57", + "shop_id": 11, + "brand_id": 1, + "status_id": 1 + }, + "received_address": { + "id": 3, + "full_name": "User 02", + "phone": "0338620999", + "state": "XXX", + "city": "YYY", + "town": "ZZZ", + "address": "Address 01 of User 02", + "is_home": true + }, + "pickup_address": { + "id": 13, + "full_name": "Jinx", + "phone": "0916407555", + "state": "District 5", + "city": "TP.HCM", + "town": "Ward 5", + "address": "12\/07", + "is_home": true + } + } + ], + "first_page_url": "http:\/\/tp-o.tk\/api\/v2\/user\/orders?page=1", + "from": 1, + "last_page": 1, + "last_page_url": "http:\/\/tp-o.tk\/api\/v2\/user\/orders?page=1", + "links": [ + { + "url": null, + "label": "« Previous", + "active": false + }, + { + "url": "http:\/\/tp-o.tk\/api\/v2\/user\/orders?page=1", + "label": "1", + "active": true + }, + { + "url": null, + "label": "Next »", + "active": false + } + ], + "next_page_url": null, + "path": "http:\/\/tp-o.tk\/api\/v2\/user\/orders", + "per_page": "10", + "prev_page_url": null, + "to": 3, + "total": 3 + } +} \ No newline at end of file diff --git a/src/data/review.json b/src/data/review.json new file mode 100644 index 0000000..a08329e --- /dev/null +++ b/src/data/review.json @@ -0,0 +1,34 @@ +{ + "status": true, + "data": { + "current_page": 1, + "data": [], + "first_page_url": "http:\/\/tp-o.tk\/api\/v2\/products\/5\/reviews?page=1", + "from": null, + "last_page": 1, + "last_page_url": "http:\/\/tp-o.tk\/api\/v2\/products\/5\/reviews?page=1", + "links": [ + { + "url": null, + "label": "« Previous", + "active": false + }, + { + "url": "http:\/\/tp-o.tk\/api\/v2\/products\/5\/reviews?page=1", + "label": "1", + "active": true + }, + { + "url": null, + "label": "Next »", + "active": false + } + ], + "next_page_url": null, + "path": "http:\/\/tp-o.tk\/api\/v2\/products\/5\/reviews", + "per_page": "10", + "prev_page_url": null, + "to": null, + "total": 0 + } +} \ No newline at end of file diff --git a/src/pages/buyer/account/orders.vue b/src/pages/buyer/account/orders.vue index e780bc9..8356718 100644 --- a/src/pages/buyer/account/orders.vue +++ b/src/pages/buyer/account/orders.vue @@ -31,7 +31,7 @@ const payload = reactive({ }) watch(async() => { loading.isLoading = true - const { data: orderData } = await OrderRequest.getOrders({ params: { limit: payload.limit} }) + const { data: orderData } = await OrderRequest.getOrders({ params: { limit: payload.limit } }) loading.isLoading = false user.order = orderData order.payget = orderData.data @@ -55,6 +55,7 @@ watch(async() => { {{ t('account.order-name') }} {{ t('account.order-date') }} {{ t('account.order-status') }} + Quantity {{ t('account.order-total') }} {{ t('account.order-action') }} @@ -68,6 +69,7 @@ watch(async() => { {{ orderStatus(item.status_id) }} {{ item.quantity }} ${{ item.total }} + Download @@ -79,8 +81,8 @@ watch(async() => { thead > tr, tbody > tr:not(:last-child){ border-bottom: 1px solid #e9e9e9; } -th:not(:last-child), td:not(:last-child){ +th, td{ border-right: 1px solid #e9e9e9; - padding: 0.75rem 0; + padding: 0.75rem; } diff --git a/src/pages/product/[product].vue b/src/pages/product/[product].vue index 089d2a6..d7d37ff 100644 --- a/src/pages/product/[product].vue +++ b/src/pages/product/[product].vue @@ -12,6 +12,7 @@ import { useSeller } from '~/stores/seller' import { handleError } from '~/helpers/error' import { handleDate } from '~/utils/date' import { productStatus } from '~/utils/status' +import { equalArray } from '~/utils/arrayHandle' import { getResources } from '~/utils/resources' import ShopRequest from '~/services/shop-request' @@ -35,6 +36,7 @@ const productResponseData = ref([]) const productPrice = ref() const productStock = ref() const productImg = ref('') +const productReview = ref([]) onMounted(async() => { if (!localStorage.getItem('token')) { router.push({ path: '/buyer/login' }) } @@ -45,7 +47,8 @@ onMounted(async() => { productResponseData.value = productData productImg.value = productData.images - const { data: reviewData } = await getReviewsProductsById(product.productRequestID, { params: { limit: 10 } }) + const { data: reviewData } = await ProductRequest.getReviewsProductsById(product.productRequestID, { params: { limit: 10 } }) + productReview.value = reviewData } }) @@ -66,6 +69,7 @@ const handleAdd = async() => { useToast.updateToast('success', 'You cart items has been updated!', true) } // ------------------------------------------ +const isChoossen = ref() watchEffect(async() => { // get price min-max const valuesPrice = productResponseData.value.models.map(i => i.price) @@ -84,6 +88,7 @@ watchEffect(async() => { }) function getModelStock(array, outer, inner) { array.map((element) => { + isChoossen.value = [outer, inner] if (element.variation_index.length === 2) { if (JSON.stringify(element.variation_index) === JSON.stringify([outer, inner])) { productStock.value = element.stock @@ -230,7 +235,7 @@ const onvisitShop = () => {
-

+

{{ option }}

@@ -443,7 +448,8 @@ const onvisitShop = () => { border-radius: 0.3rem; padding: 0 0.5rem; } -.infor .box-type:hover{ +.infor .box-type:hover, +.infor .box-type.active{ color: #EE4D2D; border-color: #EE4D2D; background: #FFF5F1; diff --git a/src/utils/arrayHandle.ts b/src/utils/arrayHandle.ts index 9edff17..4322da0 100644 --- a/src/utils/arrayHandle.ts +++ b/src/utils/arrayHandle.ts @@ -5,5 +5,6 @@ const removeItemByIndex = (array: Array, item: any, length: number) => { return array } +const equalArray = (array1: Array, array2: Array) => JSON.stringify(array1) === JSON.stringify(array2) -export { removeItemByIndex } +export { removeItemByIndex, equalArray } From 2138363154079c40d22b71efe5ce15500547d468 Mon Sep 17 00:00:00 2001 From: thuongtruong1009 Date: Sun, 5 Jun 2022 11:19:12 +0700 Subject: [PATCH 4/5] logic check validate form before authentication --- src/pages/buyer/login.vue | 10 ++++++++-- src/pages/buyer/register.vue | 8 +++++++- src/pages/product/[product].vue | 6 ++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/pages/buyer/login.vue b/src/pages/buyer/login.vue index 9d7d6b2..51fb09c 100644 --- a/src/pages/buyer/login.vue +++ b/src/pages/buyer/login.vue @@ -31,6 +31,12 @@ const payload = reactive({ password: '', }) +const isEntrance = ref(false) +watchEffect(() => { + if (payload.usernameOrEmail.length > 0 && payload.password.length > 0) + isEntrance.value = true +}) + const handleSubmit = (e) => { e.preventDefault() loading.isLoading = true @@ -64,7 +70,7 @@ const handleSubmit = (e) => {
{{ t('auth.b-oauth') }} - + - diff --git a/src/pages/buyer/register.vue b/src/pages/buyer/register.vue index c3054ba..447afee 100644 --- a/src/pages/buyer/register.vue +++ b/src/pages/buyer/register.vue @@ -27,6 +27,12 @@ const payload = reactive({ password_confirmation: '', }) +const isEntrance = ref(false) +watchEffect(() => { + if (payload.username.length > 0 && payload.email.length > 0 && payload.password.length > 0 && payload.password_confirmation.length > 0 && payload.password === payload.password_confirmation) + isEntrance.value = true +}) + const handleSubmit = async(e) => { e.preventDefault() loading.isLoading = true @@ -81,7 +87,7 @@ const handleSubmit = async(e) => {
-

diff --git a/src/pages/product/[product].vue b/src/pages/product/[product].vue index d7d37ff..d912d09 100644 --- a/src/pages/product/[product].vue +++ b/src/pages/product/[product].vue @@ -14,7 +14,6 @@ import { handleDate } from '~/utils/date' import { productStatus } from '~/utils/status' import { equalArray } from '~/utils/arrayHandle' import { getResources } from '~/utils/resources' - import ShopRequest from '~/services/shop-request' import ProductRequest from '~/services/product-request' import AccountRequest from '~/services/account-request' @@ -90,7 +89,7 @@ function getModelStock(array, outer, inner) { array.map((element) => { isChoossen.value = [outer, inner] if (element.variation_index.length === 2) { - if (JSON.stringify(element.variation_index) === JSON.stringify([outer, inner])) { + if (equalArray(element.variation_index, [outer, inner])) { productStock.value = element.stock productPrice.value = element.price payloadCart.product_model_id = element.id @@ -98,13 +97,12 @@ function getModelStock(array, outer, inner) { } if (element.variation_index.length === 1) { const option = [element.variation_index[0], element.variation_index[0]] - if (JSON.stringify(option) === JSON.stringify([outer, inner])) { + if (equalArray(option, [outer, inner])) { productStock.value = element.stock productPrice.value = element.price payloadCart.product_model_id = element.id } } - return '' }) } From 2170b39e01f36b0a6efbf76868aa3f6bd5818e17 Mon Sep 17 00:00:00 2001 From: thuongtruong1009 Date: Sun, 5 Jun 2022 11:23:27 +0700 Subject: [PATCH 5/5] check avatar profile link --- src/pages/buyer/account/dashboard.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/buyer/account/dashboard.vue b/src/pages/buyer/account/dashboard.vue index 88e3be3..51d923e 100644 --- a/src/pages/buyer/account/dashboard.vue +++ b/src/pages/buyer/account/dashboard.vue @@ -147,7 +147,7 @@ const signOut = async() => {

-