Authored by zhangxiaoru

fav

... ... @@ -36,7 +36,7 @@ let favProduct = (req, res, next) => {
favoriteModel.favProduct(uid, page, limit).then((result) => {
if (typeof(result.total) === "undefined" && typeof(result.more) === "undefined") {
if (typeof(result.total) === 'undefined' && typeof(result.more) === 'undefined') {
res.render('favorite/favorite-product', {
layout: false,
hasFavProduct: result.hasFavProduct
... ... @@ -54,7 +54,7 @@ let favfavBrand = (req, res, next) => {
favoriteModel.favfavBrand(uid, page, limit).then((result) => {
if (typeof(result.total) === "undefined" && typeof(result.more) === "undefined") {
if (typeof(result.total) === 'undefined' && typeof(result.more) === 'undefined') {
res.render('favorite/favorite-brand', {
layout: false,
hasFavBrand: result.hasFavBrand
... ... @@ -62,7 +62,7 @@ let favfavBrand = (req, res, next) => {
} else {
res.json(result);
}
}).catch(next);
};
... ...
... ... @@ -125,7 +125,7 @@ const favfavBrand = (uid, page, limit) => {
let resu = {
hasFavBrand: []
}
};
if (result && result.code === 200) {
let list = camelCase(result);
... ... @@ -185,8 +185,8 @@ const favfavBrand = (uid, page, limit) => {
});
resu.hasFavBrand.push(obj);
});
});
} else {
resu.more = true;
}
... ...
... ... @@ -13,6 +13,7 @@ const personalController = require(`${cRoot}/qrcode`);
const homeController = require(`${cRoot}/index`);
const addressController = require(`${cRoot}/address`);
const favorite = require(`${cRoot}/favorite`);
// const myDetail = require(`${cRoot}/myDetail);
// 查看二维码
router.get('/QRcode/:id', personalController.QRcode);
... ...
... ... @@ -39,7 +39,3 @@
{{/if}}
</div>
{{/ hasFavBrand}}
{{!-- {{#if more}}
<div class="fav-brand-load-more">没有更多了</div>
{{/if}} --}}
\ No newline at end of file
... ...
... ... @@ -31,6 +31,3 @@
</a>
</li>
{{/ hasFavProduct}}
{{!-- {{#if more}}
<div class="fav-brand-load-more">没有更多了</div>
{{/if}} --}}
\ No newline at end of file
... ...
<div class="personal-details yoho-page">
<ul>
<li><span>头像</span><span><i class="head-portrait user-avatar" data-avatar="{{head_ico}}"></i></span></li>
<li><span>昵称</span><span>{{ nickname }}</span></li>
<li><span>性别</span><span>{{ gender }}</span></li>
<li><span>生日</span><span>{{ birthday }}</span></li>
<li class="tap-hightlight"><span>会员等级</span>
<span>
<a href="grade" class="grade">
{{# vip_info}}
<i class="vip-icon vip-{{ cur_level}}"></i>
{{/ vip_info}}
<span class="iconfont">&#xe604;</span>
</a>
</span>
</li>
</ul>
</div>
\ No newline at end of file
... ...
... ... @@ -23,10 +23,10 @@ var $navLi = $('#fav-tab > li'),
$favProductList = $('.fav-product-list'),
$favBrandList = $('.fav-brand-swiper-wrapper'),
pageId = 1,
brandPageId = 1, //收藏品牌的当前页数
brandPageId = 1, // 收藏品牌的当前页数
lockId = true,
brandLockId = true, //收藏品牌是否可下拉加载更多
brandTab = false; //当前是否停留在收藏品牌页
brandLockId = true, // 收藏品牌是否可下拉加载更多
brandTab = false; // 当前是否停留在收藏品牌页
require('../common');
... ... @@ -38,7 +38,7 @@ function showFavTab(index) {
$favContainer.eq(index).addClass('show');
}
//初始化swiper
// 初始化swiper
function initSwiper(data) {
var i,
idStrReg = /container-(\d+)['"]{1}/gi,
... ... @@ -47,10 +47,10 @@ function initSwiper(data) {
idArrLen = idArr.length,
containerId;
//$swiperList = $('.swiper-container');
// $swiperList = $('.swiper-container');
for (i = 0; i < idArrLen; i++) {
/*id = $swiperList.eq(i).attr('data-id');
/* id = $swiperList.eq(i).attr('data-id');
if (!!swiperObj[id]) {
swiperObj[id].destroy(true, true);
... ... @@ -97,13 +97,13 @@ function loadData($parent, url, page) {
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
window.rePosFooter();
} else if (data.more === true) {
console.log(0)
console.log(0);
//处理data等于end时如果loadingMask存在且没有hide样式的情况
// 处理data等于end时如果loadingMask存在且没有hide样式的情况
if ($loadingMask && !$loadingMask.hasClass('hide')) {
$loadingMask.addClass('hide');
//$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
// $parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
}
$parent.closest('.fav-type').find('.fav-load-background')
... ... @@ -115,14 +115,14 @@ function loadData($parent, url, page) {
} else if (data.length > 10) {
$parent.append(data);
//如果有数据loadingMask会被remove掉
// 如果有数据loadingMask会被remove掉
$loadingMask.remove();
if (url === 'favBrand') {
initSwiper(data);//如果是收藏品牌需要初始化swiper
initSwiper(data);// 如果是收藏品牌需要初始化swiper
brandLockId = false;//请求成功后解锁品牌收藏page++
brandLockId = false;// 请求成功后解锁品牌收藏page++
} else {
lockId = false;//请求成功后解锁商品收藏page++
lockId = false;// 请求成功后解锁商品收藏page++
}
}
window.rePosFooter();
... ... @@ -172,7 +172,7 @@ favTabHammer.on('tap', function(e) {
});
//删除收藏的商品
// 删除收藏的商品
favContentHammer = new Hammer(document.getElementById('fav-content'));
favContentHammer.on('tap', function(e) {
... ... @@ -221,7 +221,7 @@ favContentHammer.on('tap', function(e) {
}
}).fail(function() {
//TODO
// TODO
diaLog.showDialog({
autoHide: true,
... ... @@ -233,7 +233,7 @@ favContentHammer.on('tap', function(e) {
function scrollHandler() {
//距离底部未1/4列表高度+底部高度的时候加载更多
// 距离底部未1/4列表高度+底部高度的时候加载更多
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $favBrandList.height() - footerH) {
if (brandTab) {
$brandLoadMore.filter('.hide').removeClass('hide');
... ... @@ -255,7 +255,7 @@ function scrollHandler() {
}
}
//srcoll to load more
// srcoll to load more
$(window).scroll(scrollHandler);
$(document).on('touchend', '.swiper-header', function() {
... ...