Showing
2 changed files
with
70 additions
and
139 deletions
@@ -3226,9 +3226,10 @@ require("js/product/newsale/newarrival"); | @@ -3226,9 +3226,10 @@ require("js/product/newsale/newarrival"); | ||
3226 | require("js/product/newsale/discount"); | 3226 | require("js/product/newsale/discount"); |
3227 | require("js/product/list"); | 3227 | require("js/product/list"); |
3228 | require("js/product/detail/detail"); | 3228 | require("js/product/detail/detail"); |
3229 | -require("js/product/detail/loadmore"); | ||
3230 | require("js/product/detail/consultform"); | 3229 | require("js/product/detail/consultform"); |
3231 | require("js/product/newsale/hot-rank"); | 3230 | require("js/product/newsale/hot-rank"); |
3231 | + | ||
3232 | + | ||
3232 | }); | 3233 | }); |
3233 | define("js/product/newsale/newarrival", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ | 3234 | define("js/product/newsale/newarrival", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ |
3234 | /** | 3235 | /** |
@@ -4734,6 +4735,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), | @@ -4734,6 +4735,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), | ||
4734 | 4735 | ||
4735 | require("js/product/detail/desc"); | 4736 | require("js/product/detail/desc"); |
4736 | require("js/product/detail/comments-consults"); | 4737 | require("js/product/detail/comments-consults"); |
4738 | +require("js/product/recommend-for-you-product-desc"); | ||
4737 | 4739 | ||
4738 | //add extra marign-bottom for footer to show the yoho copyright | 4740 | //add extra marign-bottom for footer to show the yoho copyright |
4739 | function showFooter() { | 4741 | function showFooter() { |
@@ -4810,13 +4812,14 @@ var introUrl = $('#introUrl').val(), | @@ -4810,13 +4812,14 @@ var introUrl = $('#introUrl').val(), | ||
4810 | var sizeSwiper, | 4812 | var sizeSwiper, |
4811 | refSwiper; | 4813 | refSwiper; |
4812 | 4814 | ||
4813 | -require("js/product/recommend-for-you"); | ||
4814 | - | ||
4815 | //判断是否要显示向左滑动提示 | 4815 | //判断是否要显示向左滑动提示 |
4816 | function hiddenTips($ele) { | 4816 | function hiddenTips($ele) { |
4817 | + var offsetContainer, | ||
4818 | + offsetLastColumn; | ||
4819 | + | ||
4817 | if ($ele.length > 0) { | 4820 | if ($ele.length > 0) { |
4818 | - var offsetContainer = $ele[0].getBoundingClientRect().right; | ||
4819 | - var offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right; | 4821 | + offsetContainer = $ele[0].getBoundingClientRect().right; |
4822 | + offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right; | ||
4820 | 4823 | ||
4821 | 4824 | ||
4822 | if (offsetLastColumn - offsetContainer < 0) { | 4825 | if (offsetLastColumn - offsetContainer < 0) { |
@@ -4884,35 +4887,6 @@ $(window).scroll(function() { | @@ -4884,35 +4887,6 @@ $(window).scroll(function() { | ||
4884 | 4887 | ||
4885 | 4888 | ||
4886 | }); | 4889 | }); |
4887 | -define("js/product/recommend-for-you", ["swiper","jquery","index"], function(require, exports, module){ | ||
4888 | -/** | ||
4889 | - * 为您优选 | ||
4890 | - * @author: bikai<kai.bi@yoho.cn> | ||
4891 | - * @date: 2015/11/16 | ||
4892 | - */ | ||
4893 | - | ||
4894 | - | ||
4895 | -var Swiper = require("swiper"), | ||
4896 | - $ = require("jquery"); | ||
4897 | - | ||
4898 | -var recommendSwiper, | ||
4899 | - $recommendForYou = $('.recommend-for-you'); | ||
4900 | - | ||
4901 | -$.get('/home/preference').then(function(html) { | ||
4902 | - $recommendForYou.html(html).show(); | ||
4903 | - if ($('#swiper-recommend').length) { | ||
4904 | - recommendSwiper = new Swiper('#swiper-recommend', { | ||
4905 | - slidesPerView: 'auto', | ||
4906 | - grabCursor: true, | ||
4907 | - slideElement: 'a', | ||
4908 | - lazyLoading: true, | ||
4909 | - watchSlidesVisibility: true | ||
4910 | - }); | ||
4911 | - } | ||
4912 | -}).fail(function() { | ||
4913 | - $recommendForYou.hide(); | ||
4914 | -}); | ||
4915 | -}); | ||
4916 | define("js/product/detail/comments-consults", ["jquery"], function(require, exports, module){ | 4890 | define("js/product/detail/comments-consults", ["jquery"], function(require, exports, module){ |
4917 | /** | 4891 | /** |
4918 | * 商品详情 --评论和咨询tab | 4892 | * 商品详情 --评论和咨询tab |
@@ -4968,6 +4942,39 @@ $('#nav-tab li').on('touchend', function() { | @@ -4968,6 +4942,39 @@ $('#nav-tab li').on('touchend', function() { | ||
4968 | } | 4942 | } |
4969 | }); | 4943 | }); |
4970 | }); | 4944 | }); |
4945 | +define("js/product/recommend-for-you-product-desc", ["swiper","jquery","index"], function(require, exports, module){ | ||
4946 | +/** | ||
4947 | + * 为您优选 | ||
4948 | + * @author: liangzhifeng<zhifeng.liang@yoho.cn> | ||
4949 | + * @date: 2015/11/16 | ||
4950 | + */ | ||
4951 | + | ||
4952 | + | ||
4953 | +var Swiper = require("swiper"), | ||
4954 | + $ = require("jquery"); | ||
4955 | + | ||
4956 | +var recommendSwiper, | ||
4957 | + $recommendForYou = $('.recommend-for-you'), | ||
4958 | + preferenceUrl = $('#preferenceUrl').val(); | ||
4959 | + | ||
4960 | +if (preferenceUrl) { | ||
4961 | + $.get(preferenceUrl).then(function(html) { | ||
4962 | + $recommendForYou.html(html).show(); | ||
4963 | + if ($('#swiper-recommend').length) { | ||
4964 | + recommendSwiper = new Swiper('#swiper-recommend', { | ||
4965 | + slidesPerView: 'auto', | ||
4966 | + grabCursor: true, | ||
4967 | + slideElement: 'a', | ||
4968 | + lazyLoading: true, | ||
4969 | + watchSlidesVisibility: true | ||
4970 | + }); | ||
4971 | + } | ||
4972 | + }).fail(function() { | ||
4973 | + $recommendForYou.hide(); | ||
4974 | + }); | ||
4975 | +} | ||
4976 | + | ||
4977 | +}); | ||
4971 | define("js/product/detail/like", ["jquery","hammer"], function(require, exports, module){ | 4978 | define("js/product/detail/like", ["jquery","hammer"], function(require, exports, module){ |
4972 | /** | 4979 | /** |
4973 | * 商品详情 --添加收藏 | 4980 | * 商品详情 --添加收藏 |
@@ -5048,111 +5055,6 @@ addToCartHammer.on('tap', function(e) { | @@ -5048,111 +5055,6 @@ addToCartHammer.on('tap', function(e) { | ||
5048 | 5055 | ||
5049 | 5056 | ||
5050 | }); | 5057 | }); |
5051 | -define("js/product/detail/loadmore", [], function(require, exports, module){ | ||
5052 | -/** | ||
5053 | - * 商品详情 --滚动页面加载 | ||
5054 | - * @author: Lynnic | ||
5055 | - * @date: 2015/11/25 | ||
5056 | - */ | ||
5057 | - | ||
5058 | -// var $ = require('jquery'), | ||
5059 | -// loading = require('../../plugin/loading'), | ||
5060 | -// tip = require('../../plugin/tip'); | ||
5061 | - | ||
5062 | -// var loadMoreUrl = $('#loadMoreUrl').val(), | ||
5063 | -// $commentsDiv = $('#goods-comments'), | ||
5064 | -// $consultsDiv = $('#goods-consults'), | ||
5065 | -// winH = $(window).height(), | ||
5066 | -// searching = false, | ||
5067 | -// end = false; | ||
5068 | - | ||
5069 | -// var jsonObj; | ||
5070 | - | ||
5071 | -// //插入评论列表底部 | ||
5072 | -// function insertCommentsDiv(json) { | ||
5073 | -// var html = ''; | ||
5074 | -// var i; | ||
5075 | - | ||
5076 | - | ||
5077 | -// for (i = 0; i < json.length; i++) { | ||
5078 | -// html += '<div class="comment-item">'; | ||
5079 | -// html += '<span class="user-name">' + json[i].userName + '</span>'; | ||
5080 | -// html += '<span class="goods-spec">' + json[i].desc + '</span>'; | ||
5081 | -// html += '<span class="goods-spec">' + json[i].content + '</span>'; | ||
5082 | -// html += '<span class="goods-spec">' + json[i].time + '</span>'; | ||
5083 | -// } | ||
5084 | -// $commentsDiv.append(html); | ||
5085 | -// } | ||
5086 | - | ||
5087 | -// //插入咨询列表底部 | ||
5088 | -// function insertConsultsDiv(json) { | ||
5089 | -// var html = ''; | ||
5090 | -// var i; | ||
5091 | - | ||
5092 | - | ||
5093 | -// for (i = 0; i < json.length; i++) { | ||
5094 | -// html += '<div class="consult-item"> '; | ||
5095 | -// html += '<div class="question"> '; | ||
5096 | -// html += '<span class="iconfont"></span> '; | ||
5097 | -// html += '<p> '; | ||
5098 | -// html += json[i].question + '<br> '; | ||
5099 | -// html += '<span class="time">' + json[i].time + '</span> '; | ||
5100 | -// html += '</p> '; | ||
5101 | -// html += '</div> '; | ||
5102 | - | ||
5103 | -// html += '<div class="answer"> '; | ||
5104 | -// html += '<span class="iconfont"></span> '; | ||
5105 | -// html += '<p>' + json[i].answer + '</p> '; | ||
5106 | -// html += '</div> '; | ||
5107 | -// html += '</div> '; | ||
5108 | -// } | ||
5109 | -// $consultsDiv.append(html); | ||
5110 | -// } | ||
5111 | - | ||
5112 | -// function search() { | ||
5113 | -// if (searching || end) { | ||
5114 | -// return; | ||
5115 | -// } | ||
5116 | -// searching = true; | ||
5117 | - | ||
5118 | -// loading.showLoadingMask(); | ||
5119 | - | ||
5120 | -// $.ajax({ | ||
5121 | -// type: 'GET', | ||
5122 | -// url: loadMoreUrl, | ||
5123 | -// success: function(data) { | ||
5124 | -// if (data.length > 0) { | ||
5125 | -// jsonObj = JSON.parse(data); | ||
5126 | -// if ($commentsDiv.length > 0) { | ||
5127 | -// insertCommentsDiv(jsonObj); | ||
5128 | -// } else if ($consultsDiv.length > 0) { | ||
5129 | -// insertConsultsDiv(jsonObj); | ||
5130 | -// } | ||
5131 | -// } | ||
5132 | -// searching = false; | ||
5133 | -// end = true; | ||
5134 | -// loading.hideLoadingMask(); | ||
5135 | -// }, | ||
5136 | -// error: function() { | ||
5137 | -// tip.show('网络断开连接了~'); | ||
5138 | -// searching = false; | ||
5139 | -// loading.hideLoadingMask(); | ||
5140 | -// } | ||
5141 | -// }); | ||
5142 | -// } | ||
5143 | - | ||
5144 | - | ||
5145 | -// function scrollHandler() { | ||
5146 | -// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) { | ||
5147 | -// search(); | ||
5148 | -// } | ||
5149 | -// } | ||
5150 | - | ||
5151 | -// //srcoll to load more | ||
5152 | -// $(window).scroll(function() { | ||
5153 | -// window.requestAnimationFrame(scrollHandler); | ||
5154 | -// }); | ||
5155 | -}); | ||
5156 | define("js/product/detail/consultform", ["jquery"], function(require, exports, module){ | 5058 | define("js/product/detail/consultform", ["jquery"], function(require, exports, module){ |
5157 | /** | 5059 | /** |
5158 | * 我要咨询提交页面 | 5060 | * 我要咨询提交页面 |
@@ -7090,6 +6992,35 @@ $('.yoho-page').on('touchstart', '.list-item, .type-item', function() { | @@ -7090,6 +6992,35 @@ $('.yoho-page').on('touchstart', '.list-item, .type-item', function() { | ||
7090 | }); | 6992 | }); |
7091 | 6993 | ||
7092 | }); | 6994 | }); |
6995 | +define("js/product/recommend-for-you", ["swiper","jquery","index"], function(require, exports, module){ | ||
6996 | +/** | ||
6997 | + * 为您优选 | ||
6998 | + * @author: bikai<kai.bi@yoho.cn> | ||
6999 | + * @date: 2015/11/16 | ||
7000 | + */ | ||
7001 | + | ||
7002 | + | ||
7003 | +var Swiper = require("swiper"), | ||
7004 | + $ = require("jquery"); | ||
7005 | + | ||
7006 | +var recommendSwiper, | ||
7007 | + $recommendForYou = $('.recommend-for-you'); | ||
7008 | + | ||
7009 | +$.get('/home/preference').then(function(html) { | ||
7010 | + $recommendForYou.html(html).show(); | ||
7011 | + if ($('#swiper-recommend').length) { | ||
7012 | + recommendSwiper = new Swiper('#swiper-recommend', { | ||
7013 | + slidesPerView: 'auto', | ||
7014 | + grabCursor: true, | ||
7015 | + slideElement: 'a', | ||
7016 | + lazyLoading: true, | ||
7017 | + watchSlidesVisibility: true | ||
7018 | + }); | ||
7019 | + } | ||
7020 | +}).fail(function() { | ||
7021 | + $recommendForYou.hide(); | ||
7022 | +}); | ||
7023 | +}); | ||
7093 | define("js/me/coupons", ["jquery","hammer","mlellipsis"], function(require, exports, module){ | 7024 | define("js/me/coupons", ["jquery","hammer","mlellipsis"], function(require, exports, module){ |
7094 | var $ = require("jquery"), | 7025 | var $ = require("jquery"), |
7095 | Hammer = require("hammer"), | 7026 | Hammer = require("hammer"), |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment