Authored by zhangxiaoru

fav

@@ -36,7 +36,7 @@ let favProduct = (req, res, next) => { @@ -36,7 +36,7 @@ let favProduct = (req, res, next) => {
36 36
37 favoriteModel.favProduct(uid, page, limit).then((result) => { 37 favoriteModel.favProduct(uid, page, limit).then((result) => {
38 38
39 - if (typeof(result.total) === "undefined" && typeof(result.more) === "undefined") { 39 + if (typeof(result.total) === 'undefined' && typeof(result.more) === 'undefined') {
40 res.render('favorite/favorite-product', { 40 res.render('favorite/favorite-product', {
41 layout: false, 41 layout: false,
42 hasFavProduct: result.hasFavProduct 42 hasFavProduct: result.hasFavProduct
@@ -54,7 +54,7 @@ let favfavBrand = (req, res, next) => { @@ -54,7 +54,7 @@ let favfavBrand = (req, res, next) => {
54 54
55 favoriteModel.favfavBrand(uid, page, limit).then((result) => { 55 favoriteModel.favfavBrand(uid, page, limit).then((result) => {
56 56
57 - if (typeof(result.total) === "undefined" && typeof(result.more) === "undefined") { 57 + if (typeof(result.total) === 'undefined' && typeof(result.more) === 'undefined') {
58 res.render('favorite/favorite-brand', { 58 res.render('favorite/favorite-brand', {
59 layout: false, 59 layout: false,
60 hasFavBrand: result.hasFavBrand 60 hasFavBrand: result.hasFavBrand
@@ -62,7 +62,7 @@ let favfavBrand = (req, res, next) => { @@ -62,7 +62,7 @@ let favfavBrand = (req, res, next) => {
62 } else { 62 } else {
63 res.json(result); 63 res.json(result);
64 } 64 }
65 - 65 +
66 }).catch(next); 66 }).catch(next);
67 }; 67 };
68 68
@@ -125,7 +125,7 @@ const favfavBrand = (uid, page, limit) => { @@ -125,7 +125,7 @@ const favfavBrand = (uid, page, limit) => {
125 125
126 let resu = { 126 let resu = {
127 hasFavBrand: [] 127 hasFavBrand: []
128 - } 128 + };
129 129
130 if (result && result.code === 200) { 130 if (result && result.code === 200) {
131 let list = camelCase(result); 131 let list = camelCase(result);
@@ -185,8 +185,8 @@ const favfavBrand = (uid, page, limit) => { @@ -185,8 +185,8 @@ const favfavBrand = (uid, page, limit) => {
185 }); 185 });
186 186
187 resu.hasFavBrand.push(obj); 187 resu.hasFavBrand.push(obj);
188 - });  
189 - 188 + });
  189 +
190 } else { 190 } else {
191 resu.more = true; 191 resu.more = true;
192 } 192 }
@@ -13,6 +13,7 @@ const personalController = require(`${cRoot}/qrcode`); @@ -13,6 +13,7 @@ const personalController = require(`${cRoot}/qrcode`);
13 const homeController = require(`${cRoot}/index`); 13 const homeController = require(`${cRoot}/index`);
14 const addressController = require(`${cRoot}/address`); 14 const addressController = require(`${cRoot}/address`);
15 const favorite = require(`${cRoot}/favorite`); 15 const favorite = require(`${cRoot}/favorite`);
  16 +// const myDetail = require(`${cRoot}/myDetail);
16 17
17 // 查看二维码 18 // 查看二维码
18 router.get('/QRcode/:id', personalController.QRcode); 19 router.get('/QRcode/:id', personalController.QRcode);
@@ -39,7 +39,3 @@ @@ -39,7 +39,3 @@
39 {{/if}} 39 {{/if}}
40 </div> 40 </div>
41 {{/ hasFavBrand}} 41 {{/ hasFavBrand}}
42 -  
43 -{{!-- {{#if more}}  
44 - <div class="fav-brand-load-more">没有更多了</div>  
45 -{{/if}} --}}  
@@ -31,6 +31,3 @@ @@ -31,6 +31,3 @@
31 </a> 31 </a>
32 </li> 32 </li>
33 {{/ hasFavProduct}} 33 {{/ hasFavProduct}}
34 -{{!-- {{#if more}}  
35 - <div class="fav-brand-load-more">没有更多了</div>  
36 -{{/if}} --}}  
  1 +<div class="personal-details yoho-page">
  2 + <ul>
  3 + <li><span>头像</span><span><i class="head-portrait user-avatar" data-avatar="{{head_ico}}"></i></span></li>
  4 + <li><span>昵称</span><span>{{ nickname }}</span></li>
  5 + <li><span>性别</span><span>{{ gender }}</span></li>
  6 + <li><span>生日</span><span>{{ birthday }}</span></li>
  7 + <li class="tap-hightlight"><span>会员等级</span>
  8 + <span>
  9 + <a href="grade" class="grade">
  10 + {{# vip_info}}
  11 + <i class="vip-icon vip-{{ cur_level}}"></i>
  12 + {{/ vip_info}}
  13 + <span class="iconfont">&#xe604;</span>
  14 + </a>
  15 + </span>
  16 + </li>
  17 + </ul>
  18 +</div>
@@ -23,10 +23,10 @@ var $navLi = $('#fav-tab > li'), @@ -23,10 +23,10 @@ var $navLi = $('#fav-tab > li'),
23 $favProductList = $('.fav-product-list'), 23 $favProductList = $('.fav-product-list'),
24 $favBrandList = $('.fav-brand-swiper-wrapper'), 24 $favBrandList = $('.fav-brand-swiper-wrapper'),
25 pageId = 1, 25 pageId = 1,
26 - brandPageId = 1, //收藏品牌的当前页数 26 + brandPageId = 1, // 收藏品牌的当前页数
27 lockId = true, 27 lockId = true,
28 - brandLockId = true, //收藏品牌是否可下拉加载更多  
29 - brandTab = false; //当前是否停留在收藏品牌页 28 + brandLockId = true, // 收藏品牌是否可下拉加载更多
  29 + brandTab = false; // 当前是否停留在收藏品牌页
30 30
31 require('../common'); 31 require('../common');
32 32
@@ -38,7 +38,7 @@ function showFavTab(index) { @@ -38,7 +38,7 @@ function showFavTab(index) {
38 $favContainer.eq(index).addClass('show'); 38 $favContainer.eq(index).addClass('show');
39 } 39 }
40 40
41 -//初始化swiper 41 +// 初始化swiper
42 function initSwiper(data) { 42 function initSwiper(data) {
43 var i, 43 var i,
44 idStrReg = /container-(\d+)['"]{1}/gi, 44 idStrReg = /container-(\d+)['"]{1}/gi,
@@ -47,10 +47,10 @@ function initSwiper(data) { @@ -47,10 +47,10 @@ function initSwiper(data) {
47 idArrLen = idArr.length, 47 idArrLen = idArr.length,
48 containerId; 48 containerId;
49 49
50 - //$swiperList = $('.swiper-container'); 50 + // $swiperList = $('.swiper-container');
51 for (i = 0; i < idArrLen; i++) { 51 for (i = 0; i < idArrLen; i++) {
52 52
53 - /*id = $swiperList.eq(i).attr('data-id'); 53 + /* id = $swiperList.eq(i).attr('data-id');
54 54
55 if (!!swiperObj[id]) { 55 if (!!swiperObj[id]) {
56 swiperObj[id].destroy(true, true); 56 swiperObj[id].destroy(true, true);
@@ -97,13 +97,13 @@ function loadData($parent, url, page) { @@ -97,13 +97,13 @@ function loadData($parent, url, page) {
97 $parent.closest('.fav-type').find('.fav-null-box').removeClass('hide'); 97 $parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
98 window.rePosFooter(); 98 window.rePosFooter();
99 } else if (data.more === true) { 99 } else if (data.more === true) {
100 - console.log(0) 100 + console.log(0);
101 101
102 - //处理data等于end时如果loadingMask存在且没有hide样式的情况 102 + // 处理data等于end时如果loadingMask存在且没有hide样式的情况
103 if ($loadingMask && !$loadingMask.hasClass('hide')) { 103 if ($loadingMask && !$loadingMask.hasClass('hide')) {
104 $loadingMask.addClass('hide'); 104 $loadingMask.addClass('hide');
105 105
106 - //$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide'); 106 + // $parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
107 } 107 }
108 108
109 $parent.closest('.fav-type').find('.fav-load-background') 109 $parent.closest('.fav-type').find('.fav-load-background')
@@ -115,14 +115,14 @@ function loadData($parent, url, page) { @@ -115,14 +115,14 @@ function loadData($parent, url, page) {
115 } else if (data.length > 10) { 115 } else if (data.length > 10) {
116 $parent.append(data); 116 $parent.append(data);
117 117
118 - //如果有数据loadingMask会被remove掉 118 + // 如果有数据loadingMask会被remove掉
119 $loadingMask.remove(); 119 $loadingMask.remove();
120 if (url === 'favBrand') { 120 if (url === 'favBrand') {
121 - initSwiper(data);//如果是收藏品牌需要初始化swiper 121 + initSwiper(data);// 如果是收藏品牌需要初始化swiper
122 122
123 - brandLockId = false;//请求成功后解锁品牌收藏page++ 123 + brandLockId = false;// 请求成功后解锁品牌收藏page++
124 } else { 124 } else {
125 - lockId = false;//请求成功后解锁商品收藏page++ 125 + lockId = false;// 请求成功后解锁商品收藏page++
126 } 126 }
127 } 127 }
128 window.rePosFooter(); 128 window.rePosFooter();
@@ -172,7 +172,7 @@ favTabHammer.on('tap', function(e) { @@ -172,7 +172,7 @@ favTabHammer.on('tap', function(e) {
172 172
173 }); 173 });
174 174
175 -//删除收藏的商品 175 +// 删除收藏的商品
176 favContentHammer = new Hammer(document.getElementById('fav-content')); 176 favContentHammer = new Hammer(document.getElementById('fav-content'));
177 177
178 favContentHammer.on('tap', function(e) { 178 favContentHammer.on('tap', function(e) {
@@ -221,7 +221,7 @@ favContentHammer.on('tap', function(e) { @@ -221,7 +221,7 @@ favContentHammer.on('tap', function(e) {
221 } 221 }
222 }).fail(function() { 222 }).fail(function() {
223 223
224 - //TODO 224 + // TODO
225 225
226 diaLog.showDialog({ 226 diaLog.showDialog({
227 autoHide: true, 227 autoHide: true,
@@ -233,7 +233,7 @@ favContentHammer.on('tap', function(e) { @@ -233,7 +233,7 @@ favContentHammer.on('tap', function(e) {
233 233
234 function scrollHandler() { 234 function scrollHandler() {
235 235
236 - //距离底部未1/4列表高度+底部高度的时候加载更多 236 + // 距离底部未1/4列表高度+底部高度的时候加载更多
237 if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $favBrandList.height() - footerH) { 237 if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $favBrandList.height() - footerH) {
238 if (brandTab) { 238 if (brandTab) {
239 $brandLoadMore.filter('.hide').removeClass('hide'); 239 $brandLoadMore.filter('.hide').removeClass('hide');
@@ -255,7 +255,7 @@ function scrollHandler() { @@ -255,7 +255,7 @@ function scrollHandler() {
255 } 255 }
256 } 256 }
257 257
258 -//srcoll to load more 258 +// srcoll to load more
259 $(window).scroll(scrollHandler); 259 $(window).scroll(scrollHandler);
260 260
261 $(document).on('touchend', '.swiper-header', function() { 261 $(document).on('touchend', '.swiper-header', function() {