diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-17 22:19:52 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-17 22:19:52 -0400 |
| commit | 4e62771a27bdb318ace378eff31a9c6eb67cfd8d (patch) | |
| tree | 308342220d6499d68b12c96aef7b49e4e68beaa5 /StoneIsland/platforms | |
| parent | 7d35fbd21d4f31132ae62a07c1863db5d0325cb2 (diff) | |
build
Diffstat (limited to 'StoneIsland/platforms')
8 files changed, 182 insertions, 38 deletions
diff --git a/StoneIsland/platforms/ios/www/index.html b/StoneIsland/platforms/ios/www/index.html index 86ad6d52..2cbe762b 100644 --- a/StoneIsland/platforms/ios/www/index.html +++ b/StoneIsland/platforms/ios/www/index.html @@ -143,10 +143,16 @@ <div id="product"> <div class="scroll"> - <span class="left"></span> - <span class="right"></span> - <div class="gallery"> - <img src=""> + <div id="gallery"> + <span class="left"></span> + <span class="right"></span> + <div class="slider"> + <script type="text/html" class="template"> + <div class="item"> + <img src="{{image}}"> + </div> + </script> + </div> </div> <div class="content"> <h2><b class="num"></b><span class="title"></h2> @@ -167,6 +173,9 @@ <div id="selector"> <span class="close"></span> <div class="options"> + <script type="text/html" class="template"> + <span data-id="{{id}}">{{value}}</span> + </script> </div> </div> @@ -175,14 +184,13 @@ <span class="close"> <div class="login_ask">LOGIN</div> <div class="signup_ask">SIGNUP</div> - <div> - <input type="text" name="username" placeholder="USERNAME / EMAIL"> - <input type="text" name="password" placeholder="PASSWORD"> + <form> + <input type="email" name="email" placeholder="EMAIL" required> + <input type="password" name="password" placeholder="PASSWORD" required> <span class="submit">SIGN IN</span> - </div> + </form> </div> - - + <div id="cart"> <h1>YOUR CART / <span class="itemcount">2 ITEMS</h1> @@ -357,6 +365,7 @@ <script src="js/lib/products/CollectionView.js"></script> <script src="js/lib/products/ProductView.js"></script> +<script src="js/lib/products/GalleryView.js"></script> <script src="js/lib/products/Selector.js"></script> <script src="js/lib/blogs/BlogView.js"></script> diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js index f958f716..5d741492 100644 --- a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js @@ -6,6 +6,9 @@ var CartView = View.extend({ }, initialize: function(){ + this.summary = new CartSummary () + this.billing = new CartBilling () + this.shipping = new CartShipping () }, show: function(){ diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js b/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js index 15c6425f..76126102 100644 --- a/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js +++ b/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js @@ -3,9 +3,28 @@ var FooterView = View.extend({ el: "#footer", events: { + "click .filter": "filter", + "click .buynow": "buynow", + "click .addtocart": "addtocart", + "click .cancel": "cancel", + "click .checkout": "checkout", + "click .checkout_proceed": "checkout_proceed", }, initialize: function(){ }, + + filter: function(){ + }, + buynow: function(){ + }, + addtocart: function(){ + }, + cancel: function(){ + }, + checkout: function(){ + }, + checkout_proceed: function(){ + }, })
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js b/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js index 0f30db3d..de534e32 100644 --- a/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js +++ b/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js @@ -3,17 +3,53 @@ var LoginView = View.extend({ el: "#login", events: { + "click .close": "hide", + "click .login_ask": "login", + "click .signup_ask": "signup", + "submit form": "submit", }, + mode: null, + initialize: function(){ + this.$form = this.$("form") + this.$email = this.$("[name=email]") + this.$password = this.$("[name=password]") }, show: function(){ + this.$form.hide() + this.$email.val("") + this.$password.val("") document.body.classList.add("login") }, hide: function(){ document.body.classList.remove("login") }, + + login: function(){ + this.mode = "login" + this.$form.show() + }, + + signup: function(){ + this.mode = "signup" + this.$form.show() + }, + + submit: function(e){ + e.preventDefault() + if (this.mode == "login") { + // login api + } + else { + // signup api + } + }, + + success: function(){ + // change login in ui to logout or whatever + }, })
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/products/GalleryView.js b/StoneIsland/platforms/ios/www/js/lib/products/GalleryView.js new file mode 100644 index 00000000..2eabe2a6 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/products/GalleryView.js @@ -0,0 +1,33 @@ +var GalleryView = View.extend({ + + el: "#gallery", + + events: { + "click .left": "prev", + "click .right": "next", + "touchstart .gallery": "touchstart", + "touchmove .gallery": "touchmove", + "touchend .gallery": "touchend", + }, + + initialize: function(){ + this.$prev = this.$(".prev") + this.$next = this.$(".next") + this.$slider = this.$(".slider") + }, + + populate: function(){ + }, + + prev: function(){ + }, + next: function(){ + }, + touchstart: function(e){ + }, + touchmove: function(e){ + }, + touchend: function(e){ + }, + +})
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js index a98f3ca4..e87fa398 100644 --- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js @@ -13,17 +13,14 @@ 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", + "click .size": "select_size", + "click .color": "select_color", + "click .share": "share", }, initialize: function(){ + this.gallery = new GalleryView () + this.$num = this.$(".num") this.$title = this.$(".title") this.$type = this.$(".type") @@ -36,47 +33,75 @@ var ProductView = View.extend({ show: function(){ document.body.className = "product" }, + hide: function(){ + }, + + item: null, + size: null, + color: null, + code: null, 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 size = data['Sizes'][0] + var size_label = SIZE_LOOKUP[size] + var color = data['Colors'][0] + var color_label = color['Text'] var body = "" + this.item = data + this.color = color + this.size = size + this.code = data['DefaultCode10'] + this.$num.html(num) this.$title.html(title) this.$type.html(type) this.$price.html(price) - this.$size.html(size) + this.$size.html(size_label) this.$color.html(color) this.$body.html(body) + + // TODO: fetch product from item API, get other Code10s so you can populate the gallery }, select_size: function(){ + if (this.item['Sizes'].length == 0) { return } + var mapped_sizes = this.item['Sizes'].map(function(size){ + return { + id: size['Id'], + label: SIZE_LOOKUP[ size['Text'] ], + value: size, + } + }) + app.selector.select(mapped_sizes, function(size){ + this.size = size.value + this.$size.html(size.label) + }.bind(this)) }, + select_color: function(){ + if (this.item['Colors'].length == 0) { return } + var mapped_colors = this.item['Colors'].map(function(color){ + return { + id: color['Id'], + label: color['Text'], + value: color, + } + }) + app.selector.select(mapped_colors, function(color){ + this.color = color.value + this.$color.html(color.label) + }.bind(this)) }, + share: function(){ }, - prev: function(){ - }, - next: function(){ - }, - touchstart: function(e){ - }, - touchmove: function(e){ - }, - end: function(e){ - }, - }) diff --git a/StoneIsland/platforms/ios/www/js/lib/products/Selector.js b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js index c81aa121..1580624b 100644 --- a/StoneIsland/platforms/ios/www/js/lib/products/Selector.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js @@ -1,6 +1,7 @@ var Selector = View.extend({ el: "#selector", + template: $("#selector .template").html(), events: { "click .close": "hide", @@ -8,17 +9,34 @@ var Selector = View.extend({ }, initialize: function(){ + this.$options = this.$(".options") }, + lookup: null, + callback: null, select: function(options, callback){ + var lookup = this.lookup = {} + this.$options.empty() + options.forEach(function(opt){ + lookup[opt.id] = opt + var t = this.template.replace(/{{id}}/, opt.id) + .replace(/{{label}}/, opt.label) + this.$options.append(t) + }) + this.$el.show() }, hide: function(){ + this.lookup = this.callback = null + this.$el.hide() }, pick: function(e){ - var el = $(e.currentTarget) - + var $option = $(e.currentTarget) + var id = $option.data("id") + var selection = this.lookup[id] + this.callback( selection ) + this.hide() }, })
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/sdk/sdk.js b/StoneIsland/platforms/ios/www/js/sdk/sdk.js index c34188a8..893d3fae 100644 --- a/StoneIsland/platforms/ios/www/js/sdk/sdk.js +++ b/StoneIsland/platforms/ios/www/js/sdk/sdk.js @@ -1,7 +1,8 @@ var sdk = (function(){ var sdk = {} - var endpoint = "https://secure.api.yoox.biz/" + // var endpoint = "https://secure.api.yoox.biz/" + var endpoint = "https://sandbox.api.yoox.biz/" sdk.path = function(api, path){ return endpoint + api + "/STONEISLAND_US/" + path |
