Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy.git into develop
Showing
36 changed files
with
923 additions
and
236 deletions
@@ -30,4 +30,8 @@ script/nginx/logs/ | @@ -30,4 +30,8 @@ script/nginx/logs/ | ||
30 | *.DS_Store | 30 | *.DS_Store |
31 | compile/ | 31 | compile/ |
32 | nbproject/ | 32 | nbproject/ |
33 | -web-static/npm-debug.log | ||
33 | +web-static/npm-debug.log | ||
34 | +.tags | ||
35 | +.tags_sorted_by_file | ||
36 | +yohobuyP.sublime-project | ||
37 | +yohobuyP.sublime-workspace |
@@ -31,6 +31,7 @@ class Yohobuy | @@ -31,6 +31,7 @@ class Yohobuy | ||
31 | 31 | ||
32 | // /* 测试环境 */ | 32 | // /* 测试环境 */ |
33 | // const API_URL = 'http://testapi.yoho.cn:28078/'; | 33 | // const API_URL = 'http://testapi.yoho.cn:28078/'; |
34 | +// const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关 | ||
34 | // const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; | 35 | // const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; |
35 | // const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 36 | // const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
36 | // const API_OLD = 'http://test2.open.yohobuy.com/'; | 37 | // const API_OLD = 'http://test2.open.yohobuy.com/'; |
@@ -58,4 +58,6 @@ class CacheConfig | @@ -58,4 +58,6 @@ class CacheConfig | ||
58 | 58 | ||
59 | const KEY_INDEX_BRANDS_LIST_DATA = 'key_index_brands_list_data';//频道brands数据 | 59 | const KEY_INDEX_BRANDS_LIST_DATA = 'key_index_brands_list_data';//频道brands数据 |
60 | 60 | ||
61 | + const KEY_CODE_YOHOCOIN_BANNER = 'key_code_yohocoin_banner';// 有货币banner数据 | ||
62 | + | ||
61 | } | 63 | } |
@@ -198,11 +198,18 @@ class UserData | @@ -198,11 +198,18 @@ class UserData | ||
198 | */ | 198 | */ |
199 | public static function yohoCoinTotal($uid) | 199 | public static function yohoCoinTotal($uid) |
200 | { | 200 | { |
201 | - $param = Yohobuy::param(); | 201 | + /*$param = Yohobuy::param(); |
202 | $param['method'] = 'app.yohocoin.total'; | 202 | $param['method'] = 'app.yohocoin.total'; |
203 | $param['uid'] = $uid; | 203 | $param['uid'] = $uid; |
204 | $param['client_secret'] = Sign::getSign($param); | 204 | $param['client_secret'] = Sign::getSign($param); |
205 | 205 | ||
206 | + return Yohobuy::get(Yohobuy::API_URL, $param);*/ | ||
207 | + | ||
208 | + $param = Yohobuy::param(); | ||
209 | + $param['method'] = 'app.yoho.yohocoin'; | ||
210 | + $param['uid'] = $uid; | ||
211 | + $param['client_secret'] = Sign::getSign($param); | ||
212 | + | ||
206 | return Yohobuy::get(Yohobuy::API_URL, $param); | 213 | return Yohobuy::get(Yohobuy::API_URL, $param); |
207 | } | 214 | } |
208 | 215 |
@@ -64,16 +64,22 @@ class DetailData | @@ -64,16 +64,22 @@ class DetailData | ||
64 | /** | 64 | /** |
65 | * 咨询内容列表 | 65 | * 咨询内容列表 |
66 | * | 66 | * |
67 | + * @param int $uid 用户ID | ||
67 | * @param int $productId 产品ID | 68 | * @param int $productId 产品ID |
68 | * @param int $pageNum 页码数 | 69 | * @param int $pageNum 页码数 |
69 | * @param int $pageSize 每页显示个数 | 70 | * @param int $pageSize 每页显示个数 |
70 | * @return array | 71 | * @return array |
71 | */ | 72 | */ |
72 | - public static function consultList($productId, $pageNum, $pageSize) | 73 | + public static function consultList($uid, $productId, $pageNum, $pageSize) |
73 | { | 74 | { |
74 | $param = Yohobuy::param(); | 75 | $param = Yohobuy::param(); |
75 | - $param['method'] = 'h5.consult.li'; | 76 | + $param['method'] = 'app.consult.li'; |
76 | $param['product_id'] = $productId; | 77 | $param['product_id'] = $productId; |
78 | + | ||
79 | + if (!empty($uid)) { | ||
80 | + $param['uid'] = $uid; | ||
81 | + } | ||
82 | + | ||
77 | $param['page'] = $pageNum; | 83 | $param['page'] = $pageNum; |
78 | $param['limit'] = $pageSize; | 84 | $param['limit'] = $pageSize; |
79 | $param['client_secret'] = Sign::getSign($param); | 85 | $param['client_secret'] = Sign::getSign($param); |
@@ -154,4 +160,40 @@ class DetailData | @@ -154,4 +160,40 @@ class DetailData | ||
154 | return Yohobuy::get(Yohobuy::API_URL, $param); | 160 | return Yohobuy::get(Yohobuy::API_URL, $param); |
155 | } | 161 | } |
156 | 162 | ||
163 | + /** | ||
164 | + * 咨询点赞 | ||
165 | + * | ||
166 | + * @param int $uid 用户ID | ||
167 | + * @param int $id 咨询ID | ||
168 | + * @return array | ||
169 | + */ | ||
170 | + public static function upvoteConsult($uid, $id) | ||
171 | + { | ||
172 | + $param = Yohobuy::param(); | ||
173 | + $param['method'] = 'app.consult.like'; | ||
174 | + $param['id'] = $id; | ||
175 | + $param['uid'] = $uid; | ||
176 | + $param['client_secret'] = Sign::getSign($param); | ||
177 | + | ||
178 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
179 | + } | ||
180 | + | ||
181 | + /** | ||
182 | + * 咨询有用 | ||
183 | + * | ||
184 | + * @param int $uid 用户ID | ||
185 | + * @param int $id 咨询ID | ||
186 | + * @return array | ||
187 | + */ | ||
188 | + public static function usefulConsult($uid, $id) | ||
189 | + { | ||
190 | + $param = Yohobuy::param(); | ||
191 | + $param['method'] = 'app.consult.useful'; | ||
192 | + $param['id'] = $id; | ||
193 | + $param['uid'] = $uid; | ||
194 | + $param['client_secret'] = Sign::getSign($param); | ||
195 | + | ||
196 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
197 | + } | ||
198 | + | ||
157 | } | 199 | } |
@@ -208,7 +208,7 @@ class FloorProcess | @@ -208,7 +208,7 @@ class FloorProcess | ||
208 | foreach ($data['list'] as &$one) { | 208 | foreach ($data['list'] as &$one) { |
209 | if (isset($one['url'])) { | 209 | if (isset($one['url'])) { |
210 | $one['url'] = Helpers::getFilterUrl($one['url']); | 210 | $one['url'] = Helpers::getFilterUrl($one['url']); |
211 | - isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type]; | 211 | +// isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type]; |
212 | } | 212 | } |
213 | $one['img'] = Helpers::getImageUrl($one['src'], 158, 174); | 213 | $one['img'] = Helpers::getImageUrl($one['src'], 158, 174); |
214 | unset($one['src']); | 214 | unset($one['src']); |
@@ -273,7 +273,7 @@ class FloorProcess | @@ -273,7 +273,7 @@ class FloorProcess | ||
273 | isset(self::$channel[$type]) && $urlParam['gender'] = self::$channel[$type]; | 273 | isset(self::$channel[$type]) && $urlParam['gender'] = self::$channel[$type]; |
274 | $value['more_url'] = Helpers::url('', $urlParam, 'guang'); | 274 | $value['more_url'] = Helpers::url('', $urlParam, 'guang'); |
275 | } | 275 | } |
276 | - if ($key == 'list') { | 276 | + if ($key == 'list' && is_array($value)) { |
277 | foreach ($value as &$one) { | 277 | foreach ($value as &$one) { |
278 | if (isset($one['url'])) { | 278 | if (isset($one['url'])) { |
279 | $one['url'] = Helpers::getFilterUrl($one['url']); | 279 | $one['url'] = Helpers::getFilterUrl($one['url']); |
@@ -379,9 +379,6 @@ class FloorProcess | @@ -379,9 +379,6 @@ class FloorProcess | ||
379 | */ | 379 | */ |
380 | private static function small_pic($data, $type) | 380 | private static function small_pic($data, $type) |
381 | { | 381 | { |
382 | - // 按照以前业务操作,不显示 | ||
383 | - return array(); | ||
384 | - | ||
385 | $result = array(); | 382 | $result = array(); |
386 | 383 | ||
387 | foreach ($data as &$one) { | 384 | foreach ($data as &$one) { |
@@ -391,7 +388,9 @@ class FloorProcess | @@ -391,7 +388,9 @@ class FloorProcess | ||
391 | $one['img'] = Helpers::getImageUrl($one['src'], 98, 98); | 388 | $one['img'] = Helpers::getImageUrl($one['src'], 98, 98); |
392 | unset($one['src']); | 389 | unset($one['src']); |
393 | } | 390 | } |
394 | - $result['small_pic'] = $data; | 391 | + if (!empty($data)) { |
392 | + $result['smallPic']['list'] = $data; | ||
393 | + } | ||
395 | 394 | ||
396 | return $result; | 395 | return $result; |
397 | } | 396 | } |
@@ -13,6 +13,7 @@ var swiper, | @@ -13,6 +13,7 @@ var swiper, | ||
13 | $fixTitleBar, | 13 | $fixTitleBar, |
14 | $brandList = $('.brand-list'), | 14 | $brandList = $('.brand-list'), |
15 | $icon = $('.search-icon'), | 15 | $icon = $('.search-icon'), |
16 | + $genderItem = $('.genderNav li'), | ||
16 | hotBrandsSwiper; | 17 | hotBrandsSwiper; |
17 | 18 | ||
18 | var searchH = $('.newbrand-search').outerHeight(), | 19 | var searchH = $('.newbrand-search').outerHeight(), |
@@ -177,3 +178,11 @@ if ($('.brand-search-page').length) { | @@ -177,3 +178,11 @@ if ($('.brand-search-page').length) { | ||
177 | }); | 178 | }); |
178 | 179 | ||
179 | } | 180 | } |
181 | + | ||
182 | +if ($genderItem.length > 0) { | ||
183 | + $genderItem.on('touchstart', function() { | ||
184 | + $('.genderNav ul .active').removeClass('active'); | ||
185 | + $(this).addClass('active'); | ||
186 | + window.location.search = 'channel=' + ($(this).data('id') + 1); | ||
187 | + }); | ||
188 | +} |
@@ -4,146 +4,157 @@ | @@ -4,146 +4,157 @@ | ||
4 | * @date: 2015/10/12 | 4 | * @date: 2015/10/12 |
5 | */ | 5 | */ |
6 | 6 | ||
7 | -var $ = require('jquery'), | ||
8 | - Hammer = require('yoho.hammer'), | ||
9 | - tip = require('../plugin/tip'), | ||
10 | - loading = require('../plugin/loading'), | ||
11 | - lazyLoad = require('yoho.lazyload'); | ||
12 | - | ||
13 | -var navHammer, | ||
14 | - winH = $(window).height(), | ||
15 | - $goodList = $('#goods-list'), | ||
16 | - searching = false, | ||
17 | - page = 0, | ||
18 | - gender = null, | ||
19 | - kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false, | ||
20 | - lifestyleType = $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false, | ||
21 | - num, | ||
22 | - url; | ||
23 | - | ||
24 | -var $curNav, | ||
25 | - index, | ||
26 | - $navList = $('#maybe-like-nav'); | ||
27 | - | ||
28 | -//ajax url | ||
29 | -if (kidsType) { | ||
30 | - url = '/product/recom/maylikekids'; | ||
31 | -} else if (lifestyleType) { | ||
32 | - url = '/product/recom/maylikelife'; | ||
33 | -} else { | ||
34 | - gender = $('.mobile-wrap').hasClass('boys-wrap') ? '1,3' : '2,3', | ||
35 | - url = '/product/recom/maylike?gender=' + gender; | ||
36 | -} | ||
37 | - | ||
38 | -$curNav = $navList.children('.focus'); | ||
39 | - | ||
40 | -if (lifestyleType) { | ||
41 | - navHammer = new Hammer($navList[0]); | ||
42 | - navHammer.on('tap', function(e) { | ||
43 | - var $this = $(e.target).closest('li'), | ||
44 | - $goods = $('.goods-list'), | ||
45 | - $content; | ||
46 | - | ||
47 | - e.preventDefault(); | ||
48 | - if ($this.hasClass('focus')) { | ||
49 | - return; | ||
50 | - } | 7 | +module.exports = function(specificGender) { |
8 | + var $ = require('jquery'), | ||
9 | + Hammer = require('yoho.hammer'), | ||
10 | + tip = require('../plugin/tip'), | ||
11 | + loading = require('../plugin/loading'), | ||
12 | + lazyLoad = require('yoho.lazyload'); | ||
13 | + | ||
14 | + var navHammer, | ||
15 | + winH = $(window).height(), | ||
16 | + $goodList = $('#goods-list'), | ||
17 | + searching = false, | ||
18 | + page = 0, | ||
19 | + gender = null, | ||
20 | + num, | ||
21 | + url; | ||
22 | + | ||
23 | + //The kidsType can be specified by the parameter. Add by @ZhaoBiao | ||
24 | + var kidsType = specificGender === 'kids' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false, | ||
25 | + lifestyleType = specificGender === 'lifestyle' || | ||
26 | + $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false; | ||
27 | + | ||
28 | + var $curNav, | ||
29 | + index, | ||
30 | + $navList = $('#maybe-like-nav'); | ||
31 | + | ||
32 | + //ajax url | ||
33 | + if (kidsType) { | ||
34 | + url = '/product/recom/maylikekids'; | ||
35 | + } else if (lifestyleType) { | ||
36 | + url = '/product/recom/maylikelife'; | ||
37 | + } else { | ||
38 | + gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ? | ||
39 | + '1,3' : '2,3', | ||
40 | + url = '/product/recom/maylike?gender=' + gender; | ||
41 | + } | ||
42 | + | ||
43 | + $curNav = $navList.children('.focus'); | ||
51 | 44 | ||
52 | - index = $this.index(); | 45 | + if (lifestyleType) { |
46 | + navHammer = new Hammer($navList[0]); | ||
47 | + navHammer.on('tap', function(e) { | ||
48 | + var $this = $(e.target).closest('li'), | ||
49 | + $goods = $('.goods-list'), | ||
50 | + $content; | ||
53 | 51 | ||
54 | - $this.addClass('focus'); | ||
55 | - $curNav.removeClass('focus'); | 52 | + e.preventDefault(); |
53 | + if ($this.hasClass('focus')) { | ||
54 | + return; | ||
55 | + } | ||
56 | 56 | ||
57 | - $goods.not('.hide').addClass('hide'); | ||
58 | - $content = $goods.eq(index); | ||
59 | - $content.removeClass('hide'); | 57 | + index = $this.index(); |
60 | 58 | ||
61 | - $curNav = $this; | 59 | + $this.addClass('focus'); |
60 | + $curNav.removeClass('focus'); | ||
62 | 61 | ||
63 | - $(document).trigger('scroll'); //Trigger lazyLoad | ||
64 | - e.srcEvent.stopPropagation(); | ||
65 | - }); | ||
66 | -} | 62 | + $goods.not('.hide').addClass('hide'); |
63 | + $content = $goods.eq(index); | ||
64 | + $content.removeClass('hide'); | ||
67 | 65 | ||
68 | -loading.init($('.maybe-like')); | 66 | + $curNav = $this; |
69 | 67 | ||
70 | -function search() { | ||
71 | - if (searching) { | ||
72 | - return; | 68 | + $(document).trigger('scroll'); //Trigger lazyLoad |
69 | + e.srcEvent.stopPropagation(); | ||
70 | + }); | ||
73 | } | 71 | } |
74 | - searching = true; | ||
75 | - | ||
76 | - loading.showLoadingMask(); | ||
77 | - | ||
78 | - //num = $goodList.find('.good-info').length; | ||
79 | - $.ajax({ | ||
80 | - type: 'GET', | ||
81 | - url: url, | ||
82 | - data: { | ||
83 | - page: page + 1 | ||
84 | - }, | ||
85 | - success: function(data) { | ||
86 | - if (data === ' ') { | ||
87 | - searching = false; | ||
88 | - loading.hideLoadingMask(); | ||
89 | - if (gender) { | ||
90 | - if (gender === '1,3') { | ||
91 | - url = '/boys/bottomBanner'; | ||
92 | - } else { | ||
93 | - url = '/girls/bottomBanner'; | ||
94 | - } | ||
95 | - $.ajax({ | ||
96 | - type: 'GET', | ||
97 | - url: url, | ||
98 | - success: function(data) { | ||
99 | - if (data && data.img) { | ||
100 | - $('#load-more-img').show(); | ||
101 | - $('#load-more-img a').attr('href', data.url); | ||
102 | - $('#load-more-img a > img').attr('src', data.img); | ||
103 | - } | ||
104 | - }, | ||
105 | - error: function() { | 72 | + |
73 | + loading.init($('.maybe-like')); | ||
74 | + | ||
75 | + function search() { | ||
76 | + if (searching) { | ||
77 | + return; | ||
78 | + } | ||
79 | + searching = true; | ||
80 | + | ||
81 | + loading.showLoadingMask(); | ||
82 | + | ||
83 | + //num = $goodList.find('.good-info').length; | ||
84 | + $.ajax({ | ||
85 | + type: 'GET', | ||
86 | + url: url, | ||
87 | + data: { | ||
88 | + page: page + 1 | ||
89 | + }, | ||
90 | + success: function(data) { | ||
91 | + if (data === ' ') { | ||
92 | + searching = false; | ||
93 | + loading.hideLoadingMask(); | ||
94 | + if (gender) { | ||
95 | + if (gender === '1,3') { | ||
96 | + url = '/boys/bottomBanner'; | ||
97 | + } else { | ||
98 | + url = '/girls/bottomBanner'; | ||
106 | } | 99 | } |
107 | - }); | 100 | + $.ajax({ |
101 | + type: 'GET', | ||
102 | + url: url, | ||
103 | + success: function(data) { | ||
104 | + if (data && data.img) { | ||
105 | + $('#load-more-img').show(); | ||
106 | + $('#load-more-img a').attr('href', data.url); | ||
107 | + $('#load-more-img a > img').attr('src', data.img); | ||
108 | + } | ||
109 | + }, | ||
110 | + error: function() { | ||
111 | + } | ||
112 | + }); | ||
108 | 113 | ||
114 | + } | ||
115 | + return; | ||
109 | } | 116 | } |
110 | - return; | ||
111 | - } | ||
112 | 117 | ||
113 | - num = $goodList.find('.good-info').length; | 118 | + num = $goodList.find('.good-info').length; |
119 | + | ||
120 | + $goodList.append(data); | ||
114 | 121 | ||
115 | - $goodList.append(data); | 122 | + // 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题 |
123 | + if (num === 0) { | ||
124 | + lazyLoad($goodList.find('.good-info').find('img.lazy')); | ||
125 | + } else { | ||
126 | + lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy')); | ||
127 | + } | ||
116 | 128 | ||
117 | - // 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题 | ||
118 | - if (num === 0) { | ||
119 | - lazyLoad($goodList.find('.good-info').find('img.lazy')); | ||
120 | - } else { | ||
121 | - lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy')); | 129 | + searching = false; |
130 | + loading.hideLoadingMask(); | ||
131 | + page++; | ||
132 | + }, | ||
133 | + error: function() { | ||
134 | + tip.show('网络断开连接了~'); | ||
135 | + searching = false; | ||
136 | + loading.hideLoadingMask(); | ||
122 | } | 137 | } |
138 | + }); | ||
139 | + } | ||
123 | 140 | ||
124 | - searching = false; | ||
125 | - loading.hideLoadingMask(); | ||
126 | - page++; | ||
127 | - }, | ||
128 | - error: function() { | ||
129 | - tip.show('网络断开连接了~'); | ||
130 | - searching = false; | ||
131 | - loading.hideLoadingMask(); | ||
132 | - } | 141 | + $('.maybe-like p').on('touchstart', function(e) { |
142 | + search(); | ||
133 | }); | 143 | }); |
134 | -} | ||
135 | 144 | ||
136 | -$('.maybe-like p').on('touchstart', function(e) { | ||
137 | - search(); | ||
138 | -}); | 145 | + function scrollHandler() { |
146 | + if ($(window).scrollTop() + winH >= $(document).height() - 200) { | ||
147 | + search(); | ||
148 | + } | ||
149 | + } | ||
139 | 150 | ||
140 | -function scrollHandler() { | ||
141 | - if ($(window).scrollTop() + winH >= $(document).height() - 200) { | 151 | + // 优惠券页面直接加载你可能喜欢。add by @zhaobiao |
152 | + if (specificGender) { | ||
142 | search(); | 153 | search(); |
143 | } | 154 | } |
144 | -} | ||
145 | 155 | ||
146 | -//srcoll to load more | ||
147 | -$(window).scroll(function() { | ||
148 | - window.requestAnimationFrame(scrollHandler); | ||
149 | -}); | ||
156 | + //srcoll to load more | ||
157 | + $(window).scroll(function() { | ||
158 | + window.requestAnimationFrame(scrollHandler); | ||
159 | + }); | ||
160 | +}; |
static/js/me/currency-new.js
0 → 100644
@@ -9,11 +9,18 @@ var $ = require('jquery'), | @@ -9,11 +9,18 @@ var $ = require('jquery'), | ||
9 | 9 | ||
10 | var commentsNum,consultsNum; | 10 | var commentsNum,consultsNum; |
11 | 11 | ||
12 | -var navtabEle = document.getElementById('nav-tab'), | 12 | +var consultFooterEle = $('.consult-content-footer')[0], |
13 | + consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle), | ||
14 | + | ||
15 | + navtabEle = document.getElementById('nav-tab'), | ||
13 | navtabHammer = navtabEle && new Hammer(navtabEle), | 16 | navtabHammer = navtabEle && new Hammer(navtabEle), |
14 | 17 | ||
15 | gotoConsultEle = document.getElementById('goto-consult'), | 18 | gotoConsultEle = document.getElementById('goto-consult'), |
16 | - gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle); | 19 | + gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle), |
20 | + | ||
21 | + readmore = document.getElementById('readmore'), | ||
22 | + readmoreHammer = readmore && new Hammer(readmore); | ||
23 | + | ||
17 | 24 | ||
18 | 25 | ||
19 | (function() { | 26 | (function() { |
@@ -63,6 +70,12 @@ if (navtabHammer) { | @@ -63,6 +70,12 @@ if (navtabHammer) { | ||
63 | }); | 70 | }); |
64 | } | 71 | } |
65 | 72 | ||
73 | +if (consultFooterHammer) { | ||
74 | + consultFooterHammer.on('tap', function() { | ||
75 | + location.href = $(consultFooterEle).data('href'); | ||
76 | + }); | ||
77 | +} | ||
78 | + | ||
66 | if (gotoConsultHammer) { | 79 | if (gotoConsultHammer) { |
67 | gotoConsultHammer.on('tap', function() { | 80 | gotoConsultHammer.on('tap', function() { |
68 | location.href = $(gotoConsultEle).find('a').attr('href'); | 81 | location.href = $(gotoConsultEle).find('a').attr('href'); |
@@ -74,3 +87,16 @@ if ($('.goods-consults-page').length > 0) { | @@ -74,3 +87,16 @@ if ($('.goods-consults-page').length > 0) { | ||
74 | $('#yoho-header').css('position', 'fixed').css('top', '0'); | 87 | $('#yoho-header').css('position', 'fixed').css('top', '0'); |
75 | } | 88 | } |
76 | 89 | ||
90 | +if ($('.goods-consults-page').length > 0) { | ||
91 | + $('#yoho-footer').css('border-top', '1px solid #e0e0e0'); | ||
92 | +} | ||
93 | + | ||
94 | +if (readmoreHammer) { | ||
95 | + readmoreHammer.on('tap', function() { | ||
96 | + $('.readmore').hide(); | ||
97 | + $('.goods-consults .consult-item').show(); | ||
98 | + return false; | ||
99 | + }); | ||
100 | +} | ||
101 | + | ||
102 | +require('./fav'); |
static/js/product/detail/fav.js
0 → 100755
1 | +/** | ||
2 | + * 商品详情咨询页 --点赞和帮助功能 | ||
3 | + * @author: Lynnic | ||
4 | + * @date: 2015/12/09 | ||
5 | + */ | ||
6 | + | ||
7 | + var $ = require('jquery'), | ||
8 | + Hammer = require('yoho.hammer'), | ||
9 | + tip = require('../../plugin/tip'); | ||
10 | + | ||
11 | +var goodsConsultsEle = $('#goods-consults')[0], | ||
12 | + goodsConsultsHammer = goodsConsultsEle && new Hammer(goodsConsultsEle); | ||
13 | + | ||
14 | +function showCountPlus($el) { | ||
15 | + var $count = $el.find('.animate-count'); | ||
16 | + | ||
17 | + $count.css('display', 'inline'); | ||
18 | + $count.animate({ | ||
19 | + opacity: 0.25, | ||
20 | + fontSize: '0.7rem', | ||
21 | + right: '-=5' | ||
22 | + }, 300, function() { | ||
23 | + $count.css('display', 'none'); | ||
24 | + }); | ||
25 | +} | ||
26 | + | ||
27 | +if (goodsConsultsHammer) { | ||
28 | + | ||
29 | + goodsConsultsHammer.on('tap', function(e) { | ||
30 | + | ||
31 | + var $this = $(e.target).closest('li'), | ||
32 | + id = $this.closest('.consult-item').data('id'), | ||
33 | + count = $this.find('.count').html() - 0, | ||
34 | + url; | ||
35 | + | ||
36 | + if (!$this.hasClass('highlight')) { | ||
37 | + | ||
38 | + if ($this.hasClass('fav')) { | ||
39 | + url = '/product/detail/consultupvote'; | ||
40 | + } else if ($this.hasClass('useful')) { | ||
41 | + url = '/product/detail/consultuseful'; | ||
42 | + } | ||
43 | + | ||
44 | + $.ajax({ | ||
45 | + method: 'post', | ||
46 | + url: url, | ||
47 | + data: { | ||
48 | + id: id | ||
49 | + } | ||
50 | + }).done(function(data) { | ||
51 | + if (data.code === 200) { | ||
52 | + showCountPlus($this); | ||
53 | + $this.addClass('highlight'); | ||
54 | + $this.find('.count').html(count + 1); | ||
55 | + } else if (data.code === 401) { | ||
56 | + location.href = data.data;//未登录跳转登录页 | ||
57 | + } | ||
58 | + }).fail(function(data) { | ||
59 | + tip.show('网络断开连接了~'); | ||
60 | + }); | ||
61 | + | ||
62 | + } | ||
63 | + }); | ||
64 | +} |
1 | .brand-page { | 1 | .brand-page { |
2 | + .re-pos-search { | ||
3 | + top: 170rem / $pxConvertRem !important; | ||
4 | + } | ||
5 | + .genderNav { | ||
6 | + display: block; | ||
7 | + width: 100%; | ||
8 | + height: 80rem / $pxConvertRem; | ||
9 | + line-height: 80rem / $pxConvertRem; | ||
10 | + overflow: hidden; | ||
11 | + color: #aeaeae; | ||
12 | + z-index: 3; | ||
13 | + position: fixed; | ||
14 | + top: 90rem / $pxConvertRem; | ||
15 | + border-bottom: 1px solid #e1e1e1; | ||
16 | + background-color: #fff; | ||
17 | + | ||
18 | + ul{ | ||
19 | + width: 100%; | ||
20 | + height: 90%; | ||
21 | + overflow: hidden; | ||
22 | + li{ | ||
23 | + width: 25%; | ||
24 | + height: 100%; | ||
25 | + overflow: hidden; | ||
26 | + float: left; | ||
27 | + text-align: center; | ||
28 | + position: relative; | ||
29 | + font-size: 28rem / $pxConvertRem; | ||
30 | + i{ | ||
31 | + width: 100%; | ||
32 | + height: 40%; | ||
33 | + overflow: hidden; | ||
34 | + display: block; | ||
35 | + } | ||
36 | + span:not(.split-border){ | ||
37 | + width: 100%; | ||
38 | + height: auto; | ||
39 | + overflow: hidden; | ||
40 | + display: block; | ||
41 | + //line-height: 40rem / $pxConvertRem; | ||
42 | + } | ||
43 | + | ||
44 | + .split-border { | ||
45 | + display: inline-block; | ||
46 | + width: 2px; | ||
47 | + height: 1rem; | ||
48 | + background-color: #e1e1e1; | ||
49 | + position: absolute; | ||
50 | + top: 30%; | ||
51 | + right: 0; | ||
52 | + } | ||
53 | + } | ||
54 | + | ||
55 | + li:last-child { | ||
56 | + .split-border { | ||
57 | + display: none; | ||
58 | + } | ||
59 | + } | ||
60 | + | ||
61 | + li.active { | ||
62 | + color: #444; | ||
63 | + } | ||
64 | + } | ||
65 | + } | ||
2 | .newbrand-search { | 66 | .newbrand-search { |
3 | width: 93.75%; | 67 | width: 93.75%; |
4 | height: 60rem / $pxConvertRem; | 68 | height: 60rem / $pxConvertRem; |
1 | @import "header-download", "banner-top","banner-center","banner-bottom", "side-nav", "floor-header", "hot-brands", "fine-brands", "creative-life", "plus-star", "maybe-like", | 1 | @import "header-download", "banner-top","banner-center","banner-bottom", "side-nav", "floor-header", "hot-brands", "fine-brands", "creative-life", "plus-star", "maybe-like", |
2 | "icons-enter","trendsetter-collocation", | 2 | "icons-enter","trendsetter-collocation", |
3 | -"trend-topics","goods-category","hot-brands", "hot-category", "home-header"; | ||
4 | - | 3 | +"trend-topics","goods-category","hot-brands", "hot-category", "home-header", "thumb-row"; |
4 | + | ||
5 | .mobile-container{ | 5 | .mobile-container{ |
6 | width: 100%; | 6 | width: 100%; |
7 | overflow: hidden; | 7 | overflow: hidden; |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | .overlay { | 21 | .overlay { |
22 | display: none; | 22 | display: none; |
23 | position: absolute; | 23 | position: absolute; |
24 | - top: 0; | 24 | + top: 0; |
25 | left: 0; | 25 | left: 0; |
26 | right: 0; | 26 | right: 0; |
27 | bottom: 0; | 27 | bottom: 0; |
static/sass/home/_thumb-row.scss
0 → 100644
1 | +#thumb-row { | ||
2 | + @include flexbox(( | ||
3 | + display: box, | ||
4 | + box-pack: justify | ||
5 | + ), $version: 1); | ||
6 | + @include flexbox(( | ||
7 | + display: flex, | ||
8 | + justify-content: space-around | ||
9 | + ), $version: 3); | ||
10 | + background-color: #f0f0f0; | ||
11 | + text-align: center; | ||
12 | + padding: 32rem/$pxConvertRem 14rem/$pxConvertRem 0; | ||
13 | + | ||
14 | + .thumb-row-box { | ||
15 | + display: inline-block; | ||
16 | + width: 275rem/$pxConvertRem; | ||
17 | + height: 160rem/$pxConvertRem; | ||
18 | + border-radius: 4px; | ||
19 | + background-size: 100%; | ||
20 | + background-repeat: no-repeat; | ||
21 | + background-position: center; | ||
22 | + } | ||
23 | +} |
@@ -55,6 +55,7 @@ | @@ -55,6 +55,7 @@ | ||
55 | height: pxToRem(120px); | 55 | height: pxToRem(120px); |
56 | background-color: #ffffff; | 56 | background-color: #ffffff; |
57 | border-bottom: 1px solid $borderC; | 57 | border-bottom: 1px solid $borderC; |
58 | + z-index: 10; | ||
58 | i, | 59 | i, |
59 | span, | 60 | span, |
60 | a { | 61 | a { |
@@ -73,12 +74,20 @@ | @@ -73,12 +74,20 @@ | ||
73 | .goods-consults { | 74 | .goods-consults { |
74 | margin-top: 5.25rem; | 75 | margin-top: 5.25rem; |
75 | overflow: hidden; | 76 | overflow: hidden; |
77 | + .consult-item:nth-child(1) { | ||
78 | + display: block; | ||
79 | + } | ||
80 | + .consult-item:nth-child(2) { | ||
81 | + display: block; | ||
82 | + } | ||
83 | + | ||
76 | .consult-item { | 84 | .consult-item { |
77 | margin-top: pxToRem(30px); | 85 | margin-top: pxToRem(30px); |
78 | padding: pxToRem(20px) pxToRem(28px); | 86 | padding: pxToRem(20px) pxToRem(28px); |
79 | background-color: #fff; | 87 | background-color: #fff; |
80 | border-bottom: 1px solid $borderC; | 88 | border-bottom: 1px solid $borderC; |
81 | border-top: 1px solid $borderC; | 89 | border-top: 1px solid $borderC; |
90 | + display:none; | ||
82 | .question { | 91 | .question { |
83 | font-size: pxToRem(24px); | 92 | font-size: pxToRem(24px); |
84 | color: $mainFontC; | 93 | color: $mainFontC; |
@@ -114,6 +123,84 @@ | @@ -114,6 +123,84 @@ | ||
114 | overflow: hidden; | 123 | overflow: hidden; |
115 | } | 124 | } |
116 | } | 125 | } |
126 | + .operation { | ||
127 | + width: 120%; | ||
128 | + height: pxToRem(60px); | ||
129 | + line-height: pxToRem(80px); | ||
130 | + position: relative; | ||
131 | + right: 12%; | ||
132 | + border-top: 1px solid #e0e0e0; | ||
133 | + margin-top: pxToRem(20px); | ||
134 | + | ||
135 | + li{ | ||
136 | + &.highlight{ | ||
137 | + color: $basicBtnC; | ||
138 | + } | ||
139 | + font-size:pxToRem(28px); | ||
140 | + float:left; | ||
141 | + width: 50%; | ||
142 | + text-align: center; | ||
143 | + color:$subFontC; | ||
144 | + .iconfont{ | ||
145 | + display: inline-block; | ||
146 | + padding-right: 5px; | ||
147 | + font-size: inherit; | ||
148 | + } | ||
149 | + position: relative; | ||
150 | + .animate-count { | ||
151 | + display: none; | ||
152 | + position: absolute; | ||
153 | + top: 0; | ||
154 | + font-size: pxToRem(20px); | ||
155 | + z-index: 5; | ||
156 | + } | ||
157 | + i.count { | ||
158 | + position: absolute; | ||
159 | + } | ||
160 | + } | ||
161 | + li.fav { | ||
162 | + .animate-count { | ||
163 | + right: pxToRem(100px); | ||
164 | + } | ||
165 | + } | ||
166 | + | ||
167 | + li.useful { | ||
168 | + .animate-count { | ||
169 | + right: pxToRem(88px); | ||
170 | + } | ||
171 | + } | ||
172 | + } | ||
173 | + | ||
174 | + | ||
175 | + } | ||
176 | + } | ||
177 | + .readmore{ | ||
178 | + display: block; | ||
179 | + height: pxToRem(88px); | ||
180 | + line-height: pxToRem(88px); | ||
181 | + background-color: #fff; | ||
182 | + text-align: center; | ||
183 | + color: $subFontC; | ||
184 | + margin-top: pxToRem(30px); | ||
185 | + border-top: 1px solid $borderC; | ||
186 | + border-bottom: 1px solid $borderC; | ||
187 | + font-size: pxToRem(28px); | ||
188 | + i{ | ||
189 | + font-size: inherit; | ||
190 | + } | ||
191 | + } | ||
192 | + .faq-title{ | ||
193 | + height: pxToRem(88px); | ||
194 | + line-height: pxToRem(88px); | ||
195 | + text-align: center; | ||
196 | + font-size: pxToRem(32px); | ||
197 | + } | ||
198 | + .goods-consults .faq-item{ | ||
199 | + @extend .consult-item; | ||
200 | + margin-top: 0; | ||
201 | + margin-bottom: pxToRem(30px); | ||
202 | + .answer{ | ||
203 | + border-bottom: none; | ||
117 | } | 204 | } |
118 | } | 205 | } |
119 | // .gap-block { | 206 | // .gap-block { |
@@ -174,6 +261,9 @@ | @@ -174,6 +261,9 @@ | ||
174 | &.focus { | 261 | &.focus { |
175 | color: #000; | 262 | color: #000; |
176 | } | 263 | } |
264 | + .comments-num { | ||
265 | + display: none; | ||
266 | + } | ||
177 | } | 267 | } |
178 | .comment-nav { | 268 | .comment-nav { |
179 | border-right: 1px solid #ccc; | 269 | border-right: 1px solid #ccc; |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="brand-page yoho-page"> | 2 | <div class="brand-page yoho-page"> |
3 | {{# channel}} | 3 | {{# channel}} |
4 | - | ||
5 | - <div class="newbrand-search"> | 4 | + |
5 | + <div class="genderNav"> | ||
6 | + <ul> | ||
7 | + {{# channels}} | ||
8 | + <li {{#if active}}class="active"{{/if}} data-id="{{@index}}"> | ||
9 | + <span>{{name}}</span> | ||
10 | + <span class="split-border"></span> | ||
11 | + </li> | ||
12 | + {{/channels}} | ||
13 | + </ul> | ||
14 | + </div> | ||
15 | + | ||
16 | + <div class="newbrand-search re-pos-search"> | ||
6 | <div class="search-box clearfix"> | 17 | <div class="search-box clearfix"> |
7 | <a href="{{searchUrl}}" > | 18 | <a href="{{searchUrl}}" > |
8 | <input type="text" class="search-input" placeholder="查找品牌" readonly="true"> | 19 | <input type="text" class="search-input" placeholder="查找品牌" readonly="true"> |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="yoho-coin-new-page yoho-page"> | 2 | <div class="yoho-coin-new-page yoho-page"> |
3 | <div class="coin"> | 3 | <div class="coin"> |
4 | + {{# yohoCoin}} | ||
4 | <p class="coin-num"> | 5 | <p class="coin-num"> |
5 | - 7876 | 6 | + {{coinNum}} |
6 | </p> | 7 | </p> |
7 | <p class="info"> | 8 | <p class="info"> |
8 | <span class="dollar"></span> | 9 | <span class="dollar"></span> |
9 | 个 YOHO 币 | 10 | 个 YOHO 币 |
10 | </p> | 11 | </p> |
11 | - <a href="" class="more">查看明细</a> | 12 | + <a href="/home/currencyDetail" class="more">查看明细</a> |
13 | + {{#if notice}} | ||
12 | <div class="coin-tip"> | 14 | <div class="coin-tip"> |
13 | <span class="icon">!</span> | 15 | <span class="icon">!</span> |
14 | - 您有300个YOHO币即将于2017年12月31日过期,请尽快使用 | 16 | + {{notice}} |
15 | </div> | 17 | </div> |
18 | + {{/if}} | ||
19 | + {{/ yohoCoin}} | ||
16 | </div> | 20 | </div> |
17 | <div class="banner"> | 21 | <div class="banner"> |
18 | - <a href=""> | 22 | + {{#banner}} |
23 | + <a href="{{url}}"> | ||
19 | {{!-- 演示图片 --}} | 24 | {{!-- 演示图片 --}} |
20 | - <img src="http://temp.im/640x200" alt=""> | 25 | + <img src="{{img}}" alt="img"> |
21 | </a> | 26 | </a> |
27 | + {{/banner}} | ||
22 | </div> | 28 | </div> |
23 | 29 | ||
24 | {{> home/maybe_like}} | 30 | {{> home/maybe_like}} |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | 优惠券 | 81 | 优惠券 |
82 | <span class="iconfont num">{{coupon_num}} </span> | 82 | <span class="iconfont num">{{coupon_num}} </span> |
83 | </a> | 83 | </a> |
84 | - <a class="list-item" href="/home/currencyDetail"> | 84 | + <a class="list-item" href="/home/currency"> |
85 | <span class="iconfont icon"></span> | 85 | <span class="iconfont icon"></span> |
86 | YOHO 币 | 86 | YOHO 币 |
87 | <span class="iconfont num">{{yoho_coin_num}} </span> | 87 | <span class="iconfont num">{{yoho_coin_num}} </span> |
@@ -6,14 +6,61 @@ | @@ -6,14 +6,61 @@ | ||
6 | <a href="{{link}}" class="iconfont enter-consult-page"></a> | 6 | <a href="{{link}}" class="iconfont enter-consult-page"></a> |
7 | </div> | 7 | </div> |
8 | {{# consults}} | 8 | {{# consults}} |
9 | - <div class="goods-consults" id="goods-consults"> | 9 | + <div class="goods-consults" id="goods-consults"> |
10 | {{#list}} | 10 | {{#list}} |
11 | - <div class="consult-item"> | ||
12 | - <div class="question"> | 11 | + <div class="consult-item" data-id="{{id}}"> |
12 | + <div class="question"> | ||
13 | + <span class="iconfont"></span> | ||
14 | + <p> | ||
15 | + {{question}}<br> | ||
16 | + <span class="time">{{time}}</span> | ||
17 | + </p> | ||
18 | + </div> | ||
19 | + | ||
20 | + <div class="answer"> | ||
21 | + <span class="iconfont"></span> | ||
22 | + <p>{{answer}}</p> | ||
23 | + </div> | ||
24 | + | ||
25 | + <ul class="operation"> | ||
26 | + <li class="fav {{#if isLike}}highlight{{/if}}"> | ||
27 | + <i class="iconfont "></i> | ||
28 | + 赞 | ||
29 | + <i class="count">{{#if like}}{{like}}{{/if}}</i> | ||
30 | + <span class="animate-count">+1</span> | ||
31 | + </li> | ||
32 | + | ||
33 | + <li class="useful {{#if isUseful}}highlight{{/if}}"> | ||
34 | + <i class="iconfont "></i> | ||
35 | + 有用 | ||
36 | + <i class="count">{{#if useful}}{{useful}}{{/if}}</i> | ||
37 | + <span class="animate-count">+1</span> | ||
38 | + </li> | ||
39 | + </ul> | ||
40 | + | ||
41 | + </div> | ||
42 | + {{/list}} | ||
43 | + </div> | ||
44 | + {{/ consults}} | ||
45 | + | ||
46 | + {{#showReadMore}} | ||
47 | + <a href="javascript:;" id="readmore" class="readmore tap-hightlight" >查看更多 <i class="iconfont"></i></a> | ||
48 | + {{/showReadMore}} | ||
49 | + | ||
50 | + {{#faq}} | ||
51 | + <h1 class="faq-title"> | ||
52 | + 常见问题 | ||
53 | + </h1> | ||
54 | + {{/faq}} | ||
55 | + | ||
56 | + {{#faq}} | ||
57 | + <div class="goods-consults" style="margin-top:0"> | ||
58 | + {{#list}} | ||
59 | + <div class="faq-item"> | ||
60 | + <div class="question"> | ||
13 | <span class="iconfont"></span> | 61 | <span class="iconfont"></span> |
14 | <p> | 62 | <p> |
15 | - {{question}}<br> | ||
16 | - <span class="time">{{time}}</span> | 63 | + {{question}} |
17 | </p> | 64 | </p> |
18 | </div> | 65 | </div> |
19 | 66 | ||
@@ -21,10 +68,10 @@ | @@ -21,10 +68,10 @@ | ||
21 | <span class="iconfont"></span> | 68 | <span class="iconfont"></span> |
22 | <p>{{answer}}</p> | 69 | <p>{{answer}}</p> |
23 | </div> | 70 | </div> |
24 | - </div> | ||
25 | - {{/list}} | 71 | + </div> |
72 | + {{/list}} | ||
26 | </div> | 73 | </div> |
27 | - {{/ consults}} | 74 | + {{/faq}} |
28 | 75 | ||
29 | </div> | 76 | </div> |
30 | {{> layout/footer}} | 77 | {{> layout/footer}} |
@@ -14,6 +14,11 @@ | @@ -14,6 +14,11 @@ | ||
14 | {{> home/banner}} | 14 | {{> home/banner}} |
15 | {{/ banner}} | 15 | {{/ banner}} |
16 | 16 | ||
17 | + {{! 两个小图}} | ||
18 | + {{# smallPic}} | ||
19 | + {{> home/thumb_row}} | ||
20 | + {{/ smallPic}} | ||
21 | + | ||
17 | {{! 热门品类}} | 22 | {{! 热门品类}} |
18 | {{# hotCategory}} | 23 | {{# hotCategory}} |
19 | {{> home/hot_category}} | 24 | {{> home/hot_category}} |
@@ -38,7 +43,7 @@ | @@ -38,7 +43,7 @@ | ||
38 | {{# trendTopics}} | 43 | {{# trendTopics}} |
39 | {{> home/trend_topics}} | 44 | {{> home/trend_topics}} |
40 | {{/ trendTopics}} | 45 | {{/ trendTopics}} |
41 | - | 46 | + |
42 | {{! 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装}} | 47 | {{! 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装}} |
43 | {{# goodsCategory}} | 48 | {{# goodsCategory}} |
44 | {{> home/goods_category}} | 49 | {{> home/goods_category}} |
@@ -55,5 +60,5 @@ | @@ -55,5 +60,5 @@ | ||
55 | {{/ plusStar}} | 60 | {{/ plusStar}} |
56 | {{/ content}} | 61 | {{/ content}} |
57 | 62 | ||
58 | -{{! 可能喜欢}} | ||
59 | -{{> home/maybe_like}} | ||
63 | +{{! 可能喜欢}} | ||
64 | +{{> home/maybe_like}} |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | -<div class="login-page passport-page yoho-page clearfix"> | 2 | +<div class="passport-page yoho-page clearfix"> |
3 | {{# passport}} | 3 | {{# passport}} |
4 | {{> passport/cover}} | 4 | {{> passport/cover}} |
5 | <div class="content"> | 5 | <div class="content"> |
6 | - <div class="register-page"> | ||
7 | - <form id="register-form" class="register-form" method="POST" action="{{actionUrl}}" autocomplete="off"> | ||
8 | - <ul> | ||
9 | - <li class="clearfix"> | ||
10 | - <select id="region" class="region" name="region"> | ||
11 | - {{#each region}} | ||
12 | - <option {{#if selected}}selected="selected"{{/if}} value="{{id}}">{{name}}</option> | ||
13 | - {{/each}} | ||
14 | - </select> | ||
15 | - </li> | ||
16 | - <li class="clearfix" data-index="0"> | ||
17 | - <span id="country-code" class="country-code">{{location}}</span> | ||
18 | - <input value="" id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="请输入手机号码" autocomplete="off"> | ||
19 | - </li> | ||
20 | - <li class="w330 clearfix" data-index="1"> | ||
21 | - <input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="图形验证码" autocomplete="off" maxlength="4"> | ||
22 | - <img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt=""> | ||
23 | - <a class="link change-captcha">换一张</a> | ||
24 | - </li> | ||
25 | - <li class="clearfix" data-index="2"> | ||
26 | - <input id="msg-captcha" class="input va msg-captcha" type="text" name="msgCaptcha" placeholder="短信验证码" autocomplete="off" maxlength="4"> | ||
27 | - <input id="send-captcha" class="btn send-captcha disable" type="button" value="获取短信验证码"> | ||
28 | - <span id="msg-tip" class="hide msg-tip">短信验证码已发送至您的手机,请查收</span> | ||
29 | - </li> | ||
30 | - <li class="clearfix" data-index="3"> | ||
31 | - <input id="pwd" class="input va pwd" name="pwd" placeholder="设置密码" autocomplete="off" maxlength="20" type="password"> | ||
32 | - <div class="pwd-intensity-container"> | ||
33 | - <span class="pwd-intensity low">低</span> | ||
34 | - <span class="pwd-intensity mid">中</span> | ||
35 | - <span class="pwd-intensity high">高</span> | ||
36 | - </div> | ||
37 | - <div id="pwd-tips" class="hide pwd-tips"> | ||
38 | - <div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div> | ||
39 | - <div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div> | ||
40 | - </div> | ||
41 | - </li> | ||
42 | - | ||
43 | - <li class="items-container clearfix"> | ||
44 | - <input id="agree-terms" class="agree-terms" type="checkbox" checked=""> | ||
45 | - <span> | ||
46 | - 我已阅读并同意遵守 | ||
47 | - <a class="link go-yoho-items" href="{{itemUrl}}">YOHO!有货服务条款</a> | ||
48 | - </span> | ||
49 | - </li> | ||
50 | - <li class="clearfix"> | ||
51 | - <input name="refer" id="refer" type="hidden" value="{{referUrl}}"> | ||
52 | - <input id="register-btn" class="btn register-btn disable" type="submit" value="立即注册" disabled=""> | ||
53 | - </li> | ||
54 | - <li class="quick-login-container"> | ||
55 | - 我已注册YOHO!有货账号 | ||
56 | - <a class="link go-login" href="{{loginUrl}}">快速登录</a> | ||
57 | - </li> | ||
58 | - </ul> | ||
59 | - <div id="err-tip" class="err-tip hide"> | ||
60 | - <span></span> | ||
61 | - <b></b> | ||
62 | - </div> | ||
63 | - </form> | ||
64 | - </div> | 6 | + {{> passport/register}} |
65 | </div> | 7 | </div> |
66 | {{/ passport}} | 8 | {{/ passport}} |
67 | </div> | 9 | </div> |
1 | +{{> layout/header}} | ||
2 | +<div class="passport-page yoho-page clearfix"> | ||
3 | + {{# passport}} | ||
4 | + {{> passport/cover}} | ||
5 | + <div class="content"> | ||
6 | + {{> passport/register}} | ||
7 | + </div> | ||
8 | + {{/ passport}} | ||
9 | + | ||
10 | + <div class="page-tip clearfix">为了给您更好的购物体验, 建议您创建YOHO!Family账号</div> | ||
11 | + | ||
12 | +</div> | ||
13 | +{{> layout/footer}} |
1 | +<div class="register-page"> | ||
2 | + <form id="register-form" class="register-form" method="POST" action="{{actionUrl}}" autocomplete="off"> | ||
3 | + <ul> | ||
4 | + <li class="clearfix"> | ||
5 | + <select id="region" class="region" name="region"> | ||
6 | + {{#each region}} | ||
7 | + <option {{#if selected}}selected="selected"{{/if}} value="{{id}}">{{name}}</option> | ||
8 | + {{/each}} | ||
9 | + </select> | ||
10 | + </li> | ||
11 | + <li class="clearfix" data-index="0"> | ||
12 | + <span id="country-code" class="country-code">{{location}}</span> | ||
13 | + <input value="" id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="请输入手机号码" autocomplete="off"> | ||
14 | + </li> | ||
15 | + <li class="w330 clearfix" data-index="1"> | ||
16 | + <input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="图形验证码" autocomplete="off" maxlength="4"> | ||
17 | + <img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt=""> | ||
18 | + <a class="link change-captcha">换一张</a> | ||
19 | + </li> | ||
20 | + <li class="clearfix" data-index="2"> | ||
21 | + <input id="msg-captcha" class="input va msg-captcha" type="text" name="msgCaptcha" placeholder="短信验证码" autocomplete="off" maxlength="4"> | ||
22 | + <input id="send-captcha" class="btn send-captcha disable" type="button" value="获取短信验证码"> | ||
23 | + <span id="msg-tip" class="hide msg-tip">短信验证码已发送至您的手机,请查收</span> | ||
24 | + </li> | ||
25 | + <li class="clearfix" data-index="3"> | ||
26 | + <input id="pwd" class="input va pwd" name="pwd" placeholder="设置密码" autocomplete="off" maxlength="20" type="password"> | ||
27 | + <div class="pwd-intensity-container"> | ||
28 | + <span class="pwd-intensity low">低</span> | ||
29 | + <span class="pwd-intensity mid">中</span> | ||
30 | + <span class="pwd-intensity high">高</span> | ||
31 | + </div> | ||
32 | + <div id="pwd-tips" class="hide pwd-tips"> | ||
33 | + <div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div> | ||
34 | + <div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div> | ||
35 | + </div> | ||
36 | + </li> | ||
37 | + | ||
38 | + <li class="items-container clearfix"> | ||
39 | + <input id="agree-terms" class="agree-terms" type="checkbox" checked=""> | ||
40 | + <span> | ||
41 | + 我已阅读并同意遵守 | ||
42 | + <a class="link go-yoho-items" href="{{itemUrl}}">YOHO!有货服务条款</a> | ||
43 | + </span> | ||
44 | + </li> | ||
45 | + <li class="clearfix"> | ||
46 | + <input name="refer" id="refer" type="hidden" value="{{referUrl}}"> | ||
47 | + <input id="register-btn" class="btn register-btn disable" type="submit" value="{{regBtnText}}" disabled=""> | ||
48 | + </li> | ||
49 | + {{# loginUrl}} | ||
50 | + <li class="quick-login-container"> | ||
51 | + 我已注册YOHO!有货账号 | ||
52 | + <a class="link go-login" href="{{.}}">完善信息</a> | ||
53 | + </li> | ||
54 | + {{/loginUrl}} | ||
55 | + | ||
56 | + {{# skipUrl}} | ||
57 | + <li class="skip-user-info"> | ||
58 | + <a href="{{.}}">跳过此步</a> | ||
59 | + </li> | ||
60 | + {{/skipUrl}} | ||
61 | + | ||
62 | + </ul> | ||
63 | + <div id="err-tip" class="err-tip hide"> | ||
64 | + <span></span> | ||
65 | + <b></b> | ||
66 | + </div> | ||
67 | + </form> | ||
68 | +</div> |
@@ -83,7 +83,7 @@ InfiniteLoad.prototype.stop = function() { | @@ -83,7 +83,7 @@ InfiniteLoad.prototype.stop = function() { | ||
83 | InfiniteLoad.prototype.__directionCalculation = function() { | 83 | InfiniteLoad.prototype.__directionCalculation = function() { |
84 | var p = this.options; | 84 | var p = this.options; |
85 | 85 | ||
86 | - if (p.offset.height && p.offset.height() > 0 && $(window).scrollTop() + window.innerHeight >= p.offset.height()) { | 86 | + if (p.offset.height && p.offset.height() > 0 && $(window).scrollTop() + $(window).height() >= p.offset.height()) { |
87 | return true; | 87 | return true; |
88 | } | 88 | } |
89 | return false; | 89 | return false; |
@@ -172,6 +172,20 @@ $tip: sprite-map("passport/tip/*.png", $spacing: 10px); | @@ -172,6 +172,20 @@ $tip: sprite-map("passport/tip/*.png", $spacing: 10px); | ||
172 | margin-right: 5px; | 172 | margin-right: 5px; |
173 | } | 173 | } |
174 | } | 174 | } |
175 | + | ||
176 | + /*完善信息提示框*/ | ||
177 | + .page-tip { | ||
178 | + display: block; | ||
179 | + width: 100%; | ||
180 | + height: 30px; | ||
181 | + line-height: 30px; | ||
182 | + text-align: center; | ||
183 | + font-size: 20px; | ||
184 | + font-weight: bold; | ||
185 | + color: #ccc; | ||
186 | + clear: both; | ||
187 | + margin-bottom: 15px; | ||
188 | + } | ||
175 | } | 189 | } |
176 | 190 | ||
177 | .passport-cover { | 191 | .passport-cover { |
@@ -200,6 +200,15 @@ | @@ -200,6 +200,15 @@ | ||
200 | text-align: right; | 200 | text-align: right; |
201 | white-space: nowrap; | 201 | white-space: nowrap; |
202 | } | 202 | } |
203 | + | ||
204 | + &.skip-user-info { | ||
205 | + font-size: 18px; | ||
206 | + text-align: center; | ||
207 | + a { | ||
208 | + color: #ff1901; | ||
209 | + text-decoration: underline; | ||
210 | + } | ||
211 | + } | ||
203 | } | 212 | } |
204 | 213 | ||
205 | .err-tip { | 214 | .err-tip { |
@@ -261,9 +261,12 @@ class HomeController extends AbstractAction | @@ -261,9 +261,12 @@ class HomeController extends AbstractAction | ||
261 | $this->setNavHeader('YOHO币', true, false); | 261 | $this->setNavHeader('YOHO币', true, false); |
262 | 262 | ||
263 | $currency = UserModel::getYohoCoinData($this->_uid); | 263 | $currency = UserModel::getYohoCoinData($this->_uid); |
264 | + // banenr数据 | ||
265 | + $currency['banner'] = UserModel::getYohoCoinBanner(); | ||
264 | $currency['pageFooter'] = true; | 266 | $currency['pageFooter'] = true; |
267 | + $currency['currencyPage'] = true; | ||
265 | 268 | ||
266 | - $this->_view->display('currency', $currency); | 269 | + $this->_view->display('currency-new', $currency); |
267 | } | 270 | } |
268 | 271 | ||
269 | /** | 272 | /** |
@@ -8,7 +8,7 @@ use Plugin\Helpers; | @@ -8,7 +8,7 @@ use Plugin\Helpers; | ||
8 | 8 | ||
9 | /** | 9 | /** |
10 | * 品牌相关的模板数据模型 | 10 | * 品牌相关的模板数据模型 |
11 | - * | 11 | + * |
12 | * @name BrandModel | 12 | * @name BrandModel |
13 | * @package Models/Category | 13 | * @package Models/Category |
14 | * @copyright yoho.inc | 14 | * @copyright yoho.inc |
@@ -29,7 +29,7 @@ class BrandModel | @@ -29,7 +29,7 @@ class BrandModel | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | * 根据频道获取品牌一览数据 | 31 | * 根据频道获取品牌一览数据 |
32 | - * | 32 | + * |
33 | * @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | 33 | * @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 |
34 | * @return array | 34 | * @return array |
35 | */ | 35 | */ |
@@ -38,6 +38,24 @@ class BrandModel | @@ -38,6 +38,24 @@ class BrandModel | ||
38 | $result = array(); | 38 | $result = array(); |
39 | $brand = array(); | 39 | $brand = array(); |
40 | 40 | ||
41 | + // 设置品牌一览顶部频道导航 | ||
42 | + $channels = array( | ||
43 | + array( | ||
44 | + 'name' => 'Boy' | ||
45 | + ), | ||
46 | + array( | ||
47 | + 'name' => 'Girl' | ||
48 | + ), | ||
49 | + array( | ||
50 | + 'name' => 'Kid' | ||
51 | + ), | ||
52 | + array( | ||
53 | + 'name' => 'Lifestyle' | ||
54 | + ) | ||
55 | + ); | ||
56 | + $channels[$channel-1]['active'] = true; | ||
57 | + $result['channels'] = $channels; | ||
58 | + | ||
41 | /* 根据频道调用接口 */ | 59 | /* 根据频道调用接口 */ |
42 | switch (intval($channel)) { | 60 | switch (intval($channel)) { |
43 | case 1: // 男生 | 61 | case 1: // 男生 |
@@ -91,7 +109,7 @@ class BrandModel | @@ -91,7 +109,7 @@ class BrandModel | ||
91 | 109 | ||
92 | /** | 110 | /** |
93 | * 获取搜索的品牌列表 | 111 | * 获取搜索的品牌列表 |
94 | - * | 112 | + * |
95 | * @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | 113 | * @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 |
96 | * @return array | 114 | * @return array |
97 | */ | 115 | */ |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | namespace Index; | 3 | namespace Index; |
4 | 4 | ||
5 | use Configs\CacheConfig; | 5 | use Configs\CacheConfig; |
6 | +use LibModels\Wap\Home\IndexData; | ||
6 | use LibModels\Wap\Home\UserData; | 7 | use LibModels\Wap\Home\UserData; |
7 | use Plugin\Cache; | 8 | use Plugin\Cache; |
8 | use Plugin\Helpers; | 9 | use Plugin\Helpers; |
@@ -18,6 +19,7 @@ use Plugin\Images; | @@ -18,6 +19,7 @@ use Plugin\Images; | ||
18 | */ | 19 | */ |
19 | class UserModel | 20 | class UserModel |
20 | { | 21 | { |
22 | + const CODE_YOHOCOIN_BANNER = '05afedf76886d732573f10f7451a1703'; | ||
21 | 23 | ||
22 | /** | 24 | /** |
23 | * 处理用户个人详情数据 | 25 | * 处理用户个人详情数据 |
@@ -358,14 +360,58 @@ class UserModel | @@ -358,14 +360,58 @@ class UserModel | ||
358 | */ | 360 | */ |
359 | public static function getYohoCoinData($uid) | 361 | public static function getYohoCoinData($uid) |
360 | { | 362 | { |
361 | - $result = array(); | 363 | + $result = array( |
364 | + 'yohoCoin' => array( | ||
365 | + 'coinNum' => 0 | ||
366 | + ) | ||
367 | + ); | ||
362 | 368 | ||
363 | // 调用接口获取YOHO币 | 369 | // 调用接口获取YOHO币 |
364 | $yohoCoin = UserData::yohoCoinTotal($uid); | 370 | $yohoCoin = UserData::yohoCoinTotal($uid); |
365 | 371 | ||
366 | // 处理YOHO币数据 | 372 | // 处理YOHO币数据 |
367 | if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) { | 373 | if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) { |
368 | - $result['yohoCoin']['coinNum'] = $yohoCoin['data']['total']; | 374 | + $result['yohoCoin']['coinNum'] = $yohoCoin['data']['yohocoin_num']; |
375 | + $result['yohoCoin']['notice'] = $yohoCoin['data']['notice']; | ||
376 | + } | ||
377 | + | ||
378 | + return $result; | ||
379 | + } | ||
380 | + | ||
381 | + public static function getYohoCoinBanner() | ||
382 | + { | ||
383 | + $result = false; | ||
384 | + | ||
385 | + if (USE_CACHE) { | ||
386 | + // 先尝试获取一级缓存(master), 有数据则直接返回. | ||
387 | + $result = Cache::get(CacheConfig::KEY_CODE_YOHOCOIN_BANNER, 'master'); | ||
388 | + if (!empty($result)) { | ||
389 | + return $result; | ||
390 | + } | ||
391 | + } | ||
392 | + | ||
393 | + // 调用接口获取数据 | ||
394 | + $banner = IndexData::getBannerStart(self::CODE_YOHOCOIN_BANNER); | ||
395 | + if (isset($banner['code']) && $banner['code'] == 200 && !empty($banner['data'])) { | ||
396 | + $result = array(); | ||
397 | + // 处理数据 | ||
398 | + foreach ($banner['data'] as $val) { | ||
399 | + foreach ($val['data'] as $single) { | ||
400 | + $result['url'] = ''; | ||
401 | + $result['img'] = Helpers::getImageUrl($single['src'], 640, 200); | ||
402 | + } | ||
403 | + } | ||
404 | + } | ||
405 | + | ||
406 | + if (USE_CACHE) { | ||
407 | + // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. | ||
408 | + if (empty($result)) { | ||
409 | + $result = Cache::get(CacheConfig::KEY_CODE_YOHOCOIN_BANNER, 'slave'); | ||
410 | + } | ||
411 | + // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 | ||
412 | + else { | ||
413 | + Cache::set(CacheConfig::KEY_CODE_YOHOCOIN_BANNER, $result); | ||
414 | + } | ||
369 | } | 415 | } |
370 | 416 | ||
371 | return $result; | 417 | return $result; |
@@ -549,24 +549,31 @@ class DetailModel | @@ -549,24 +549,31 @@ class DetailModel | ||
549 | 549 | ||
550 | /** | 550 | /** |
551 | * 获取咨询列表 | 551 | * 获取咨询列表 |
552 | - * | 552 | + * |
553 | + * @param int $uid 用户ID | ||
553 | * @param int $productId 产品ID | 554 | * @param int $productId 产品ID |
554 | * @param int $pageNum 页码数 | 555 | * @param int $pageNum 页码数 |
555 | * @param int $pageSize 每页显示个数 | 556 | * @param int $pageSize 每页显示个数 |
556 | * @return array | 557 | * @return array |
557 | */ | 558 | */ |
558 | - public static function getConsults($productId, $pageNum = 1, $pageSize = 300) | 559 | + public static function getConsults($uid, $productId, $pageNum = 1, $pageSize = 300) |
559 | { | 560 | { |
560 | $result = array(); | 561 | $result = array(); |
561 | 562 | ||
562 | if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) { | 563 | if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) { |
563 | - $consultList = DetailData::consultList($productId, $pageNum, $pageSize); | ||
564 | - if (!empty($consultList)) { | 564 | + $consultList = DetailData::consultList($uid, $productId, $pageNum, $pageSize); |
565 | + if (isset($consultList['code']) && $consultList['code'] === 200) { | ||
566 | + $consultList = $consultList['data']['list']; | ||
565 | $build = array(); | 567 | $build = array(); |
566 | foreach ($consultList as $value) { | 568 | foreach ($consultList as $value) { |
567 | $build['question'] = $value['ask']; | 569 | $build['question'] = $value['ask']; |
568 | - $build['time'] = $value['askTime']; | 570 | + $build['time'] = $value['ask_time']; |
569 | $build['answer'] = $value['answer']; | 571 | $build['answer'] = $value['answer']; |
572 | + $build['id'] = $value['id']; | ||
573 | + $build['isLike'] = $value['is_like'] === 'Y'; | ||
574 | + $build['like'] = $value['like']; | ||
575 | + $build['isUseful'] = $value['is_useful'] === 'Y'; | ||
576 | + $build['useful'] = $value['useful']; | ||
570 | $result[] = $build; | 577 | $result[] = $build; |
571 | } | 578 | } |
572 | } | 579 | } |
@@ -577,6 +584,70 @@ class DetailModel | @@ -577,6 +584,70 @@ class DetailModel | ||
577 | } | 584 | } |
578 | 585 | ||
579 | /** | 586 | /** |
587 | + * 咨询点赞 | ||
588 | + * | ||
589 | + * @param int $uid 用户ID | ||
590 | + * @param int $id 咨询ID | ||
591 | + * @param int $productId 商品ID | ||
592 | + * @return array | ||
593 | + */ | ||
594 | + public static function upvoteConsult($uid, $id, $productId) | ||
595 | + { | ||
596 | + $result = array('code' => 400, 'message' => '出错啦~'); | ||
597 | + | ||
598 | + do { | ||
599 | + $record = DetailData::upvoteConsult($uid, $id); | ||
600 | + | ||
601 | + if (empty($uid)) { | ||
602 | + $result['code'] = 401; | ||
603 | + $result['message'] = '用户id为空'; | ||
604 | + $result['data'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)))); | ||
605 | + break; | ||
606 | + } | ||
607 | + | ||
608 | + // 处理数据 | ||
609 | + if ($record && isset($record['code'])) { | ||
610 | + $result['code'] = $record['code']; | ||
611 | + $result['message'] = $record['message']; | ||
612 | + } | ||
613 | + }while(false); | ||
614 | + | ||
615 | + return $result; | ||
616 | + } | ||
617 | + | ||
618 | + /** | ||
619 | + * 咨询有用 | ||
620 | + * | ||
621 | + * @param int $uid 用户ID | ||
622 | + * @param int $id 咨询ID | ||
623 | + * @param int $productId 商品ID | ||
624 | + * @return array | ||
625 | + */ | ||
626 | + public static function usefulConsult($uid, $id, $productId) | ||
627 | + { | ||
628 | + $result = array('code' => 400, 'message' => '出错啦~'); | ||
629 | + | ||
630 | + do { | ||
631 | + $record = DetailData::usefulConsult($uid, $id); | ||
632 | + | ||
633 | + if (empty($uid)) { | ||
634 | + $result['code'] = 401; | ||
635 | + $result['message'] = '用户id为空'; | ||
636 | + $result['data'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)))); | ||
637 | + break; | ||
638 | + } | ||
639 | + | ||
640 | + // 处理数据 | ||
641 | + if ($record && isset($record['code'])) { | ||
642 | + $result['code'] = $record['code']; | ||
643 | + $result['message'] = $record['message']; | ||
644 | + } | ||
645 | + }while(false); | ||
646 | + | ||
647 | + return $result; | ||
648 | + } | ||
649 | + | ||
650 | + /** | ||
580 | * 获取为你优选的商品 | 651 | * 获取为你优选的商品 |
581 | * | 652 | * |
582 | * @param int $productSkn 商品SKN | 653 | * @param int $productSkn 商品SKN |
@@ -12,7 +12,7 @@ class DetailController extends AbstractAction | @@ -12,7 +12,7 @@ class DetailController extends AbstractAction | ||
12 | 12 | ||
13 | /** | 13 | /** |
14 | * 商品详情 | 14 | * 商品详情 |
15 | - * | 15 | + * |
16 | * @param int productId | 16 | * @param int productId |
17 | * @param int goodsId | 17 | * @param int goodsId |
18 | */ | 18 | */ |
@@ -50,7 +50,7 @@ class DetailController extends AbstractAction | @@ -50,7 +50,7 @@ class DetailController extends AbstractAction | ||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * 商品详情 (SKN) | 52 | * 商品详情 (SKN) |
53 | - * | 53 | + * |
54 | * @param int productSkn | 54 | * @param int productSkn |
55 | */ | 55 | */ |
56 | public function showAction() | 56 | public function showAction() |
@@ -100,7 +100,7 @@ class DetailController extends AbstractAction | @@ -100,7 +100,7 @@ class DetailController extends AbstractAction | ||
100 | 100 | ||
101 | /** | 101 | /** |
102 | * 购买评价列表 | 102 | * 购买评价列表 |
103 | - * | 103 | + * |
104 | * @param int productId | 104 | * @param int productId |
105 | * @param int total | 105 | * @param int total |
106 | */ | 106 | */ |
@@ -132,7 +132,7 @@ class DetailController extends AbstractAction | @@ -132,7 +132,7 @@ class DetailController extends AbstractAction | ||
132 | 132 | ||
133 | /** | 133 | /** |
134 | * 购买咨询列表 | 134 | * 购买咨询列表 |
135 | - * | 135 | + * |
136 | * @param int productId | 136 | * @param int productId |
137 | * @param int total | 137 | * @param int total |
138 | */ | 138 | */ |
@@ -150,12 +150,15 @@ class DetailController extends AbstractAction | @@ -150,12 +150,15 @@ class DetailController extends AbstractAction | ||
150 | } | 150 | } |
151 | $this->setTitle('购买咨询'); | 151 | $this->setTitle('购买咨询'); |
152 | 152 | ||
153 | + $uid = $this->getUid(); | ||
154 | + $consults = \Product\DetailModel::getConsults($uid, $productId); | ||
153 | $data = array( | 155 | $data = array( |
154 | 'goodsConsultsPage' => true, | 156 | 'goodsConsultsPage' => true, |
155 | 'pageFooter' => true, | 157 | 'pageFooter' => true, |
156 | 'consults' => array( | 158 | 'consults' => array( |
157 | - 'list' => \Product\DetailModel::getConsults($productId), | 159 | + 'list' => $consults |
158 | ), | 160 | ), |
161 | + 'showReadMore' => count($consults) > 2, | ||
159 | 'link' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)), | 162 | 'link' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)), |
160 | ); | 163 | ); |
161 | 164 | ||
@@ -163,6 +166,40 @@ class DetailController extends AbstractAction | @@ -163,6 +166,40 @@ class DetailController extends AbstractAction | ||
163 | $this->_view->display('consults', $data); | 166 | $this->_view->display('consults', $data); |
164 | } | 167 | } |
165 | 168 | ||
169 | + /* | ||
170 | + * 咨询点赞 | ||
171 | + */ | ||
172 | + public function consultupvoteAction() | ||
173 | + { | ||
174 | + $result = array(); | ||
175 | + | ||
176 | + if ($this->isAjax()) { | ||
177 | + $productId = $this->get('product_id', 0); | ||
178 | + $uid = $this->getUid(); | ||
179 | + $id = $this->post('id'); | ||
180 | + $result = \Product\DetailModel::upvoteConsult($uid, $id, $productId); | ||
181 | + } | ||
182 | + | ||
183 | + $this->echoJson($result); | ||
184 | + } | ||
185 | + | ||
186 | + /* | ||
187 | + * 咨询有用 | ||
188 | + */ | ||
189 | + public function consultusefulAction() | ||
190 | + { | ||
191 | + $result = array(); | ||
192 | + | ||
193 | + if ($this->isAjax()) { | ||
194 | + $productId = $this->get('product_id', 0); | ||
195 | + $uid = $this->getUid(); | ||
196 | + $id = $this->post('id'); | ||
197 | + $result = \Product\DetailModel::usefulConsult($uid, $id, $productId); | ||
198 | + } | ||
199 | + | ||
200 | + $this->echoJson($result); | ||
201 | + } | ||
202 | + | ||
166 | /** | 203 | /** |
167 | * 我要咨询表单 | 204 | * 我要咨询表单 |
168 | */ | 205 | */ |
@@ -188,7 +225,7 @@ class DetailController extends AbstractAction | @@ -188,7 +225,7 @@ class DetailController extends AbstractAction | ||
188 | 225 | ||
189 | /** | 226 | /** |
190 | * 添加咨询操作 | 227 | * 添加咨询操作 |
191 | - * | 228 | + * |
192 | * @param int product_id 商品ID | 229 | * @param int product_id 商品ID |
193 | * @param string content 咨询内容 | 230 | * @param string content 咨询内容 |
194 | * @return json | 231 | * @return json |
@@ -209,7 +246,7 @@ class DetailController extends AbstractAction | @@ -209,7 +246,7 @@ class DetailController extends AbstractAction | ||
209 | 246 | ||
210 | /** | 247 | /** |
211 | * 为你优选 | 248 | * 为你优选 |
212 | - * | 249 | + * |
213 | * @param int productSkn 商品SKN号 | 250 | * @param int productSkn 商品SKN号 |
214 | * @return json | 251 | * @return json |
215 | */ | 252 | */ |
@@ -25,12 +25,41 @@ class RegisterController extends WebAction | @@ -25,12 +25,41 @@ class RegisterController extends WebAction | ||
25 | 'referUrl' => $refer, | 25 | 'referUrl' => $refer, |
26 | 'loginUrl' => '/signin.html?refer='.$refer, | 26 | 'loginUrl' => '/signin.html?refer='.$refer, |
27 | 'coverHref' => $cover['url'], | 27 | 'coverHref' => $cover['url'], |
28 | - 'coverImg' => $cover['img'] | 28 | + 'coverImg' => $cover['img'], |
29 | + 'regBtnText' => '快速登录' | ||
29 | ) | 30 | ) |
30 | ); | 31 | ); |
31 | $this->setCookie('refer', $refer); | 32 | $this->setCookie('refer', $refer); |
32 | $this->_view->display('index', $data); | 33 | $this->_view->display('index', $data); |
33 | } | 34 | } |
35 | + | ||
36 | + | ||
37 | + /** | ||
38 | + * 第三方登录 | ||
39 | + */ | ||
40 | + public function thirdAction() | ||
41 | + { | ||
42 | + $refer = $this->get('refer', SITE_MAIN); | ||
43 | + $cover = PassportModel::getLeftBanner(PassportModel::REGISTER_LEFT_BANNER_CODE); | ||
44 | + $this->setSession('effective_time', time() + 1800); | ||
45 | + $data = array( | ||
46 | + 'registerPage' => true, | ||
47 | + 'passport' => array( | ||
48 | + 'actionUrl' => '/passport/register/mobileregister', | ||
49 | + 'region' => RegData::getAreasData(), | ||
50 | + 'location' => '+86', | ||
51 | + 'captchaUrl' => 'http://web.dev.yohobuy.com/passport/images?t=1449799445', | ||
52 | + 'itemUrl' => '##', | ||
53 | + 'referUrl' => $refer, | ||
54 | + 'skipUrl' => '/signin.html?refer='.$refer, | ||
55 | + 'coverHref' => $cover['url'], | ||
56 | + 'coverImg' => $cover['img'], | ||
57 | + 'regBtnText' => '完善信息' | ||
58 | + ) | ||
59 | + ); | ||
60 | + $this->setCookie('refer', $refer); | ||
61 | + $this->_view->display('third-register', $data); | ||
62 | + } | ||
34 | 63 | ||
35 | /** | 64 | /** |
36 | * 检测手机号 | 65 | * 检测手机号 |
-
Please register or login to post a comment