Showing
2 changed files
with
56 additions
and
56 deletions
@@ -2255,62 +2255,62 @@ $countPerPage.click(function() { | @@ -2255,62 +2255,62 @@ $countPerPage.click(function() { | ||
2255 | }); | 2255 | }); |
2256 | }); | 2256 | }); |
2257 | define("js/product/latest-walk", ["jquery","handlebars","source-map","lazyload"], function(require, exports, module){ | 2257 | define("js/product/latest-walk", ["jquery","handlebars","source-map","lazyload"], function(require, exports, module){ |
2258 | -/** | ||
2259 | - * 最近浏览取接口渲染模板 | ||
2260 | - * @author: xuqi<qi.xu@yoho.cn> | ||
2261 | - 8 @date: 2016/1/20 | ||
2262 | - */ | ||
2263 | - | ||
2264 | -var $ = require("jquery"); | ||
2265 | -var Handlebars = require("handlebars"); | ||
2266 | -var lazyLoad = require("lazyload"); | ||
2267 | - | ||
2268 | -var $latestWalkCount = $('#latest-walk-count'); | ||
2269 | - | ||
2270 | -(function() { | ||
2271 | - var tpl; | ||
2272 | - | ||
2273 | - if ($latestWalkCount.lenght < 0) { | ||
2274 | - return; | ||
2275 | - } | ||
2276 | - | ||
2277 | - tpl = Handlebars.compile($('#latest-walk-tpl').html()); | ||
2278 | - | ||
2279 | - $.ajax({ | ||
2280 | - url: 'http://itemapi.yohobuy.com/item/item/recentreview', | ||
2281 | - dataType: 'jsonp', | ||
2282 | - data: { | ||
2283 | - limit: $latestWalkCount.val() | ||
2284 | - }, | ||
2285 | - success: function(data) { | ||
2286 | - var latestWalk = [], | ||
2287 | - res, i, cur; | ||
2288 | - | ||
2289 | - if (data.code === 200) { | ||
2290 | - res = data.data; | ||
2291 | - | ||
2292 | - for (i = 0; i < res.length; i++) { | ||
2293 | - cur = res[i]; | ||
2294 | - | ||
2295 | - latestWalk.push({ | ||
2296 | - href: cur.url, | ||
2297 | - img: cur.pic_url, | ||
2298 | - name: cur.product_name, | ||
2299 | - salePrice: cur.price, | ||
2300 | - marketPrice: cur.market_price | ||
2301 | - }); | ||
2302 | - } | ||
2303 | - | ||
2304 | - if (latestWalk.length > 0) { | ||
2305 | - $('#latest-walk-goods').html(tpl({ | ||
2306 | - latestWalk: latestWalk | ||
2307 | - })); | ||
2308 | - | ||
2309 | - lazyLoad($('#latest-walk-goods .lazy')); | ||
2310 | - } | ||
2311 | - } | ||
2312 | - } | ||
2313 | - }); | 2258 | +/** |
2259 | + * 最近浏览取接口渲染模板 | ||
2260 | + * @author: xuqi<qi.xu@yoho.cn> | ||
2261 | + 8 @date: 2016/1/20 | ||
2262 | + */ | ||
2263 | + | ||
2264 | +var $ = require("jquery"); | ||
2265 | +var Handlebars = require("handlebars"); | ||
2266 | +var lazyLoad = require("lazyload"); | ||
2267 | + | ||
2268 | +var $latestWalkCount = $('#latest-walk-count'); | ||
2269 | + | ||
2270 | +(function() { | ||
2271 | + var tpl; | ||
2272 | + | ||
2273 | + if ($latestWalkCount.length < 0) { | ||
2274 | + return; | ||
2275 | + } | ||
2276 | + | ||
2277 | + tpl = Handlebars.compile($('#latest-walk-tpl').html()); | ||
2278 | + | ||
2279 | + $.ajax({ | ||
2280 | + url: 'http://itemapi.yohobuy.com/item/item/recentreview', | ||
2281 | + dataType: 'jsonp', | ||
2282 | + data: { | ||
2283 | + limit: $latestWalkCount.val() | ||
2284 | + }, | ||
2285 | + success: function(data) { | ||
2286 | + var latestWalk = [], | ||
2287 | + res, i, cur; | ||
2288 | + | ||
2289 | + if (data.code === 200) { | ||
2290 | + res = data.data; | ||
2291 | + | ||
2292 | + for (i = 0; i < res.length; i++) { | ||
2293 | + cur = res[i]; | ||
2294 | + | ||
2295 | + latestWalk.push({ | ||
2296 | + href: cur.url, | ||
2297 | + img: cur.pic_url, | ||
2298 | + name: cur.product_name, | ||
2299 | + salePrice: cur.price, | ||
2300 | + marketPrice: cur.market_price | ||
2301 | + }); | ||
2302 | + } | ||
2303 | + | ||
2304 | + if (latestWalk.length > 0) { | ||
2305 | + $('#latest-walk-goods').html(tpl({ | ||
2306 | + latestWalk: latestWalk | ||
2307 | + })); | ||
2308 | + | ||
2309 | + lazyLoad($('#latest-walk-goods .lazy')); | ||
2310 | + } | ||
2311 | + } | ||
2312 | + } | ||
2313 | + }); | ||
2314 | }()); | 2314 | }()); |
2315 | }); | 2315 | }); |
2316 | define("js/product/product", ["jquery","lazyload"], function(require, exports, module){ | 2316 | define("js/product/product", ["jquery","lazyload"], function(require, exports, module){ |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment