From 5bc375d3247e0c4a3d5ae266306e7fd924a1f4e0 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Tue, 19 Dec 2017 14:28:19 +0100 Subject: [PATCH] list items with images --- client/item/routes.json | 6 +++- client/item/src/list/item-product.html | 14 ++++++++ client/item/src/list/item-product.js | 8 +++++ client/item/src/list/list.js | 2 ++ client/item/src/list/style.css | 16 +++++++++ services/item/common/methods/item/filter.js | 2 +- services/item/common/models/item.json | 9 +++++ services/nginx/static/images/icon_item.png | Bin 0 -> 3006 bytes services/nginx/static/images/icon_item.svg | 37 -------------------- 9 files changed, 55 insertions(+), 39 deletions(-) create mode 100644 client/item/src/list/item-product.html create mode 100644 client/item/src/list/item-product.js create mode 100644 client/item/src/list/style.css create mode 100644 services/nginx/static/images/icon_item.png delete mode 100644 services/nginx/static/images/icon_item.svg diff --git a/client/item/routes.json b/client/item/routes.json index 803a8cce8..014dc318d 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -1,7 +1,7 @@ { "module": "item", "name": "Items", - "icon": "/static/images/icon_item.svg", + "icon": "/static/images/icon_item.png", "routes": [ { "url": "/item", @@ -17,6 +17,10 @@ "url": "/create", "state": "item.create", "component": "vn-item-create" + }, { + "url": "/data", + "state": "item.data", + "component": "vn-item-data" } ] } \ No newline at end of file diff --git a/client/item/src/list/item-product.html b/client/item/src/list/item-product.html new file mode 100644 index 000000000..6368f1f95 --- /dev/null +++ b/client/item/src/list/item-product.html @@ -0,0 +1,14 @@ + + + + + + +
{{$ctrl.item.name}}
+
Id: {{$ctrl.item.id}}
+
Category: {{$ctrl.item.category}}
+
Description: {{$ctrl.item.description}}
+
Size: {{$ctrl.item.size}}
+
+
+
diff --git a/client/item/src/list/item-product.js b/client/item/src/list/item-product.js new file mode 100644 index 000000000..4f7c7b4e7 --- /dev/null +++ b/client/item/src/list/item-product.js @@ -0,0 +1,8 @@ +import ngModule from '../module'; + +ngModule.component('vnItemProduct', { + template: require('./item-product.html'), + bindings: { + item: '<' + } +}); diff --git a/client/item/src/list/list.js b/client/item/src/list/list.js index ce4d773fa..db48692d8 100644 --- a/client/item/src/list/list.js +++ b/client/item/src/list/list.js @@ -1,4 +1,6 @@ import ngModule from '../module'; +import './item-product'; +import './style.css'; class ItemList { constructor() { diff --git a/client/item/src/list/style.css b/client/item/src/list/style.css new file mode 100644 index 000000000..f6afaff66 --- /dev/null +++ b/client/item/src/list/style.css @@ -0,0 +1,16 @@ +vn-item-product { + display: block; +} +vn-item-product a { + display: block; + text-decoration: none; + color: inherit; +} +vn-item-product a:hover { + color: white; + background-color: #424242; +} + +.vn-item-product-name { + font-family: vn-font-bold; +} diff --git a/services/item/common/methods/item/filter.js b/services/item/common/methods/item/filter.js index 59be28565..c60c2222b 100644 --- a/services/item/common/methods/item/filter.js +++ b/services/item/common/methods/item/filter.js @@ -6,7 +6,7 @@ module.exports = Self => { where: {}, skip: (params.page - 1) * params.size, limit: params.size, - order: params.order || 'name ASC'/* , + order: params.order || 'relevancy DESC'/* , include: { relation: "greugeType", scope: { diff --git a/services/item/common/models/item.json b/services/item/common/models/item.json index 8479e2217..0ccbb2e4c 100644 --- a/services/item/common/models/item.json +++ b/services/item/common/models/item.json @@ -30,6 +30,15 @@ }, "isBargain": { "type": "Boolean" + }, + "comment": { + "type": "String" + }, + "relevancy": { + "type": "Number" + }, + "image": { + "type": "String" } } } \ No newline at end of file diff --git a/services/nginx/static/images/icon_item.png b/services/nginx/static/images/icon_item.png new file mode 100644 index 0000000000000000000000000000000000000000..ff660fb23ebae0b5957a21cad994edba30698650 GIT binary patch literal 3006 zcmV;v3qkaWP)jiu-93@4;NfA*)dmY9&)-VK0)P_$cK~hxL_AbXuDY0$rTPZIspYd@ z0C*smIp?8ca#bNEUG|WdnT=lWQVK=z-4+ z$FGSn+lCf!MFJlN3z*XElF2nuUA3Yxf=R5W0M?$LgEg0Dx+*6fbYie7=R}OI552%H zK6XwnQK!egq3fA^=wiy2OX{K2-~y!{S~YZmP0pWHgf$-N_=?FDp03Ia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