do merge develop code to fixes some bugs
Showing
6 changed files
with
369 additions
and
34 deletions
@@ -3188,9 +3188,10 @@ require("js/product/newsale/newarrival"); | @@ -3188,9 +3188,10 @@ require("js/product/newsale/newarrival"); | ||
3188 | require("js/product/newsale/discount"); | 3188 | require("js/product/newsale/discount"); |
3189 | require("js/product/list"); | 3189 | require("js/product/list"); |
3190 | require("js/product/detail/detail"); | 3190 | require("js/product/detail/detail"); |
3191 | -require("js/product/detail/desc"); | 3191 | +require("js/product/detail/loadmore"); |
3192 | +require("js/product/detail/consultform"); | ||
3192 | }); | 3193 | }); |
3193 | -define("js/product/newsale/newarrival", ["jquery","swiper","lazyload","index"], function(require, exports, module){ | 3194 | +define("js/product/newsale/newarrival", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ |
3194 | /** | 3195 | /** |
3195 | * 新品到着 | 3196 | * 新品到着 |
3196 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> | 3197 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> |
@@ -3578,7 +3579,7 @@ $listNav.on('touchstart', 'li', function(e) { | @@ -3578,7 +3579,7 @@ $listNav.on('touchstart', 'li', function(e) { | ||
3578 | }); | 3579 | }); |
3579 | 3580 | ||
3580 | }); | 3581 | }); |
3581 | -define("js/plugin/filter", ["jquery"], function(require, exports, module){ | 3582 | +define("js/plugin/filter", ["jquery","hammer"], function(require, exports, module){ |
3582 | /** | 3583 | /** |
3583 | * 筛选JS | 3584 | * 筛选JS |
3584 | * 暴露三个接口:注册回调、显示filter、隐藏filter | 3585 | * 暴露三个接口:注册回调、显示filter、隐藏filter |
@@ -3586,9 +3587,8 @@ define("js/plugin/filter", ["jquery"], function(require, exports, module){ | @@ -3586,9 +3587,8 @@ define("js/plugin/filter", ["jquery"], function(require, exports, module){ | ||
3586 | * @date: 2015/10/19 | 3587 | * @date: 2015/10/19 |
3587 | */ | 3588 | */ |
3588 | 3589 | ||
3589 | -var $ = require("jquery"); | ||
3590 | - | ||
3591 | -// Hammer = require('yoho.hammer'); | 3590 | +var $ = require("jquery"), |
3591 | + Hammer = require("hammer"); | ||
3592 | 3592 | ||
3593 | var $filter; | 3593 | var $filter; |
3594 | 3594 | ||
@@ -3694,8 +3694,7 @@ function subClassifyTapEvt($this) { | @@ -3694,8 +3694,7 @@ function subClassifyTapEvt($this) { | ||
3694 | 3694 | ||
3695 | //初始化筛选 | 3695 | //初始化筛选 |
3696 | function initFilter(opt) { | 3696 | function initFilter(opt) { |
3697 | - | ||
3698 | - // var filterHammer; | 3697 | + var filterHammer; |
3699 | 3698 | ||
3700 | //注册回调 | 3699 | //注册回调 |
3701 | fCbFn = opt.fCbFn; | 3700 | fCbFn = opt.fCbFn; |
@@ -3708,8 +3707,8 @@ function initFilter(opt) { | @@ -3708,8 +3707,8 @@ function initFilter(opt) { | ||
3708 | 3707 | ||
3709 | $filter = $('.filter-mask'); | 3708 | $filter = $('.filter-mask'); |
3710 | 3709 | ||
3711 | - // filterHammer = new Hammer($filter[0]); | ||
3712 | - $filter.on('touchend', function(e) { | 3710 | + filterHammer = new Hammer($filter[0]); |
3711 | + filterHammer.on('tap', function(e) { | ||
3713 | var $this = $(e.target), | 3712 | var $this = $(e.target), |
3714 | $cur; | 3713 | $cur; |
3715 | 3714 | ||
@@ -3728,7 +3727,7 @@ function initFilter(opt) { | @@ -3728,7 +3727,7 @@ function initFilter(opt) { | ||
3728 | //tap classify | 3727 | //tap classify |
3729 | $cur = $this.closest('.classify-item'); | 3728 | $cur = $this.closest('.classify-item'); |
3730 | 3729 | ||
3731 | - e.stopPropagation(); | 3730 | + e.srcEvent.stopPropagation(); |
3732 | 3731 | ||
3733 | classifyTapEvt($cur); | 3732 | classifyTapEvt($cur); |
3734 | } | 3733 | } |
@@ -3765,6 +3764,7 @@ exports.showFilter = showFilter; | @@ -3765,6 +3764,7 @@ exports.showFilter = showFilter; | ||
3765 | exports.hideFilter = hideFilter; | 3764 | exports.hideFilter = hideFilter; |
3766 | 3765 | ||
3767 | exports.resetFilter = resetFilter; | 3766 | exports.resetFilter = resetFilter; |
3767 | + | ||
3768 | }); | 3768 | }); |
3769 | define("js/product/extract-url", [], function(require, exports, module){ | 3769 | define("js/product/extract-url", [], function(require, exports, module){ |
3770 | /** | 3770 | /** |
@@ -3833,7 +3833,7 @@ $.ajax({ | @@ -3833,7 +3833,7 @@ $.ajax({ | ||
3833 | } | 3833 | } |
3834 | }); | 3834 | }); |
3835 | }); | 3835 | }); |
3836 | -define("js/product/newsale/discount", ["jquery","swiper","lazyload","index"], function(require, exports, module){ | 3836 | +define("js/product/newsale/discount", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ |
3837 | /** | 3837 | /** |
3838 | * 商品列表页 | 3838 | * 商品列表页 |
3839 | * @author: xuqi<qi.xu@yoho.cn> | 3839 | * @author: xuqi<qi.xu@yoho.cn> |
@@ -4709,7 +4709,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { | @@ -4709,7 +4709,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { | ||
4709 | } | 4709 | } |
4710 | 4710 | ||
4711 | //goods-discount下拉按钮点击事件 | 4711 | //goods-discount下拉按钮点击事件 |
4712 | -$('.goodsDiscount .dropdown').on('click', function() { | 4712 | +$('.goodsDiscount .dropdown').on('touchend', function(e) { |
4713 | if ($discountFolder.is(':hidden')) { | 4713 | if ($discountFolder.is(':hidden')) { |
4714 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); | 4714 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); |
4715 | $discountFolder.slideDown(); | 4715 | $discountFolder.slideDown(); |
@@ -4717,6 +4717,8 @@ $('.goodsDiscount .dropdown').on('click', function() { | @@ -4717,6 +4717,8 @@ $('.goodsDiscount .dropdown').on('click', function() { | ||
4717 | $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); | 4717 | $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); |
4718 | $discountFolder.slideUp(); | 4718 | $discountFolder.slideUp(); |
4719 | } | 4719 | } |
4720 | + | ||
4721 | + return false; | ||
4720 | }); | 4722 | }); |
4721 | require("js/product/detail/like"); | 4723 | require("js/product/detail/like"); |
4722 | 4724 | ||
@@ -4912,10 +4914,9 @@ var $ = require("jquery"), | @@ -4912,10 +4914,9 @@ var $ = require("jquery"), | ||
4912 | Hammer = require("hammer"), | 4914 | Hammer = require("hammer"), |
4913 | tip = require("js/plugin/tip"); | 4915 | tip = require("js/plugin/tip"); |
4914 | 4916 | ||
4915 | -var likeHammer = new Hammer(document.getElementById('likeBtn')); | ||
4916 | -var addToCartHammer = new Hammer(document.getElementById('addtoCart')); | ||
4917 | - | ||
4918 | -var productId = $('#productId').val(); | 4917 | +var likeHammer = new Hammer(document.getElementById('likeBtn')), |
4918 | + addToCartHammer = new Hammer(document.getElementById('addtoCart')), | ||
4919 | + productId = $('#productId').val(); | ||
4919 | 4920 | ||
4920 | likeHammer.on('tap', function(e) { | 4921 | likeHammer.on('tap', function(e) { |
4921 | var opt, | 4922 | var opt, |
@@ -4981,6 +4982,190 @@ addToCartHammer.on('tap', function(e) { | @@ -4981,6 +4982,190 @@ addToCartHammer.on('tap', function(e) { | ||
4981 | 4982 | ||
4982 | 4983 | ||
4983 | }); | 4984 | }); |
4985 | +define("js/product/detail/loadmore", [], function(require, exports, module){ | ||
4986 | +/** | ||
4987 | + * 商品详情 --滚动页面加载 | ||
4988 | + * @author: Lynnic | ||
4989 | + * @date: 2015/11/25 | ||
4990 | + */ | ||
4991 | + | ||
4992 | +// var $ = require('jquery'), | ||
4993 | +// loading = require('../../plugin/loading'), | ||
4994 | +// tip = require('../../plugin/tip'); | ||
4995 | + | ||
4996 | +// var loadMoreUrl = $('#loadMoreUrl').val(), | ||
4997 | +// $commentsDiv = $('#goods-comments'), | ||
4998 | +// $consultsDiv = $('#goods-consults'), | ||
4999 | +// winH = $(window).height(), | ||
5000 | +// searching = false, | ||
5001 | +// end = false; | ||
5002 | + | ||
5003 | +// var jsonObj; | ||
5004 | + | ||
5005 | +// //插入评论列表底部 | ||
5006 | +// function insertCommentsDiv(json) { | ||
5007 | +// var html = ''; | ||
5008 | +// var i; | ||
5009 | + | ||
5010 | + | ||
5011 | +// for (i = 0; i < json.length; i++) { | ||
5012 | +// html += '<div class="comment-item">'; | ||
5013 | +// html += '<span class="user-name">' + json[i].userName + '</span>'; | ||
5014 | +// html += '<span class="goods-spec">' + json[i].desc + '</span>'; | ||
5015 | +// html += '<span class="goods-spec">' + json[i].content + '</span>'; | ||
5016 | +// html += '<span class="goods-spec">' + json[i].time + '</span>'; | ||
5017 | +// } | ||
5018 | +// $commentsDiv.append(html); | ||
5019 | +// } | ||
5020 | + | ||
5021 | +// //插入咨询列表底部 | ||
5022 | +// function insertConsultsDiv(json) { | ||
5023 | +// var html = ''; | ||
5024 | +// var i; | ||
5025 | + | ||
5026 | + | ||
5027 | +// for (i = 0; i < json.length; i++) { | ||
5028 | +// html += '<div class="consult-item"> '; | ||
5029 | +// html += '<div class="question"> '; | ||
5030 | +// html += '<span class="iconfont"></span> '; | ||
5031 | +// html += '<p> '; | ||
5032 | +// html += json[i].question + '<br> '; | ||
5033 | +// html += '<span class="time">' + json[i].time + '</span> '; | ||
5034 | +// html += '</p> '; | ||
5035 | +// html += '</div> '; | ||
5036 | + | ||
5037 | +// html += '<div class="answer"> '; | ||
5038 | +// html += '<span class="iconfont"></span> '; | ||
5039 | +// html += '<p>' + json[i].answer + '</p> '; | ||
5040 | +// html += '</div> '; | ||
5041 | +// html += '</div> '; | ||
5042 | +// } | ||
5043 | +// $consultsDiv.append(html); | ||
5044 | +// } | ||
5045 | + | ||
5046 | +// function search() { | ||
5047 | +// if (searching || end) { | ||
5048 | +// return; | ||
5049 | +// } | ||
5050 | +// searching = true; | ||
5051 | + | ||
5052 | +// loading.showLoadingMask(); | ||
5053 | + | ||
5054 | +// $.ajax({ | ||
5055 | +// type: 'GET', | ||
5056 | +// url: loadMoreUrl, | ||
5057 | +// success: function(data) { | ||
5058 | +// if (data.length > 0) { | ||
5059 | +// jsonObj = JSON.parse(data); | ||
5060 | +// if ($commentsDiv.length > 0) { | ||
5061 | +// insertCommentsDiv(jsonObj); | ||
5062 | +// } else if ($consultsDiv.length > 0) { | ||
5063 | +// insertConsultsDiv(jsonObj); | ||
5064 | +// } | ||
5065 | +// } | ||
5066 | +// searching = false; | ||
5067 | +// end = true; | ||
5068 | +// loading.hideLoadingMask(); | ||
5069 | +// }, | ||
5070 | +// error: function() { | ||
5071 | +// tip.show('网络断开连接了~'); | ||
5072 | +// searching = false; | ||
5073 | +// loading.hideLoadingMask(); | ||
5074 | +// } | ||
5075 | +// }); | ||
5076 | +// } | ||
5077 | + | ||
5078 | + | ||
5079 | +// function scrollHandler() { | ||
5080 | +// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) { | ||
5081 | +// search(); | ||
5082 | +// } | ||
5083 | +// } | ||
5084 | + | ||
5085 | +// //srcoll to load more | ||
5086 | +// $(window).scroll(function() { | ||
5087 | +// window.requestAnimationFrame(scrollHandler); | ||
5088 | +// }); | ||
5089 | +}); | ||
5090 | +define("js/product/detail/consultform", ["jquery"], function(require, exports, module){ | ||
5091 | +/** | ||
5092 | + * 我要咨询提交页面 | ||
5093 | + * @author: liangzhifeng<zhifeng.liang@yoho.cn> | ||
5094 | + * @date: 2015/12/01 | ||
5095 | + */ | ||
5096 | +var $ = require("jquery"), | ||
5097 | + tip = require("js/plugin/tip"), | ||
5098 | + loading = require("js/plugin/loading"); | ||
5099 | + | ||
5100 | +var $consultForm = $('.consult-form'), | ||
5101 | + $submit = $('#submit'), | ||
5102 | + $content = $('#content'), | ||
5103 | + productId = $('#product_id').val(), | ||
5104 | + isSubmiting; | ||
5105 | + | ||
5106 | +$submit.on('touchend', function() { | ||
5107 | + $content.blur(); | ||
5108 | + $consultForm.submit(); | ||
5109 | + return false; | ||
5110 | +}).on('touchstart', function() { | ||
5111 | + $(this).addClass('highlight'); | ||
5112 | +}).on('touchend touchcancel', function() { | ||
5113 | + $(this).removeClass('highlight'); | ||
5114 | +}); | ||
5115 | + | ||
5116 | +$content.on('focus', function() { | ||
5117 | + if ($content.val() === '请输入咨询内容') { | ||
5118 | + $content.val(''); | ||
5119 | + } | ||
5120 | +}).on('blur', function() { | ||
5121 | + if ($content.val() === '') { | ||
5122 | + $content.val('请输入咨询内容'); | ||
5123 | + } | ||
5124 | +}); | ||
5125 | + | ||
5126 | +// 提交表单请求 | ||
5127 | +$consultForm.on('submit', function() { | ||
5128 | + var content; | ||
5129 | + | ||
5130 | + if (isSubmiting) { | ||
5131 | + return false; | ||
5132 | + } | ||
5133 | + | ||
5134 | + // 简单的表单校验 | ||
5135 | + content = $content.val(); | ||
5136 | + if (!content || content === '请输入咨询内容') { | ||
5137 | + tip.show('咨询内容不能为空'); | ||
5138 | + return false; | ||
5139 | + } | ||
5140 | + | ||
5141 | + isSubmiting = true; | ||
5142 | + loading.showLoadingMask(); | ||
5143 | + $.ajax({ | ||
5144 | + method: 'POST', | ||
5145 | + url: '/product/detail/consultsubmit', | ||
5146 | + data: { | ||
5147 | + product_id: productId, | ||
5148 | + content: content | ||
5149 | + } | ||
5150 | + }).then(function(res) { | ||
5151 | + if ($.type(res) !== 'object') { | ||
5152 | + res = {}; | ||
5153 | + } | ||
5154 | + if (res.code !== 200) { | ||
5155 | + tip.show(res.message || '网络出了点问题~'); | ||
5156 | + isSubmiting = false; | ||
5157 | + loading.hideLoadingMask(); | ||
5158 | + } else { | ||
5159 | + window.history.go(-1); | ||
5160 | + } | ||
5161 | + }).fail(function() { | ||
5162 | + tip.show('网络出了点问题~'); | ||
5163 | + isSubmiting = false; | ||
5164 | + }); | ||
5165 | + return false; | ||
5166 | +}); | ||
5167 | + | ||
5168 | +}); | ||
4984 | define("js/me/entry", ["jquery","hammer","lazyload","handlebars","source-map","swiper","mlellipsis","index"], function(require, exports, module){ | 5169 | define("js/me/entry", ["jquery","hammer","lazyload","handlebars","source-map","swiper","mlellipsis","index"], function(require, exports, module){ |
4985 | /** | 5170 | /** |
4986 | * 个人中心js打包入口文件 | 5171 | * 个人中心js打包入口文件 |
@@ -4999,6 +5184,8 @@ require("js/me/address"); | @@ -4999,6 +5184,8 @@ require("js/me/address"); | ||
4999 | require("js/me/suggest"); | 5184 | require("js/me/suggest"); |
5000 | require("js/me/browse-record"); | 5185 | require("js/me/browse-record"); |
5001 | require("js/me/address-act"); | 5186 | require("js/me/address-act"); |
5187 | +require("js/me/logistic"); | ||
5188 | +require("js/me/pay"); | ||
5002 | 5189 | ||
5003 | }); | 5190 | }); |
5004 | define("js/me/order", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){ | 5191 | define("js/me/order", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){ |
@@ -5131,10 +5318,22 @@ orderHammer.on('tap', function(e) { | @@ -5131,10 +5318,22 @@ orderHammer.on('tap', function(e) { | ||
5131 | }, | 5318 | }, |
5132 | success: function(data) { | 5319 | success: function(data) { |
5133 | if (data.code === 200) { | 5320 | if (data.code === 200) { |
5321 | + dialog.showDialog({ | ||
5322 | + dialogText: '删除订单成功', | ||
5323 | + autoHide: true, | ||
5324 | + fast: true | ||
5325 | + }); | ||
5134 | 5326 | ||
5135 | //删除订单页面刷新 | 5327 | //删除订单页面刷新 |
5136 | history.go(0); | 5328 | history.go(0); |
5137 | } | 5329 | } |
5330 | + }, | ||
5331 | + error: function() { | ||
5332 | + dialog.showDialog({ | ||
5333 | + dialogText: '删除订单失败', | ||
5334 | + autoHide: true, | ||
5335 | + fast: true | ||
5336 | + }); | ||
5138 | } | 5337 | } |
5139 | }); | 5338 | }); |
5140 | }); | 5339 | }); |
@@ -5156,10 +5355,22 @@ orderHammer.on('tap', function(e) { | @@ -5156,10 +5355,22 @@ orderHammer.on('tap', function(e) { | ||
5156 | }, | 5355 | }, |
5157 | success: function(data) { | 5356 | success: function(data) { |
5158 | if (data.code === 200) { | 5357 | if (data.code === 200) { |
5358 | + dialog.showDialog({ | ||
5359 | + dialogText: '取消订单成功', | ||
5360 | + autoHide: true, | ||
5361 | + fast: true | ||
5362 | + }); | ||
5159 | 5363 | ||
5160 | //取消订单页面刷新 | 5364 | //取消订单页面刷新 |
5161 | history.go(0); | 5365 | history.go(0); |
5162 | } | 5366 | } |
5367 | + }, | ||
5368 | + error: function() { | ||
5369 | + dialog.showDialog({ | ||
5370 | + dialogText: '取消订单失败', | ||
5371 | + autoHide: true, | ||
5372 | + fast: true | ||
5373 | + }); | ||
5163 | } | 5374 | } |
5164 | }); | 5375 | }); |
5165 | }); | 5376 | }); |
@@ -5189,6 +5400,7 @@ $(window).scroll(function() { | @@ -5189,6 +5400,7 @@ $(window).scroll(function() { | ||
5189 | 5400 | ||
5190 | //初始化请求第一页数据 | 5401 | //初始化请求第一页数据 |
5191 | getOrders(); | 5402 | getOrders(); |
5403 | + | ||
5192 | }); | 5404 | }); |
5193 | define("js/me/dialog", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){ | 5405 | define("js/me/dialog", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){ |
5194 | /* | 5406 | /* |
@@ -5275,6 +5487,7 @@ exports.showDialog = function(data, callback) { | @@ -5275,6 +5487,7 @@ exports.showDialog = function(data, callback) { | ||
5275 | exports.hideDialog = function() { | 5487 | exports.hideDialog = function() { |
5276 | $dialogWrapper.fadeOut(); | 5488 | $dialogWrapper.fadeOut(); |
5277 | }; | 5489 | }; |
5490 | + | ||
5278 | }); | 5491 | }); |
5279 | define("js/me/order-detail", ["jquery","lazyload","hammer"], function(require, exports, module){ | 5492 | define("js/me/order-detail", ["jquery","lazyload","hammer"], function(require, exports, module){ |
5280 | /** | 5493 | /** |
@@ -5654,6 +5867,9 @@ headerNavHammer.on('tap', function(e) { | @@ -5654,6 +5867,9 @@ headerNavHammer.on('tap', function(e) { | ||
5654 | autoHide: true, | 5867 | autoHide: true, |
5655 | dialogText: '提交成功' | 5868 | dialogText: '提交成功' |
5656 | }); | 5869 | }); |
5870 | + setTimeout(function() { | ||
5871 | + location.pathname = 'home/suggest'; | ||
5872 | + }, 2000); | ||
5657 | } | 5873 | } |
5658 | }).fail(function() { | 5874 | }).fail(function() { |
5659 | 5875 | ||
@@ -5688,7 +5904,8 @@ $likeBtn.bind('click', function() { | @@ -5688,7 +5904,8 @@ $likeBtn.bind('click', function() { | ||
5688 | method: 'post', | 5904 | method: 'post', |
5689 | url: '/home/upAndDown', | 5905 | url: '/home/upAndDown', |
5690 | data: { | 5906 | data: { |
5691 | - suggest_id: id | 5907 | + suggest_id: id, |
5908 | + reliable: 1 | ||
5692 | } | 5909 | } |
5693 | }).then(function(data) { | 5910 | }).then(function(data) { |
5694 | if (data.code === 200) { | 5911 | if (data.code === 200) { |
@@ -5715,7 +5932,8 @@ $disLikeBtn.bind('click', function() { | @@ -5715,7 +5932,8 @@ $disLikeBtn.bind('click', function() { | ||
5715 | method: 'post', | 5932 | method: 'post', |
5716 | url: '/home/upAndDown', | 5933 | url: '/home/upAndDown', |
5717 | data: { | 5934 | data: { |
5718 | - suggest_id: id | 5935 | + suggest_id: id, |
5936 | + reliable: 2 | ||
5719 | } | 5937 | } |
5720 | }).then(function(data) { | 5938 | }).then(function(data) { |
5721 | if (data.code === 200) { | 5939 | if (data.code === 200) { |
@@ -6839,7 +7057,6 @@ var end = false, | @@ -6839,7 +7057,6 @@ var end = false, | ||
6839 | var winH = $(window).height(); | 7057 | var winH = $(window).height(); |
6840 | 7058 | ||
6841 | load.init(); | 7059 | load.init(); |
6842 | - | ||
6843 | function moreRecord(cb) { | 7060 | function moreRecord(cb) { |
6844 | var count = $page.children('.browse-record-good').length; | 7061 | var count = $page.children('.browse-record-good').length; |
6845 | 7062 | ||
@@ -6875,7 +7092,7 @@ function moreRecord(cb) { | @@ -6875,7 +7092,7 @@ function moreRecord(cb) { | ||
6875 | 7092 | ||
6876 | lazyLoad($page.find('.browse-record-good:gt(' + (count - 1) + ') .lazy')); | 7093 | lazyLoad($page.find('.browse-record-good:gt(' + (count - 1) + ') .lazy')); |
6877 | } | 7094 | } |
6878 | - | 7095 | + window.rePosFooter(); |
6879 | page++; | 7096 | page++; |
6880 | 7097 | ||
6881 | if (cb) { | 7098 | if (cb) { |
@@ -6913,6 +7130,7 @@ $page.on('touchstart', '.del-icon', function() { | @@ -6913,6 +7130,7 @@ $page.on('touchstart', '.del-icon', function() { | ||
6913 | rightBtnText: '确定' | 7130 | rightBtnText: '确定' |
6914 | } | 7131 | } |
6915 | }, function() { | 7132 | }, function() { |
7133 | + | ||
6916 | $.ajax({ | 7134 | $.ajax({ |
6917 | type: 'GET', | 7135 | type: 'GET', |
6918 | url: '/home/delRecord', | 7136 | url: '/home/delRecord', |
@@ -6921,7 +7139,12 @@ $page.on('touchstart', '.del-icon', function() { | @@ -6921,7 +7139,12 @@ $page.on('touchstart', '.del-icon', function() { | ||
6921 | }, | 7139 | }, |
6922 | success: function(data) { | 7140 | success: function(data) { |
6923 | if (data.code === 200) { | 7141 | if (data.code === 200) { |
6924 | - window.history.go(0); | 7142 | + dialog.showDialog({ |
7143 | + dialogText: '删除浏览记录成功', | ||
7144 | + autoHide: true, | ||
7145 | + fast: true | ||
7146 | + }); | ||
7147 | + setTimeout(function(){window.history.go(0);},1000); | ||
6925 | } | 7148 | } |
6926 | }, | 7149 | }, |
6927 | complete: function() { | 7150 | complete: function() { |
@@ -6947,7 +7170,6 @@ var $addressForm = $('.edit-address'), | @@ -6947,7 +7170,6 @@ var $addressForm = $('.edit-address'), | ||
6947 | $submit = $('.submit'), | 7170 | $submit = $('.submit'), |
6948 | $editAddressPage = $('.my-edit-address-page'), | 7171 | $editAddressPage = $('.my-edit-address-page'), |
6949 | $addressListPage = $('.my-address-list-page'), | 7172 | $addressListPage = $('.my-address-list-page'), |
6950 | - $footer = $('#yoho-footer'), | ||
6951 | $backBtn = $('.nav-back'), | 7173 | $backBtn = $('.nav-back'), |
6952 | $navTitle = $('.nav-title'), | 7174 | $navTitle = $('.nav-title'), |
6953 | $input = $('input, textarea'), | 7175 | $input = $('input, textarea'), |
@@ -7045,12 +7267,6 @@ $submit.on('touchend', function() { | @@ -7045,12 +7267,6 @@ $submit.on('touchend', function() { | ||
7045 | $(this).removeClass('highlight'); | 7267 | $(this).removeClass('highlight'); |
7046 | }); | 7268 | }); |
7047 | 7269 | ||
7048 | -$input.on('focus', function() { | ||
7049 | - $footer.hide(); | ||
7050 | -}).on('blur', function() { | ||
7051 | - $footer.show(); | ||
7052 | -}); | ||
7053 | - | ||
7054 | // 省市区列表异步加载 | 7270 | // 省市区列表异步加载 |
7055 | $.get('/home/locationList').then(function(html) { | 7271 | $.get('/home/locationList').then(function(html) { |
7056 | $addressListPage.html(html); | 7272 | $addressListPage.html(html); |
@@ -7058,9 +7274,7 @@ $.get('/home/locationList').then(function(html) { | @@ -7058,9 +7274,7 @@ $.get('/home/locationList').then(function(html) { | ||
7058 | // 省市区 | 7274 | // 省市区 |
7059 | $area.on('touchend', function() { | 7275 | $area.on('touchend', function() { |
7060 | $editAddressPage.hide(); | 7276 | $editAddressPage.hide(); |
7061 | - $addressListPage.show(1, function() { | ||
7062 | - $footer.hide(); | ||
7063 | - }); | 7277 | + $addressListPage.show(); |
7064 | currentPage = 'list'; | 7278 | currentPage = 'list'; |
7065 | $navTitle.html('地区选择'); | 7279 | $navTitle.html('地区选择'); |
7066 | }); | 7280 | }); |
@@ -7099,7 +7313,6 @@ $.get('/home/locationList').then(function(html) { | @@ -7099,7 +7313,6 @@ $.get('/home/locationList').then(function(html) { | ||
7099 | $editAddressPage.show(); | 7313 | $editAddressPage.show(); |
7100 | currentPage = 'edit'; | 7314 | currentPage = 'edit'; |
7101 | $navTitle.html(navTitle); | 7315 | $navTitle.html(navTitle); |
7102 | - $footer.show(); | ||
7103 | 7316 | ||
7104 | // 恢复默认的三级选择 | 7317 | // 恢复默认的三级选择 |
7105 | $addressListPage.hide(); | 7318 | $addressListPage.hide(); |
@@ -7122,3 +7335,125 @@ $.get('/home/locationList').then(function(html) { | @@ -7122,3 +7335,125 @@ $.get('/home/locationList').then(function(html) { | ||
7122 | }); | 7335 | }); |
7123 | 7336 | ||
7124 | }); | 7337 | }); |
7338 | +define("js/me/logistic", ["jquery"], function(require, exports, module){ | ||
7339 | +/** | ||
7340 | + * 物流信息页面 | ||
7341 | + * @author: 赵彪<bill.zhao@yoho.cn> | ||
7342 | + * @date: 2015/12/02 | ||
7343 | + */ | ||
7344 | + | ||
7345 | +var $ = require("jquery"), | ||
7346 | + $footer = $('#yoho-footer'); | ||
7347 | + | ||
7348 | +var winH = window.outerHeight, | ||
7349 | + bodyH = document.body.offsetHeight, | ||
7350 | + footH = $footer.height(); | ||
7351 | + | ||
7352 | +function addFooterTopBorder() { | ||
7353 | + if (footH + bodyH > winH) { | ||
7354 | + window.rePosFooter(); | ||
7355 | + } else { | ||
7356 | + $footer.css('border-top', '1px solid #f1f1f1'); | ||
7357 | + } | ||
7358 | +} | ||
7359 | + | ||
7360 | +$(document).ready(addFooterTopBorder); | ||
7361 | + | ||
7362 | + | ||
7363 | + | ||
7364 | + | ||
7365 | + | ||
7366 | + | ||
7367 | + | ||
7368 | + | ||
7369 | +}); | ||
7370 | +define("js/me/pay", ["jquery"], function(require, exports, module){ | ||
7371 | +/** | ||
7372 | + * 支付页面 | ||
7373 | + * @author: 赵彪<bill.zhao@yoho.cn> | ||
7374 | + * @date: 2015/12/03 | ||
7375 | + */ | ||
7376 | +var loading = require("js/plugin/loading"); | ||
7377 | + | ||
7378 | +function isWXOpen() { | ||
7379 | + var ua = navigator.userAgent.toLowerCase(); | ||
7380 | + | ||
7381 | + if (ua.match(/MicroMessenger/i) === 'micromessenger') { | ||
7382 | + return true; | ||
7383 | + } else { | ||
7384 | + return false; | ||
7385 | + } | ||
7386 | +} | ||
7387 | + | ||
7388 | +function hideWeChatPay() { | ||
7389 | + var payApps = document.getElementsByClassName('app'); | ||
7390 | + | ||
7391 | + [].forEach.call(payApps, function(app, index) { | ||
7392 | + if (app.innerHTML.indexOf('微信') !== -1) { | ||
7393 | + app.parentNode.style.display = 'none'; | ||
7394 | + return false; | ||
7395 | + } | ||
7396 | + }); | ||
7397 | +} | ||
7398 | + | ||
7399 | +function handleForWX() { | ||
7400 | + if (!isWXOpen()) { | ||
7401 | + hideWeChatPay(); | ||
7402 | + } | ||
7403 | +} | ||
7404 | + | ||
7405 | +function setIcon(div, appName) { | ||
7406 | + | ||
7407 | + if (appName.indexOf('百度') !== -1) { | ||
7408 | + div.style.backgroundPositionY = '-2.7rem'; | ||
7409 | + return false; | ||
7410 | + } | ||
7411 | + | ||
7412 | + if (appName.indexOf('微信') !== -1) { | ||
7413 | + div.style.backgroundPositionY = '-1.2rem'; | ||
7414 | + return false; | ||
7415 | + } | ||
7416 | + | ||
7417 | + if (appName.indexOf('银联') !== -1) { | ||
7418 | + div.style.backgroundPositionY = '-4rem'; | ||
7419 | + return false; | ||
7420 | + } | ||
7421 | + | ||
7422 | + if (appName.indexOf('QQ') !== -1) { | ||
7423 | + div.style.backgroundPositionY = '-5.4rem'; | ||
7424 | + return false; | ||
7425 | + } | ||
7426 | +} | ||
7427 | + | ||
7428 | +function loadIcon() { | ||
7429 | + var boxs = document.getElementsByClassName('box'); | ||
7430 | + var div = null; | ||
7431 | + var appName = null; | ||
7432 | + | ||
7433 | + [].forEach.call(boxs, function(box, index) { | ||
7434 | + div = box.getElementsByClassName('icon')[0].getElementsByTagName('div')[0]; | ||
7435 | + if (div) { | ||
7436 | + appName = box.getElementsByClassName('app')[0].innerHTML; | ||
7437 | + setIcon(div, appName); | ||
7438 | + } | ||
7439 | + }); | ||
7440 | +} | ||
7441 | + | ||
7442 | +function showPage() { | ||
7443 | + var pageList = document.getElementsByClassName('payapp-list')[0]; | ||
7444 | + | ||
7445 | + pageList.style.visibility = 'visible'; | ||
7446 | +} | ||
7447 | + | ||
7448 | +function main() { | ||
7449 | + handleForWX(); | ||
7450 | + loading.hideLoadingMask(); | ||
7451 | + showPage(); | ||
7452 | + loadIcon(); | ||
7453 | +} | ||
7454 | + | ||
7455 | +loading.showLoadingMask(); | ||
7456 | + | ||
7457 | +window.onload = main; | ||
7458 | + | ||
7459 | +}); |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
18.4 KB
@@ -23,7 +23,7 @@ class OrderModel | @@ -23,7 +23,7 @@ class OrderModel | ||
23 | { | 23 | { |
24 | $result = array(); | 24 | $result = array(); |
25 | //调用接口获得数据 | 25 | //调用接口获得数据 |
26 | - $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, 5772257); var_dump($data); exit; | 26 | + $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid); |
27 | // 判断是否还有数据, 没有数据则返回空 | 27 | // 判断是否还有数据, 没有数据则返回空 |
28 | if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { | 28 | if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { |
29 | return $result; | 29 | return $result; |
-
Please register or login to post a comment