diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-16 20:27:14 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-16 20:27:14 -0400 |
| commit | 7eb327b13bd9ee241f47f22ba1c3db3c90e8e942 (patch) | |
| tree | 0a47937e7e0785ff7f4cd925193ed385ade97567 /StoneIsland/www/js/lib/products/ProductView.js | |
| parent | 14b92bdc7fb69a5751a7e029537e910cb7345262 (diff) | |
populate collectionview and productview
Diffstat (limited to 'StoneIsland/www/js/lib/products/ProductView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/products/ProductView.js | 156 |
1 files changed, 155 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js index 3c18338e..a98f3ca4 100644 --- a/StoneIsland/www/js/lib/products/ProductView.js +++ b/StoneIsland/www/js/lib/products/ProductView.js @@ -1,15 +1,169 @@ +var SIZE_LOOKUP = { + "XS": "X-SMALL", + "S": "SMALL", + "M": "MEDIUM", + "L": "LARGE", + "XL": "X-LARGE", + "XXL": "XX-LARGE", + "XXXL": "XXX-LARGE", +}; + var ProductView = View.extend({ el: "#product", events: { + "click .left": "prev", + "click .right": "next", + "touchstart .gallery": "touchstart", + "touchmove .gallery": "touchmove", + "touchend .gallery": "touchend", + "click .size": "select_size", + "click .color": "select_color", + "click .share": "share", }, initialize: function(){ + this.$num = this.$(".num") + this.$title = this.$(".title") + this.$type = this.$(".type") + this.$price = this.$(".price") + this.$size = this.$(".size") + this.$color = this.$(".color") + this.$body = this.$(".body") }, show: function(){ document.body.className = "product" }, + + load: function(data){ + // + this.item = data + + var name_partz = data['ModelNames'].split(' ') + var num = name_partz.shift() + var title = name_parts.join(' ') + var size = data['Sizes'][0] + var type = data['MicroCategory'].toUpperCase() + var price = "$" + data['DiscountedPrice'] + ".00" + var color = SIZE_LOOKUP[ data['Colors'][0]['Text'] ] + var body = "" + + this.$num.html(num) + this.$title.html(title) + this.$type.html(type) + this.$price.html(price) + this.$size.html(size) + this.$color.html(color) + this.$body.html(body) + }, + + select_size: function(){ + }, + select_color: function(){ + }, + share: function(){ + }, + + prev: function(){ + }, + next: function(){ + }, + touchstart: function(e){ + }, + touchmove: function(e){ + }, + end: function(e){ + }, + +}) + + +/* + +{ + "Code8": "41504876", + "BrandName": "STONE ISLAND", + "DefaultCode10": "41504876MA", + "MicroCategory": "Jacket", + "MacroCategory": "COATS & JACKETS", + "FullPrice": 728, + "DiscountedPrice": 437, + "PriceListId": 155702498, + "ModelNames": "41764 FLOWING CAMO WATRO", + "Sizes": [ + { + "Id": 4, + "Text": "S", + "ClassFamily": "INT", + "Labeled": true + }, + { + "Id": 6, + "Text": "L", + "ClassFamily": "INT", + "Labeled": true + }, + { + "Id": 7, + "Text": "XL", + "ClassFamily": "INT", + "Labeled": true + }, + { + "Id": 8, + "Text": "XXL", + "ClassFamily": "INT", + "Labeled": true + } + ], + "Colors": [ + { + "Id": 3152, + "Code10": { + "Id": 6769575, + "Value": "41504876MA" + }, + "Description": "Green", + "MacroColorId": 3152, + "Rgb": "3C941F" + } + ], + "SizeTypeId": 928, + "HasFlipSide": false, + "SeasonOfSale": "PE15", + "SalesLineId": "126", + "SalesLine": "18_STONE ISLAND", + "MarketId": 19, + "Criteria": { + "Sizes": [ + "3", + "5", + "6", + "7" + ], + "Looks": [], + "Styles": [], + "WashTypes": [], + "WashStories": [], + "WashCodes": [], + "Waists": [], + "Fabrics": [], + "ColorTypes": [], + "ModelNames": [], + "Material": [] + }, + "NoveltyPoints": 0, + "C10Attributes": [ + { + "Key": "MFC", + "Value": "621541764CC-6215-64V0050", + "C10": "41504876MA" + } + ], + "MacroCategoryId": 224, + "MicroCategoryId": 1319 +}, -})
\ No newline at end of file +*/
\ No newline at end of file |
