diff --git a/.gitignore b/.gitignore index 0cbaaa4..4639fb0 100644 --- a/.gitignore +++ b/.gitignore @@ -143,3 +143,7 @@ public/bundle/* .vscode/ .DS_Store .devhost + +### foreman ### +Procfile +.env diff --git a/apps/cart/models/easypay.js b/apps/cart/models/easypay.js index 8f498e7..b1427f5 100644 --- a/apps/cart/models/easypay.js +++ b/apps/cart/models/easypay.js @@ -90,8 +90,7 @@ const _handelPaymentInfo = (d) => { _.forEach(d.goods_list, g => { // link to goods - g.linkToGoods = helper.urlFormat(`/product/pro_${g.product_id}_${g.goods_id}/${g.cn_alphabet}.html`, - '', 'item'); + g.linkToGoods = helper.getUrlBySkc(g.product_id, g.goods_id, g.cn_alphabet); }); resData.goodsList = d.goods_list; diff --git a/apps/cart/views/action/order-ensure.hbs b/apps/cart/views/action/order-ensure.hbs index 1a4decf..ab8200a 100644 --- a/apps/cart/views/action/order-ensure.hbs +++ b/apps/cart/views/action/order-ensure.hbs @@ -263,7 +263,7 @@ </div> <ul id="balance-detail" class="balance-detail right"> <li class="gain-coin"> - <a class="gain-coin-tip" href="/help/?category_id=87" target="_blank"></a> + <a class="gain-coin-tip" href="/help/detail?id=105" target="_blank"></a> 共返YOHO币:{{gain_yoho_coin}}个 </li> {{#each promotion_formula_list}} @@ -326,7 +326,7 @@ <p class="btns"> <span id="coin-sure" class="coin-sure sure-btn">确定</span> <span id="coin-cancel" class="coin-cancel cancel-btn">取消</span> - <a href="/help/?category_id=87" class="coin-help" target="_blank">有货币使用规则?</a> + <a href="/help/detail?id=105" class="coin-help" target="_blank">有货币使用规则?</a> </p> </div> <input id="coin-used" type="hidden" data-coin="{{usedCoinNum}}" data-max={{canUseCoinNum}}> diff --git a/apps/common/models/recent-view.js b/apps/common/models/recent-view.js index e1761bf..0a9b6eb 100644 --- a/apps/common/models/recent-view.js +++ b/apps/common/models/recent-view.js @@ -41,8 +41,7 @@ const index = (skn, limit) => { market_price: mp === sp ? '' : `¥${helper.round(mp, 2)}`, price: `¥${helper.round(sp, 2)}`, product_name: hp.product_name, - url: helper.urlFormat( - `/product/pro_${hp.product_id}_${defaultGoods.goods_id}/${hp.cn_alphabet}.html`, null, 'item'), + url: helper.getUrlBySkc(hp.product_id, defaultGoods.goods_id, hp.cn_alphabet), pic_url: helper.image(defaultGoods.images_url, 280, 382, 2, 70) }); }); diff --git a/apps/guang/helpers/pager.js b/apps/guang/helpers/pager.js index 35ecec0..cd50936 100644 --- a/apps/guang/helpers/pager.js +++ b/apps/guang/helpers/pager.js @@ -17,7 +17,7 @@ let ALL_TYPES = { ellipsis: 'p-pe-n' }; -exports.pager = function() { +exports.gpager = function() { let options = arguments[arguments.length - 1]; diff --git a/apps/guang/views/action/guang/editor.hbs b/apps/guang/views/action/guang/editor.hbs index 11adf59..418641d 100644 --- a/apps/guang/views/action/guang/editor.hbs +++ b/apps/guang/views/action/guang/editor.hbs @@ -20,7 +20,7 @@ {{/ msgs}} </div> <div class="msg-pager pager"> - {{pager baseUrl totalRecords=total page=page type="ellipsis" theme="msg-pager"}} + {{gpager baseUrl totalRecords=total page=page type="ellipsis" theme="msg-pager"}} </div> </div> <div class="right-side"> diff --git a/apps/guang/views/action/guang/index.hbs b/apps/guang/views/action/guang/index.hbs index 6235c11..0c7a0e8 100644 --- a/apps/guang/views/action/guang/index.hbs +++ b/apps/guang/views/action/guang/index.hbs @@ -30,7 +30,7 @@ {{> msg}} {{/ msgs}} </div> - {{pager baseUrl totalRecords=total page=page type="ellipsis" theme="msg-pager"}} + {{gpager baseUrl totalRecords=total page=page type="ellipsis" theme="msg-pager"}} </div> </div> <div class="right-side"> diff --git a/apps/guang/views/action/guang/tag.hbs b/apps/guang/views/action/guang/tag.hbs index 5b08e29..9b4c746 100644 --- a/apps/guang/views/action/guang/tag.hbs +++ b/apps/guang/views/action/guang/tag.hbs @@ -12,7 +12,7 @@ {{/ msgs}} </div> - {{pager baseUrl totalRecords=total page=page type="ellipsis" theme="msg-pager"}} + {{gpager baseUrl totalRecords=total page=page type="ellipsis" theme="msg-pager"}} </div> <div class="right-side"> {{> right-side}} diff --git a/apps/guang/views/partial/comment.hbs b/apps/guang/views/partial/comment.hbs index 027d8b9..bd7580b 100644 --- a/apps/guang/views/partial/comment.hbs +++ b/apps/guang/views/partial/comment.hbs @@ -18,6 +18,6 @@ </li> {{/ list}} </ul> - <div class="comment-pager pager">{{pager baseUrl totalRecords=commentNum page=page pageSize=pageSize type="ellipsis" theme="msg-pager"}}</div> + <div class="comment-pager pager">{{gpager baseUrl totalRecords=commentNum page=page pageSize=pageSize type="ellipsis" theme="msg-pager"}}</div> </div> {{/ comment}} diff --git a/apps/help/controllers/about.js b/apps/help/controllers/about.js deleted file mode 100644 index 8764232..0000000 --- a/apps/help/controllers/about.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const yohobuy = (req, res, next) => { - res.render('help/yohobuy'); -}; - -const newpower = (req, res, next) => { - res.render('help/newpower'); -}; - -const contact = (req, res, next) => { - res.render('help/contact'); -}; - -const privacy = (req, res, next) => { - res.render('help/privacy'); -}; - -const yoholink = (req, res, next) => { - res.render('help/link'); -}; - -module.exports = { - yohobuy, - newpower, - contact, - privacy, - yoholink -}; diff --git a/apps/help/controllers/help.js b/apps/help/controllers/help.js new file mode 100644 index 0000000..5285aad --- /dev/null +++ b/apps/help/controllers/help.js @@ -0,0 +1,108 @@ +/** + * 帮助中心 + * @author: jiangmin + * @date: 2016/07/25 + */ + +'use strict'; +const helpModel = require('../models/help'); + +const index = (req, res, next) => { + let siteUrl = global.yoho.config.siteUrl; + let channel = req.query.channel ? req.query.channel : 'boys'; + + helpModel.helpData(channel).then(result => { + if (result.content.menuData.length === 0) { + return next(); + } + + res.render('help', Object.assign({ + module: 'help', + page: 'help-index', + content: Object.assign({ + siteUrl: siteUrl, + isHelp: true, + pathNav: [ + { + href: siteUrl, + name: 'YOHO!BUY 有货首页' + }, + { + name: '帮助中心' + } + ] + }, result.content) + }, result.headerData)); + }).catch(next); +}; + +/** + * 详情 + */ +const detail = (req, res, next) => { + let q = req.query; + let params = { + id: parseInt(q.id || 1, 10), + contId: +req.query.contId || 0, + keywords: req.query.helpQuery, + channel: req.query.channel ? req.query.channel : 'boys', + url: req.originalUrl, + page: q.page || 1 + }; + + let nav = [ + { + href: global.yoho.config.siteUrl, + name: 'YOHO!BUY 有货首页' + }, + { + name: '帮助中心', + href: '/help' + } + ]; + + helpModel.detailData(params).then(result => { + let newData = result.newData; + let headerData = result.headerData; + + if (result.newData.data.menuData.length === 0) { + return next(); + } + + if (!(typeof (newData.nav) === 'undefined')) { + nav = nav.concat(newData.nav); + } + + res.render('detail', Object.assign({ + module: 'help', + page: 'help', + content: Object.assign({ + isHelp: true, + pathNav: nav, + helpQuery: req.query.helpQuery + }, newData.data), + qid: q.helpQuery ? false : params.id + }, headerData)); + }).catch(next); +}; + +// 帮助搜索功能 +const search = (req, res, next) => { + helpModel.searchData(req.query).then(result => { + res.json(result); + }).catch(next); +}; + +// 获取在线客服的链接 +const onlineService = (req, res, next) => { + helpModel.onlineService().then(url => { + res.json(url); + }).catch(next); +}; + +module.exports = { + index, + detail, + search, + onlineService +}; diff --git a/apps/help/controllers/index.js b/apps/help/controllers/index.js deleted file mode 100644 index d958441..0000000 --- a/apps/help/controllers/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -const mRoot = '../models'; - -const index = (req, res, next) => { - res.render('help/index', {}); -}; - -module.exports = { - index -}; diff --git a/apps/help/index.js b/apps/help/index.js index 4faa081..e4e3e81 100644 --- a/apps/help/index.js +++ b/apps/help/index.js @@ -1,32 +1,34 @@ /** - * sub app help - * @author: yyq<yanqing.yang@yoho.cn> - * @date: 2016/11/14 + * help + * @author: lcy<chuanyang.liu@yoho.cn> + * @date: 2016/08/31 */ + 'use strict'; -var express = require('express'), - path = require('path'); + var express = require('express'), + path = require('path'); -var app = express(); + var app = express(); // set view engin -var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root - -app.on('mount', function(parent) { - delete parent.locals.settings; // 不继承父 App 的设置 - Object.assign(app.locals, parent.locals); -}); - -app.use(global.yoho.hbs({ - extname: '.hbs', - defaultLayout: 'layout', - layoutsDir: doraemon, - partialsDir: [path.join(__dirname, 'views/partial')], - views: path.join(__dirname, 'views/action'), - helpers: global.yoho.helpers -})); + var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root + + app.on('mount', function(parent) { + delete parent.locals.settings; // 不继承父 App 的设置 + Object.assign(app.locals, parent.locals); + }); + + app.use(global.yoho.hbs({ + extname: '.hbs', + defaultLayout: 'layout', + layoutsDir: doraemon, + partialsDir: [path.join(__dirname, 'views/partial')], + views: path.join(__dirname, 'views/action'), + helpers: global.yoho.helpers + })); // router -app.use(require('./router')); + app.use(require('./router')); + + module.exports = app; -module.exports = app; diff --git a/apps/help/models/help-api.js b/apps/help/models/help-api.js new file mode 100644 index 0000000..ebb72d3 --- /dev/null +++ b/apps/help/models/help-api.js @@ -0,0 +1,80 @@ +/** + * 帮助中心首页 + * @author: wsl<shuiling.wang@yoho.cn> + * @date: 2016/12/13 + */ + +'use strict'; + +const api = global.yoho.API; + +// 获取热词搜索 +const getHotSearch = () => { + return api.get('', { + method: 'app.helper.hotSearch', + showPlatform: 'yohobuy_pc' + }, { + code: 200, + cache: true + }); +}; + +// 获取首页帮助分类以及常见问题 +const gethomeCategoryFaq = () => { + return api.get('', { + method: 'app.helper.homeCategoryFaq', + showPlatform: 'yohobuy_pc' + }, { + code: 200, + cache: true + }); +}; + +// 获取自助服务 +const getSelfService = () => { + return api.get('', { + method: 'app.helper.selfService', + showPlatform: 'yohobuy_pc' + }, { + code: 200 + }); +}; + +const helpSearch = (params) => { + return api.get('', { + method: 'app.helper.search', + showPlatform: 'yohobuy_pc', + keyword: params.keywords, + page: params.page, + viewNum: '15', + debug: 'XYZ' + }, { + code: 200 + }); +}; + +const allQA = (page) => { + return api.get('', { + method: 'app.helper.allQA', + showPlatform: 'yohobuy_pc', + viewNum: 15, + page: page + }, { + code: 200 + }); +}; + +const onlineService = () => { + return api.get('', { + method: 'app.helper.getServiceOnline' + }); +}; + +module.exports = { + getHotSearch, + gethomeCategoryFaq, + getSelfService, + helpSearch, + allQA, + onlineService +}; diff --git a/apps/help/models/help.js b/apps/help/models/help.js new file mode 100644 index 0000000..983cdfd --- /dev/null +++ b/apps/help/models/help.js @@ -0,0 +1,368 @@ +/** + * 帮助中心 + * @author: jiangmin + * @date: 2016/07/27 + */ + +'use strict'; +const _ = require('lodash'); +const helpApi = require('./help-api'); +const headerModel = require('../../../doraemon/models/header'); +const pager = require(`${global.utils}/pager`).setPager; + +/** + * 根据id获取当前所在位置,拼接面包屑 + * @param id + * @param menuData + * @returns {*[]} + * @private + */ +const _getNav = (id, menuData, url)=> { + for (let i = 0; i < menuData.length; i++) { + if (menuData[i].subsets) { + for (let j = 0; j < menuData[i].subsets.length; j++) { + if (menuData[i].subsets[j].id === id) { + return [ + { + href: url, + name: menuData[i].categoryName + }, { + name: menuData[i].subsets[j].categoryName + } + ]; + } + } + } else { + if (menuData[i].id === id) { + return [ + { + name: menuData[i].categoryName + } + ]; + } + } + } +}; + +// 首页链接组装 +const _processLink = (list, id) => { + let params = ''; + + list = list || []; + + _.forEach(list, d => { + if (id) { + params = 'id=' + id + '&contId=' + d.id; + } else { + params = 'id=' + d.id; + } + + d.jumpLink = global.yoho.config.siteUrl + '/help/detail?' + params; + }); + + return list; +}; + +// 处理分类 +const _processMenuType = (item) => { + let curMenu = { + id: item.id, + categoryName: item.categoryName + }; + + let subsets = []; + + if (item.categoryItems) { + _.forEach(item.categoryItems, c => { + subsets.push({ + id: c.id, + parendId: item.id, + categoryName: c.categoryName + }); + }); + curMenu.subsets = subsets; + } + + return curMenu; +}; + +// 统计当前分类下的内容是否大于1 +const _processCountLength = (c) => { + if (!c.contentItems) { + return false; + } else { + return c.contentItems.length > 1; + } +}; + +// 首页模块内容处理 +const _processHomeCategoryFaq = (list) => { + let result = { + menuData: [] + }; + + list = list || {}; + + // 常见问题 + if (list.faqs) { + result.menuData.push({ + id: 1, + categoryName: '常见问题' + }); + } + + _.forEach(list.categorys, (item) => { + let newCont = []; + + result.menuData.push(_processMenuType(item)); + + if (item.categoryItems) { + item.categoryItems = _processLink(item.categoryItems); + } else { + item.contentItems = _processLink(item.contentItems, item.id); + } + + switch (item.categoryName) { + case '新手指南': + _.forEach(item.categoryItems, (ng, k) => { + ng.index = k + 1; + }); + + item.categoryItems = _.chunk(item.categoryItems, 6); + result.newGuide = item; + break; + case '公告': + _.forEach(item.contentItems, (c, k) => { + c.caption = c.caption.substring(0, 10); + c.index = k; + }); + + _.chunk(item.contentItems, 2).forEach(data => { + newCont.push({ + row: data + }); + }); + + result.notice = newCont; + break; + default: + break; + } + }); + + result.problem = { + categoryName: '常见问题', + list: list.faqs + }; + + return result; +}; + +const returnCont = (data, contId) => { + let curCont = {}; + + if (!data.contentItems) { + return; + } + + _.forEach(data.contentItems, c => { + if (c.id === contId) { + curCont = c; + } + }); + + return { + isShowMenu: _processCountLength(data), + id: data.id, + title: data.categoryName, + list: data.contentItems, + contId: contId ? contId : data.contentItems[0].id, + cont: contId ? curCont : data.contentItems[0] + }; +}; + +// 处理详情内容 +const _processDetailCont = (item, params) => { + let cont = false; + + if (item.contentItems && item.id === params.id) { + return returnCont(item, params.contId); + } + + if (item.categoryItems) { + _.forEach(item.categoryItems, c => { + if (c.id === params.id) { + cont = returnCont(c, params.contId); + } + }); + return cont; + } + return false; +}; + +// 处理搜索结果内容 +const _processSearch = (list, params) => { + list = list || []; + + if (list.total === 0) { + return { + error: true + }; + } else { + let page = pager(_.get(list, 'page_total', 0), { + page: params.page, + helpQuery: params.keywords + }); + + list = _.assign({ + footPager: page + }, list); + } + + return list; +}; + +// 详情内容及分类数据 +const _processDetailData = (result, params) => { + let menuData = []; + let contData = false; + let data = _.get(result, '[2].data', {}); + let nav = []; + + // 常见问题 + if (data.faqs) { + menuData.push({ + id: 1, + categoryName: '常见问题' + }); + + if (params.id === 1 && !params.keywords) { + let page = pager(_.get(result, '[3].data.page_total', 0), { + id: params.id, + page: params.page + }); + + contData = { + isShowMenu: _processCountLength(data.faqs), + id: 1, + commonProblem: true, + faqs: data.faqs, + allQa: _.get(result, '[3].data.list', []), + footPager: page + }; + } + } + + // 其它分类数据处理 + _.forEach(data.categorys, item => { + let resCont; + + menuData.push(_processMenuType(item)); + + if (contData || params.keywords) { + return; + } + + resCont = _processDetailCont(item, params); + + if (resCont) { + contData = _.assign({ + helpDetail: true + }, resCont); + } + }); + + if (params.keywords) { + nav = [ + { + name: '搜索结果' + } + ]; + } else { + nav = _getNav(params.id, menuData, params.url); + } + + return { + nav: nav, + data: { + menuData: menuData, + contData: contData + } + }; +}; + +// 自助服务数据处理 +const _processServiceData = (data) => { + _.forEach(data, (item, k) => { + item.index = k + 1; + }); + + return _.chunk(data, 4); +}; + +// 首页 +const helpData = (channel) => { + return Promise.all([ + headerModel.requestHeaderData(channel), + helpApi.getHotSearch(), + helpApi.gethomeCategoryFaq(), + helpApi.getSelfService() + ]).then(result => { + return { + headerData: _.get(result, '[0]', {}), + content: _.assign({ + hotSearch: _.slice(_.get(result, '[1].data', []), 0, 4), + selfService: { + categoryName: '自助服务', + list: _processServiceData(_.get(result, '[3].data', [])) + } + }, _processHomeCategoryFaq(_.get(result, '[2].data', {}))) + }; + }); +}; + +// 详情 +const detailData = (params) => { + let promiseData = [ + headerModel.requestHeaderData(params.channel), + helpApi.getHotSearch(), + helpApi.gethomeCategoryFaq() + ]; + + if (params.id === 1 && !params.keywords) { + promiseData.push(helpApi.allQA(params.page)); + } + + return Promise.all(promiseData).then(result => { + let newData = _processDetailData(result, params); + + _.set(newData, 'data.hotSearch', _.slice(_.get(result, '[1].data', []), 0, 4)); + return { + headerData: _.get(result, '[0]', {}), + newData: newData + }; + }); +}; + +// 搜索 +const searchData = (params) => { + return helpApi.helpSearch(params).then(result => { + return _.assign({ + keywords: params.keywords + }, _processSearch(_.get(result, 'data', []), params)); + }); +}; + +// 在线客服 +const onlineService = () => { + return helpApi.onlineService().then(result => { + return _.get(result, 'data.url', ''); + }); +}; + +module.exports = { + helpData, + detailData, + searchData, + onlineService +}; diff --git a/apps/help/router.js b/apps/help/router.js index 3c220fb..740b3f4 100644 --- a/apps/help/router.js +++ b/apps/help/router.js @@ -1,7 +1,7 @@ /** - * router of sub app help - * @author: yyq<yanqing.yang@yoho.cn> - * @date: 2016/11/14 + * router of sub app me + * @author: xuqi<qi.xu@yoho.cn> + * @date: 2016/07/04 */ 'use strict'; @@ -9,14 +9,14 @@ const router = require('express').Router(); // eslint-disable-line const cRoot = './controllers'; -const help = require(`${cRoot}/index`); -const about = require(`${cRoot}/about`); -router.get('/help', help.index); +// 帮助中心 +const help = require(`${cRoot}/help`); -router.get('/yohobuy.html', about.yohobuy); -router.get('/newpower.html', about.newpower); -router.get('/contact.html', about.contact); -router.get('/privacy.html', about.privacy); -router.get('/link.html', about.yoholink); +// 帮助中心 +router.get('/', help.index); +router.get('/detail', help.detail); +router.get('/search', help.search); +router.get('/onlineService', help.onlineService); + module.exports = router; diff --git a/apps/help/views/action/detail.hbs b/apps/help/views/action/detail.hbs new file mode 100644 index 0000000..502c564 --- /dev/null +++ b/apps/help/views/action/detail.hbs @@ -0,0 +1,33 @@ +<div class="help-page blk-page"> + <div class="center-content clearfix"> + {{# content}} + {{!-- 头部面包屑 --}} + {{> common/path-nav}} + + {{!-- 左侧菜单导航 --}} + <div class="help-navigation left"> + <p class="title bold">帮助中心</p> + {{>menu}} + </div> + + {{!-- 右侧页面内容 --}} + <div class="help-main left"> + <div class="detail-search"> + {{> search-form}} + </div> + <div class="detail-cont"> + {{#contData}} + {{#if commonProblem}} + {{> common-problem}} + {{/if}} + + {{#if helpDetail}} + {{> help-detail}} + {{/if}} + {{/contData}} + </div> + </div> + {{/ content}} + </div> + +</div> diff --git a/apps/help/views/action/help.hbs b/apps/help/views/action/help.hbs new file mode 100644 index 0000000..4ad26d9 --- /dev/null +++ b/apps/help/views/action/help.hbs @@ -0,0 +1,72 @@ +<div class="help-page blk-page"> + <div class="center-content clearfix"> + {{# content}} + {{!-- 头部面包屑 --}} + {{> common/path-nav}} + + {{!-- 左侧菜单导航 --}} + <div class="help-navigation left"> + <p class="title bold">帮助中心</p> + {{>menu}} + </div> + + {{!-- 右侧页面内容 --}} + <div class="help-main left"> + <div class="nav-top"> + <span class="title-img"></span> + <ul class="notice" id="notice"> + {{#each notice}} + <li> + {{#each row}} + <a class="notice-cont" href="{{jumpLink}}" target="_blank" data-index={{index}}><i class="dot-icon"></i> <span class="notice-txt">{{caption}}</span></a> + {{/each}} + </li> + {{/each}} + </ul> + {{> search-form}} + </div> + + {{#newGuide}} + {{> nav-title}} + <ul class="menu-common new-guide"> + {{#each categoryItems}} + <li> + {{#each .}} + <a href="{{jumpLink}}" target="_blank" {{#if @first}}style="margin-left: 0;"{{/if}} data-index={{index}}> + <img src="{{categoryIco}}" width="55" height="55"> + <p>{{categoryName}}</p> + </a> + {{/each}} + </li> + {{/each}} + </ul> + {{/newGuide}} + + {{#selfService}} + {{> nav-title}} + <ul class="menu-common self-service"> + {{#each list}} + <li> + {{#each .}} + <a href="{{jumpUrl}}" target="_blank" {{#if @first}}style="margin-left: 0;"{{/if}} data-index={{index}}> + <img src="{{categoryIco}}" width="55" height="55"> + <p>{{categoryName}}</p> + </a> + {{/each}} + </li> + {{/each}} + </ul> + {{/selfService}} + + {{#problem}} + {{> nav-title}} + <div class="problem"> + {{#each list}} + <a href="javascript:void(0);" data-ask="{{caption}}" data-answer="{{content}}"><i class="dot-icon"></i>{{caption}}</a> + {{/each}} + </div> + {{/problem}} + </div> + {{/ content}} + </div> +</div> \ No newline at end of file diff --git a/apps/help/views/action/help/contact.hbs b/apps/help/views/action/help/contact.hbs deleted file mode 100644 index 4c19012..0000000 --- a/apps/help/views/action/help/contact.hbs +++ /dev/null @@ -1,78 +0,0 @@ -<div class="contact-about-page about-page center-content yoho-page"> - <div class="about-nav right"> - <ul> - <li><a href="/yohobuy.html">关于YOHO!BUY 有货</a></li> - <li><a href="/newpower.html">关于新力传媒</a></li> - <li class="act"><a>联系我们</a></li> - <li><a href="/privacy.html">隐私条款</a></li> - <li><a href="/link.html">友情链接</a></li> - </ul> - </div> - <div class="main-container"> - <div class="text-title">联系我们</div> - <div class="text-info"> - <p> - <strong>客户服务:</strong><br/> - 电话:4008899646(工作日9:00-22:30)<br/> - EMAIL:service#yoho.cn (发送邮件时请将#换成@) - </p><br/> - <p> - <strong>广告服务:</strong><br/> - 北京:(+86)10 56312657<br/> - 上海:(+86)21 51698833*8005<br/> - 广州:(+86)83831060<br/> - EMAIL:advertising#yoho.cn (发送邮件时请将#换成@) - </p><br/> - <p> - <strong>市场合作:</strong><br/> - 北京:(+86)10 56312548<br/> - 上海:(+86)21 51698833*8013<br/> - EMAIL:marketing#yoho.cn (发送邮件时请将#换成@) - </p><br/> - <p> - <strong>网站合作:</strong><br/> - EMAIL:community#yoho.cn (发送邮件时请将#换成@) - </p><br/> - <p> - <strong>有货品牌合作:</strong><br/> - 上海:(+86)21 51698833*8007<br/> - 广州:(+86)83831060<br/> - EMAIL:brands#yoho.cn (发送邮件时请将#换成@) - </p><br/> - <p> - <strong>有货推广合作:</strong><br/> - EMAIL:haizheng.zhao#yoho.cn (发送邮件时请将#换成@) - </p><br/> - <p> - <strong>南京新与力文化传播有限公司:</strong><br/> - 地址:南京市建邺区嘉陵江东街18号国家广告产业园5栋17,18楼<br/> - 邮编:210017<br/> - 电话:(+86)25 87781000<br/> - 传真:(+86)25 87781155<br/> - </p><br/> - <p> - <strong>南京新与力文化传播有限公司北京分公司:</strong><br/> - 地址:北京市朝阳区建国路81号华贸中心1号楼3层<br/> - 邮编:100025<br/> - 电话:(+86)10 56312400<br/> - </p><br/> - <p> - <strong>南京新与力文化传播有限公司上海分公司:</strong><br/> - 地址:上海市徐汇区富民路291号悟锦世纪大厦801室<br/> - 邮编:200040<br/> - 电话:(+86)21 51698833 - </p><br/> - <p> - <strong>南京新与力文化传播有限公司广州分公司:</strong><br/> - 地址:广州市天河区林和西路157号保利中汇大厦A座602室<br/> - 邮编:510610<br/> - 电话:(+86)20 83777600 - </p><br/> - <p> - <strong>南京新与力文化传播有限公司香港分公司:</strong><br/> - 地址:香港鰂魚涌海澤街28號東港中心1505室<br/> - 电话:(+852)34602671 - </p><br/> - </div> - </div> -</div> diff --git a/apps/help/views/action/help/index.hbs b/apps/help/views/action/help/index.hbs deleted file mode 100644 index 982ce4d..0000000 --- a/apps/help/views/action/help/index.hbs +++ /dev/null @@ -1 +0,0 @@ -index.hbs diff --git a/apps/help/views/action/help/newpower.hbs b/apps/help/views/action/help/newpower.hbs deleted file mode 100644 index f6edbfe..0000000 --- a/apps/help/views/action/help/newpower.hbs +++ /dev/null @@ -1,46 +0,0 @@ - -<div class="newpower-about-page about-page center-content yoho-page"> - <div class="about-nav right"> - <ul> - <li><a href="/yohobuy.html">关于YOHO!BUY 有货</a></li> - <li class="act"><a>关于新力传媒</a></li> - <li><a href="/contact.html">联系我们</a></li> - <li><a href="/privacy.html">隐私条款</a></li> - <li><a href="/link.html">友情链接</a></li> - </ul> - </div> - <div class="main-container"> - {{#if devEnv}} - <img src="//cdn.yoho.cn/yohobuy/assets/img/about/aboutnewpower.png?random=1466056691"/> - {{^}} - <img src="//cdn.yoho.cn/yohobuy/assets/img/about/aboutnewpower.png?random=1466056691"/> - {{/if}} - <div class="text-info"> - <p style="font-family:微软雅黑; text-align:left;"> - <span style="font-size:18px; line-height:68px;">一、公司概况:</span> - <br/> - 南京新与力文化传播有限公司(简称新力传媒)——中国潮流文化生态圈的创造者和引领者。10年以来,YOHO!致力于中国潮流产业的发展,从一本《YOHO!潮流志》开始,延伸到网络社区、电子商务等等领域,成为中国最权威和最具影响力的潮流“营、销”平台。我们通过媒体+零售线上线下一体化布局,为中国数以亿计的潮流消费者提供潮流讯息、产品及服务,并传播积极健康、全球化的潮流生活方式,更为中国的年轻一代消费者带来了来自全球的潮流生活方式。公司总部位于南京建邺区国家广告产业园,并在北京、上海、广州、香港、东京设立了分(子)公司。公司已获得鼎晖投资、新加坡淡马锡祥峰基金、软银赛富基金、达晨创投、华人文化等数轮投资。公司致力于将“YOHO!”打造成为中国年轻人最喜爱和最值得信赖的品牌,引领中国潮流文化产业的发展。 - <br/> - <br/> - <span style="font-size:18px; line-height:68px;">二、公司主要项目:</span> - <br/> - 1、平面杂志及电子平台 - <br/> - 《YOHO!潮流志》、《YOHO!GIRL》为YOHO!旗下在国内潮流领域影响力的杂志媒体。《YOHO!潮流志》2005 年10月创刊。他是国内第一本完全原创版权的,提供潮流和 lifestyle 资讯,属于年轻人的潮流时尚半月刊,通过正规发行渠道(报刊亭、连锁商超等)发行至全国各大中城市,深受全国年轻人的喜爱。设计给国内年轻女性的中高端时装月刊《YOHO!GIRL》,2013年3月正式创刊,在香港、大陆以及日本东京茑屋地区同步发行。以大量独家资讯加上独特的编采手法,改变读者的阅读习惯,扩阔大家在时装、美容、设计、生活、次文化等各方面的视野。深入结构品牌背后的哲学和时装趋势,带领各读者一探最新时尚。 - <br/> - <br/> - 作为中国影响力最大、权威性最高、发行量最广的潮流杂志电子平台, “Yoho!Now”于 iOS 和 Android平台触亮全球潮流资讯,“Yoho!Now”7*24h 无休供应时装、运动、设计、科技、美容、家居、趣闻等严选潮流营养,并于每周发布特别线上专题,与读者Play and Learn。《YOHO!潮流志》和《YOHO!GIRL》亦于各自App內每周上架新鲜线上周刊,打包纸质版内容精华,汇通YOHO!潮流矩阵。 - <br/> - <br/> - 2、关于“Yoho!Buy有货” - <br/> - “Yoho!Buy有货”(www.yohobuy.com)——年轻人潮流购物中心,同样秉承YOHO!“年轻是种态度”的口号,Yoho!Buy有货专注于中国潮流趋势和受众的需要,凭借专业的买手团队和对中国潮流趋势敏锐的嗅觉,积极开拓符合中国年轻人喜爱的品牌和商品。销售包括国际知名、日韩港台流行、明星设计师、内地原创等等超过1000 个潮流品牌商品,满足18-35岁年轻群体的时尚个性化述求,涵盖男女服装、鞋帽、配件、童装及创意生活用品等。Yoho!Buy有货所销售的品牌均与品牌直接签订销售协议,保持货品与国际国内实体店铺同步,通过独家定制、限定发售、明星合作品牌等,并结合“逛”内容频道及社区互动引导消费。Yoho!Buy有货已成为中国年轻态群体最喜爱的潮流购物平台。 - <br/> - <br/> - 3、关于“mars - 新鲜好去处” - <br/> - “mars - 新鲜好去处”是一款由YOHO!出品的潮流生活应用,立志为百万年轻人打造最酷的“城市探索”线上枢纽。连续两周被 Apple 评选为App Store“最佳新应用”,并获得 2016 年“一月最佳 App”、“最佳生活 App”等推荐。mars深入探索全球热点城市潮流坐标,现已上线北京、上海、成都、台北、香港、东京、首尔、纽约、洛杉矶等城市,未来还将陆续上线更多城市。集优质潮流攻略、专属玩乐线路、每日热点话题等功能,邀集世界各地时髦生活方式达人与所有用户分享好去处,让潮流随时、随地、随享。我们的目标就是带你去那些“如果你不用 mars 可能一辈子都不知道”的潮流好去处。 - </p> - </div> - </div> -</div> diff --git a/apps/help/views/action/help/privacy.hbs b/apps/help/views/action/help/privacy.hbs deleted file mode 100644 index d544898..0000000 --- a/apps/help/views/action/help/privacy.hbs +++ /dev/null @@ -1,70 +0,0 @@ -<div class="privacy-about-page about-page center-content yoho-page"> - <div class="about-nav right"> - <ul> - <li><a href="/yohobuy.html">关于YOHO!BUY 有货</a></li> - <li><a href="/newpower.html">关于新力传媒</a></li> - <li><a href="/contact.html">联系我们</a></li> - <li class="act"><a>隐私条款</a></li> - <li><a href="/link.html">友情链接</a></li> - </ul> - </div> - <div class="main-container"> - <div class="text-title">隐私条款</div> - <div class="text-info"> - <p> - 欢迎访问YOHO!BUY 有货!我们以本隐私申明声明对访问者隐私保护的许诺。<br> - <br> - <strong>YOHO!BUY</strong> - <strong>有货的信息收集与使用</strong><br> - YOHO!BUY 有货收集用户提交的个人识别信息(下称“个人识别信息”), 一旦注册,YOHO!BUY 有货用户即可以建立由一页或多页网页组成的含有用户信息的用户档案。YOHO!BUY 有货 将收集用户发布在其用户档案中的数据,包括但不限于: 会员信息,联系信息,购物&着装习惯和喜爱品牌(合称为“用户档案信息”),我们使用这些信息来获得用户的统计资料。我们将会用这些统计数据来给我们的用户分类,以便有针对性地向我们的用户提供新的服务。我们会通过您的邮件地址来通知您这些新的服务。<br> - <br> - YOHO!BUY 有货同样从用户处收集其他非个人识别信息(下称“非个人识别信息”),包括IP地址、集合的用户数据和浏览器类型。该等数据会被用来管理YOHO!BUY 有货网站,跟踪使用记录,改进YOHO!BUY 有货网站的服务。该等非个人识别信息通常被用于下列目的:研究和分析站点的使用情况,订制您浏览的广告和内容,满足您对服务的要求,以及改进我们的服务。出于安全和监管的目的,用户的IP地址将会被记录。<br> - <br> - YOHO!BUY 有货或其商业伙伴可能在YOHO!BUY 有货上不时地进行促销或者抽奖。用户可能会被要求提供个人识别信息,包括姓名,电子邮件地址或家庭住址。因进行促销或者抽奖而收集个人识别信息时,您将清楚地被告知个人识别信息的收集方以及适用的隐私政策。<br> - <br> - <strong>YOHO!BUY</strong> - <strong>有货收集信息的共享与披露</strong><br> - 除本隐私政策另有规定,YOHO!BUY 有货不会在未经您同意的情况下在YOHO!BUY 有货及其母公司、子公司或者关联公司(为本隐私政策之目的,包括遵守本隐私政策的技术提供者)之外泄露您的个人识别信息或者用户档案信息,除非我们认为这种披露是有必要的:(1)为遵守法律的要求或者回应YOHO!BUY 有货收到的传票、搜查令或者其他法律程序,而不论该等回应是否为适用法律所要求的;(2)为回应主管政府部门的要求;(3)为了保护公众和服务用户的安全;或者(4)为了维护YOHO!BUY 有货的法律权利和利益。<br> - 当YOHO!BUY 有货出售YOHO!BUY 有货或其全部资产时,YOHO!BUY 有货保留向其继任者转让个人识别信息和用户档案信息的权利。<br> - YOHO!BUY 有货也可以向某些您明确同意接收其信息的广告合作伙伴转让您的个人识别信息和用户档案信息。因此进行个人识别信息的收集时,您将清楚地被告知适用的隐私政策。<br> - <br> - <br> - <br> - <strong>用户名和密码</strong><br> - YOHO!BUY 有货用户账号通过用户创设的密码确保其安全性。您应当对您密码的保密负全部责任。请不要和他人分享此信息。如果您泄漏了密码,您可能丢失了您的个人识别信息,并且有可能导致对您不利的司法行为。如果您和他人共享一台电脑,您应该在离开YOHO!服务时退出系统以保证您的信息不被后来使用该电脑者获取。<br> - 因此不管任何原因使您的密码安全受到危及,您应该立即通过请与我们客服联系客服热线:400-889-9646和我们取得联系 。<br> - <br> - <strong>您的交易行为</strong><br> - 我们跟踪IP地址仅仅只是为了安全的必要。如果我们没有发现任何安全问题,我们会及时删除我们收集到的IP地址。我们还跟踪全天的页面访问数据。全天页面访问数据被用来反映网站的流量,我们可以为未来的发展制定计划(例如,增加服务器)。<br> - <br> - <strong>邮件</strong> - <strong>/</strong> - <strong>短信</strong> - <strong>/</strong> - <strong>会刊服务</strong><br> - YOHO!BUY 有货保留通过邮件、短信、邮寄会刊的形式,对本网站注册、购物用户发送订单信息、促销活动等告知服务的权利。如果您在YOHO!BUY 有货注册、购物,表明您已默示同意接受此项服务。如果您不想接收来自YOHO!BUY 有货的邮件、短信或会刊,您可以向YOHO!BUY 有货客服提出退阅申请,并注明您的E-mail地址、手机号或相关地址信息,YOHO!BUY 有货会在收到申请后为您办理退阅。<br> - <br> - <strong>Cookies</strong> - <strong>的使用</strong><br> - YOHO!BUY 有货使用cookies来储存用户的喜好和记录活动信息以确保用户不会重复收到同样的广告和定制的时事通讯、广告以及基于浏览器类型和用户档案信息的网页内容。我们不会把在cookies中保存的信息与您在我们网站上提交的任何个人识别信息相连接。您可以通过设置您的浏览器以接受或者拒绝全部或部分的cookies,或要求在cookies被设置时通知您。由于每个浏览器是不同的,请查看浏览器的“帮助”菜单来了解如何更改您的cookies选择参数。但是,您应允许来自YOHO!BUY 有货的cookies以使您可以使用网站的更多的功能。<br> - <br> - <strong>外部链接</strong><br> - YOHO!BUY 有货包含其他网站的链接。YOHO!BUY 有货不对其他网站上的隐私政策和/或其执行承担责任。当链接到其他网站时,用户应该阅读该网站贴示的隐私政策。我们的隐私政策仅适用于YOHO!BUY 有货收集的信息。<br> - <br> - <strong>第三方广告</strong><br> - YOHO!BUY 有货可能会通过与第三方合作向用户提供YOHO!服务。因此,YOHO!BUY 有货可能向该第三方提供您提交给YOHO!BUY 有货的个人识别信息和用户档案信息;但该第三方应同意承担与YOHO!BUY 有货相同的责任以保护用户的隐私。另外,在不会披露用户的个人识别信息和用户档案信息的前提下,YOHO!BUY 有货可以对集合的用户个人识别信息和用户档案进行分析和商业性使用。<br> - <br> - <strong>安全</strong><br> - 我们网站有相应的安全措施来确保我们掌握的信息不丢失,不被滥用和变造。这些安全措施包括向其它服务器备份数据和对用户密码。<br> - <br> - YOHO!BUY 有货会采取合理的防范措施以确保用户个人识别信息和用户档案信息的保密性。我们会采取合理措施保护存储在我们数据库中的用户个人识别信息和用户档案信息,并且对那些需要履行其工作职责的雇员,比如我们的客户服务人员和技术人员,获取用户个人识别信息和用户档案信息进行限制。请注意,我们无法保证用户个人识别信息和用户档案信息的安全性。未授权的登陆或使用、硬件或软件的故障、以及其他因素均可能在任何时候危及用户个人识别信息的安全性。<br> - <br> - <strong>隐私政策的变更</strong><br> - 我们可能对本隐私政策不时进行修改。如果我们进行任何修改,我们将在YOHO!BUY 有货主页上发布为期30天的通知以使用户知道被修改内容的类型以及指示用户审阅更新的隐私政策。如果您在对本隐私政策任何细微修改发布后继续使用网站,则表示您同意遵守任何该等修改。<br> - <br> - <strong>联系我们</strong><br> - 如果您就本隐私政策有任何疑问,请与我们客服联系客服热线:400-889-9646。<br> - </p> - </div> - </div> -</div> diff --git a/apps/help/views/action/help/yohobuy.hbs b/apps/help/views/action/help/yohobuy.hbs deleted file mode 100644 index abc7091..0000000 --- a/apps/help/views/action/help/yohobuy.hbs +++ /dev/null @@ -1,34 +0,0 @@ - -<div class="yohobuy-about-page about-page center-content yoho-page"> - <div class="about-nav right"> - <ul> - <li class="act"><a>关于YOHO!BUY 有货</a></li> - <li><a href="/newpower.html">关于新力传媒</a></li> - <li><a href="/contact.html">联系我们</a></li> - <li><a href="/privacy.html">隐私条款</a></li> - <li><a href="/link.html">友情链接</a></li> - </ul> - </div> - <div class="main-container"> - {{#if devEnv}} - <img src="//cdn.yoho.cn/yohobuy/assets/img/about/about.jpg?random=1466056691" /> - {{^}} - <img src="//cdn.yoho.cn/yohobuy/assets/img/about/about.jpg?random=1466056691" /> - {{/if}} - <div class="text-info"> - <p style="font-family:微软雅黑; text-align:left;">关于“Yoho!Buy 有货”</p> - <p style="font-family:微软雅黑; text-align:left;"> - “Yoho!Buy 有货”( - <a style=" font:#000;" href="//www.yohobuy.com" target="_blank">www.yohobuy.com</a> - )——年轻人潮流购物中心,同样秉承YOHO!“年轻是种态度”的口号,Yoho!Buy有货专注于中国潮流趋势和受众的需要,凭借专业的买手团队和对中国潮流趋势敏锐的嗅觉,积极开拓符合中国年轻人喜爱的品牌和商品。销售包括国际知名、日韩港台流行、明星设计师、内地原创等等超过1000 个潮流品牌商品,满足18-35岁年轻群体的时尚个性化述求,涵盖男女服装、鞋帽、配件、童装及创意生活用品等。Yoho!Buy有货所销售的品牌均与品牌直接签订销售协议,保持货品与国际国内实体店铺同步,通过独家定制、限定发售、明星合作品牌等,并结合“逛”内容频道及社区互动引导消费。Yoho!Buy有货已成为中国年轻态群体最喜爱的潮流购物平台。<br> - </p> - <p> - {{#if devEnv}} - <img src="//cdn.yoho.cn/yohobuy/assets/img/about/about_yohobuy.jpg?random=1466056691" /> - {{^}} - <img src="//cdn.yoho.cn/yohobuy/assets/img/about/about_yohobuy.jpg?random=1466056691" /> - {{/if}} - </p> - </div> - </div> -</div> diff --git a/apps/help/views/partial/common-problem.hbs b/apps/help/views/partial/common-problem.hbs new file mode 100644 index 0000000..5ef9984 --- /dev/null +++ b/apps/help/views/partial/common-problem.hbs @@ -0,0 +1,20 @@ +<div class="common-problem"> + <h2 class="nav-title">常见问题</h2> + <div class="problem"> + {{#faqs}} + <a href="javascript:void(0);" data-ask="{{caption}}" data-answer="{{content}}"><i class="dot-icon"></i>{{caption}}</a> + {{/faqs}} + </div> + <h2 class="all-problem-title nav-title">所有问题一览</h2> + <ul class="all-problem"> + {{#allQa}} + <li class="problem-li"> + <p class="title">{{caption}}</p> + <div class="cont">{{{content}}}</div> + </li> + {{/allQa}} + </ul> + {{> common/foot-pager}} +</div> + + diff --git a/apps/help/views/partial/help-detail.hbs b/apps/help/views/partial/help-detail.hbs new file mode 100644 index 0000000..bdbd690 --- /dev/null +++ b/apps/help/views/partial/help-detail.hbs @@ -0,0 +1,17 @@ +<div class="help-detail"> + {{#if isShowMenu}} + <h2 class="nav-title">{{title}}</h2> + <div class="detail-problem"> + {{#list}} + <a href="/help/detail?id={{../id}}&contId={{id}}" class="{{#isEqual id ../contId}}active{{/isEqual}}"><i class="dot-icon"></i>{{caption}}</a> + {{/list}} + </div> + {{/if}} + + <div class="help-cont"> + {{#cont}} + <h2 class="nav-title">{{caption}}</h2> + <div class="cont">{{{content}}}</div> + {{/cont}} + </div> +</div> diff --git a/apps/help/views/partial/menu.hbs b/apps/help/views/partial/menu.hbs new file mode 100644 index 0000000..dd5476c --- /dev/null +++ b/apps/help/views/partial/menu.hbs @@ -0,0 +1,22 @@ +<ul class="nav"> + {{#each menuData}} + {{#if subsets}} + <li class="big-category cateId-{{id}} subsets {{#isEqual id @root.qid}}selected{{/isEqual}}"> + <div class="icon plus inline-block"></div> + <span class="menu-txt">{{categoryName}}</span> + </li> + {{#each subsets}} + <li class="smll-category cateId-{{id}} parentId-{{parendId}} {{#isEqual id @root.qid}}selected{{/isEqual}}" data-parent-id="{{parendId}}"> + <span class="mult"></span> + <a href="/help/detail?id={{id}}"><span class="menu-txt">{{categoryName}}</span></a> + </li> + {{/each}} + {{else}} + <li class="big-category cateId-{{id}} {{#isEqual id @root.qid}}selected{{/isEqual}}"> + <span class="mult"></span> + <a href="/help/detail?id={{id}}"><span class="menu-txt">{{categoryName}}</span></a> + </li> + {{/if}} + {{/each}} +</ul> + diff --git a/apps/help/views/partial/nav-title.hbs b/apps/help/views/partial/nav-title.hbs new file mode 100644 index 0000000..b16b364 --- /dev/null +++ b/apps/help/views/partial/nav-title.hbs @@ -0,0 +1,5 @@ +<div class="nav-title"> + <div class="center-area"> + <span class="title">{{categoryName}}</span> + </div> +</div> diff --git a/apps/help/views/partial/search-form.hbs b/apps/help/views/partial/search-form.hbs new file mode 100644 index 0000000..01419b4 --- /dev/null +++ b/apps/help/views/partial/search-form.hbs @@ -0,0 +1,14 @@ +<div class="search-box"> + <div class="search-area"> + <form id="help-search-form" action="{{siteUrl}}/help/detail"> + <input type="text" class="help-search" autocomplete="off" name="helpQuery" value="{{helpQuery}}"> + <input type="text" class="hide"> + <span class="iconfont search-btn"></span> + </form> + </div> + <div class="keyword"> + {{#each hotSearch}} + <a href="{{link}}">{{keyword}}</a> + {{/each}} + </div> +</div> diff --git a/apps/home/controllers/message.js b/apps/home/controllers/message.js index 773cadd..8ce6b92 100644 --- a/apps/home/controllers/message.js +++ b/apps/home/controllers/message.js @@ -9,13 +9,12 @@ const message = require('../models/message'); const index = (req, res, next) => { let uid = req.user.uid; - let page = req.query.page || 1; if (!uid) { return next(); } - message.getMessageList(uid, page).then(result => { + message.getMessageList(uid, req.query || {}).then(result => { res.render('message', result); }).catch(next); }; @@ -23,13 +22,12 @@ const index = (req, res, next) => { const detail = (req, res, next) => { let uid = req.user.uid; let id = parseInt(req.query.id, 10); - let page = req.query.page; - if (!uid || !id || !page) { + if (!uid || !id) { return next(); } - message.getMessageDetail(uid, id, page).then(result => { + message.getMessageDetail(uid, req.query || {}).then(result => { res.render('message-detail', result); }).catch(next); }; diff --git a/apps/home/models/CurrencyModel.js b/apps/home/models/CurrencyModel.js index c951acc..473ffd2 100644 --- a/apps/home/models/CurrencyModel.js +++ b/apps/home/models/CurrencyModel.js @@ -40,7 +40,7 @@ const currencyData = (uid, condition)=>{ let currency = yield currencyList(uid, condition); result.currency = currency.list; result.pager = currency.pager; - result.coinHelperUrl = '//www.yohobuy.com/help/?category_id=87';// yoho币帮助 + result.coinHelperUrl = '//www.yohobuy.com/help/detail?id=105';// yoho币帮助 result.tabs = currencyTabs(condition.queryType); result.options = currencyOptions(condition); return result; diff --git a/apps/home/models/message.js b/apps/home/models/message.js index 34175b6..60e1249 100644 --- a/apps/home/models/message.js +++ b/apps/home/models/message.js @@ -10,17 +10,31 @@ const api = global.yoho.API; const _ = require('lodash'); const Promise = require('bluebird'); +const userApi = require('./user-api'); const setPager = require(`${global.utils}/pager`).setPager; const co = Promise.coroutine; -const getMessageAsync = (uid, page, size) => { +const getMessageTabList = (uid) => { return api.get('', { - method: 'app.inbox.getlist', + method: 'app.inbox.getAllInboxCatInfo', + uid: uid + }, {code: 200}); +}; + +const getMessageAsync = (uid, page, size, type) => { + let params = { + method: 'app.inbox.getlistnew', uid: uid, page: page || 1, size: size || 10 - }, {code: 200}); + }; + + if (type) { + params.displayTab = type; + } + + return api.get('', params, {code: 200}); }; const delMessageAsync = (uid, id) => { @@ -63,31 +77,99 @@ const getCouponAsync = (uid) => { }; /** + * 未读消息 + * @function unreadTotal + * @param { Number } uid 用户uid + * @return { Number } 未读消息数量 + */ +const unreadTotal = (uid) => { + return api.get('', { + method: 'app.inbox.getTotal', + uid: uid, + is_read: 'N' + }); +}; + +/** * 获取消息列表 * @function getMessageList * @param { Number } uid 用户uid - * @param { Number } page 页码 + * @param { Object } params url参数 * @param { Number } limit 每页数目 * @return { Object } 消息列表数据 */ -const getMessageList = (uid, page, limit) => { - let process = function*() { - let resData = {}; - let result = yield getMessageAsync(uid, page, limit); +const getMessageList = (uid, params, limit) => { + let resData = {}; + let page = parseInt(`0${params.page}`, 10) || 1, + type = parseInt(`0${params.type}`, 10); + + return Promise.all([ + userApi.getUserInfo(uid), + getMessageTabList(uid), + getMessageAsync(uid, page, limit, type) + ]).then(result => { + const msgBaseUrl = '/home/message'; + + resData.userThumb = _.get(result, '[0].data.head_ico', ''); + + let tabList = [{ + name: '全部', + focus: !type, + href: msgBaseUrl + }]; + + let focusTabName = ''; + + _.forEach(_.get(result, '[1]data.list', []), value => { + let tab = { + name: `${value.inboxCatName}`, + focus: type === value.id * 1, + href: `${msgBaseUrl}?type=${value.id}` + }; + + if (value.unReadCount * 1) { + tab.name += ` (${value.unReadCount})`; + } + + if (tab.focus) { + focusTabName = value.inboxCatName; + } + + tabList.push(tab); + }); - if (result.data) { + resData.tabList = tabList; + + if (result[2].data) { + let data = result[2].data; let msg = []; - _.forEach(_.get(result, 'data.list', []), value => { + _.forEach(_.get(data, 'list', []), value => { // 信息过滤 if (value.type === '$inboxval' || value.type === 'notice') { return; } + let href = `/home/message/detail?id=${value.id}&page=${page}`; + + href += type ? `&type=${type}` : ''; + switch (value.type) { + case 'pullCoupon': + case 'button': + case 'pushCoupon': + break; + default: + if (value.pcLink) { + href = value.pcLink.replace('http:', ''); + } + break; + } + msg.push({ id: value.id || 0, - href: `/home/message/detail?id=${value.id}&page=${page}`, + href: href, title: value.title || '', + content: _.get(value, 'body.content', ''), sender: value.from || '', time: value.create_date, isNew: value.is_read === 'Y' ? false : true @@ -96,40 +178,51 @@ const getMessageList = (uid, page, limit) => { resData.messages = msg; + let pagerList = setPager(_.get(data, 'page_total', 1), + Object.assign(params, {page: page})); + resData.pager = Object.assign({ - count: _.get(result, 'data.total', 0), + count: _.get(data, 'total', 0), curPage: page, - totalPages: _.get(result, 'data.page_total', 0) - }, setPager(_.get(result, 'data.page_total', 0), { - page: page - })); + totalPages: _.get(data, 'page_total', 0) + }, pagerList); } if (_.isEmpty(resData.messages)) { - resData.messages = {empty: '您尚未收到任何短消息'}; + resData.messages = {empty: `您尚未收到任何${focusTabName}消息`}; } return resData; - }; - - return co(process)(); + }); }; /** * 获取消息内容 * @function getMessageDetail * @param { Number } uid 用户uid - * @param { Number } page 页码 + * @param { Object } params url参数 * @param { Number } limit 每页数目 * @return { Object } 消息列表数据 */ -const getMessageDetail = (uid, mid, page, limit) => { +const getMessageDetail = (uid, params, limit) => { + let mid = parseInt(`0${params.id}`, 10); + let page = parseInt(`0${params.page}`, 10) || 1; + let type = parseInt(`0${params.type}`, 10); + let process = function*() { + let result = yield Promise.all([ + userApi.getUserInfo(uid), + getMessageAsync(uid, page, limit, type) + ]); let resData = { - backUrl: `/home/message?page=${page}` + backUrl: `/home/message?page=${page}`, + userThumb: _.get(result, '[0].data.head_ico', '') }; - let result = yield getMessageAsync(uid, page, limit); - let msg = _.find(_.get(result, 'data.list', []), {id: mid}); + let msg = _.find(_.get(result, '[1]data.list', []), {id: mid}); + + if (type) { + resData.backUrl += `&type=${type}`; + } if (!_.isEmpty(msg)) { resData.message = { @@ -140,6 +233,26 @@ const getMessageDetail = (uid, mid, page, limit) => { switch (msg.type) { case 'pullCoupon': // eslint-disable-line + resData.message.birthCoupon = { + text: `${_.get(result, '[0].data.nickname', '')} 有货祝您生日快乐!感谢您对有货的支持,特赠您VIP生日专属礼,即刻享受生日福利吧!` + }; + + if (_.get(msg, 'body.is_collar', '') === 'Y') { + Object.assign(resData.message.birthCoupon, { + over: true, + overText: '已领取' + }); + break; + } + + if (_.get(msg, 'body.is_over_time', '') === 'Y') { + Object.assign(resData.message.birthCoupon, { + over: true, + overText: '生日券已过期' + }); + break; + } + let couponInfo = yield getCouponAsync(uid); let coupons = []; @@ -169,7 +282,7 @@ const getMessageDetail = (uid, mid, page, limit) => { image: _.get(msg, 'body.image', ''), content: _.get(msg, 'body.text', ''), btnLink: _.get(msg, 'body.pc_link', ''), - btnName: _.get(msg, 'body.button_text', '') + btnName: _.get(msg, 'body.button_text', '') || '查看详情' }; break; case 'pushCoupon': @@ -222,8 +335,6 @@ const delMessage = (uid, mid) => { return co(process)(); }; - - /** * 删除用户消息 * @function getMessageDetail @@ -255,5 +366,6 @@ module.exports = { getMessageDetail, delMessage, readMessage, + unreadTotal, pickBirthCoupon }; diff --git a/apps/home/models/returns.js b/apps/home/models/returns.js index 31fd4a5..2a228d3 100644 --- a/apps/home/models/returns.js +++ b/apps/home/models/returns.js @@ -30,8 +30,7 @@ const EXCHANGE_URI = '/home/returns/exchangeDetail'; const getProductUrlBySkc = (pid, gid, cnAlphabet) => { cnAlphabet = cnAlphabet || 'cnalphabet'; - return helpers.urlFormat(`/product/pro_${pid}_${gid}/${cnAlphabet}.html`, - {}, 'item'); + return helpers.getUrlBySkc(pid, gid, cnAlphabet); }; const setDetailGoods = (list) => { diff --git a/apps/home/router.js b/apps/home/router.js index 71eaef1..8b45854 100644 --- a/apps/home/router.js +++ b/apps/home/router.js @@ -9,6 +9,7 @@ const express = require('express'); const router = express.Router(); // eslint-disable-line const cRoot = './controllers'; const headerModel = require('../../doraemon/models/header'); +const msgModel = require('./models/message'); const _ = require('lodash'); const helpers = global.yoho.helpers; @@ -16,7 +17,8 @@ const commentController = require(`${cRoot}/comment`); // const consultController = require(`${cRoot}/consult`); // const complaintsController = require(`${cRoot}/complaints`); -// const messageController = require(`${cRoot}/message`); +const messageController = require(`${cRoot}/message`); + // const returnsController = require(`${cRoot}/returns`); // const IndexController = require(`${cRoot}/Index`); // const CurrencyController = require(`${cRoot}/Currency`); @@ -35,60 +37,68 @@ const AccountController = require(`${cRoot}/account`); // const AddressController = require(`${cRoot}/address`); // const GiftController = require(`${cRoot}/gift`); -const homeNav = [ - { - title: '交易管理', - subNav: [ - {name: '我的订单', href: '/home/orders', catchs: ['/home/orders', '/home/index']}, - {name: '我的收藏', href: '/home/favorite'}, - {name: '我的有货币', href: '/home/currency'}, - {name: '我的红包', href: '/home/redenvelopes'}, - {name: '我的优惠券', href: '/home/coupons'}, - {name: '我的VIP', href: '/home/vip'} - ] - }, - { - title: '服务中心', - subNav: [ - {name: '我的退/换货', href: '/home/returns'}, - {name: '我的咨询', href: '/home/consult'}, - {name: '我的评论', href: '/home/comment'}, - {name: '我的投诉', href: '/home/complaints'}, - {name: '我的信息', href: '/home/message', count: 0}, - {name: '在线客服', href: 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=', isBlank: true} - ] - }, - { - title: '个人信息管理', - subNav: [ - {name: '编辑个人资料', href: '/home/user'}, - {name: '账号安全', href: '/home/account', catchs: [ - '/home/account/userpwd', - '/home/account/email', - '/home/account/mobile', - '/home/account/checkverifycode', - '/home/account/checkpassword', - '/home/account/verifypassword', - '/home/account/modifypwd', - '/home/account/sendemail', - '/home/account/checkemail', - '/home/account/modifyemail', - '/home/account/sendemailsuccess', - '/home/account/mailresult', - '/home/account/checkmobile', - '/home/account/checkmobilemsg', - '/home/account/sendmobilemsg', - '/home/account/modifymobile' - ]}, - {name: '地址管理', href: '/home/address'}, - {name: '兑换礼品卡', href: '/home/gift'} - ] - } -]; - -const getActiveNav = (req)=>{ - - let mHomeNav = _.cloneDeep(homeNav); +const homeNav = (req) => { + return [ + { + title: '交易管理', + subNav: [ + {name: '我的订单', href: '/home/orders', catchs: ['/home/orders', '/home/index']}, + {name: '我的收藏', href: '/home/favorite'}, + {name: '我的有货币', href: '/home/currency'}, + {name: '我的红包', href: '/home/redenvelopes'}, + {name: '我的优惠券', href: '/home/coupons'}, + {name: '我的VIP', href: '/home/vip'} + ] + }, + { + title: '服务中心', + subNav: [ + {name: '我的退/换货', href: '/home/returns'}, + {name: '我的咨询', href: '/home/consult'}, + {name: '我的评论', href: '/home/comment'}, + + // {name: '我的投诉', href: '/home/complaints'}, + {name: '我的信息', href: '/home/message', count: 0}, + { + name: '在线客服', + href: _.get(req.app.locals.pc, 'clientService.new', false) ? + '/service/client' : 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409', + isBlank: true + } + ] + }, + { + title: '个人信息管理', + subNav: [ + {name: '编辑个人资料', href: '/home/user'}, + {name: '账号安全', href: '/home/account', catchs: [ + '/home/account/userpwd', + '/home/account/email', + '/home/account/mobile', + '/home/account/checkverifycode', + '/home/account/checkpassword', + '/home/account/verifypassword', + '/home/account/modifypwd', + '/home/account/sendemail', + '/home/account/checkemail', + '/home/account/modifyemail', + '/home/account/sendemailsuccess', + '/home/account/mailresult', + '/home/account/checkmobile', + '/home/account/checkmobilemsg', + '/home/account/sendmobilemsg', + '/home/account/modifymobile' + ]}, + {name: '地址管理', href: '/home/address'}, + {name: '兑换礼品卡', href: '/home/gift'} + ] + } + ]; +}; + +const getActiveNav = (req, count)=>{ + + let mHomeNav = _.cloneDeep(homeNav(req)); let activeNav = null; mHomeNav = mHomeNav.map((item) => { @@ -104,6 +114,10 @@ const getActiveNav = (req)=>{ nav.active = true; } + if (nav.name === '我的信息') { + nav.count = +count; + } + if (nav.catchs) { if (nav.catchs.indexOf(curMatchPath) > -1) { nav.active = true; @@ -127,31 +141,32 @@ const getActiveNav = (req)=>{ }; const getHomeNav = (req, res, next) => { - - let navs = getActiveNav(req); - let activeNav = navs.activeNav; - let bread = [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'}]; - - if (activeNav) { - bread.push({ - name: '个人中心', - href: helpers.urlFormat('/home') - }); - - bread.push({ - name: activeNav.name - }); - } else { - bread.push({ - name: '个人中心' - }); - } - - res.locals.path = bread; // [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'}, {name: '个人中心'}]; - res.locals.homeNav = navs.homeNav; - res.locals.userThumb = '//img10.static.yhbimg.com/headimg/' + - '2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100'; - next(); + msgModel.unreadTotal(req.user.uid).then(result => { + let navs = getActiveNav(req, _.get(result, 'data.total', 0)); + let activeNav = navs.activeNav; + let bread = [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'}]; + + if (activeNav) { + bread.push({ + name: '个人中心', + href: helpers.urlFormat('/home') + }); + + bread.push({ + name: activeNav.name + }); + } else { + bread.push({ + name: '个人中心' + }); + } + + res.locals.path = bread; // [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'}, {name: '个人中心'}]; + res.locals.homeNav = navs.homeNav; + res.locals.userThumb = '//img10.static.yhbimg.com/headimg/' + + '2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100'; + next(); + }); }; const getCommonHeader = (req, res, next) => { let channel = req.query.channel ? req.query.channel : 'boys'; @@ -180,11 +195,11 @@ router.get('/comment/order', [getCommonHeader, getHomeNav], commentController.co // router.post('/complaints/cancel', complaintsController.cancel); // 我的消息 -// router.get('/message', messageController.index); -// router.get('/message/detail', messageController.detail); -// router.get('/message/del', messageController.delMsg); -// router.get('/message/read', messageController.readMsg); -// router.get('/message/pickCoupon', messageController.pickCoupon); +router.get('/message', [getCommonHeader, getHomeNav], messageController.index); +router.get('/message/detail', [getCommonHeader, getHomeNav], messageController.detail); +router.get('/message/del', messageController.delMsg); +router.get('/message/read', messageController.readMsg); +router.get('/message/pickCoupon', messageController.pickCoupon); // 我的退/换货 // router.get('/returns', returnsController.index); diff --git a/apps/home/views/action/home/orders/order-detail.phtml b/apps/home/views/action/home/orders/order-detail.phtml index 4c2204a..ed802f3 100644 --- a/apps/home/views/action/home/orders/order-detail.phtml +++ b/apps/home/views/action/home/orders/order-detail.phtml @@ -230,7 +230,7 @@ </table> <div class="order-balance"> <p class="back-coin"> - <a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>共返YOHO币:{{totalYoho}}个 + <a href="/help/detail?id=105" class="yoho-coin" target="_blank"></a>共返YOHO币:{{totalYoho}}个 </p> {{#each orderBalance}} <p> diff --git a/apps/home/views/action/message-detail.hbs b/apps/home/views/action/message-detail.hbs index c65bc70..4f6735c 100644 --- a/apps/home/views/action/message-detail.hbs +++ b/apps/home/views/action/message-detail.hbs @@ -13,45 +13,70 @@ {{# message}} <div class="text-title"> <h1>{{title}}</h1> - <span>{{sender}} 发送于{{time}}</span> + <span>{{sender}} 发送于{{time}}</span> </div> <div class="text-content"> {{# text}} <!-- 文本消息 --> <p>{{{content}}}</p> {{/ text}} - {{# coupons}} - <!-- 优惠券消息 --> - <div class="coupon-item"> - <div class="coupon-img"> - <img src="//static.yohobuy.com/images/v2/activity/default_coupon.jpg"> - </div> - <div class="coupon-info"> - <p>{{remark}}</p> - {{#if url}} - <p>面值:{{price}}</p> - <p>有效期:{{useTime}}</p> - {{^}} - <p>使用时间:{{useTime}}</p> - <p>领取时间:{{pickTime}}</p> - {{/if}} - </div> - <div class="coupon-action"> - {{#if url}} - <a href="{{url}}" class="view-coupon-btn">立即查看</a> - {{^}} - <a{{#if canPick}} class="pick-coupon-btn" data-id="{{id}}"{{/if}}>立即领取</a> - {{/if}} - </div> + {{# birthCoupon}} + <p>{{text}}</p> + <p class="birth-card"> + {{#if @root.devEnv}} + <img src="////{{@root.devHost}}:5002/img/home/birth-card.jpg"> + {{^}} + <img src="//cdn.yoho.cn/yohobuy-node/assets/img/home/birth-card.jpg"> + {{/if}} + </p> + {{#if over}} + <div>{{overText}}</div> + {{^}} + <div class="show-birth-coupon"{{#if errMsg}} data-msg="{{errMsg}}"{{/if}}>点这里领取</div> + {{/if}} + {{/ birthCoupon}} + + {{#if coupons}} + <div class="{{#if birthCoupon}}birth-coupon-wrap{{/if}}"> + {{#if birthCoupon}} + <p>您365天内有且仅有一次领劵生日礼券的机会,每次限领1张哦</p> + {{/if}} + {{# coupons}} + <!-- 优惠券消息 --> + <div class="coupon-item"> + <div class="coupon-img"> + <img src="//static.yohobuy.com/images/v2/activity/default_coupon.jpg"> + </div> + <div class="coupon-info"> + <p>{{remark}}</p> + {{#if url}} + <p>面值:{{price}}</p> + <p>有效期:{{useTime}}</p> + {{^}} + <p>使用时间:{{useTime}}</p> + <p>领取时间:{{pickTime}}</p> + {{/if}} + </div> + <div class="coupon-action"> + {{#if url}} + <a href="{{url}}" class="view-coupon-btn">立即查看</a> + {{^}} + <a{{#if canPick}} class="pick-coupon-btn" data-id="{{id}}"{{/if}}>立即领取</a> + {{/if}} + </div> + </div> + {{/ coupons}} </div> - {{/ coupons}} + {{/if}} {{# sale}} <!-- 促销消息 --> <div class="sale-img"> <img src="{{image2 image}}"> </div> <p>{{{content}}}</p> - <a href="{{btnLink}}" class="sale-btn">{{btnName}}</a> + {{#if btnLink}} + <a href="{{btnLink}}" class="sale-btn">{{btnName}}</a> + {{/if}} {{/ sale}} </div> {{/ message}} @@ -60,4 +85,4 @@ {{> help-us}} </div> -</div> \ No newline at end of file +</div> diff --git a/apps/home/views/action/message.hbs b/apps/home/views/action/message.hbs index 983ab77..e3fb226 100644 --- a/apps/home/views/action/message.hbs +++ b/apps/home/views/action/message.hbs @@ -6,19 +6,19 @@ <div class="me-main"> <div class="message block"> <h2 class="title"></h2> - - <p class="message-table-header table-header clearfix"> - <span class="sender">发件人</span> - <span class="heading">标题</span> - <span class="time">发件时间</span> - <span class="action">操作</span> - </p> + <div class="msg-tabs-wrap"> + <ul class="tabs-list clearfix"> + {{# tabList}} + <li{{#if focus}} class="active"{{/if}}> + <a href="{{href}}">{{name}}</a> + </li> + {{/ tabList}} + </ul> + </div> <div id="message-main-container"> {{> message/message-list}} - {{> pager}} </div> + {{> pager}} </div> - - {{> help-us}} </div> -</div> \ No newline at end of file +</div> diff --git a/apps/home/views/partial/home/edit/basicinfo.hbs b/apps/home/views/partial/home/edit/basicinfo.hbs index 70e3f17..034b5b8 100644 --- a/apps/home/views/partial/home/edit/basicinfo.hbs +++ b/apps/home/views/partial/home/edit/basicinfo.hbs @@ -3,12 +3,15 @@ <h2 class="sub-title"> <div class="more"><a class="btn-edit" title="修改"></a></div> {{subTitle}} - {{#if certified}} - <span class="sub-tips">学生身份已验证通过啦,赶紧去体验下<a class="tips-url" href="{{tipsUrl}}" target="_blank">我们的专属特权</a>吧!</span> - {{else}} - <span class="sub-tips"> 校园潮流季-我们的专属特权,进行学生身份验证即有惊喜哦,</span> - <a class="tips-url" href="{{tipsUrl}}" target="_blank">立即进行身份验证</a> - {{/if}} + + {{#unless @root.pc.user.removeStudentIdentification}} + {{#if certified}} + <span class="sub-tips">学生身份已验证通过啦,赶紧去体验下<a class="tips-url" href="{{tipsUrl}}" target="_blank">我们的专属特权</a>吧!</span> + {{else}} + <span class="sub-tips"> 校园潮流季-我们的专属特权,进行学生身份验证即有惊喜哦,</span> + <a class="tips-url" href="{{tipsUrl}}" target="_blank">立即进行身份验证</a> + {{/if}} + {{/unless}} </h2> <form action="" {{# firstBox}}class="first" {{/firstBox}}> <div class="box"> diff --git a/apps/home/views/partial/message/message-list.hbs b/apps/home/views/partial/message/message-list.hbs index 7932958..0e4d756 100644 --- a/apps/home/views/partial/message/message-list.hbs +++ b/apps/home/views/partial/message/message-list.hbs @@ -4,29 +4,17 @@ {{> empty}} {{/with}} {{^}} - <table> - {{# messages}} - <tr{{#if isNew}} class="new-msg"{{/if}}> - <td width="37"> - <input type="checkbox" class="msg-check" value="{{id}}"> - </td> - <td class="td-sender"><a href="{{href}}">{{sender}}</a></td> - <td class="td-title"><a href="{{href}}">{{title}}</a></td> - <td width="130">{{time}}</td> - <td> - <a class="del-btn" data-id="{{id}}">删除</a> - </td> - </tr> - {{/ messages}} - <tr class="list-foot"> - <td> - <input type="checkbox" class="choose-all"> - </td> - <td colspan="4"> - <button class="del-choose-btn">删除选中的消息</button> - <button class="read-choose-btn">标记为已读</button> - </td> - </tr> - </table> + {{# messages}} + <div class="msg-item{{#if isNew}} new-msg{{/if}}"> + <a href="{{href}}"> + <p class="it-title">{{title}}</p> + <p class="it-content">{{content}}</p> + <p class="it-time">{{time}}</p> + </a> + <div class="del-btn" data-id="{{id}}"> + <i class="iconfont"></i> + </div> + </div> + {{/ messages}} {{/if}} </div> diff --git a/apps/home/views/partial/navigation.hbs b/apps/home/views/partial/navigation.hbs index d3266cd..aeafe2c 100644 --- a/apps/home/views/partial/navigation.hbs +++ b/apps/home/views/partial/navigation.hbs @@ -2,7 +2,9 @@ <p class="title ucenter"></p> <div class="user-thumb"> <div class="thumb-bg"> - <img id="user-thumb" src="{{image2 userThumb}}"> + {{#if userThumb}} + <img id="user-thumb" src="{{image2 userThumb w=100 h=100}}"> + {{/if}} </div> </div> {{# homeNav}} @@ -23,4 +25,4 @@ </ul> </div> {{/ homeNav}} -</div> \ No newline at end of file +</div> diff --git a/apps/home/views/partial/pager.hbs b/apps/home/views/partial/pager.hbs index 6d526e7..5dc1c7f 100644 --- a/apps/home/views/partial/pager.hbs +++ b/apps/home/views/partial/pager.hbs @@ -16,11 +16,11 @@ {{# pages}} <a{{#if url}} href="{{url}}"{{/if}}{{#if cur}} class="cur"{{/if}}>{{num}}</a> {{/ pages}} - + {{# nextPage}} <a href="{{url}}" title="下一页">下一页<span class="iconfont"></span></a> {{/ nextPage}} </div> </div> </div> -{{/ pager}} \ No newline at end of file +{{/ pager}} diff --git a/apps/passport/controllers/reg.js b/apps/passport/controllers/reg.js index 36634d8..a49e928 100644 --- a/apps/passport/controllers/reg.js +++ b/apps/passport/controllers/reg.js @@ -85,7 +85,7 @@ let index = (req, res, next) => { location: area || '+86', defaultMobile: mobile, captchaUrl: helpers.urlFormat('/passport/imagesNode', {t: Date.now()}), - itemUrl: helpers.urlFormat('/help/', {category_id: 143}), + itemUrl: helpers.urlFormat('/help/detail', {id: 103, contId: 197}), referUrl: refer, loginUrl: helpers.urlFormat('/signin.html', {refer: refer}), coverHref: result.url, diff --git a/apps/passport/router.js b/apps/passport/router.js index 4e52d0b..98bff69 100644 --- a/apps/passport/router.js +++ b/apps/passport/router.js @@ -99,10 +99,19 @@ router.get('/passport/reg/index', reg.index); // NOTE: 该接口的存在只是为了兼容前端 ajax 请求 router.post('/passport/reg/checkmobile', reg.fakeCheckMobile); -router.post('/passport/reg/piccaptcha', reg.checkCode, reg.picCaptcha); router.post('/passport/reg/msgcaptcha', reg.checkMobileMiddleware, reg.msgCaptcha); -router.post('/passport/reg/sendBindMsg', reg.checkMobileMiddleware, reg.checkCode, reg.sendBindMsg); -router.post('/passport/reg/mobileregister', reg.checkMobileMiddleware, reg.checkPassword, reg.checkCode, reg.mobileRegister); //eslint-disable-line + +router.post('/passport/reg/sendBindMsg', + captcha.requiredAPI, + reg.checkMobileMiddleware, + reg.sendBindMsg); + +router.post('/passport/reg/mobileregister', + captcha.requiredAPI, + reg.checkMobileMiddleware, + reg.checkPassword, + reg.mobileRegister); + router.get('/passport/reg/success', reg.success); /** diff --git a/apps/product/controllers/detail.js b/apps/product/controllers/detail.js index e3f8ed4..8b82194 100644 --- a/apps/product/controllers/detail.js +++ b/apps/product/controllers/detail.js @@ -13,7 +13,6 @@ const detailHelper = require(`${mRoot}/detail-helper`); const moment = require('moment'); const DEFAULT_AVATAR_ICO = 'http://static.yohobuy.com/images/v3/boy.jpg'; -const SEO_SLOGAN = 'YOHO!BUY 有货'; const _ = require('lodash'); const CHANNEL = { diff --git a/apps/product/controllers/list.js b/apps/product/controllers/list.js index 36425f8..83de137 100644 --- a/apps/product/controllers/list.js +++ b/apps/product/controllers/list.js @@ -92,6 +92,12 @@ exports.index = (req, res, next) => { if (_.isEmpty(_.get(resData, 'list.goods', []))) { res.set('Cache-Control', 'no-cache'); } + + // 商品详情页跳转过来带参数 + if (req.query.phrase) { + resData.list.phrase = decodeURIComponent(req.query.phrase); + } + res.render('list/index', resData); }).catch(next); }; diff --git a/apps/product/controllers/newArrive.js b/apps/product/controllers/newArrive.js new file mode 100644 index 0000000..c85f0e8 --- /dev/null +++ b/apps/product/controllers/newArrive.js @@ -0,0 +1,35 @@ +/* + * @Author: hongwei.gao + * @Date: 2016-12-28 + */ + +'use strict'; + +const mRoot = '../models'; +const arrive = require(`${mRoot}/newArrive-service`); + +/** + * 新品到着首页加载 + * @param {[type]} req [description] + * @param {[type]} res [description] + * @return {[type]} [description] + */ +exports.index = (req, res, next) => { + let pjax = req.query._pjax; + + // 加载最新上架数据 + if (pjax) { + arrive.getRecList(req).then(result => { + Object.assign(result, {layout: false}); + res.render('list/new-pro-list', result); + }).catch(next); + + return; + } + + // 加载所有 + arrive.index(req).then(result => { + res.render('list/new-arrive', result); + }).catch(next); + +}; diff --git a/apps/product/helper/index.js b/apps/product/helper/index.js index 91c877e..547d306 100644 --- a/apps/product/helper/index.js +++ b/apps/product/helper/index.js @@ -5,7 +5,7 @@ 'use strict'; -exports.if_cond = (left, operator, right, options) => { +exports.if_cond = function(left, operator, right, options) { switch (operator) { case '==': return (left == right) ? options.fn(this) : options.inverse(this); // eslint-disable-line @@ -30,7 +30,7 @@ exports.if_cond = (left, operator, right, options) => { } }; -exports.escapeType = (value) => { +exports.escapeType = function(value) { let strs = value.split(''); @@ -51,14 +51,14 @@ exports.escapeType = (value) => { return strs.join(''); }; -exports.escapeLength = (value) => { - let strs = value.split(''); +exports.escapeLength = function(value) { + let strs = value.split(''); - if (strs.length === 2) { - strs[2] = strs[1]; - strs[1] = ' '; - return strs.join(''); - } + if (strs.length === 2) { + strs[2] = strs[1]; + strs[1] = ' '; + return strs.join(''); + } - return strs.join(''); -} + return strs.join(''); +}; diff --git a/apps/product/models/detail-bundle-service.js b/apps/product/models/detail-bundle-service.js deleted file mode 100644 index 7f24350..0000000 --- a/apps/product/models/detail-bundle-service.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Created by TaoHuang on 2016/11/30. - */ - -'use strict'; - -const api = require('./detail-product-api'); - -const type = { - package: 'package', // 套餐 - bundle: 'bundle' // 量贩 -}; - - -const _getBundle = (data) => { - -}; - -const getPackage = (data) => { - -}; - - -module.exports = { -} diff --git a/apps/product/models/detail-product-api.js b/apps/product/models/detail-product-api.js index 37c7613..f08ea4f 100644 --- a/apps/product/models/detail-product-api.js +++ b/apps/product/models/detail-product-api.js @@ -51,16 +51,6 @@ const getProductComfortAsync = (pid) => { }; /** - * 模特卡 - */ -const getProductModelCardAsync = (pid) => { - return api.get('', { - method: 'web.productModelcard.list', - product_id: pid - }, config.apiCache); -}; - -/** * 模特试穿 */ const getProductModelTryAsync = (skn) => { @@ -147,13 +137,10 @@ const getBundleAsync = (skn) => { }); }; - - module.exports = { getProductBannerAsync, sizeInfoAsync, getProductComfortAsync, - getProductModelCardAsync, getProductModelTryAsync, getProductAsync, getPromotionAsync, diff --git a/apps/product/models/detail-service.js b/apps/product/models/detail-service.js index 1bf2922..7cd34ae 100644 --- a/apps/product/models/detail-service.js +++ b/apps/product/models/detail-service.js @@ -13,6 +13,7 @@ const Fn = require('lodash/fp'); const cheerio = require('cheerio'); const url = require('url'); const helpers = global.yoho.helpers; +const config = global.yoho.config; const crypto = global.yoho.crypto; const videoPlayerTpl = require('../helper/video-player-tpl'); @@ -61,7 +62,6 @@ const _getProductIntroAsync = (productId, productSkn) => { let result = yield Promise.props({ sizeInfo: productAPI.sizeInfoAsync(productSkn), productComfort: productAPI.getProductComfortAsync(productId), - productModelCard: productAPI.getProductModelCardAsync(productId), productModelTry: productAPI.getProductModelTryAsync(productSkn) }); @@ -192,8 +192,10 @@ const _getVipDataByProductBaseInfo = (data, vipLevel, uid) => { const _getProductActivityBanner = (additionalData) => { let data = additionalData.productBanner; - if (_.isEmpty(data) || _.get(data, 'code', 400) !== 200 || !_.get(data, 'data.bannerImg')) { - return {}; + if (_.isEmpty(data) || + _.get(data, 'code', 400) !== 200 || + !_.get(data, 'data.bannerImg')) { + return false; } return { @@ -212,16 +214,15 @@ const _getBundleAsync = (result) => { }; const _getActivityDataByProductBaseInfo = (data) => { - let result = []; + return _.get(data, 'data', []).map(value => { + let des = value.promotionTitle.replace(/¥/g, '¥'); - _.get(data, 'data', []).forEach(value => { - result.push({ + return { type: value.promotionType.replace(/¥/g, '¥'), - des: value.promotionTitle.replace(/¥/g, '¥') - }); + des: des, + url: value.id && helpers.urlFormat('', {psp_id: value.id, phrase: encodeURIComponent(des)}, 'list') + }; }); - - return result; }; /** @@ -279,7 +280,7 @@ const _getSkuDataByProductBaseInfo = (data) => { let totalStorageNum = 0; let skuGoods = null;// sku商品 let defaultImage = '';// 默认图 - let chooseSkuFlag = false; // 选中状态 + let defaultSkuFlag = false; // 选中状态 if (_.isEmpty(_.get(data, 'goods_list', []))) { return { @@ -289,33 +290,34 @@ const _getSkuDataByProductBaseInfo = (data) => { }; } - skuGoods = _.get(data, 'goods_list', []).reduce((acc, cur, pos)=> { + skuGoods = _.get(data, 'goods_list', []).reduce((goodsDetailList, goods)=> { // 如果status为0,即skc下架时就跳过该商品$value['status'] === 0 - let goodsGroup = {}; + let goodsDetail = {}; - if (_.isEmpty(cur.color_image)) { - return acc; + if (_.isEmpty(goods.color_image)) { + return goodsDetailList; } - if (cur.images_list) { + if (goods.images_list) { // 商品列表 - goodsGroup.productSkc = cur.product_skc; - goodsGroup.src = cur.color_image; - goodsGroup.title = `${_.trim(data.product_name)} ${cur.factory_goods_name}`; - goodsGroup.name = cur.factory_goods_name; - goodsGroup.focus = false; - goodsGroup.total = 0; - goodsGroup.thumbs = []; - goodsGroup.size = []; - if (goodsGroup.title.length > 20) { - goodsGroup.title = goodsGroup.title.substr(0, 20) + '...'; + goodsDetail.productSkc = goods.product_skc; + goodsDetail.src = goods.color_image; + goodsDetail.title = `${_.trim(data.product_name)} ${goods.factory_goods_name}`; + goodsDetail.name = goods.factory_goods_name; + goodsDetail.focus = false; + goodsDetail.total = 0; + goodsDetail.thumbs = []; + goodsDetail.size = []; + + if (goodsDetail.title.length > 20) { + goodsDetail.title = goodsDetail.title.substr(0, 20) + '...'; } } - _.get(cur, 'images_list', []).forEach((good) => { + _.get(goods, 'images_list', []).forEach((good) => { if (good.image_url) { - goodsGroup.thumbs.push({ + goodsDetail.thumbs.push({ url: '', shower: good.image_url, img: good.image_url @@ -324,51 +326,53 @@ const _getSkuDataByProductBaseInfo = (data) => { }); // 缩略图空,不显示 - if (_.isEmpty(goodsGroup.thumbs)) { - return acc; + if (_.isEmpty(goodsDetail.thumbs)) { + return goodsDetailList; } // 商品的尺码列表 - _.get(cur, 'size_list', []).forEach((size) => { + _.get(goods, 'size_list', []).forEach((size) => { if (data.attribute === 3) { // 虚拟商品,门票默认最大为4, size.storage_number = size.storage_number > 4 ? 4 : size.storage_number; } // 如果status为0,即skc下架时就跳过该商品 - if (cur.status === 0) { + if (goods.status === 0) { size.storage_number = 0; } // 是否显示到货通知 size.notify = size.isSuppled === 'Y' && size.storage_number === 0 ? 'Y' : 'N'; - goodsGroup.size.push({ + // 尺码信息 + goodsDetail.size.push({ name: size.size_name, sku: size.product_sku, num: _.parseInt(size.storage_number), goodsId: size.size_id, notify: size.notify, - soldOut: _.parseInt(size.storage_number) === 0 + soldOut: _.parseInt(size.storage_number) === 0, + info: _.get(size, 'size_info', '').replace(/\//ig, '-').replace(/ /ig, '/').replace(/:/ig, ' ') }); // 单个sku商品的总数 - goodsGroup.total += _.parseInt(size.storage_number); + goodsDetail.total += _.parseInt(size.storage_number); - if (goodsGroup.total > 0 && !chooseSkuFlag) { // 默认选中该sku商品 - goodsGroup.focus = true; - defaultImage = goodsGroup.src; // 默认为选中的skc - chooseSkuFlag = true;// 选中sku商品 + if (goodsDetail.total > 0 && !defaultSkuFlag) { // 默认选中该sku商品 + goodsDetail.focus = true; + defaultImage = goodsDetail.src; // 默认为选中的skc + defaultSkuFlag = true;// 选中sku商品 } - goodsGroup.disable = !goodsGroup.total > 0; + goodsDetail.disable = !goodsDetail.total > 0; totalStorageNum += _.parseInt(size.storage_number); }); - if (goodsGroup.focus) { - _.some(goodsGroup.size, function(value) { + if (goodsDetail.focus) { + _.some(goodsDetail.size, function(value) { if (value.num !== 0) { value.focus = true; return true; @@ -377,11 +381,11 @@ const _getSkuDataByProductBaseInfo = (data) => { }); } - acc.push(goodsGroup); - return acc; + goodsDetailList.push(goodsDetail); + return goodsDetailList; }, []); - if (!_.isEmpty(skuGoods) && !chooseSkuFlag) { // 没有选中一个sku商品,默认选中第一个sku商品 + if (!_.isEmpty(skuGoods) && !defaultSkuFlag) { // 没有选中一个sku商品,默认选中第一个sku商品 // 所有商品都售罄 _.head(skuGoods).focus = true; defaultImage = _.head(skuGoods).src; @@ -509,16 +513,13 @@ function _getSortNavAsync(smallSortId, gender) { // 保存在 gids 和 skns ,最近流览功能 const saveRecentGoodInCookies = (oldSkns, res, addSkns) => { - oldSkns = oldSkns ? oldSkns.split(',') : []; - oldSkns = _.reject(oldSkns, old => old === String(addSkns) ? true : false); - oldSkns.unshift(addSkns); - res.cookie('_browseskn', oldSkns.splice(0, 30).join(','), { + res.cookie('_browseskn', _.take(oldSkns, 30).join(','), { maxAge: 2000000000, - domain: '.yohobuy.com' + domain: config.cookieDomain }); }; @@ -526,14 +527,13 @@ const saveRecentGoodInCookies = (oldSkns, res, addSkns) => { * 获取商品的舒适度 */ const _getProductComfort = (data) => { - let result = []; let comfort = data.productComfort; if (_.isEmpty(comfort) || !comfort || !comfort.data) { - return result; + return []; } - _.get(comfort, 'data', []).forEach(value => { + return _.get(comfort, 'data', []).reduce((all, value) => { let blocks = []; let flag = false; @@ -550,19 +550,19 @@ const _getProductComfort = (data) => { // 不存在 if (!flag) { - return; + return all; } // 存在,添加 - result.push({ + all.push({ name: value.caption.caption, minDes: value.caption.low, blocks: blocks, maxDes: value.caption.high }); - }); - return result; + return all; + }, []); }; /** @@ -579,30 +579,26 @@ const _getBasicDescription = (productDescBo) => { } }(productDescBo.gender)); - let basic = [ - { - key: '编号', - value: productDescBo.erpProductId - }, - { - key: '颜色', - value: productDescBo.factoryGoodsName, - dColor: true - }, - { - key: '性别', - value: sex - } - ]; - - _.get(productDescBo, 'standardBos', []).forEach(value => { - basic.push({ + const basic = [{ + key: '编号', + value: productDescBo.erpProductId + }, { + key: '颜色', + value: productDescBo.factoryGoodsName, + dColor: true + }, { + key: '性别', + value: sex + }]; + + return _.get(productDescBo, 'standardBos', []).reduce((all, value) => { + all.push({ key: value.standardName, value: value.standardVal }); - }); - return basic; + return all; + }, basic); }; /** @@ -610,7 +606,7 @@ const _getBasicDescription = (productDescBo) => { */ const _getDescriptionDataBySizeInfo = (sizeInfo, additionalData) => { if (!sizeInfo.productDescBo || !sizeInfo.productDescBo.erpProductId) { - return {}; + return false; } return { @@ -751,18 +747,51 @@ const _getSizeData = (sizeInfo) => { * 获取商品模特卡 * @param productId */ -const _getProductModelCard = (additionalData) => { - let data = additionalData.productModelCard; +const _getProductModelCard = (sortId, sizeInfo) => { + if (!sortId || !_.includes([1, 3, 4], sortId)) { + return []; + } - if (_.isEmpty(data) || !data || _.get(data, 'code', 400) !== 200) { + const modelData = _.get(sizeInfo, 'modelCardsBo', []); + + if (_.isEmpty(modelData)) { return []; } - return _.get(data, 'data', []).map((value) => ({ - url: helpers.getForceSourceUrl(value.modelImg), - size: value.size, - name: value.modelName - })); + const TYPE_SORT = { + 1: ['height', 'weight', 'shoulderWidth', 'bust', 'waist', 'dressSize'], // 上衣 + 3: ['height', 'weight', 'waist', 'hip', 'downDressSize'], // 裤子 + 4: ['height', 'weight', 'waist', 'hip', 'downDressSize'] // 裙子 + }; + + const local_ = { + height: ['身高', 'cm'], + weight: ['体重', 'kg'], + shoulderWidth: ['肩宽', 'cm'], + bust: ['胸围', 'cm'], + waist: ['腰围', 'cm'], + dressSize: ['日常尺码', ''], + downDressSize: ['日常尺码', ''], + hip: ['臀围', 'cm'] + }; + + return _.map(modelData, (model) => { + return { + avatar: _.get(model, 'avatar'), + name: _.get(model, 'modelName'), + size: _.get(model, 'size'), + desc: _.reduce(TYPE_SORT[sortId], (total, value) => { + if (model[value]) { + total.push({ + key: local_[value][0], + value: model[value] + local_[value][1] + }); + } + + return total; + }, []) + }; + }); }; /** @@ -771,7 +800,7 @@ const _getProductModelCard = (additionalData) => { */ const getReferenceDataBySizeInfo = (sizeInfo) => { if (_.isEmpty(sizeInfo.modelBos)) { - return {}; + return false; } // 模特试穿, 竖着输出排列显示 @@ -891,7 +920,7 @@ const _getProductModelTry = (data) => { let result = data.productModelTry; if (_.isEmpty(result) || result.code !== 200 || _.isEmpty(result.data)) { - return {}; + return false; } let modelTry = { @@ -927,60 +956,6 @@ const _getProductModelTry = (data) => { }; /** - * 根据最大分类ID获取尺寸属性 - * @param maxSortId - * @param sizeInfoBo - */ -const _getSizeAttrByMaxSortId = (maxSortId, sizeList) => { - if (_.isEmpty(sizeList)) { - return []; - } - - // 不同分类,取得属性值不同 - let attributeIds = (function(id) { - if (id === 1 && id === 2) { - return [3, 4]; - } else if (id === 3) { - return [6, 10]; - } else if (id === 6) { - return [13]; - } else { - return []; - } - }(maxSortId)); - - let sizeInfos = []; - let attributeNames = {}; - - // 获取属性名称 - _.get(sizeList, 'sizeAttributeBos', []).forEach((size) => { - attributeNames[size.id] = size.attributeName; - }); - - _.get(sizeList, 'sizeBoList', []).forEach((size) => { - let sizeValues = []; - - _.get(size, 'sortAttributes', []).forEach((sort) => { - if (_.includes(attributeIds, sort.id)) { - if (sort.sizeValue) { - sizeValues.push( - `${attributeNames[sort.id]} ${sort.sizeValue}cm` - ); - } - } - }); - - // 获取尺寸属性 - if (!_.isEmpty(sizeValues)) { - sizeInfos[size.sizeName] = sizeValues.join(' / '); - } - }); - - return sizeInfos; - -}; - -/** * 商品尺码信息 * * @param productSkn @@ -1004,24 +979,16 @@ const _getIntroInfo = (productSkn, maxSortId, additionalData)=> { result.description = _getDescriptionDataBySizeInfo(sizeInfo, additionalData); // 模特卡 - result.modelCards = _getProductModelCard(additionalData); + result.modelCards = _getProductModelCard(maxSortId, sizeInfo); // 试穿模特 - let fittingReport = _getProductModelTry(additionalData); - - if (!_.isEmpty(fittingReport)) { - result.fittingReport = fittingReport; - } + result.fittingReport = _getProductModelTry(additionalData); // 尺寸数据 result.size = _getSizeData(sizeInfo); // 模特数据 - let reference = getReferenceDataBySizeInfo(sizeInfo); - - if (!_.isEmpty(reference)) { - result.reference = reference; - } + result.reference = getReferenceDataBySizeInfo(sizeInfo); // 洗涤材质 result.material = _getMaterialDataBySizeInfo(sizeInfo); @@ -1029,10 +996,6 @@ const _getIntroInfo = (productSkn, maxSortId, additionalData)=> { // 商品详情页介绍 result.details = _getDetailDataBySizeInfo(sizeInfo); - // 获取尺寸说明 - result.sizeTitleJson = - sizeInfo.sizeInfoBo ? JSON.stringify(_getSizeAttrByMaxSortId(maxSortId, sizeInfo.sizeInfoBo)) : ''; - return result; }; @@ -1168,11 +1131,6 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { ); // 限购商品的状态 } - if (propOrigin('brand_info', '')) { - requestApi.brand = - brandService.getBrandByDomainAsync(propOrigin('brand_info.brand_domain')); // 品牌信息 - } - if (propOrigin('bundle_type') === BUNDLE_PRODUCE) { requestApi.bundle = productAPI.getBundleAsync(result.skn); // 量贩 } @@ -1184,7 +1142,6 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { let promotionData = requestData.promotion; let coupon = requestData.coupon; let limitedInfo = requestData.limited; - let domainBrand = requestData.brand; let bundle = requestData.bundle; // 商品标签 @@ -1196,12 +1153,13 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { // 是否收藏 result.isCollect = favoriteData.product; - // 商品价格 + // 带人民币符号的商品价格 result.marketPrice = propOrigin('format_market_price'); result.salePrice = propOrigin('format_sales_price'); result.hasOtherPrice = true; - if (result.salePrice === '0') { + // + if (result.salePrice === '0' || result.marketPrice === result.salePrice) { delete result.salePrice; result.hasOtherPrice = false; } @@ -1222,7 +1180,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { result.promotion = ((salePriceNum / marketPriceNum) * 10).toFixed(1); // 只显示大于1折小于9折的折扣 - if (1.0 >= result.promotion || result.promotion >= 9.0) { + if (result.promotion <= 1.0 || result.promotion >= 9.0) { result.promotion = false; } } @@ -1409,18 +1367,6 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { }; } - - // 非普通商品导航条移除加入购物车按钮 - const hasNavCart = (pro) => { - return !(pro.limitedsale === 'Y' || - pro.secKill === 'Y' || - pro.deposit === 'Y' || - pro.presale === 'Y' || - pro.bundle.type !== 0); - }; - - result.hasNavCart = hasNavCart(result); - // 电子票 result.isTicket = propOrigin('product_skn') === YOHOOD_TICKET; if (virtualGoods && result.isTicket) { @@ -1457,8 +1403,12 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { statGoodsInfo.productId = propOrigin('product_id'); statGoodsInfo.productName = result.name.replace('\'', '’'); statGoodsInfo.brandName = (result.brandName || '').replace('\'', '’'); - statGoodsInfo.marketPrice = (result.marketPrice ? result.marketPrice : result.presalePrice).replace('¥', ''); // 数字 - statGoodsInfo.salePrice = (result.salePrice ? result.salePrice : (result.marketPrice || result.presalePrice)).replace('¥', ''); // 数字 + statGoodsInfo.marketPrice = (result.marketPrice ? + result.marketPrice : + result.presalePrice).replace('¥', ''); // 数字 + statGoodsInfo.salePrice = (result.salePrice ? + result.salePrice : + (result.marketPrice || result.presalePrice)).replace('¥', ''); // 数字 statGoodsInfo.imageUrl = helpers.getForceSourceUrl(result.img); statGoodsInfo.productUrl = 'http:' + helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item'); @@ -1545,7 +1495,8 @@ const getDetailHeader = (pid, uid, isStudent, vipLevel, dataMd5, cookie) => { * 是否支持退换货,true 支持,false 不支持 */ const saleReturn = (skn) => { - return productAPI.isSupportReturnedSale(skn).then(result => _.get(result, `data.${skn}`, 'N') === 'N' ? 'Y' : 'N'); + return productAPI.isSupportReturnedSale(skn) + .then(result => _.get(result, `data.${skn}`, 'N') === 'N' ? 'Y' : 'N'); }; /** @@ -1642,7 +1593,7 @@ const recommendAsync = (skn, page, limit) => { } const formatPrice = p => `¥${p}`; - const productUrl = (pid, gid, cn) => helpers.urlFormat(`/product/pro_${pid}_${gid}/${cn}.html`, null, 'item'); + const productUrl = (pid, gid, cn) => helpers.getUrlBySkc(pid, gid, cn); const productImageUrl = Fn.pipe(Fn.prop('default_images'), _.partial(helpers.image, _, 280, 382, 2, 70)); let products = _.get(recommendData, 'data.product_list', []).map((rp) => { diff --git a/apps/product/models/newArrive-api.js b/apps/product/models/newArrive-api.js new file mode 100644 index 0000000..7b1e529 --- /dev/null +++ b/apps/product/models/newArrive-api.js @@ -0,0 +1,56 @@ +/** + * 新品到着相关接口 + * @author: yyq<yanqing.yang@yoho.cn> + * @date: 2016/7/17 + */ + +'use strict'; + +const api = global.yoho.API; + +/** + * 为您推荐店铺API + * + */ +const recShop = (params) => { + let finalParams = { + method: 'app.newproduct.recshop' + }; + + Object.assign(finalParams, params); + return api.get('', finalParams); +}; + +/** + * 为您推荐品牌API + * + */ +const recBrand = (params) => { + let finalParams = { + method: 'app.newproduct.recbrand' + }; + + Object.assign(finalParams, params); + return api.get('', finalParams); +}; + +/** + * 最新上架API + * + */ +const recList = (params) => { + let finalParams = { + method: 'app.newproduct.reclist', + limit: 60 + }; + + Object.assign(finalParams, params); + + return api.get('', finalParams); +}; + +module.exports = { + recShop, + recBrand, + recList +}; diff --git a/apps/product/models/newArrive-service.js b/apps/product/models/newArrive-service.js new file mode 100644 index 0000000..899f609 --- /dev/null +++ b/apps/product/models/newArrive-service.js @@ -0,0 +1,352 @@ +/* + * @Author: hongwei.gao + * @Date: 2016-12-28 + */ +'use strict'; + +const headerModel = require('../../../doraemon/models/header'); +const api = require('./newArrive-api'); +const _ = require('lodash'); +const searchHandler = require('./search-handler'); +const publicHandler = require('./public-handler'); +const helpers = global.yoho.helpers; +const moment = require('moment'); + +const channelMap = { + boys: { + code: '29ce9c740c452b97d421f9630893dfe6', + yh_channel: 1, + gender: '1,3' + }, + girls: { + code: 'cc145b163edb010c5d6320a2c680f24a', + yh_channel: 2, + gender: '2,3' + }, + kids: { + code: '4eed401c1ba714099585b593dd25dfbe', + yh_channel: 3, + gender: '2,3' + }, + lifestyle: { + code: 'c6c7421b3fddddf04799c13d3a84b4f2', + yh_channel: 4, + gender: '2,3' + } +}; + +/** + * 处理列表数据、及页码 + * @param data + * @returns {{footPager: type[], newProList: Array}} + * @private + */ +const _proListHandler = (data, params) => { + let total = data.total || '', + proList = data.product_list || [], + newProList = []; + + // 页码 + let footPager = searchHandler.handlePagerData(total, + Object.assign(params, {limit: _.get(data, 'page_size', '50')}), true); + + // 商品列表 + _.forEach(proList, pro => { + let proObj = {}; + + // 应季热门 + if (pro.recommend_type === 'seasonSort') { + let tags = []; + + _.forEach(pro.data, subData => { + tags.push({ + url: helpers.urlFormat('', {sort: subData.relationParameter}, 'list'), + name: subData.categoryName, + cateId: subData.categoryId + }); + }); + + proObj.tags = tags; + proObj.tagType = true; + } + + // 热门搜索 + if (pro.recommend_type === 'hotSearchTerm') { + let tags = []; + + _.forEach(pro.data, subData => { + tags.push({ + url: helpers.urlFormat('', {query: subData}, 'search'), + name: subData + }); + }); + + proObj.tags = tags; + proObj.tagType = true; + proObj.hotSearch = true; + } + + // 店铺 + if (pro.recommend_type === 'hotShop') { + + proObj = { + url: helpers.urlFormat('', {shopId: pro.data.shops_id}, pro.data.shop_domain), + src: pro.data.shop_logo, + newNum: pro.data.new_product_num, + collNum: pro.data.favorite_num, + shopId: pro.data.shops_id, + shopName: pro.data.shop_name + }; + proObj.shopType = true; + } + + // 文章 + if (pro.recommend_type === 'fashionArticle') { + + proObj = { + url: helpers.urlFormat('/' + pro.data.id + '.html', {channel: params.channel}, 'guang'), + src: pro.data.src, + title: pro.data.title, + publishTime: moment(parseInt(pro.data.publish_time_long, 10)).format('YYYY年MM月DD HH:mm'), + num: pro.data.browse || 0, + articalId: pro.data.id + }; + proObj.articalType = true; + } + + // 普通商品 + if (!pro.recommend_type) { + let defaultGoods = _.find(pro.goods_list, {is_default: 'Y'}); + + // 无默认商品取商品列表第一个 + if (!defaultGoods) { + defaultGoods = pro.goods_list[0]; + } + proObj = { + url: helpers.getUrlBySkc(pro.product_id, defaultGoods.goods_id, pro.cn_alphabet), + src: pro.default_images, + proName: pro.product_name, + salesPrice: pro.sales_price, + proSkn: pro.product_skn + }; + proObj.goodsType = true; + } + proObj.recType = pro.recommend_type; + newProList.push(proObj); + }); + + return { + footPager: footPager, + newProList: newProList + }; +}; + +/** + * 加载新品到着首页 + * @param req + * @returns {Promise.<TResult>} + */ +const index = (req) => { + + let channel = req.yoho.channel; + let params = { + yh_channel: channelMap[channel].yh_channel, + channel: channel, + uid: req.user.uid || '' + }; + + let shopParams = Object.assign({}, params, {contentCode: channelMap[channel].code}); + let recParams = Object.assign({}, params, { + sort: req.query.sort || '', + page: req.query.page || 1 + }); + + let cateId = req.query.cateId || ''; + + let apiMethod = [ + headerModel.requestHeaderData(channel), + api.recShop(shopParams), + api.recBrand(params), + api.recList(Object.assign({}, params)), // 获取品类 + api.recList(recParams)// 获取商品数据 + ]; + + return Promise.all(apiMethod).then(result => { + var respData = { + slide: { + list: [] + }, + recommond: { + name: '为您推荐', + dataList: [] + }, + newBrand: { + name: '新品牌入驻', + brandList: [] + }, + newProduct: { + name: '最新上架', + newProList: [], + ctyList: [] + }, + firstLook: { + name: '精彩抢先看', + lookBanner: { + list: [] + }, + lookTwoImg: [] + } + }; + + // 头部数据 + Object.assign(respData, result[0]); + + // 面包屑头部 + Object.assign(respData, searchHandler.handlePathNavData({}, {}, 'new', channel)); + + if (result[1].code === 200 && result[1].data) { + + _.forEach(_.get(result, '[1].data.ads', []), ads => { + // banner + if (ads.template_name === 'focus') { + Object.assign(respData.slide.list, ads.data); + } + + // 精彩想先看,左轮播右2图 + if (ads.template_name === 'NL2R') { + Object.assign(respData.firstLook.lookBanner.list, ads.data.left); + Object.assign(respData.firstLook.lookTwoImg, ads.data.right); + } + }); + } + + // 新品牌入驻 + if (result[2].code === 200 && result[2].data) { + let hotBrandsData = _.get(result, '[2].data.hot_brand_list', []), + recList = []; + + _.forEach(hotBrandsData, hotBrand => { + recList.push({ + url: helpers.urlFormat('', {shopId: hotBrand.shops_id}, hotBrand.shop_domain), + src: hotBrand.shop_logo, + num: hotBrand.new_product_num, + shopId: hotBrand.shops_id, + brandId: hotBrand.brand_id + }); + }); + + // 为您推荐 + Object.assign(respData.recommond.dataList, recList); + + let brandsData = _.get(result, '[2].data.new_brand_list', []), + brandList = []; + + _.forEach(brandsData, brand => { + brandList.push({ + url: helpers.urlFormat('', {shopId: brand.shops_id}, brand.shop_domain), + src: brand.shop_logo, + shopId: brand.shops_id, + brandId: brand.brand_id + }); + }); + + Object.assign(respData.newBrand.brandList, brandList); + } + + // 最新上架 + if (result[3].code === 200 && result[3].data) { + let groupSort = _.get(result, '[3].data.filter.group_sort', []), + ctyList = []; + + // 推荐品类 + _.forEach(groupSort, group =>{ + _.forEach(group.sub, subSort =>{ + let cateObj = { + cateId: subSort.category_id, + url: publicHandler.handleFilterUrl(params, { + sort: subSort.relation_parameter.sort, + cateId: subSort.category_id + }), + name: subSort.category_name, + active: false + }; + + if (ctyList.length < 20) { + // 默认选中判断 + if (cateId === subSort.category_id) { + cateObj.active = true; + } + ctyList.push(cateObj); + } else { + return true; + } + }); + }); + Object.assign(respData.newProduct.ctyList, ctyList); + } + + // 最新上架 + if (result[4].code === 200 && result[4].data) { + // 列表数据 + Object.assign(respData.newProduct, _proListHandler(result[4].data, + Object.assign({}, recParams, {channel: channel, cateId: cateId}))); + } + + // 数据为空,不显示页面模块 + if (_.isEmpty(respData.slide.list)) { + delete respData.slide; + } + if (_.isEmpty(respData.recommond.dataList)) { + delete respData.recommond; + } + if (_.isEmpty(respData.newBrand.brandList)) { + delete respData.newBrand; + } + if (_.isEmpty(respData.newProduct.newProList) && _.isEmpty(respData.newProduct.ctyList)) { + delete respData.newProduct; + } + if (_.isEmpty(respData.firstLook.lookBanner.list) && _.isEmpty(respData.firstLook.lookTwoImg)) { + delete respData.firstLook; + } + return respData; + }); +}; + +/** + * 加载最新上架数据 + * @param req + * @returns {Promise.<TResult>} + */ +const getRecList = (req) => { + let channel = req.yoho.channel; + + let params = { + yh_channel: channelMap[channel].yh_channel, + channel: channel, + uid: req.user.uid || '' + }; + + Object.assign(params, { + sort: req.query.sort || '', + cateId: req.query.cateId || '', + page: req.query.page || 1 + }); + + let apiMethod = [ + api.recList(params) + ]; + + return Promise.all(apiMethod).then(result => { + let respData = {}; + + if (result[0].code === 200 && result[0].data) { + Object.assign(respData, _proListHandler(result[0].data, params)); + } + return respData; + }); +}; + +module.exports = { + index, + getRecList +}; diff --git a/apps/product/models/search-api.js b/apps/product/models/search-api.js index 2c22302..fb3ee1a 100644 --- a/apps/product/models/search-api.js +++ b/apps/product/models/search-api.js @@ -13,7 +13,6 @@ const config = global.yoho.config; const helpers = global.yoho.helpers; const cache = global.yoho.cache; const logger = global.yoho.logger; -const images = require('../../../utils/images.js'); const getSortByConditionAsync = (condition) => { return api.get('', Object.assign({ @@ -288,191 +287,50 @@ const getBrandCouponAsync = (brandId, uid) => { */ const getBrandShop = (query) => { let finalParams = { - // method: 'web.regular.groupsort' - method: 'web.search.shopInfo' + method: 'web.search.shopNewInfo' }; - Object.assign(finalParams, {keyword: query}); - - let cKey = getSearchCacheKey(finalParams); - - return cache.get(cKey) - .catch(err => logger.debug(`product query save cache data fail:${err.toString()}`)) - .then(cdata => { - let retObj; - - try { - if (cdata) { - retObj = JSON.parse(cdata); - } - } catch (e) { - logger.debug('getBrandShop cache data parse fail.'); - } - - if (retObj) { - return retObj; - } else { - return api.get('', finalParams).then(ret => { - if (ret && ret.code === 200) { - - saveCache(cKey, ret.data, CACHE_TIME_S); - return ret.data; - } - return null; - }); - } - }); -}; - -/** - * 根据品牌ID获取品牌下的店铺 - * @return - */ -const getShopsByBrandId = bid => { - let finalParams = { - method: 'app.shop.queryShopsByBrandId', - brand_id: bid - }; - - let cKey = getSearchCacheKey(finalParams); - - return cache.get(cKey) - .catch(err => logger.debug(`product query save cache data fail:${err.toString()}`)) - .then(cdata => { - let cdataObj; - - if (cdata) { - try { - cdataObj = JSON.parse(cdata); - } catch (e) { - logger.debug('getShopsByBrandId cache data parse fail.'); - } - } - - if (cdataObj) { - return cdataObj; - } else { - return api.get('', finalParams).then(ret => { - if (ret && ret.code === 200) { - - saveCache(cKey, ret.data, CACHE_TIME_S); - return ret.data; - } - return null; - }); - } - }); -}; - -const shopFormat = shopDatas => { - let shopEntry = []; - - _.forEach(shopDatas, val => { - let sorts = []; - let shopId = _.get(val, 'shop.shop_id', ''); - let url = helpers.urlFormat('', {shopId: shopId}, val.shop.brand_domain); - - if (val.shopSort) { - for (let ss of val.shopSort) { - if (!ss.sub) { - continue; - } - - let isFull = false; - - for (let misort of ss.sub) { - if (sorts.length >= 10) { - isFull = true; - break; - } - - sorts.push({ - href: `${url}&msort=${ss.sort_id}&misort=${misort.sort_id}`, - name: misort.sort_name - }); - } - if (isFull) { - break; - } - } - } - - shopEntry.push({ - home: url, - logo: images.getImageUrl(val.shop.brand_ico, 80, 50, 1, 'brandLogo'), - shopName: val.shop.brand_name, - sort: sorts - }); - }); - - return shopEntry; + return api.get('', Object.assign(finalParams, {keyword: query}), config.apiCache); }; /** - * 根据搜索得到店铺/品牌 列表 + * 根据搜索得到店铺/品牌 */ const getShopList = params => { - if (!params || !params.query) { return; } - let brandShop; - let brandShops; - - return getBrandShop(params.query).then(shop => { // 获取品牌,并根据品牌获取品牌下的所有店铺 + return getBrandShop(params.query).then(shops => { + let shopEntry = {}, + sort = _.get(shops, 'data.sortInfo.sort', {}), + shopInfo = _.get(shops, 'data.shopBrandInfo.shopInfo', {}) || + _.get(shops, 'data.shopBrandInfo.brandInfo', {}); - if (!shop || !shop.id) { + if (_.isEmpty(shopInfo)) { return; } - brandShop = shop; - return getShopsByBrandId(shop.id).then(shops => { - if (shops && shops.length) { - return shops; - } else { - return shop; - } - }); - }).then(shops => { // 获取品牌/品牌店下所有的分类 - - if (_.isArray(shops)) { - brandShops = shops; - - let promises = []; - - for (let s of shops) { - promises.push(getSortList({ - brand: s.brand_id || brandShop.id - })); - } - - return Promise.all(promises); - } else if (shops && shops.id) { - return getSortList({ - brand: shops.id - }); - } - - }).then(sorts => { // 数组则为品牌店列表,否则为品牌 - let shopData = []; - - if (_.isArray(sorts)) { - - _.forEach(sorts, (val, index) => { - shopData.push({ - shop: brandShops[index], - shopSort: val && val.data && !_.isFunction(val.data.sort) && val.data.sort + shopEntry = { + home: helpers.urlFormat('', '', shopInfo.shop_domain || shopInfo.brand_domain), + logo: shopInfo.shop_logo || shopInfo.brand_ico, + shopName: shopInfo.shop_name || shopInfo.brand_name, + sort: [] + }; + + // 店铺/品牌的小分类 + _.forEach(sort, (sortInfo) => { + _.forEach(_.get(sortInfo, 'sub', []), (subSort) => { + shopEntry.sort.push({ + href: helpers.urlFormat('', {misort: subSort.sort_id}, + shopInfo.shop_domain || shopInfo.brand_domain), + name: subSort.sort_name }); }); - } else if (sorts && sorts.code === 200 && sorts.data) { - shopData.push({ - shop: brandShop, - shopSort: !_.isFunction(sorts.data.sort) && sorts.data.sort - }); - } - return shopFormat(shopData); + }); + + return shopEntry; }); }; @@ -557,12 +415,9 @@ const getArticleByBrand = (brand, udid, limit) => { }; const getBrands4Filter = (params) => { - - let finalParams = { + return api.get('', Object.assign({ method: 'web.regular.aggBrand' - }; - - return api.get('', Object.assign(params, finalParams)); + }, params)); }; module.exports = { diff --git a/apps/product/models/search-handler.js b/apps/product/models/search-handler.js index a165890..f8444bb 100644 --- a/apps/product/models/search-handler.js +++ b/apps/product/models/search-handler.js @@ -1599,6 +1599,15 @@ exports.getSearchParams = params => { nparams.price = nmp.join(','); } + // 商品详情页促销跳转 + if (params && params.psp_id) { + Object.assign(nparams, { + promotion_id: params.psp_id, + method: 'app.search.promotion' + }); + } + + /** 查询参数再处理 **/ // 对可能有中文的情况进行处理 if (params.query) { params.query = decodeURIComponent(params.query); diff --git a/apps/product/models/search.js b/apps/product/models/search.js index 676cd90..7e3bfac 100644 --- a/apps/product/models/search.js +++ b/apps/product/models/search.js @@ -26,9 +26,25 @@ exports.getKeyActivity = (query) => { * @return {[type]} [description] */ exports.getSearchData = (params, channel) => { - let searchParams = searchHandler.getSearchParams(params); + switch (channel) { + case 'boys': + searchParams.physical_channel = 1; + break; + case 'girls': + searchParams.physical_channel = 2; + break; + case 'kids': + searchParams.physical_channel = 3; + break; + case 'lifestyle': + searchParams.physical_channel = 4; + break; + default: + break; + } + // 调用接口 let apiMethod = [ headerModel.requestHeaderData(channel), @@ -37,11 +53,6 @@ exports.getSearchData = (params, channel) => { searchApi.getShopList(params) ]; - // 搜索店铺 - /* if (params.query) { - apiMethod.push(searchApi.getBrandShop(params.query)); - }*/ - return api.all(apiMethod).then(result => { let finalResult = { headerData: Object.assign(result[0].headerData, { @@ -164,5 +175,13 @@ exports.getBrands4Filter = (params) => { }); } + // 商品详情页促销跳转 + if (params && params.psp_id) { + Object.assign(nparams, { + promotion_id: params.psp_id, + method: 'app.promotion.aggBrand' + }); + } + return this.getListBrandsFilter(params, nparams); }; diff --git a/apps/product/router.js b/apps/product/router.js index 3846cfb..fe4257f 100644 --- a/apps/product/router.js +++ b/apps/product/router.js @@ -9,6 +9,7 @@ const router = require('express').Router(); // eslint-disable-line const cRoot = './controllers'; const auth = require(`${global.middleware}/auth`); +const filter = require(`${global.middleware}/filter-qs`); // 参数过滤 // 商品详情controller const detail = require(`${cRoot}/detail`); @@ -40,6 +41,9 @@ const search = require(`${cRoot}/search`); // 学生优惠controller const students = require(`${cRoot}/students`); +// 新品到着controller +const newArrive = require(`${cRoot}/newArrive`); + // 商品促销routers router.get('/sale', sale.index); // sale 首页 router.get('/sale/discount/detail', sale.discount); // 折扣专场详情页 @@ -79,24 +83,24 @@ router.post('/detail/notify/add', auth, notify.add); // 增� router.post('/detail/notify/cancel', auth, notify.cancel); // 删除到货通知 // 搜索 -router.get('/search/index', search.index); +router.get('/search/index', filter, search.index); router.get('/search/filter/brands', search.serachFilterBrands); router.get('/search/suggest', search.suggest); // 搜索提示 router.get('/api/suggest', search.suggest4Old); // 商品分类列表页 -router.get('/list/index', list.index); +router.get('/list/index', filter, list.index); // 新品到着 -router.get('/list/new', list.new); +router.get('/list/new', filter, list.new); // 品牌店铺 -router.get('/index/brand', list.brand); // 品牌店铺页 +router.get('/index/brand', filter, list.brand); // 品牌店铺页 router.get('/index/about', list.brandAbout); // 品牌店铺介绍页 router.post('/index/isFavoriteBrand', list.isFavoriteBrand); // 判断用户是否收藏品牌 router.post('/index/getNodeContent', list.getNodeContent); // 品牌页水牌 router.post('/index/getAdnav', list.getAdnav); // 品牌页系列 -router.get('/shoplist', list.shopList); // 店铺列表页 +router.get('/shoplist', filter, list.shopList); // 店铺列表页 router.post('/shop/togglecollect', favorite.collectShop); // 店铺收藏 router.post('/index/isFavoriteShop', favorite.isFavShop); // 判断用户是否收藏品牌 router.get('/brand/couponsync', list.brandCouponSync); @@ -112,4 +116,7 @@ router.get('/students/verify', students.verify); // 身份验证 router.get('/students/userAcquireStatus', students.userAcquireStatus); // 获取优惠券领取状态 router.get('/students/list', students.list); // 获取优惠券领取状态 +// 新品到着改版 +router.get('/newArrive', newArrive.index); // 获取优惠券领取状态 + module.exports = router; diff --git a/apps/product/views/action/list/new-arrive.hbs b/apps/product/views/action/list/new-arrive.hbs new file mode 100644 index 0000000..0a3f832 --- /dev/null +++ b/apps/product/views/action/list/new-arrive.hbs @@ -0,0 +1,131 @@ +<div class="home-page yoho-page {{pageType}}" data-page="{{pageType}}"> + {{> common/path-nav}} + {{! 头部banner}} + {{# slide}} + {{> banner}} + {{/ slide}} + {{#recommond}} + <div class="recommond-floor"> + {{> common/floor-header}} + <div id="rec-swiper" class="swiper-container new-arrival-swiper rec-swiper"> + <div class="swiper-wrapper"> + {{#dataList}} + <div class="swiper-slide" data-shopId="{{shopId}}" data-brandId="{{brandId}}"> + <a class="rec-pro" href="{{url}}" target="_blank"> + <img src="{{image2 src w=185 h=86}}"> + <p class="new-num">上新<span>{{num}}</span>款</p> + </a> + </div> + {{/dataList}} + </div> + + <a class="prev" href="javascript:;"> + <span class="iconfont"></span> + </a> + <a class="next" href="javascript:;"> + <span class="iconfont"></span> + </a> + </div> + </div> + {{/recommond}} + {{#newBrand}} + <div class="newBrand-floor"> + {{> common/floor-header}} + <div id="brand-swiper" class="swiper-container new-arrival-swiper brand-swiper"> + <div class="swiper-wrapper"> + {{#brandList}} + <span class="swiper-slide" data-shopId="{{shopId}}" data-brandId="{{brandId}}"> + <a class="" href="{{url}}" target="_blank"> + <img src="{{image2 src w=185 h=86}}"> + </a> + </span> + {{/brandList}} + </div> + + <a class="prev" href="javascript:;"> + <span class="iconfont"></span> + </a> + <a class="next" href="javascript:;"> + <span class="iconfont"></span> + </a> + </div> + </div> + {{/newBrand}} + {{#firstLook}} + <div class="firstLook-floor clearfix"> + {{> common/floor-header}} + {{#lookBanner}} + <div class="left-one"> + <div class="slide-wrapper"> + <ul> + {{# list}} + <li style="{{#if bgColor}}background:{{bgColor}}{{/if}}"> + <a href="{{url}}" target= "_blank"> + {{#if @first}} + <img src="{{image2 src w=785 h=420}}"> + {{^}} + <img class="lazy" data-original="{{image2 src w=785 h=420}}" alt=""> + {{/if}} + </a> + {{# tips}} + <div class="slide-tips"> + <div class="g-mark"></div> + <p>{{.}}</p> + </div> + {{/ tips}} + </li> + {{/ list}} + </ul> + </div> + </div> + {{/lookBanner}} + <div class="right-two"> + {{#lookTwoImg}} + <a class="first-right-img" href="{{url}}" target="_blank"> + <img class="lazy" data-original="{{image2 src w=355 h=205}}" style="display: block; opacity: 1;"> + </a> + {{/lookTwoImg}} + </div> + </div> + {{/firstLook}} + {{#newProduct}} + <div id="new-product-floor" class="newProduct-floor"> + {{> common/floor-header}} + <div style="height:28px;" id="catagory-wrap"> + <div class="all-catagory fixed-area clearfix"> + <div class="catagory-text">推荐品类</div> + <ul class="catagory-navs clearfix"> + {{#ctyList}} + <li {{#if active}} class="active" {{/if}} data-cateId="{{cateId}}"> + <a href="{{url}}">{{name}}</a> + </li> + {{/ctyList}} + </ul> + </div> + </div> + <div id="pjax-container" class="new-arrive-list clearfix"> + {{> list/new-arrive-list}} + </div> + </div> + {{/newProduct}} + <div id="new-arrive-latest" class="product-detail-page new-arrive-latest latest-walk"> + <div class="bottom-tab"> + <p> + <span class="bottom-title bottom-cur">最近浏览</span> + </p> + </div> + <div class="individual-comment info-block info-bottom"> + <div class="latest-walk" style="display: block;"> + <input id="latest-walk-count" type="hidden" value="5"> + <div id="latest-walk-goods" class="goods clearfix"></div> + </div> + {{> product/latest-walk-tpl}} + + <div class="lazy-load-object"> + <textarea class="latest-walk-datalazyload" style="visibility: hidden;"> + <script> fetchLatestWalk(); </script> + </textarea> + </div> + </div> + </div> +</div> diff --git a/apps/product/views/action/list/new-pro-list.hbs b/apps/product/views/action/list/new-pro-list.hbs new file mode 100644 index 0000000..69eb952 --- /dev/null +++ b/apps/product/views/action/list/new-pro-list.hbs @@ -0,0 +1 @@ +{{> list/new-arrive-list}} diff --git a/apps/product/views/action/product/detail.hbs b/apps/product/views/action/product/detail.hbs index fbb6078..5436a24 100644 --- a/apps/product/views/action/product/detail.hbs +++ b/apps/product/views/action/product/detail.hbs @@ -1,24 +1,7 @@ <div class="product-detail-page yoho-page"> {{# detail}} - {{# banner}} - <div class="brand-banner" style="background:{{bgColor}}{{#if bgImg}} url({{image bgImg 1920 45}}){{/if}}"> - <div class="center-content clearfix"> - <a class="pull-left" href="{{homeUrl}}"> - <img src="{{image2 logo}}"> - </a> - <div class="opt pull-right"> - <a class="home" href="{{homeUrl}}" title="{{brandName}}"> - <span class="iconfont"></span> - </a> - <span id="brand-favour" class="brand-fav{{#if isCollect}} coled{{/if}}" data-id="{{brandId}}"> - <i class="iconfont"></i> - <span class="fav-num"></span> - </span> - </div> - </div> - </div> - {{/ banner}} + {{>product/brand-banner}} <div class="center-content"> {{> common/path-nav}} @@ -38,550 +21,29 @@ </div> {{/if}} - {{!-- 因接口原因,暂存size的title的值 --}} - - <div id="size-title-json" style="display:none;">{{sizeTitleJson}}</div> <div id="package" class="package-box clearfix"></div> + <div class="total-content"> <div class="other-infos"> - <div class="description-material info-block head getnav" id="goodsMessage" data-id="0"> - <p class="block-title"> - <span class="title-head"> <span class="title cur">商品信息</span> </span> - </p> - - {{#if description}} - <div class="description-content"> - {{# description}} - <ul class="basic clearfix"> - {{# basic}} - <li> - <em class="justpostion"> - {{#if dColor}} - <span class="keySpace">{{{escapeType key}}}: </span> - <span id="desc-color" title="{{value}}" class="valueSpace">{{value}}</span> - {{^}} - <span class="keySpace">{{{escapeType key}}}: </span> - <span class="valueSpace">{{value}}</span> - {{/if}} - </em> - </li> - {{/ basic}} - </ul> - {{#if comfort}} - <ul class="comfort clearfix"> - {{# comfort}} - <li class="pull-left"> - <span class="comfort-title">{{{escapeLength name}}}:</span> - <span class="min-des">{{minDes}}</span> - {{# blocks}} - <span class="comfort-block {{#if cur}}cur{{/if}}"></span> - {{/ blocks}} - <span class="max-des">{{maxDes}}</span> - </li> - {{/ comfort}} - </ul> - {{/if}} - {{/ description}} - </div> - {{/if}} - </div> - - {{#if material.materialDetail}}<div class="description-material info-block"> - <p class="block-title"> - <span class="title-head"> <span class="title cur">材质洗涤</span> </span> - </p> - - <div class="material-content"> - {{# material}} - {{#if materialDetail}} - <ul class="material-detail"> - {{# materialDetail}} - <li class="clearfix"> - <div class="img-wrap clearfix"> - <img src="{{image2 img}}"> - <p class="name">{{name}}<br>{{enName}}</p> - </div> - <p class="text">{{text}}</p> - </li> - {{/ materialDetail}} - </ul> - {{/if}} - - {{#if wash}} - <ul class="wash"> - {{# wash}} - <li> - <img class="wash-icon" src="{{image2 img}}"> - <p class="wash-name">{{name}}</p> - </li> - {{/ wash}} - </ul> - {{/if}} - {{/ material}} - </div> - </div> - {{/if}} - - {{#if size.tbody}}<div class="description-material-tab info-block getnav" id="sizeMessage" data-id="1"> - - <p class="block-title" id="sizeTitle"> - <span class="title-head"> <span class="title cur">尺码信息</span> </span> - </p> - <div class="size-content"> - {{#if goodsInfo.virtualGoods}} - <!---虚拟商品-尺码信息没有---> - {{else}} - <div class="size-info "> - - {{# size}} - <table class="size-table"> - <thead> - <tr> - {{# thead}} - <th>{{name}}</th> - {{/ thead}} - </tr> - </thead> - - <tbody> - {{# tbody}} - <tr> - {{#each .}} - <td>{{.}}</td> - {{/each}} - </tr> - {{/ tbody}} - </tbody> - </table> - <p class="size-tip"> - ※ 以上尺寸为实物人工测量,因测量方式不同会有1-2CM误差,相关数据仅作参考,以收到实物为准。 单位:CM - <br /> - ※ 参考尺码因衣服版型、剪裁不同会有误差,仅供参考 - </p> - - {{#if sizeImg}} - <img class="size-img" src="{{image2 sizeImg}}"> - {{/if}} - {{/ size}} - </div> - {{/if}} - </div> - </div> - {{/if}} - {{#if reference}} - <div class="description-material-tab info-block"> - <p class="block-title"> - <span class="title-head"> <span class="title cur">试穿参考</span> </span> - </p> - - <div class="model-content"> - <div class="reference"> - {{# reference}} - <table class="reference-table"> - <thead> - <tr> - {{# thead}} - <th class="{{#if @first}}avatar-col{{/if}}{{#if modelCol}}model-col{{/if}}{{#if remarkCol}}remark-col{{/if}}">{{name}}</th> - {{/ thead}} - </tr> - </thead> - - <tbody> - {{# tbody}} - <tr> - {{#each .}} - <td> - {{#if @first}} - <img class="avatar" src="{{image2 .}}"> - {{^}} - {{.}} - {{/if}} - </td> - {{/each}} - </tr> - {{/ tbody}} - </tbody> - </table> - {{/ reference}} - <p class="size-tip"> - ※ 模特试穿中身高单位:CM,体重单位:KG,三围单位:CM - </p> - </div> - - </div> - </div> - {{/if}} - - {{#if modelCards}} - - <div class="description-material-tab info-block"> - <p class="block-title"> - <span class="title-head"> <span class="title cur">模特信息</span> </span> - </p> - - <div class="model-content"> - <div class="ref-model"> - <div class="ref-model"> - {{# modelCards}} - <div class="model" style="background: url({{image2 url}}) no-repeat"> - <span>试穿尺码: <em>{{size}}</em></span> - </div> - {{/ modelCards}} - </div> - </div> - - {{#if fittingReport}} - <div class="fitting-report info-block"> - <p class="block-title"> - <span class="title cur">试穿报告</span> - </p> - {{# fittingReport}} - {{#if frImg}} - <div class="fr-img-wrap"> - <img src="{{image2 frImg}}"> - </div> - {{^}} - <table class="fitting-report-table"> - <thead> - <tr> - {{# thead}} - <th>{{.}}</th> - {{/ thead}} - </tr> - </thead> - - <tbody> - {{# tbody}} - <tr> - {{#each .}} - <td>{{.}}</td> - {{/each}} - </tr> - {{/ tbody}} - </tbody> - </table> - {{/if}} - {{/ fittingReport}} - </div> - {{/if}} - </div> - </div> - {{/if}} - - <div class="details info-block getnav" id="goodsInside" data-id="2"> - <p class="block-title" id="goodsTitle"> - <span class="title-head"> <span class="title cur">商品详情</span> </span> - </p> - - <div id="details-html" class="details-html"> - <div class="lazy-load-object"> - <textarea class="datalazyload" style="visibility: hidden;"> - <script> - fetchHotArea(); - </script> - </textarea> - - </div> - {{{details}}} - - {{#if goodsInfo.imageBanner}} - <a class="img-link" href="{{goodsInfo.imageBanner.url}}"> - <img src="{{image2 goodsInfo.imageBanner.activityImg}}"> - </a> - {{/if}} - </div> - </div> - - {{#if comment}} - <div class="lazy-load-object"> - <textarea class="datalazyload" style="visibility: hidden;"> - <script> - fetchComment(); - </script> - </textarea> - </div> - - <div class="consult-comment info-block getnav" id="judge" data-id="3"> - - <p class="block-title" id="judgeTitle"> - <span class="title-head"> <span class="title cur">商品评价</span> </span> - </p> - - <div class="comments cc-content"> - <div class="comment-tabs clearfix"> - <h2 class="active" data-comment-type="7"> - 全部 ( <em class="comment-num all-comment-num">0</em> ) - </h2> - <h2 data-comment-type="6"> - 有图 ( <em class="comment-num img-comment-num">0</em> ) - </h2> - </div> - <div class="judge-content"> - <div data-comment-list="7"> - <ul> - <div class="img-4"><span class="img-4-message">暂无评论~</span></div> - - </ul> - </div> - - <div data-comment-list="6" class="m-hide"> - <ul> - <div class="img-4"><span class="img-4-message">暂无评论~</span></div> - - </ul> - </div> - </div> - </div> - </div> - - <div class="lazy-load-object"> - <textarea class="datalazyload" style="visibility: hidden;"> - <script> - fetchComment(); - </script> - </textarea> - </div> - {{/if}} - - {{#if consult}} - <div class="consult-comment info-block getnav" id="goodsAsk" data-id="4"> - <div class="lazy-load-object"> - <textarea class="datalazyload" style="visibility: hidden;"> - <script> - fetchConsult(); - fetchRecommend(); - </script> - </textarea> - </div> - - <p class="block-title" id="goodsAskTitle"> - <span class="title-head"> <span class="title cur">商品咨询</span> </span> - </p> - - <div class="common-consults"> - <div class="common-question"> - <p> - <span class="top-question"><i class="iconfont"></i>商品都是正品吗?</span> - <span class="bottom-answer"><i class="iconfont"></i>有货www.yohobuy.com所售的商品均经品牌授权, - 正品保障,支持专柜验货,与您亲临商场选购的商品一样享受相同的质量保证, - 请您放心购买。</span> - </p> - </div> - - <div class="common-question"> - <p> - <span class="top-question"><i class="iconfont"></i>尺码表上的尺码标准吗?</span> - <span class="bottom-answer"><i class="iconfont"></i>有货所售商品尺寸均为人工实物测量, - 可能会存在1-2cm的正常误差范围。</span> - </p> - </div> - - <div class="common-question"> - <p> - <span class="top-question"><i class="iconfont"></i>图片颜色和实物颜色相同吗?</span> - <span class="bottom-answer"><i class="iconfont"></i>有货所有商品均采用实物专业拍摄,但由于个人显示器不同, - 可能导致实物与图片存在色差,最终颜色以实物为准。</span> - </p> - </div> - - <div class="common-question"> - <p> - <span class="top-question"><i class="iconfont"></i>发货及配送</span> - <span class="bottom-answer"><i class="iconfont"></i>当天下午3点前订单当天发,之后的订单隔天发, - 合作快递有:韵达、EMS、顺丰、申通、圆通、宅急送,普通快递3-5天左右送达,顺丰速运1-2天送达。</span> - </p> - </div> - - <div class="common-question"> - <p> - <span class="top-question"><i class="iconfont"></i>退货or换货</span> - <span class="bottom-answer"><i class="iconfont"></i>签收商品未经穿着不影响二次销售的情况下,7日内退货,15日内换货; - 退回商品保证吊牌、标签、包装完整,详情点击 <a href="http://www.yohobuy.com/help/?category_id=69" target="_blank">  >>退换货政策</a></span> - </p> - </div> - - - <div class="lazy-load-object"> - <textarea class="datalazyload" style="visibility: hidden;"> - <script> - fetchConsult(); - fetchRecommend(); - </script> - </textarea> - </div> - - <div class="common-question"> - <p> - <span class="common-advice"> - <a href="#textbox-wrapper" id="common-advice"> - <i class="iconfont advice"> </i> - 我要咨询> - </a> - </span> - </p> - </div> - - <div class="buy-consults"> - <p class="block-title"> - <span class="title-head"> - <span class="title cur">购买咨询(<i class="consult-num">0</i>)</span> - </span> - </p> - </div> - - <div id="consults-ul"></div> - <div class="common-question"></div> - <div class="consults-pager"></div> - <div id="textbox-wrapper" class="common-question input"> - <textarea id="textbox" placeholder="请输入您的问题"></textarea> - <span id="submit-consult" class="btn">提交咨询</span> - </div> - - </div> - - <div class="lazy-load-object"> - <textarea class="datalazyload" style="visibility: hidden;"> - <script> - fetchConsult(); - fetchRecommend(); - </script> - </textarea> - </div> - - </div> - {{/if}} - </div> - </div> - - - - <div class="after-service"> - <div class="lazy-load-object"> - <textarea class="datalazyload" style="visibility: hidden;"> - <script> - fetchReturn(); - fetchRecommend(); - </script> - </textarea> - </div> - - <div id="after-service-switch" class="after-service-switch clearfix"> - <span class="iconfont"></span> - 售后服务 - <span class="iconfont triangle"></span> - </div> - - <div class="after-service-content info-block"> - <div class="block-title"> - <span class="title-head"> - <span class="title cur">退换货流程</span> - </span> - </div> - - <div class="img-3"></div> - - <div class="info-block"> - <div class="block-title"> - <span class="title-head"> - <span class="title cur">有货承诺</span> - </span> - </div> - </div> + {{> product/description}} + {{> product/material}} + {{> product/size-desc-list}} + {{> product/reference}} + {{> product/model-cards}} + {{> product/fitting-report}} + {{> product/introduction}} + {{> product/comment}} + {{> product/consult}} </div> - - <div id="saleReturn" class="support-saleReturned-service"></div> </div> - {{#unless @root.pc.product.removeRecentView}} - <div class="lazy-load-object"> - <textarea class="datalazyload" style="visibility: hidden;"> - <script> - fetchRecommend(); - </script> - </textarea> - </div> - - <div class="bottom-tab"> - <p> - <span class="bottom-title bottom-cur">店铺推荐</span> - <span class="bottom-title">最近浏览</span> - <span class="bottom-title change">换一批 - <span class="iconfont change-icon"></span> - </span> - </p> - </div> + {{> product/after-service}} - <div class="individual-comment info-block info-bottom"> - {{#if latestWalk}} - <div class="latest-walk"> - <input id="latest-walk-count" type="hidden" value="{{latestWalk}}"> - <div id="latest-walk-goods" class="goods clearfix"></div> - {{> product/latest-walk-tpl}} - </div> - {{/if}} + {{> product/recommend-receiveview}} - <div id="recommend-shop" class="hide"> - <div class="recommend-content clearfix"> - <div class="recommend-slider"> - <ul class=" img-list" id="recommend-content"></ul> - <div class="img-brand-switch"> - <a class="prev iconfont" href="javascript:;"></a> - <a class="next iconfont" href="javascript:;"></a> - </div> - </div> - </div> - </div> - </div> - {{/unless}} </div> {{/ detail}} </div> -{{# statGoodsInfo}} - <script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script> - <script type="text/javascript"> - window.criteo_q = window.criteo_q || []; - window.criteo_q.push( - {event: "setAccount", account: 16184}, - {event: "setCustomerId", id: "{{uid}}"}, - {event: "setSiteType", type: "d"}, - {event: "viewItem", item: "{{skn}}"} - ); - </script> - <script type="text/javascript"> - var _mvq = _mvq || []; - _mvq.push(['$setAccount', 'm-23428-1']); - _mvq.push(['$setGeneral', 'goodsdetail', '', /*用户名*/ '', /*用户id*/ '']); - _mvq.push(['$logConversion']); - _mvq.push([ - '$addGoods', /*分类id*/ '', /*品牌id*/ '', /*商品名称*/ '', /*商品ID*/ '{{skn}}', /*商品售价*/ '', /*商品图片url*/ '', /*分类名*/ - '', /*品牌名*/ '', /*商品库存状态1或是0*/ '', /*网络价*/ '', /*收藏人数*/ '' - ]); - _mvq.push(['$logData']); - (function() { - var mvl = document.createElement('script'); - mvl.type = 'text/javascript'; - mvl.async = true; - mvl.src = ('https:' == document.location.protocol ? 'https://static-ssl.mediav.com/mvl.js' : 'http://static.mediav.com/mvl.js'); - var s = document.getElementsByTagName('script')[0]; - s.parentNode.insertBefore(mvl, s); - })(); - </script> - <script> - window.PING_YOU_VIEW_ITEM = { - 'product_no':'{{productId}}', - 'spu_id': '{{skn}}', - 'name': '{{{productName}}}', - 'category': '{{{category}}}', - 'brand': '{{{brandName}}}', - 'price': {{salePrice}}, - 'orig_price': {{marketPrice}}, - 'currency_code': 'CNY', - 'product_url': '{{{productUrl}}}', - 'pic_size': '',// 宽x高 - 'pc_pic_url': '{{{imageUrl}}}', - 'promotion': '', - 'sold_out': {{soldOut}} - }; - </script> -{{/statGoodsInfo}} +{{> product/stat}} + diff --git a/apps/product/views/partial/list/new-arrive-list.hbs b/apps/product/views/partial/list/new-arrive-list.hbs new file mode 100644 index 0000000..417ec2d --- /dev/null +++ b/apps/product/views/partial/list/new-arrive-list.hbs @@ -0,0 +1,95 @@ +{{#newProList }} + {{!应季热门、热门搜索}} + {{#if tagType}} + <div class="good-info imgopacity" recommend-type="{{recType}}"> + <div class="list-top-img {{#if hotSearch}}hot-search-img{{/if}}"></div> + <ul class="list-box clearfix"> + {{#tags}} + <li data-cateId="{{cateId}}"><a href="{{url}}" target="_blank">{{name}}</a></li> + {{/tags}} + </ul> + </div> + {{/if}} + {{!普通商品}} + {{#if goodsType}} + <div class="good-info imgopacity" data-skn="{{proSkn}}"> + <div class="good-detail-img"> + <a class="good-thumb" href="{{url}}" target="_blank"> + <img class="lazy" data-original="{{image2 src w=222 h=298}}" style="display: block; opacity: 1;"> + </a> + </div> + <div class="good-detail-text"> + <a href="{{url}}" target="_blank">{{proName}}</a> + <p class="price"> + <span class="sale-priceprime-cost"> ¥{{salesPrice}}</span> + </p> + </div> + </div> + {{/if}} + {{!店铺}} + {{#if shopType}} + <div class="good-info imgopacity" recommend-type="{{recType}}" data-shopId="{{shopId}}"> + <a class="brand-box" href="{{url}}" target="_blank"> + <div class="logo-wrap"> + <img class="lazy" data-original="{{image2 src w=185 h=86}}" style="display: block; opacity: 1;"> + </div> + <div class="brand-info clearfix"> + <p class="shop-name">{{shopName}}</p> + <p class="num-info">上新<span>{{newNum}}</span>件 <span>{{collNum}}</span>人收藏</p> + <span class="btn-tag tag-home"> + <i class="iconfont"></i> <em>进入店铺</em> + </span> + </div> + </a> + </div> + {{/if}} + {{!SK商品}} + {{#if skGoodsType}} + <div class="good-info imgopacity" data-skn="{{proSkn}}"> + <div class="good-detail-img"> + <a class="good-thumb" href="" target="_blank"> + <img class="lazy" data-original="//img13.static.yhbimg.com/goodsimg/2016/11/08/16/0209f4293037c2c5ca85bf67991b691c9a.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90" src="//img13.static.yhbimg.com/goodsimg/2016/11/08/16/0209f4293037c2c5ca85bf67991b691c9a.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90" style="display: block; opacity: 1;"> + </a> + </div> + <div class="ka-tag"> + <p class="ka-name">STUSSY</p> + </div> + <div class="good-detail-text ka-detail-text"> + <a href="" target="_blank">Preppy Elite 简约连帽棉衣【两色可选】</a> + <p class="price"> + <span class="sale-priceprime-cost"> ¥379.00</span> + </p> + </div> + </div> + {{/if}} + {{!文章}} + {{#if articalType}} + <div class="good-info imgopacity" recommend-type="{{recType}}" data-articalId="{{articalId}}"> + <div class="guang-box"> + <div class="classification"> + 潮 品 + </div> + <div class="type-icon fashion-good"></div> + <a class="guang-img" href="{{url}}" target="_blank"> + <img class="lazy" data-original="{{image2 src w=222 h=140}}" style="display: block;"> + </a> + <div class="msg-info"> + <a class="msg-title" href="{{url}}" target="_blank" style="word-wrap: break-word;">{{title}}</a> + <p class="msg-app"> + <span class="publish-time"> + <i class="iconfont"></i> + {{publishTime}} + </span> + <span class="page-view"> + <i class="iconfont"></i> + <em>{{num}}</em> + </span> + </p> + </div> + </div> + </div> + {{/if}} +{{/newProList }} +{{> common/foot-pager}} + + diff --git a/apps/product/views/partial/list/shop-entry.hbs b/apps/product/views/partial/list/shop-entry.hbs index 4120de3..f4d5582 100644 --- a/apps/product/views/partial/list/shop-entry.hbs +++ b/apps/product/views/partial/list/shop-entry.hbs @@ -2,7 +2,7 @@ {{# shopEntry}} <div class="shop-entry clearfix"> <a class="pull-left" href="{{home}}"> - <img class="logo" src="{{image2 logo}}"> + <img class="logo" src="{{image2 logo w=80 h=50}}"> </a> <div class="name pull-left"> diff --git a/apps/product/views/partial/product/activity-list.hbs b/apps/product/views/partial/product/activity-list.hbs index ba3f2e6..0590510 100644 --- a/apps/product/views/partial/product/activity-list.hbs +++ b/apps/product/views/partial/product/activity-list.hbs @@ -3,7 +3,7 @@ <span class="title pull-left">促 销: </span> {{#if_cond activity.length '>=' 3}} - <div class="activity-title">展开全部促销 <span class="iconfont index"></span> </div> + <div class="activity-title"><span>展开全部促销</span> <i class="iconfont index"></i> </div> {{/if_cond}} <div class="activity-container"> @@ -11,7 +11,13 @@ {{#each activity}} <li class="promotion-item"> <span class="ac-type">{{type}}</span> - <span class="ac-des {{#if_cond ../activity.length '>=' 3}}small{{/if_cond}}">{{des}}</span> + <span class="ac-des {{#if_cond ../activity.length '>=' 3}}small{{/if_cond}}"> + {{#if url}} + <a target="_blank" href="{{url}}">{{des}}</a> + {{^}} + <span>{{des}}</span> + {{/if}} + </span> </li> {{/each}} </ul> @@ -21,8 +27,14 @@ <ul class="activity"> {{#each activity}} <li class="promotion-item {{#if_cond @index '>=' 3}}hide{{/if_cond}}"> - <span class="ac-type">{{type}}</span> - <span class="ac-des {{#if_cond ../activity.length '>=' 3}}small{{/if_cond}}">{{des}}</span> + <span class="ac-type">{{type}}</span> + <span class="ac-des {{#if_cond ../activity.length '>=' 3}}small{{/if_cond}}"> + {{#if url}} + <a target="_blank" href="{{url}}">{{des}}</a> + {{^}} + <span>{{des}}</span> + {{/if}} + </span> </li> {{/each}} </ul> diff --git a/apps/product/views/partial/product/after-service.hbs b/apps/product/views/partial/product/after-service.hbs new file mode 100644 index 0000000..7c5c02b --- /dev/null +++ b/apps/product/views/partial/product/after-service.hbs @@ -0,0 +1,41 @@ +<div class="after-service"> + <div class="lazy-load-object"> + <textarea class="datalazyload" style="visibility: hidden;"> + <script> + fetchReturn(); + fetchRecommend(); + </script> + </textarea> + </div> + + <div id="after-service-switch" class="after-service-switch clearfix"> + <span class="iconfont"></span> + 售后服务 + <span class="iconfont triangle"></span> + </div> + + <div class="after-service-content"> + + <div class="info-block"> + <div class="block-title"> + <span class="title-head"> + <span class="title cur">退换货流程</span> + </span> + </div> + + <div class="img-3"></div> + </div> + + <div class="info-block"> + <div class="block-title"> + <span class="title-head"> + <span class="title cur">有货承诺</span> + </span> + </div> + </div> + + </div> + + <div id="saleReturn" class="support-saleReturned-service"></div> + +</div> diff --git a/apps/product/views/partial/product/brand-banner.hbs b/apps/product/views/partial/product/brand-banner.hbs new file mode 100644 index 0000000..6b20dda --- /dev/null +++ b/apps/product/views/partial/product/brand-banner.hbs @@ -0,0 +1,19 @@ +{{# banner}} + <div class="brand-banner" style="background:{{bgColor}}{{#if bgImg}} url({{image bgImg 1920 45}}){{/if}}"> + <div class="center-content clearfix"> + <a class="pull-left" href="{{homeUrl}}"> + <img src="{{logo}}"> + </a> + + <div class="opt pull-right"> + <a class="home" href="{{homeUrl}}" title="{{brandName}}"> + <span class="iconfont"></span> + </a> + <span id="brand-favour" class="brand-fav{{#if isCollect}} coled{{/if}}" data-id="{{brandId}}"> + <i class="iconfont"></i> + <span class="fav-num"></span> + </span> + </div> + </div> + </div> +{{/ banner}} diff --git a/apps/product/views/partial/product/comment.hbs b/apps/product/views/partial/product/comment.hbs new file mode 100644 index 0000000..2da177d --- /dev/null +++ b/apps/product/views/partial/product/comment.hbs @@ -0,0 +1,50 @@ +{{#if comment}} + <div class="lazy-load-object"> + <textarea class="datalazyload" style="visibility: hidden;"> + <script> + fetchComment(); + </script> + </textarea> + </div> + + <div class="consult-comment info-block getnav" id="judge" data-id="3"> + + <p class="block-title" id="judgeTitle"> + <span class="title-head"> <span class="title cur">商品评价</span> </span> + </p> + + <div class="comments cc-content"> + <div class="comment-tabs clearfix"> + <h2 class="active" data-comment-type="7"> + 全部 ( <em class="comment-num all-comment-num">0</em> ) + </h2> + <h2 data-comment-type="6"> + 有图 ( <em class="comment-num img-comment-num">0</em> ) + </h2> + </div> + <div class="judge-content"> + <div data-comment-list="7"> + <ul> + <div class="img-4"><span class="img-4-message">暂无评论~</span></div> + + </ul> + </div> + + <div data-comment-list="6" class="m-hide"> + <ul> + <div class="img-4"><span class="img-4-message">暂无评论~</span></div> + + </ul> + </div> + </div> + </div> + </div> + + <div class="lazy-load-object"> + <textarea class="datalazyload" style="visibility: hidden;"> + <script> + fetchComment(); + </script> + </textarea> + </div> +{{/if}} diff --git a/apps/product/views/partial/product/consult.hbs b/apps/product/views/partial/product/consult.hbs new file mode 100644 index 0000000..5d8e565 --- /dev/null +++ b/apps/product/views/partial/product/consult.hbs @@ -0,0 +1,153 @@ +{{#if consult}} + <div class="consult-comment info-block getnav" id="goodsAsk" data-id="4"> + <div class="lazy-load-object"> + <textarea class="datalazyload" style="visibility: hidden;"> + <script> + fetchConsult(); + fetchRecommend(); + </script> + </textarea> + </div> + + <p class="block-title" id="goodsAskTitle"> + <span class="title-head"> <span class="title cur">商品咨询</span> </span> + </p> + + <div class="common-consults"> + <div class="common-question"> + <p> + <span class="top-question clearfix"> + <i class="iconfont"></i> + <span class="question">商品都是正品吗?</span> + </span> + + <span class="answer-wrapper clearfix"> + <i class="iconfont"></i> + <span class="answer"> + 有货www.yohobuy.com所售的商品均经品牌授权, + 正品保障,支持专柜验货,与您亲临商场选购的商品一样享受相同的质量保证, + 请您放心购买。 + </span> + </span> + </p> + </div> + + <div class="common-question"> + <p> + <span class="top-question clearfix"> + <i class="iconfont"></i> + <span class="question">尺码表上的尺码标准吗?</span> + </span> + + <span class="answer-wrapper clearfix"> + <i class="iconfont"></i> + <span class="answer"> + 有货所售商品尺寸均为人工实物测量,可能会存在1-2cm的正常误差范围。 + </span> + </span> + </p> + </div> + + <div class="common-question"> + <p> + <span class="top-question clearfix"> + <i class="iconfont"></i> + <span class="question">图片颜色和实物颜色相同吗?</span> + </span> + + <span class="answer-wrapper clearfix"> + <i class="iconfont"></i> + <span class="answer"> + 有货所有商品均采用实物专业拍摄,但由于个人显示器不同,可能导致实物与图片存在色差,最终颜色以实物为准。 + </span> + </span> + </p> + </div> + + <div class="common-question"> + <p> + <span class="top-question clearfix"> + <i class="iconfont"></i> + <span class="question">发货及配送</span> + </span> + + <span class="answer-wrapper clearfix"> + <i class="iconfont"></i> + <span class="answer"> + 当天下午3点前订单当天发,之后的订单隔天发,合作快递有:韵达、EMS、顺丰、申通、圆通、宅急送,普通快递3-5天左右送达,顺丰速运1-2天送达。 + </span> + </span> + </p> + </div> + + <div class="common-question"> + <p> + <span class="top-question clearfix"> + <i class="iconfont"></i> + <span class="question">退货or换货</span> + </span> + + <span class="answer-wrapper clearfix"> + <i class="iconfont"></i> + <span class="answer"> + + 签收商品未经穿着不影响二次销售的情况下,7日内退货,15日内换货; + 退回商品保证吊牌、标签、包装完整,详情点击 + <br /> + <a href="http://www.yohobuy.com/help/detail?id=49" + target="_blank">>>退换货政策</a> + </span> + </span> + </p> + </div> + + + <div class="lazy-load-object"> + <textarea class="datalazyload" style="visibility: hidden;"> + <script> + fetchConsult(); + fetchRecommend(); + </script> + </textarea> + </div> + + <div class="common-question"> + <p> + <span class="common-advice"> + <a href="#textbox-wrapper" id="common-advice"> + <i class="iconfont advice"> </i> + 我要咨询<i class="iconfont click"></i> + </a> + </span> + </p> + </div> + + <div class="buy-consults"> + <p class="block-title"> + <span class="title-head"> + <span class="title cur">购买咨询(<i class="consult-num">0</i>)</span> + </span> + </p> + </div> + + <div id="consults-ul"></div> + <div class="common-question"></div> + <div class="consults-pager"></div> + <div id="textbox-wrapper" class="common-question input"> + <textarea id="textbox" placeholder="请输入您的问题"></textarea> + <span id="submit-consult" class="btn">提交咨询</span> + </div> + + </div> + + <div class="lazy-load-object"> + <textarea class="datalazyload" style="visibility: hidden;"> + <script> + fetchConsult(); + fetchRecommend(); + </script> + </textarea> + </div> + + </div> +{{/if}} diff --git a/apps/product/views/partial/product/description.hbs b/apps/product/views/partial/product/description.hbs new file mode 100644 index 0000000..d5cf93e --- /dev/null +++ b/apps/product/views/partial/product/description.hbs @@ -0,0 +1,41 @@ +{{#if description}} + <div class="description-material info-block head getnav" id="goodsMessage" data-id="0"> + <p class="block-title"> + <span class="title-head"> <span class="title cur">商品信息</span> </span> + </p> + + <div class="description-content"> + {{# description}} + <ul class="basic clearfix"> + {{# basic}} + <li> + <em class="justpostion"> + {{#if dColor}} + <span class="keySpace">{{{escapeType key}}}: </span> + <span id="desc-color" title="{{value}}" class="valueSpace">{{value}}</span> + {{^}} + <span class="keySpace">{{{escapeType key}}}: </span> + <span class="valueSpace">{{value}}</span> + {{/if}} + </em> + </li> + {{/ basic}} + </ul> + {{#if comfort}} + <ul class="comfort clearfix"> + {{# comfort}} + <li class="pull-left"> + <span class="comfort-title">{{{escapeLength name}}}:</span> + <span class="min-des">{{minDes}}</span> + {{# blocks}} + <span class="comfort-block {{#if cur}}cur{{/if}}"></span> + {{/ blocks}} + <span class="max-des">{{maxDes}}</span> + </li> + {{/ comfort}} + </ul> + {{/if}} + {{/ description}} + </div> + </div> +{{/if}} diff --git a/apps/product/views/partial/product/detail-header.hbs b/apps/product/views/partial/product/detail-header.hbs index 42d8502..ea3f792 100644 --- a/apps/product/views/partial/product/detail-header.hbs +++ b/apps/product/views/partial/product/detail-header.hbs @@ -35,7 +35,7 @@ <div class="magnifier move-object hide"></div> <div class="magnifier move-over"></div> <div id="max" class="magnifier max hide"> - <img id='big' src="{{image2 img w=1000 h=1333}}"> + <img id='big' src="{{image2 img w=750 h=1000}}"> </div> </div> @@ -48,14 +48,14 @@ {{# thumbs}} <img class="thumb {{#if @first}}active{{/if}}" src="{{image2 img w=75 h=100}}" data-shower="{{image2 shower w=420 h=560}}" - data-origin="{{image2 shower w=1001 h=1333}}"> + data-origin="{{image2 shower w=750 h=1000}}"> {{/ thumbs}} {{^}} {{# thumbs}} <img class="thumb lazy" data-original="{{image2 img w=75 h=100}}" data-shower="{{image2 shower w=420 h=560}}" - data-origin="{{image2 shower w=1001 h=1333}}"> + data-origin="{{image2 shower w=750 h=1000}}"> {{/ thumbs}} {{/if}} </div> @@ -77,6 +77,8 @@ {{> product/coupon-list}} + <div class="line"></div> + <div class="trade-content"> <div id="type-chose" class="type-chose"> {{#if virtualGoods}} @@ -153,7 +155,7 @@ </span> <span id="enable-notify" class="buy-btn hide"> <i class="iconfont"> - </i> <span>到货通知</span></span> + </i> <span>到货通知</span></span> <span id="collect-product" class="{{#if isCollect}}coled {{/if}}collect-product"> diff --git a/apps/product/views/partial/product/fitting-report.hbs b/apps/product/views/partial/product/fitting-report.hbs new file mode 100644 index 0000000..de8e2bf --- /dev/null +++ b/apps/product/views/partial/product/fitting-report.hbs @@ -0,0 +1,34 @@ +{{#if fittingReport}} + <div class="fitting-report info-block"> + <p class="block-title"> + <span class="title cur">试穿报告</span> + </p> + {{# fittingReport}} + {{#if frImg}} + <div class="fr-img-wrap"> + <img src="{{frImg}}"> + </div> + {{^}} + <table class="fitting-report-table"> + <thead> + <tr> + {{# thead}} + <th>{{.}}</th> + {{/ thead}} + </tr> + </thead> + + <tbody> + {{# tbody}} + <tr> + {{#each .}} + <td>{{.}}</td> + {{/each}} + </tr> + {{/ tbody}} + </tbody> + </table> + {{/if}} + {{/ fittingReport}} + </div> +{{/if}} diff --git a/apps/product/views/partial/product/introduction.hbs b/apps/product/views/partial/product/introduction.hbs new file mode 100644 index 0000000..9e275ac --- /dev/null +++ b/apps/product/views/partial/product/introduction.hbs @@ -0,0 +1,23 @@ +<div class="details info-block getnav" id="goodsInside" data-id="2"> + <p class="block-title" id="goodsTitle"> + <span class="title-head"> <span class="title cur">商品详情</span> </span> + </p> + + <div id="details-html" class="details-html"> + <div class="lazy-load-object"> + <textarea class="datalazyload" style="visibility: hidden;"> + <script> + fetchHotArea(); + </script> + </textarea> + + </div> + {{{details}}} + + {{#if goodsInfo.imageBanner.url}} + <a class="img-link" href="{{goodsInfo.imageBanner.url}}"> + <img src="{{goodsInfo.imageBanner.activityImg}}"> + </a> + {{/if}} + </div> +</div> diff --git a/apps/product/views/partial/product/material.hbs b/apps/product/views/partial/product/material.hbs new file mode 100644 index 0000000..1d040bf --- /dev/null +++ b/apps/product/views/partial/product/material.hbs @@ -0,0 +1,35 @@ +{{#if material.materialDetail}}<div class="description-material info-block"> + <p class="block-title"> + <span class="title-head"> <span class="title cur">材质洗涤</span> </span> + </p> + + <div class="material-content"> + {{# material}} + {{#if materialDetail}} + <ul class="material-detail"> + {{# materialDetail}} + <li class="clearfix"> + <div class="img-wrap clearfix"> + <img src="{{img}}"> + <p class="name">{{name}}<br>{{enName}}</p> + </div> + <p class="text">{{text}}</p> + </li> + {{/ materialDetail}} + </ul> + {{/if}} + + {{#if wash}} + <ul class="wash"> + {{# wash}} + <li> + <img class="wash-icon" src="{{img}}"> + <p class="wash-name">{{name}}</p> + </li> + {{/ wash}} + </ul> + {{/if}} + {{/ material}} + </div> +</div> +{{/if}} diff --git a/apps/product/views/partial/product/model-cards.hbs b/apps/product/views/partial/product/model-cards.hbs new file mode 100644 index 0000000..efebba1 --- /dev/null +++ b/apps/product/views/partial/product/model-cards.hbs @@ -0,0 +1,41 @@ +{{#if modelCards}} + <div class="description-material-tab info-block"> + <p class="block-title"> + <span class="title-head"> <span class="title cur">模特信息</span> </span> + </p> + + {{# modelCards}} + <div class="model-cards-wrapper"> + <div class="model-card-item model-header"> + <div class="avatar"> + <img src="{{avatar}}" alt=""> + </div> + + <div class="info"> + <div class="name"> + {{name}} + </div> + + <div class="try-on-size"> + 试穿尺码:{{size}} + </div> + </div> + </div> + + <div class="model-card-item line"> + </div> + + <div class="model-card-item model-body"> + <ul> + {{#desc}} + <li class="item"> + <span class="key">{{{escapeType key}}}</span>: + <span calss="value">{{value}}</span> + </li> + {{/desc}} + </ul> + </div> + </div> + {{/modelCards}} + </div> +{{/if}} diff --git a/apps/product/views/partial/product/recommend-receiveview.hbs b/apps/product/views/partial/product/recommend-receiveview.hbs new file mode 100644 index 0000000..9b470b3 --- /dev/null +++ b/apps/product/views/partial/product/recommend-receiveview.hbs @@ -0,0 +1,41 @@ +{{#unless @root.pc.product.removeRecentView}} + <div class="lazy-load-object"> + <textarea class="datalazyload" style="visibility: hidden;"> + <script> + fetchRecommend(); + </script> + </textarea> + </div> + + <div class="bottom-tab"> + <p> + <span class="bottom-title bottom-cur">店铺推荐</span> + <span class="bottom-title">最近浏览</span> + <span class="bottom-title change">换一批 + <span class="iconfont change-icon"></span> + </span> + </p> + </div> + + <div class="individual-comment info-block info-bottom"> + {{#if latestWalk}} + <div class="latest-walk"> + <input id="latest-walk-count" type="hidden" value="{{latestWalk}}"> + <div id="latest-walk-goods" class="goods clearfix"></div> + {{> product/latest-walk-tpl}} + </div> + {{/if}} + + <div id="recommend-shop" class="hide"> + <div class="recommend-content clearfix"> + <div class="recommend-slider"> + <ul class=" img-list" id="recommend-content"></ul> + <div class="img-brand-switch"> + <a class="prev iconfont" href="javascript:;"></a> + <a class="next iconfont" href="javascript:;"></a> + </div> + </div> + </div> + </div> + </div> +{{/unless}} diff --git a/apps/product/views/partial/product/reference.hbs b/apps/product/views/partial/product/reference.hbs new file mode 100644 index 0000000..4845bdd --- /dev/null +++ b/apps/product/views/partial/product/reference.hbs @@ -0,0 +1,43 @@ +{{#if reference}} + <div class="description-material-tab info-block"> + <p class="block-title"> + <span class="title-head"> <span class="title cur">试穿参考</span> </span> + </p> + + <div class="model-content"> + <div class="reference"> + {{# reference}} + <table class="reference-table"> + <thead> + <tr> + {{# thead}} + <th class="{{#if @first}}avatar-col{{/if}}{{#if modelCol}}model-col{{/if}}{{#if remarkCol}}remark-col{{/if}}">{{name}}</th> + {{/ thead}} + </tr> + </thead> + + <tbody> + {{# tbody}} + <tr> + {{#each .}} + <td> + {{#if @first}} + <img class="avatar" src="{{.}}"> + {{^}} + {{.}} + {{/if}} + </td> + {{/each}} + </tr> + {{/ tbody}} + </tbody> + </table> + {{/ reference}} + <p class="size-tip"> + ※ 模特试穿中身高单位:CM,体重单位:KG,三围单位:CM + </p> + </div> + + </div> + </div> +{{/if}} diff --git a/apps/product/views/partial/product/size-desc-list.hbs b/apps/product/views/partial/product/size-desc-list.hbs new file mode 100644 index 0000000..9a6fd07 --- /dev/null +++ b/apps/product/views/partial/product/size-desc-list.hbs @@ -0,0 +1,48 @@ +{{#if size.tbody}} + <div class="description-material-tab info-block getnav" id="sizeMessage" data-id="1"> + + <p class="block-title" id="sizeTitle"> + <span class="title-head"> <span class="title cur">尺码信息</span> </span> + </p> + + <div class="size-content"> + {{#if goodsInfo.virtualGoods}} + <!---虚拟商品-尺码信息没有---> + {{else}} + <div class="size-info "> + + {{# size}} + <table class="size-table"> + <thead> + <tr> + {{# thead}} + <th>{{name}}</th> + {{/ thead}} + </tr> + </thead> + + <tbody> + {{# tbody}} + <tr> + {{#each .}} + <td>{{.}}</td> + {{/each}} + </tr> + {{/ tbody}} + </tbody> + </table> + <p class="size-tip"> + ※ 以上尺寸为实物人工测量,因测量方式不同会有1-2CM误差,相关数据仅作参考,以收到实物为准。 单位:CM + <br /> + ※ 参考尺码因衣服版型、剪裁不同会有误差,仅供参考 + </p> + + {{#if sizeImg}} + <img class="size-img" src="{{sizeImg}}"> + {{/if}} + {{/ size}} + </div> + {{/if}} + </div> + </div> +{{/if}} diff --git a/apps/product/views/partial/product/size-list.hbs b/apps/product/views/partial/product/size-list.hbs index 6bc5277..9d6e1f8 100644 --- a/apps/product/views/partial/product/size-list.hbs +++ b/apps/product/views/partial/product/size-list.hbs @@ -1,6 +1,6 @@ <div class="chose-size row clearfix"> - <span class="title pull-left"> 尺 码: </span> + <span class="title pull-left"> 尺 码: </span> <div id="sizes" class="size-wrapper pull-left"> {{#each colors}} @@ -11,19 +11,20 @@ data-num="{{num}}" data-name="{{name}}" data-notify="{{notify}}" - data-title="{{title}}"> + data-title="{{title}}" + data-info="{{info}}"> {{name}}</li> {{/each}} </ul> {{/each}} - <span class="size-warn warn-tip hide"> <i class="iconfont"></i> 请选择尺码 </span> {{#unless virtualGoods}} <p class="color-size-tip hide"></p> {{/unless}} - </div> + <p class="size-warn warn-tip hide"> <i class="iconfont"></i> 请选择尺码 </p> + </div> </div> diff --git a/apps/product/views/partial/product/stat.hbs b/apps/product/views/partial/product/stat.hbs new file mode 100644 index 0000000..20d8458 --- /dev/null +++ b/apps/product/views/partial/product/stat.hbs @@ -0,0 +1,48 @@ +{{# statGoodsInfo}} + <script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script> + <script type="text/javascript"> + window.criteo_q = window.criteo_q || []; + window.criteo_q.push( + {event: "setAccount", account: 16184}, + {event: "setCustomerId", id: "{{uid}}"}, + {event: "setSiteType", type: "d"}, + {event: "viewItem", item: "{{skn}}"} + ); + </script> + <script type="text/javascript"> + var _mvq = _mvq || []; + _mvq.push(['$setAccount', 'm-23428-1']); + _mvq.push(['$setGeneral', 'goodsdetail', '', /*用户名*/ '', /*用户id*/ '']); + _mvq.push(['$logConversion']); + _mvq.push([ + '$addGoods', /*分类id*/ '', /*品牌id*/ '', /*商品名称*/ '', /*商品ID*/ '{{skn}}', /*商品售价*/ '', /*商品图片url*/ '', /*分类名*/ + '', /*品牌名*/ '', /*商品库存状态1或是0*/ '', /*网络价*/ '', /*收藏人数*/ '' + ]); + _mvq.push(['$logData']); + (function() { + var mvl = document.createElement('script'); + mvl.type = 'text/javascript'; + mvl.async = true; + mvl.src = ('https:' == document.location.protocol ? 'https://static-ssl.mediav.com/mvl.js' : 'http://static.mediav.com/mvl.js'); + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(mvl, s); + })(); + </script> + <script> + window.PING_YOU_VIEW_ITEM = { + 'product_no':'{{productId}}', + 'spu_id': '{{skn}}', + 'name': '{{{productName}}}', + 'category': '{{{category}}}', + 'brand': '{{{brandName}}}', + 'price': {{salePrice}}, + 'orig_price': {{marketPrice}}, + 'currency_code': 'CNY', + 'product_url': '{{{productUrl}}}', + 'pic_size': '',// 宽x高 + 'pc_pic_url': '{{{imageUrl}}}', + 'promotion': '', + 'sold_out': {{soldOut}} + }; + </script> +{{/statGoodsInfo}} diff --git a/apps/product/views/partial/students/stu-identity.hbs b/apps/product/views/partial/students/stu-identity.hbs index 06c6a47..160f2bd 100644 --- a/apps/product/views/partial/students/stu-identity.hbs +++ b/apps/product/views/partial/students/stu-identity.hbs @@ -10,93 +10,96 @@ </div> <p class="stu-ident"><i class="iconfont star-icon"></i>学生已认证<i class="iconfont star-icon"></i></p> </div> - <div id="identity-wrap" class="identity-wrap hide"> - <form id="identity-form" class="identity-form {{#if verifyRusult}} hide {{/if}}"> - <div class="form-group"> - <label><span class="star">*</span>真实姓名:</label> - <input id="stu-name" class="ident-inp" type="text" name="stu-name" placeholder="请输入您的姓名"> - </div> - <div class="form-group"> - <label><span class="star">*</span>身份证号:</label> - <input id="stu-idNum" class="ident-inp" type="text" name="stu-idNum" placeholder="请输入您的身份证号"> - </div> - <div class="form-group select-group"> - <label><span class="star">*</span>学校地区:</label> - <input id="stu-province" class="ident-inp" type="text" name="stu-province"> - <div class="ident-select-wrap gray-p "> - <i class="iconfont arrow-down"></i> - <div id="stu-province-show" class="select-value" >请选择省份</div> - <ul id="stu-province-ul" class="select-ul select-more-line clearfix"></ul> - </div> - </div> - <div class="form-group select-group"> - <label><span class="star">*</span>学校名称:</label> - <input id="stu-school" class="ident-inp long-inp" type="text" name="stu-school"> - <div class="ident-select-wrap gray-p long-sel" > - <i class="iconfont arrow-down"></i> - <div id="stu-school-show" class="select-value">请选择您所在学校</div> - <ul id="stu-school-ul" class="select-ul select-one-line"></ul> - </div> - </div> - <div class="form-group select-group"> - <label><span class="star">*</span>学历程度:</label> - <input id="stu-edu" class="ident-inp long-inp" type="text" name="stu-edu"> - <div class="ident-select-wrap gray-p long-sel"> - <i class="iconfont arrow-down"></i> - <div id="stu-edu-show" class="select-value">请选择您的学历</div> - <ul id="stu-edu-ul" class="select-ul select-one-line"></ul> - </div> - </div> - <div class="form-group select-group"> - <label><span class="star">*</span>入学年份:</label> - <input id="stu-entrance-year" class="ident-inp " type="text" name="stu-entrance-year"> - <div class="ident-select-wrap gray-p long-sel"> - <i class="iconfont arrow-down"></i> - <div id="stu-entrance-year-show" class="select-value">请选择您的入学年份</div> - <ul id="stu-entrance-year-ul" class="select-ul select-one-line"></ul> - </div> - </div> - <div class="form-group agreen-group"> - <span id="agreen-show" class="iconfont ck-sel active"></span> - <span>同意<a id="coupon-dia">Yoho!有货学生认证协议</a></span> - </div> - <p id="prompt" class="prompt"></p> - <div class="form-group"> - <div id="identity-Btn" class="validate-btn">立即验证</div> - </div> - </form> - {{#verifyRusult}} - <div class="identity-back-wrap"> - {{#resultParams}} - <span class="hide result-uid">{{uid}}</span> - <span class="hide result-birthDay">{{birthDay}}</span> - <span class="hide result-sex">{{sex}}</span> - <span class="hide result-provName">{{provName}}</span> - <span class="hide result-collegeName">{{collegeName}}</span> - <span class="hide result-educationDegree">{{educationDegree}}</span> - <span class="hide result-enrollmentYear">{{enrollmentYear}}</span> - {{/resultParams}} - {{#if isError}} - <div id="identity-fail" class="identity-back-icon fail-icon"></div> - <p id="identity-fail-text" class="identity-back-title">{{errorMsg}}</p> - <p class="identity-back-subtitle">您可以<span class="backForm">重新验证></span></p> - {{else}} - {{#if isStudent}} - <div id="identity-success" class="identity-back-icon success-icon"></div> - <p class="identity-back-title">恭喜您,您的验证成功啦!</p> - <p class="identity-back-subtitle"><span>{{prompt}}</span></p> - {{else}} - <div id="identity-fail" class="identity-back-icon fail-icon"></div> - <p id="identity-fail-text" class="identity-back-title">太遗憾了,您的学校信息未通过审核!</p> - <p class="identity-back-subtitle">您可以<span class="backForm">重新验证></span></p> - {{/if}} - {{/if}} + {{#unless @root.pc.user.removeStudentIdentification}} + <div id="identity-wrap" class="identity-wrap"> + <form id="identity-form" class="identity-form {{#if verifyRusult}} hide {{/if}}"> + <div class="form-group"> + <label><span class="star">*</span>真实姓名:</label> + <input id="stu-name" class="ident-inp" type="text" name="stu-name" placeholder="请输入您的姓名"> + </div> + <div class="form-group"> + <label><span class="star">*</span>身份证号:</label> + <input id="stu-idNum" class="ident-inp" type="text" name="stu-idNum" placeholder="请输入您的身份证号"> + </div> + <div class="form-group select-group"> + <label><span class="star">*</span>学校地区:</label> + <input id="stu-province" class="ident-inp" type="text" name="stu-province"> + <div class="ident-select-wrap gray-p "> + <i class="iconfont arrow-down"></i> + <div id="stu-province-show" class="select-value" >请选择省份</div> + <ul id="stu-province-ul" class="select-ul select-more-line clearfix"></ul> + </div> + </div> + <div class="form-group select-group"> + <label><span class="star">*</span>学校名称:</label> + <input id="stu-school" class="ident-inp long-inp" type="text" name="stu-school"> + <div class="ident-select-wrap gray-p long-sel" > + <i class="iconfont arrow-down"></i> + <div id="stu-school-show" class="select-value">请选择您所在学校</div> + <ul id="stu-school-ul" class="select-ul select-one-line"></ul> + </div> + </div> + <div class="form-group select-group"> + <label><span class="star">*</span>学历程度:</label> + <input id="stu-edu" class="ident-inp long-inp" type="text" name="stu-edu"> + <div class="ident-select-wrap gray-p long-sel"> + <i class="iconfont arrow-down"></i> + <div id="stu-edu-show" class="select-value">请选择您的学历</div> + <ul id="stu-edu-ul" class="select-ul select-one-line"></ul> + </div> + </div> + <div class="form-group select-group"> + <label><span class="star">*</span>入学年份:</label> + <input id="stu-entrance-year" class="ident-inp " type="text" name="stu-entrance-year"> + <div class="ident-select-wrap gray-p long-sel"> + <i class="iconfont arrow-down"></i> + <div id="stu-entrance-year-show" class="select-value">请选择您的入学年份</div> + <ul id="stu-entrance-year-ul" class="select-ul select-one-line"></ul> + </div> + </div> + <div class="form-group agreen-group"> + <span id="agreen-show" class="iconfont ck-sel active"></span> + <span>同意<a id="coupon-dia">Yoho!有货学生认证协议</a></span> + </div> + <p id="prompt" class="prompt"></p> + <div class="form-group"> + <div id="identity-Btn" class="validate-btn">立即验证</div> + </div> + </form> + {{#verifyRusult}} + <div class="identity-back-wrap"> + {{#resultParams}} + <span class="hide result-uid">{{uid}}</span> + <span class="hide result-birthDay">{{birthDay}}</span> + <span class="hide result-sex">{{sex}}</span> + <span class="hide result-provName">{{provName}}</span> + <span class="hide result-collegeName">{{collegeName}}</span> + <span class="hide result-educationDegree">{{educationDegree}}</span> + <span class="hide result-enrollmentYear">{{enrollmentYear}}</span> + {{/resultParams}} + {{#if isError}} + <div id="identity-fail" class="identity-back-icon fail-icon"></div> + <p id="identity-fail-text" class="identity-back-title">{{errorMsg}}</p> + <p class="identity-back-subtitle">您可以<span class="backForm">重新验证></span></p> + {{else}} + {{#if isStudent}} + <div id="identity-success" class="identity-back-icon success-icon"></div> + <p class="identity-back-title">恭喜您,您的验证成功啦!</p> + <p class="identity-back-subtitle"><span>{{prompt}}</span></p> + {{else}} + <div id="identity-fail" class="identity-back-icon fail-icon"></div> + <p id="identity-fail-text" class="identity-back-title">太遗憾了,您的学校信息未通过审核!</p> + <p class="identity-back-subtitle">您可以<span class="backForm">重新验证></span></p> + {{/if}} + {{/if}} + </div> + {{/verifyRusult}} </div> - {{/verifyRusult}} - </div> - <div class="identity-wrap"> - <p class="close-identity-text">学生认证功能暂时关闭</p> - </div> + {{^}} + <div class="identity-wrap"> + <p class="close-identity-text">学生认证功能暂时关闭</p> + </div> + {{/unless}} <div class="identity-ad"> {{#if adImg}} <a target="_blank" href="{{url}}"><img src="{{image2 adImg w=401 h=360}}"></a> diff --git a/config/common.js b/config/common.js index 18c3607..eaeb0a6 100644 --- a/config/common.js +++ b/config/common.js @@ -21,17 +21,20 @@ module.exports = { // api: 'http://api-test3.yohops.com:9999/', // service: 'http://service-test3.yohops.com:9999/', + // prod + // singleApi: 'http://single.yoho.cn/', + // api: 'http://api.yoho.cn/', + // service: 'http://service.yoho.cn/', + + // gray singleApi: 'http://single.gray.yohops.com/', - api: 'http://api.yoho.cn/', - service: 'http://service.yoho.cn/', + api: 'http://api.gray.yohops.com/', + service: 'http://service.gray.yohops.com/', + // dev // api: 'http://dev-api.yohops.com:9999/', // service: 'http://dev-service.yohops.com:9999/', - // api: 'http://192.168.102.205:8080/gateway/', - // service: 'http://dev-service.yohops.com:9999/', - search: 'http://192.168.102.216:8080/yohosearch/', - imSocket: 'ws://socket.yohobuy.com:10240', imCs: 'http://im.yohobuy.com/api', imServer: 'http://im.yohobuy.com/server' @@ -114,8 +117,7 @@ module.exports = { apiCache: { cache: false }, - zookeeperServer: '192.168.102.168:2188', - cdn: 'aliyun' + zookeeperServer: '192.168.102.168:2188' }; if (isProduction) { diff --git a/dispatch.js b/dispatch.js index e037260..0c46861 100644 --- a/dispatch.js +++ b/dispatch.js @@ -12,13 +12,13 @@ module.exports = app => { // 业务模块 app.use(require('./apps/channel')); // 频道页 app.use(require('./apps/activity')); // 专题活动等活动页面 - app.use(require('./apps/help')); // 帮助中心 app.use('/product', require('./apps/product')); // 商品相关页面 app.use(require('./apps/passport')); // 登录注册 app.use('/home', require('./apps/home')); // 会员中心 app.use('/brands', require('./apps/brands')); // 品牌一览 app.use('/guang', require('./apps/guang')); // 逛 app.use('/cart', require('./apps/cart'));// 购物车 + app.use('/help', require('./apps/help'));// 帮助中心 // 第三方,如广告联盟 app.use('/3party', require('./apps/3party')); diff --git a/doraemon/middleware/filter-qs.js b/doraemon/middleware/filter-qs.js new file mode 100644 index 0000000..ff07462 --- /dev/null +++ b/doraemon/middleware/filter-qs.js @@ -0,0 +1,35 @@ +/** + * query string 过滤 + * @author: yyq<yanqing.yang@yoho.cn> + * @date: 2017/1/17 + */ +'use strict'; + +const _ = require('lodash'); + +module.exports = (req, res, next) => { + let query = req.query; + let int = ['color', 'limit', 'specialsale_id', 'page', 'ageLevel']; + + if (!_.isEmpty(query)) { + for (let i in query) { + if (query.hasOwnProperty(i)) { + if (!query[i]) { + return; + } + + if (int.indexOf(i) !== -1) { // 查询参数类型转换 + query[i] = parseInt(`0${query[i]}`, 10); + } else { // 过滤第三方推广参数错误拼接 + let spt = query[i].split('?'); + + if (spt.length > 1) { + query[i] = spt[0]; + } + } + } + } + } + + next(); +}; diff --git a/doraemon/middleware/user.js b/doraemon/middleware/user.js index 21d48d8..a69ce13 100644 --- a/doraemon/middleware/user.js +++ b/doraemon/middleware/user.js @@ -1,10 +1,11 @@ 'use strict'; const Fn = require('lodash/fp'); -const _ = require('lodash'); -const cache = global.yoho.cache; const cookie = global.yoho.cookie; -const loginService = require('../../apps/passport/models/login-service'); + +// const loginService = require('../../apps/passport/models/login-service'); +// const _ = require('lodash'); +// const cache = global.yoho.cache; module.exports = () => { return (req, res, next) => { diff --git a/doraemon/views/partial/common/path-nav.hbs b/doraemon/views/partial/common/path-nav.hbs index e3154cd..fb956e9 100644 --- a/doraemon/views/partial/common/path-nav.hbs +++ b/doraemon/views/partial/common/path-nav.hbs @@ -1,5 +1,8 @@ {{#if pathNav}} <p class="path-nav" listType="{{listType}}" brandId="{{brandId}}"> + {{#if isHelp}} + <span class="iconfont home-icon"></span> + {{/if}} {{#each pathNav}} {{#if name}} {{#if href}} diff --git a/doraemon/views/partial/footer.hbs b/doraemon/views/partial/footer.hbs index 61699db..4ff1864 100644 --- a/doraemon/views/partial/footer.hbs +++ b/doraemon/views/partial/footer.hbs @@ -206,19 +206,19 @@ <ul class="clearfix"> <li class="left"> <p> - <span>新手指南</span> + <span>新手专区</span> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=81#help_b00reg" target="_blank">注册登录</a> + <a href="//www.yohobuy.com/help/detail?id=25" target="_blank">注册登录</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=83" target="_blank">选购商品</a> + <a href="//www.yohobuy.com/help/detail?id=27" target="_blank">购物结算</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=103" target="_blank">订单支付</a> + <a href="//www.yohobuy.com/help/detail?id=29" target="_blank">下单支付</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=85" target="_blank">收货退款</a> + <a href="//www.yohobuy.com/help/detail?id=31" target="_blank">收货评价</a> </p> </li> <li class="left"> @@ -226,16 +226,16 @@ <span>会员中心</span> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=87" target="_blank">有货币</a> + <a href="//www.yohobuy.com/help/detail?id=7" target="_blank">会员制度</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=91" target="_blank">会员制度</a> + <a href="//www.yohobuy.com/help/detail?id=9" target="_blank">会员优惠</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=89" target="_blank">账户管理</a> + <a href="//www.yohobuy.com/help/detail?id=11" target="_blank">账户管理</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=93" target="_blank">密码管理</a> + <a href="//www.yohobuy.com/help/detail?id=13" target="_blank">密码管理</a> </p> </li> <li class="left"> @@ -243,16 +243,16 @@ <span>购物指南</span> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=95" target="_blank">全球购专区</a> + <a href="//www.yohobuy.com/help/detail?id=33" target="_blank">发票</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=97" target="_blank">尺码选择</a> + <a href="//www.yohobuy.com/help/detail?id=35" target="_blank">尺码对照</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=99" target="_blank">发票</a> + <a href="//www.yohobuy.com/help/detail?id=37" target="_blank">尺码解读</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=101" target="_blank">商品咨询</a> + <a href="//www.yohobuy.com/help/detail?id=39" target="_blank">商品咨询</a> </p> </li> <li class="left"> @@ -260,16 +260,16 @@ <span>支付方式</span> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=105" target="_blank">在线支付</a> + <a href="//www.yohobuy.com/help/detail?id=43" target="_blank">在线支付</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=107" target="_blank">货到付款</a> + <a href="//www.yohobuy.com/help/detail?id=45" target="_blank">货到付款</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=109" target="_blank">优惠券</a> + <a href="//www.yohobuy.com/help/detail?id=47" target="_blank">分期支付</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=111" target="_blank">有货币支付</a> + <a href="//www.yohobuy.com/help/detail?id=105" target="_blank">优惠券、有货币</a> </p> </li> <li class="left"> @@ -277,16 +277,16 @@ <span>配送方式</span> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=113" target="_blank">配送时间</a> + <a href="//www.yohobuy.com/help/detail?id=109" target="_blank">配送说明</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=115" target="_blank">配送范围</a> + <a href="//www.yohobuy.com/help/detail?id=111" target="_blank">运费说明</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=119" target="_blank">顺丰速运</a> + <a href="//www.yohobuy.com/help/detail?id=113" target="_blank">验货签收</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=117" target="_blank">商品验收与签收</a> + <a href="//www.yohobuy.com/help/detail?id=115" target="_blank">收货样品</a> </p> </li> <li class="left"> @@ -294,16 +294,16 @@ <span>售后服务</span> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=121" target="_blank">退换货政策</a> + <a href="//www.yohobuy.com/help/detail?id=49" target="_blank">退换货政策</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=123" target="_blank">退换货流程</a> + <a href="//www.yohobuy.com/help/detail?id=51" target="_blank">退换货流程</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=125" target="_blank">退款方式与时效</a> + <a href="//www.yohobuy.com/help/detail?id=53" target="_blank">时效承诺</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=127" target="_blank">投诉与建议</a> + <a href="//www.yohobuy.com/help/detail?id=55" target="_blank">投诉与建议</a> </p> </li> <li class="left"> @@ -311,16 +311,16 @@ <span>APP常见问题</span> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=133" target="_blank">IPhone版</a> + <a href="//www.yohobuy.com/help/detail?id=57" target="_blank">IPhone版</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=135" target="_blank">Android版</a> + <a href="//www.yohobuy.com/help/detail?id=59" target="_blank">Android版</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=137" target="_blank">wap版</a> + <a href="//www.yohobuy.com/help/detail?id=61" target="_blank">wap版</a> </p> <p> - <a href="//www.yohobuy.com/help/?category_id=139" target="_blank">IPAD版</a> + <a href="//www.yohobuy.com/help/detail?id=63" target="_blank">IPAD版</a> </p> </li> </ul> diff --git a/doraemon/views/partial/header.hbs b/doraemon/views/partial/header.hbs index 75da724..c23100a 100644 --- a/doraemon/views/partial/header.hbs +++ b/doraemon/views/partial/header.hbs @@ -46,6 +46,11 @@ <span class="icon-mail"></span> <a href="//www.yohobuy.com/home/message?t=1453168898.0176">消息</a> </li> + <li class="help"> + <span class="tag-seprate"></span> + <span class="iconfont"></span> + <a href="//www.yohobuy.com/help">帮助中心</a> + </li> <li class="phoneapp"> <span class="tag-seprate"></span> <span class="icon-phone"></span> @@ -209,8 +214,13 @@ <span class="right">\{{return}}</span> </li> </ul> + <div class="account-info-footer"> - <a href="//www.yohobuy.com/home/user?t=\{{timestamp}}">完善资料 <span>(学生认证)</span></a> + <a href="//www.yohobuy.com/home/user?t=\{{timestamp}}">完善资料 + {{#unless @root.pc.user.removeStudentIdentification}} + <span>(学生认证)</span> + {{/unless}} + </a> </div> </script> <script type="text/html" id="mini-cart-tpl"> diff --git a/doraemon/views/partial/product/standard-content.hbs b/doraemon/views/partial/product/standard-content.hbs index 69060e1..e454e1f 100644 --- a/doraemon/views/partial/product/standard-content.hbs +++ b/doraemon/views/partial/product/standard-content.hbs @@ -3,6 +3,12 @@ {{> product/filter-box}} {{/ filters}} +{{#if phrase}} + <div class="phrase"> + 以下商品参加 {{phrase}} + </div> +{{/if}} + {{# opts}} <div class="sort-pager"> {{# sortType}} diff --git a/package.json b/package.json index fc51241..3a1523c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yohobuy-node", - "version": "5.3.20", + "version": "5.4.2", "private": true, "description": "A New Yohobuy Project With Express", "repository": { @@ -112,6 +112,7 @@ "yoho-jquery-pjax": "0.0.1", "yoho-jquery-placeholder": "^2.3.1", "yoho-jquery-qrcode": "^0.14.0", - "yoho-slider": "0.0.2" + "yoho-slider": "0.0.2", + "yoho-swiper": "^3.3.1" } } diff --git a/public/font/iconfont.eot b/public/font/iconfont.eot index 61effb9..44ec706 100644 Binary files a/public/font/iconfont.eot and b/public/font/iconfont.eot differ diff --git a/public/font/iconfont.svg b/public/font/iconfont.svg index d4fea16..c7a902a 100644 --- a/public/font/iconfont.svg +++ b/public/font/iconfont.svg @@ -2,7 +2,7 @@ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > <svg xmlns="http://www.w3.org/2000/svg"> <metadata> -Created by FontForge 20120731 at Thu Dec 29 16:36:04 2016 +Created by FontForge 20120731 at Thu Jan 19 16:45:25 2017 By admin </metadata> <defs> @@ -16,7 +16,7 @@ Created by FontForge 20120731 at Thu Dec 29 16:36:04 2016 ascent="896" descent="-128" x-height="792" - bbox="-0.75 -212 1160 996" + bbox="-6 -212 2176 996" underline-thickness="0" underline-position="0" unicode-range="U+0078-E701" @@ -223,6 +223,10 @@ q0 50 -34 87h264v0h191q-34 -37 -34 -87q0 -53 38 -91t91.5 -38t91 38t37.5 91q0 50 <glyph glyph-name="z" unicode="" d="M875 126l-363 -164l-363 164v610q247 75 363 75t363 -75v-610zM930 808q-34 11 -84.5 26t-159.5 38.5t-174 23.5t-174 -23.5t-159.5 -38.5t-84.5 -26q-14 -4 -22 -15.5t-8 -25.5v-669q0 -27 25 -39l405 -183q9 -3 18 -3t18 3l405 183q25 12 25 39v669q0 14 -8 25.5 t-22 15.5v0zM751 552v83h-473v-83h206v-298h-72v237h-87v-237h-66v-84h506v84h-193v119h151v83h-151v96h179z" /> + <glyph glyph-name="shanchu" unicode="" +d="M911 725h-242v123q0 21 -13.5 34.5t-34.5 13.5h-246q-20 0 -33.5 -13.5t-13.5 -34.5v-123h-246q-21 0 -34.5 -13.5t-13.5 -34t13.5 -34t34.5 -13.5h293h243h293q21 0 34.5 13.5t13.5 34t-13.5 34t-34.5 13.5zM423 725v72h147v-72h-147zM765 579q-21 0 -34.5 -14 +t-13.5 -34v-560h-441v560q0 20 -13.5 34t-34 14t-34 -14t-13.5 -34v-611q0 -21 13.5 -34.5t34.5 -13.5h536q20 0 33.5 13.5t13.5 34.5v611q3 20 -11.5 34t-35.5 14zM447 67v389q0 20 -13.5 33.5t-34 13.5t-34 -13.5t-13.5 -33.5v-389q0 -21 13.5 -34.5t34 -13.5t34 13.5 +t13.5 34.5zM645 67v389q0 20 -13.5 33.5t-34.5 13.5q-20 0 -35.5 -13.5t-15.5 -33.5v-389q0 -21 13.5 -34.5t34.5 -13.5t36 13.5t15 34.5z" /> <glyph glyph-name="chahaoyuan" unicode="" d="M511 833q-91 0 -174 -36t-143 -96t-95.5 -143t-35.5 -174t35.5 -174t95.5 -143t143 -95.5t174 -35.5t174 35.5t143 95.5t95.5 143t35.5 174t-35.5 174t-95.5 143t-143 96t-174 36zM770 193q15 -14 15 -34t-14.5 -34t-34 -14t-33.5 14l-192 191l-192 -191q-14 -14 -34 -14 t-34 14t-14 34t14 34l192 191l-192 192q-14 14 -14 34t14 34t34 14t34 -14l192 -192l192 192q14 14 33.5 14t34 -14t14.5 -34t-15 -34l-191 -192z" /> @@ -230,10 +234,24 @@ t-34 14t-14 34t14 34l192 191l-192 192q-14 14 -14 34t14 34t34 14t34 -14l192 -192l d="M611 55h-39q-10 0 -10 -9q0 -21 -14.5 -36t-35.5 -15t-35.5 15t-14.5 36q0 9 -10 9h-40q-9 0 -9 -9q0 -45 32.5 -77t76.5 -32t76.5 32t32.5 77q0 9 -10 9v0zM920 105q0 6 -3 11q-6 48 -31.5 89t-65.5 69v170q0 96 -55 175t-145 113q-3 42 -34.5 70.5t-73.5 28.5 t-73.5 -28.5t-35.5 -70.5q-89 -34 -144 -113t-55 -175v-170q-40 -28 -65.5 -69t-31.5 -89q-4 -8 -2 -16q-1 -7 -1 -15q0 -9 10 -9h796q10 0 10 9q0 7 -1 15q1 3 1 5v0zM569 686q20 -5 39 -12q69 -29 111 -92.5t42 -137.5v-198q0 -6 5 -9q66 -33 87 -102h-682q21 70 87 102 q5 3 5 9v198q0 85 54 153.5t137 88.5q8 2 8 9v27q0 21 15 35.5t35 14.5t35 -14.5t15 -35.5v-27q0 -7 7 -9v0zM569 686z" /> + <glyph glyph-name="jian" unicode="" +d="M512 832q-91 0 -174 -35.5t-143 -95.5t-95 -143t-35 -174t35 -174t95 -142.5t143 -95t174 -35.5t174 35.5t143 95t95.5 142.5t35.5 174t-35.5 174t-95.5 143t-143 95.5t-174 35.5v0zM753 350h-206v0h-69v0h-207v69h207v0v0h69h206v-69v0zM753 350z" /> + <glyph glyph-name="jia" unicode="" +d="M512 832q-91 0 -174 -35.5t-143 -95.5t-95.5 -142.5t-35.5 -173.5t35.5 -173.5t95.5 -142.5t143 -95.5t174 -35.5t174 35.5t143 95.5t95.5 142.5t35.5 173.5t-35.5 173.5t-95.5 142.5t-143 95.5t-174 35.5v0zM753 351h-207v-207h-68v207h-207v68h207v207h68v-207h207v-68 +v0zM753 351z" /> + <glyph glyph-name="focus" unicode="" horiz-adv-x="1122" +d="M793 798q92 0 150.5 -65t58.5 -161q0 -82 -54 -145l-398 -413l-399 413q-53 63 -53 145q0 96 58 161t150 65q43 0 90 -22t79 -52t53.5 -58.5t21.5 -42.5q0 14 21 42.5t53.5 58.5t79 52t89.5 22zM793 896q-63 0 -127 -30t-116 -78q-53 48 -117 78t-127 30 +q-131 0 -218.5 -92.5t-87.5 -231.5q0 -118 76 -208l3 -3l2 -2l398 -413l71 -73l70 73l398 413l3 2l2 3q76 90 76 208q0 139 -87.5 231.5t-218.5 92.5v0z" /> + <glyph glyph-name="focused" unicode="" horiz-adv-x="1122" +d="M793 896q-63 0 -127 -30t-116 -78q-53 48 -117 78t-127 30q-131 0 -218.5 -92.5t-87.5 -231.5q0 -118 76 -208l3 -3l2 -2l398 -413l71 -73l70 73l398 413l3 2l2 3q76 90 76 208q0 139 -87.5 231.5t-218.5 92.5v0z" /> <glyph glyph-name="wenhao1" unicode="" d="M512 886q-102 0 -195 -39.5t-160.5 -107t-107 -160.5t-39.5 -195t39.5 -195t107 -160.5t160.5 -107t195 -39.5t195 39.5t160.5 107t107 160.5t39.5 195t-39.5 195t-107 160.5t-160.5 107t-195 39.5zM521 -15q-34 0 -58.5 24t-24.5 58.5t24.5 58.5t58.5 24t58 -24t24 -58 q1 -34 -23.5 -58.5t-58.5 -24.5zM738 477q-17 -34 -67 -83q-45 -43 -60 -61q-12 -16 -17 -35q-6 -22 -6 -61l1 -31h-142v30q0 56 9 90q11 38 30 64q17 23 62 71q43 44 52 60q8 13 8 44q0 28 -20 51q-20 21 -61 21q-29 0 -48.5 -9.5t-28.5 -27.5t-12.5 -36t-3.5 -43v-30h-142 l1 31q2 72 18 111q16 40 52 73q34 31 78 46q41 14 88 14q96 0 160 -56v0q66 -59 66 -154q0 -43 -17 -79z" /> + <glyph glyph-name="youjiantou" unicode="" +d="M327 -128q16 0 24 12l376 500l-373 500q-7 9 -20 11t-22 -5q-11 -6 -12.5 -19.5t6.5 -22.5l346 -464l-349 -464q-7 -9 -5 -22t11 -20q6 -6 18 -6z" /> + <glyph glyph-name="jiantou" unicode="" +d="M697 -128q-16 0 -24 12l-376 500l373 500q7 9 20 11t22 -5t11 -20t-5 -22l-346 -464l349 -467q7 -9 5 -22t-11 -20q-6 -3 -18 -3z" /> <glyph glyph-name="2" unicode="" d="M562 224h109v-111h-109v111zM889 224h109v-111h-109v111zM562 113h109v-110h-109v110zM438 458h-438v438h438v-438zM111 569h216v216h-216v-216zM1000 458h-438v438h438v-438zM673 569h216v216h-216v-216zM438 -106h-438v438h438v-438zM111 5h216v216h-216v-216zM561 335 h222v-111h-222v111zM889 334h109v-111h-109v111zM780 113h109v-111h-109v111zM562 2h218v-110h-218v110zM889 2h109v-110h-109v110z" /> @@ -248,5 +266,66 @@ d="M947 179q31 0 54 -23t23 -53.5t-23 -53.5t-54 -23h-51q31 0 54 -23t23 -54t-23 -5 q0 -136 -26 -205h256q31 0 54 -23t23 -53.5t-23 -53.5t-54 -23h51q31 0 54 -23t23 -54t-23 -54t-54 -23zM102.5 -128q-42.5 0 -72.5 30t-30 72v410q0 42 30 72t72.5 30t72.5 -30t30 -72v-410q0 -42 -30 -72t-72.5 -30z" /> <glyph glyph-name="juxingkaobei" unicode="" d="M186 2l391 382l-391 382l131 130l521 -512l-521 -512z" /> + <glyph glyph-name="shang" unicode="" +d="M958 179q0 -15 -10.5 -25.5t-25.5 -10.5t-26 10l-384 384l-384 -384q-11 -10 -26 -10t-25.5 10.5t-10.5 25.5t11 26l409 410q11 10 26 10t26 -10l409 -410q11 -11 11 -26z" /> + <glyph glyph-name="xia" unicode="" +d="M958 589q0 15 -10.5 25.5t-25.5 10.5t-26 -10l-384 -384l-384 384q-11 10 -26 10t-25.5 -10.5t-10.5 -25.5t11 -26l409 -410q11 -10 26 -10t26 10l409 410q11 11 11 26z" /> + <glyph glyph-name="tishi" unicode="" +d="M512 -62q-91 0 -173.5 35.5t-142 95t-95 142t-35.5 173.5t35.5 173.5t95 142t142 95t173.5 35.5t173.5 -35.5t142 -95t95 -142t35.5 -173.5t-35.5 -173.5t-95 -142t-142 -95t-173.5 -35.5zM512 766q-104 0 -192 -51t-139 -139t-51 -192t51 -192t139 -139t192 -51t192 51 +t139 139t51 192t-51 192t-139 139t-192 51zM464 592q0 -20 14 -34t34 -14t34 14t14 34t-14 34t-34 14t-34 -14t-14 -34zM512 128q-13 0 -22.5 9.5t-9.5 22.5v288q0 13 9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5v-288q0 -13 -9.5 -22.5t-22.5 -9.5z" /> + <glyph glyph-name="yuanxingweixuanzhong" unicode="" +d="M512 -64q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5t-131.5 -316.5t-316.5 -131.5zM512 768q-159 0 -271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5t-112.5 271.5t-271.5 112.5z" /> + <glyph glyph-name="Fill" unicode="" +d="M512 52q-34 0 -58.5 24.5t-24.5 59t24.5 58.5t58.5 24t58.5 -24t24.5 -58.5t-24.5 -59t-58.5 -24.5zM457 660q0 23 16 39.5t39 16.5t39 -16.5t16 -39.5v-304q0 -22 -16 -38.5t-39 -16.5t-39 16.5t-16 38.5v304zM512 896h-6q-104 0 -199 -40.5t-163.5 -109t-109 -163.5 +t-40.5 -199t40.5 -199t109 -163.5t163.5 -109t199 -40.5h6h6q104 0 199 40.5t163.5 109t109 163.5t40.5 199t-40.5 199t-109 163.5t-163.5 109t-199 40.5h-6z" /> + <glyph glyph-name="konggouwuche" unicode="" +d="M1007 686q-20 23 -55 23h-6h-665q-13 53 -25 106q-4 16 -12.5 28.5t-16.5 19.5t-18 12t-14 6t-7 2h-140h-2q-16 -4 -31 -19.5t-15 -41.5q0 -13 4.5 -25t10.5 -18.5t13.5 -11.5l10.5 -7t6 -2l61 -1q118 -480 137 -555q7 -26 18 -45t21.5 -28t22.5 -14.5t17.5 -6t9.5 -0.5 +v0q189 -1 333 -1q127 0 155 1q38 1 60 23.5t27 45.5q100 332 115 432q8 50 -15 77zM1000 612q-14 -88 -115 -429q0 -3 -1.5 -7t-6.5 -12.5t-11.5 -15t-18.5 -12t-27 -6.5q-28 -1 -155 -1h-49h-51t-50 0.5t-47.5 0.5h-43.5h-37.5h-28.5h-19h-7q-3 0 -6.5 0.5t-12.5 5 +t-17 11.5t-17 23t-14 37q-2 8 -139 564l-2 8h-74q-28 13 -28 43t28 39h134q7 -2 14.5 -5.5t19.5 -16t16 -29.5l28 -115l2 -8h683h4h1q25 0 38 -16q16 -18 10 -59zM441.5 67q-37.5 0 -64 -27t-26.5 -64.5t26.5 -64t64 -26.5t64 26.5t26.5 64t-26.5 64.5t-64 27zM441.5 -93 +q-28.5 0 -48.5 20t-20 48.5t20 48.5t48.5 20t48.5 -20t20 -48.5t-20 -48.5t-48.5 -20zM721.5 67q-37.5 0 -64 -27t-26.5 -64.5t26.5 -64t64 -26.5t64.5 26.5t27 64t-27 64.5t-64.5 27zM721.5 -93q-28.5 0 -48.5 20t-20 48.5t20 48.5t48.5 20t48.5 -20t20 -48.5t-20 -48.5 +t-48.5 -20z" /> + <glyph glyph-name="yuan" unicode="" +d="M59 384h906h-906z" /> + <glyph glyph-name="sq" unicode="" +d="M922 510l-368 369q-17 17 -41 17t-41 -17l-369 -369q-19 -17 -19 -43q0 -24 17 -41t41 -17q26 0 43 19l270 270v-471q0 -24 17 -41t41 -17t41 17t17 41v471l269 -270q17 -15 40 -15q24 0 41 17t17 41q0 23 -16 39v0zM834 38h-642q-24 0 -41 -17t-17 -41t17 -41t41 -17 +h642v0q24 0 41 17t17 41t-17 41t-41 17v0v0z" /> + <glyph glyph-name="zz" unicode="" +d="M763 743q-74 59 -163.5 83.5t-177 15.5t-167.5 -48l-89 83q-15 14 -32 18t-32 -6q-18 -4 -28 -20.5t-10 -36.5v-248q0 -24 16.5 -40.5t40.5 -16.5h248q38 0 57 38q12 47 -12 64l-70 70q84 34 179.5 21.5t169.5 -72.5q79 -60 116 -149.5t25.5 -185.5t-71.5 -174 +q-42 -57 -105.5 -93.5t-135.5 -46.5q-72 -9 -141 9t-126 61q-19 14 -44 10.5t-39 -23t-10 -44t23 -38.5q132 -102 292 -102q45 0 64 6q96 15 178.5 62t139.5 123q78 106 92.5 235t-35 248t-153.5 197z" /> + <glyph glyph-name="yz" unicode="" +d="M255 743q113 85 252.5 96.5t262.5 -51.5l83 83q25 25 63 12q18 0 28.5 -15t10.5 -36v-248q0 -24 -17 -40.5t-41 -16.5h-254q-38 0 -57 38q-12 48 12 64l70 70q-79 35 -174 22t-169 -73q-78 -59 -115.5 -148.5t-26 -186t71.5 -174.5q43 -57 106.5 -93.5t135.5 -46.5 +q71 -9 140 9t127 61q19 14 43.5 10.5t39 -23t10.5 -44t-23 -38.5q-133 -102 -293 -102q-44 0 -63 6q-97 15 -179.5 62t-139.5 123q-78 106 -92.5 235t35.5 248t153 197z" /> + <glyph glyph-name="hh" unicode="" horiz-adv-x="1170" +d="M995 91q97 131 110 291.5t-59 301.5l95 95q29 29 15 73q0 21 -17.5 32.5t-41.5 11.5h-285q-28 0 -47 -19t-19 -47v-285q0 -44 44 -66q54 -13 73 15l81 80q40 -97 25.5 -206.5t-84.5 -195.5q-68 -90 -171 -133t-213.5 -29.5t-200.5 81.5q-66 50 -108 123t-53 155t10 162 +t70 146q17 22 12.5 50t-26.5 44.5t-50.5 12t-44.5 -26.5q-51 -68 -80.5 -153t-29.5 -176q0 -51 7 -73q17 -111 71.5 -206t140.5 -160q119 -93 266 -111.5t283.5 38t226.5 175.5z" /> + <glyph glyph-name="sc" unicode="" +d="M409.5 787q124.5 0 212.5 -88t88 -212.5t-88 -212.5t-212.5 -88t-212.5 88t-88 212.5t88 212.5t212.5 88zM409.5 896q-110.5 0 -204.5 -55.5t-149.5 -149.5t-55.5 -204.5t55.5 -205t149.5 -149.5t204.5 -55t205 55t149.5 149.5t55 205t-55 204.5t-149.5 149.5t-205 55.5z +M890 -109l-269 269l115 115l269 -269q14 -14 14 -38t-14 -38l-39 -39q-14 -19 -35.5 -19t-40.5 19z" /> + <glyph glyph-name="w" unicode="" +d="M512 893q-104 0 -197 -39.5t-160.5 -106.5t-107 -160.5t-39.5 -197t39.5 -197t107 -161t160.5 -107t197 -39.5t197 39.5t160.5 107t107 161t39.5 197t-39.5 197t-107 160.5t-160.5 106.5t-197 39.5zM512 -57q-90 0 -172.5 35.5t-142.5 95.5t-95.5 142.5t-35.5 172.5 +t35.5 173t95.5 143t142.5 95.5t172.5 35.5t172.5 -35.5t142.5 -95.5t95.5 -143t35.5 -173t-35.5 -172.5t-95.5 -142.5t-142.5 -95.5t-172.5 -35.5zM512 706q-72 0 -122 -50q-51 -63 -51 -123q0 -16 10 -26t26 -10t26 10t10 26q0 29 29 72q29 29 72 29q38 0 66 -28t28 -65 +q0 -28 -16 -52t-42 -35q-33 -16 -52.5 -47t-19.5 -68v-43q0 -16 10 -26t26 -10t26 10t10 26v36q0 21 29 50q48 22 74.5 63t26.5 96q0 63 -50 111.5t-116 53.5zM447 137v0q0 -24 17 -40.5t41 -16.5t40.5 16.5t16.5 40.5v0v0q0 24 -16.5 41t-40.5 17t-41 -17t-17 -41v0z" /> + <glyph glyph-name="Slice" unicode="" horiz-adv-x="2176" +d="M1696 566h-105q-24 -64 -45 -96q21 0 42 12q3 -30 17 -92q13 -61 37 -115q30 56 43.5 149.5t10.5 141.5zM1792 50q-47 24 -87 58q-36 32 -66 71q-38 -36 -79 -65q-40 -28 -119 -70q-15 33 -51 54q39 5 108 46q69 40 105 80q-24 50 -37 105q-15 61 -26 123l-21 -37 +q-12 34 -36 61q36 54 66 135q30 80 42 153q36 -18 78 -27q-15 -15 -30 -47q-18 -39 -33 -79q189 0 231 3v-51q-38 3 -77 3h-4q-3 -92 -21 -182q-18 -94 -57 -160q9 -28 59 -63q47 -36 103 -54q-36 -21 -48 -57v0zM1285 165q-32 -34 -102 -88q-22 28 -54 48q45 21 84 51 +q45 33 87 93q-37 32 -99 84l30 41q52 -42 99 -77q24 38 33 98q30 -14 60 -24q-22 -57 -48 -113l84 -84q-27 -21 -51 -45q-21 33 -66 78q-23 -27 -57 -62zM1194 484q28 48 40 82q33 -18 60 -39q-12 -9 -39 -51q-36 -55 -75 -108q-26 17 -54 33q40 37 68 83zM1012 71 +q-37 14 -87.5 41t-83.5 50q-84 59 -126 143q-36 -78 -105 -141.5t-186 -113.5q-17 32 -45 57q42 10 95 37t87 54q79 64 103 143h-174q-47 0 -105 -3v56q60 -3 105 -3h186q9 63 9 136h-174q-30 -54 -63 -105q-27 16 -57 27q54 65 83 129q28 62 37 111q36 -18 66 -27 +q-15 -16 -45 -84h153q0 108 -3 162q38 -4 69 -6q-6 -43 -7.5 -76t-1.5 -80h141q49 0 99 2v-56q-48 3 -99 3h-141q0 -67 -6 -136h201q45 0 99 3v-56q-49 2 -99 3h-177q36 -81 123 -132q88 -51 171 -69q-24 -31 -42 -69zM1489 436q-27 -15 -51 -35q-43 64 -90 126q24 11 48 35 +q20 -29 45 -62zM1132 634q41 -3 87 -3h180q45 0 81 3v-51q-37 4 -74 4l-4 -1h-183q-49 0 -87 -3v51v0zM1318 758q24 -46 42 -93q-28 -13 -57 -24q-19 48 -42 96q29 9 57 21v0zM1664 896h-1152q-138 0 -256 -69t-187 -187t-69 -256t69 -256t187 -187t256 -69h1152 +q138 0 256 69t187 187t69 256t-69 256t-187 187t-256 69v0z" /> + <glyph glyph-name="icon-right" unicode="" +d="M734 452l-444 444l-68 -68l445 -444l-445 -444l68 -68l512 512z" /> + <glyph glyph-name="icon-test" unicode="" +d="M512 896q-103 0 -197.5 -41t-163.5 -110t-110 -163.5t-41 -197.5t41 -197.5t110 -163.5t163.5 -110t197.5 -41t197.5 41t163.5 110t110 163.5t41 197.5t-41 197.5t-110 163.5t-163.5 110t-197.5 41zM847 548l-335 -471q-11 -21 -36 -28t-46 7l-232 205q-20 10 -25.5 36 +t4.5 46q11 21 36.5 28t45.5 -7l185 -171l293 416q11 21 36 28t46 -7q25 -15 32 -38.5t-4 -43.5z" /> + <glyph glyph-name="bi" unicode="" +d="M973 845q-51 51 -119 51t-119 -51l-591 -592q-14 -13 -14 -20l-122 -292q-9 -25 6 -55q26 -26 55 -7l292 123q7 0 21 13l591 592q46 51 46 119t-46 119zM239 206v13l483 483h13l102 -102v-13l-285 -279l-204 -204h-14zM912 777q21 -25 19.5 -57t-26.5 -52l-7 -7h-13 +l-102 96v13l13 14q25 21 60.5 19.5t55.5 -26.5zM123 -5l61 143l82 -82z" /> + <glyph glyph-name="jinzhi" unicode="" +d="M998 384q0 99 -38.5 189t-103.5 155t-155 103.5t-189 38.5t-189 -38.5t-155 -103.5t-103.5 -155t-38.5 -189t38.5 -189t103.5 -155t155 -103.5t189 -38.5t189 38.5t155 103.5t103.5 155t38.5 189zM512 806q152 0 275 -102l-595 -595q-102 123 -102 275q0 85 33.5 163 +t90.5 135t135 90.5t163 33.5zM237 64l595 595q102 -123 102 -275q0 -114 -55.5 -211t-153 -154t-213.5 -57q-152 0 -275 102z" /> + <glyph glyph-name="shiliangzhinengduixiang1" unicode="" +d="M515 -128q60 0 105.5 40t52.5 98h-322q11 -58 57 -98t107 -40zM852 225q-15 31 -15 123v113q0 111 -56 200t-149 127q-7 47 -42 77.5t-81 30.5q-51 0 -87 -36q-26 -27 -35 -72q-93 -42 -149 -131t-56 -196v-113q0 -97 -16 -128q-30 -10 -46 -20q-20 -31 -20 -57 +q0 -31 24 -53.5t58 -22.5h660q34 0 58 22.5t24 53.5q-4 31 -24.5 54.5t-47.5 27.5z" /> </font> </defs></svg> diff --git a/public/font/iconfont.ttf b/public/font/iconfont.ttf index 28b5473..0075517 100644 Binary files a/public/font/iconfont.ttf and b/public/font/iconfont.ttf differ diff --git a/public/font/iconfont.woff b/public/font/iconfont.woff index acc0d2b..d037ff6 100644 Binary files a/public/font/iconfont.woff and b/public/font/iconfont.woff differ diff --git a/public/hbs/help/problem-box.hbs b/public/hbs/help/problem-box.hbs new file mode 100644 index 0000000..f1d6836 --- /dev/null +++ b/public/hbs/help/problem-box.hbs @@ -0,0 +1,12 @@ +<div class="problem-box"> + <div class="mark"></div> + <div class="problem-area"> + <i class="iconfont close"></i> + <div class="problem-cont"> + <div class="cont-area"> + <div class="a-area"></div> + <div class="q-area"></div> + </div> + </div> + </div> +</div> diff --git a/public/hbs/help/search-cont.hbs b/public/hbs/help/search-cont.hbs new file mode 100644 index 0000000..75fb384 --- /dev/null +++ b/public/hbs/help/search-cont.hbs @@ -0,0 +1,47 @@ +{{#if error}} + <div class="search-result nav-title">很抱歉,关于“<span class="red">{{keywords}}</span>”没有找到您想要的答案</div> + <p class="result-error mt15">建议您:看看输入的文字是否有误/减少分类条件的限制/重新检索</p> + <p class="result-error">或 者:使用<a href="{{jumpUrl}}">在线客服</a>试试</p> +{{else}} + <div class="search-result nav-title">关于“<span class="red">{{keywords}}</span>”,共为您查询到<span class="red">{{total}}</span>个答案</div> + <ul class="search-list-area"> + {{#helper_list}} + <li class="{{#if problem}}problem-li{{else}}article-li{{/if}}"> + <p class="title">{{{caption}}}</p> + {{#if problem}} + <div class="cont">{{{content}}}</div> + {{else}} + <div class="cont">{{{content}}}</div> + {{/if}} + </li> + {{/helper_list}} + </ul> + {{!-- 分页 --}} + {{# footPager}} + <div class="foot-pager clearfix" data-total={{../totalCount}}> + <span class="total"> + {{# tip}} + {{#if totalText}} + {{totalText}} + {{^}} + {{start}} - {{end}} / 共{{total}}件商品 + {{/if}} + {{/ tip}} + </span> + + <div class="pager"> + {{# prePage}} + <a href="{{url}}" title="上一页"><span class="iconfont"></span>上一页</a> + {{/ prePage}} + + {{# pages}} + <a{{#if url}} href="{{url}}"{{/if}}{{#if cur}} class="cur"{{/if}}>{{num}}</a> + {{/ pages}} + + {{# nextPage}} + <a href="{{url}}" title="下一页">下一页<span class="iconfont"></span></a> + {{/ nextPage}} + </div> + </div> + {{/ footPager}} +{{/if}} diff --git a/public/hbs/product/comment-item.hbs b/public/hbs/product/comment-item.hbs index 669e094..c29a7f0 100644 --- a/public/hbs/product/comment-item.hbs +++ b/public/hbs/product/comment-item.hbs @@ -1,6 +1,6 @@ {{#each comments}} <li> - <div class="user-info clearfix judge-head"> + <div class="user-info clearfix"> <span class="name">{{userName}}</span> <span class="comment-star pull-left"> <span class="star-{{star}} active"></span> @@ -28,9 +28,9 @@ </a> <div class="img-detail"> <dl class="toolbar"> - <dd data-role="preview-close"><i class="iconfont"></i>收起</dd> - <dd data-role="preview-left"><i class="iconfont"></i>向左旋转</dd> - <dd data-role="preview-right"><i class="iconfont"></i>向右旋转</dd> + <dd data-role="preview-close"><i class="iconfont"></i>收起</dd> + <dd data-role="preview-left"><i class="iconfont"></i>向左旋转</dd> + <dd data-role="preview-right"><i class="iconfont"></i>向右旋转</dd> </dl> <div class="img-wrap"> <img src="{{image2 url w=345 h=345}}" /> diff --git a/public/hbs/product/consult-item.hbs b/public/hbs/product/consult-item.hbs index 415b215..7b59dda 100644 --- a/public/hbs/product/consult-item.hbs +++ b/public/hbs/product/consult-item.hbs @@ -2,7 +2,7 @@ {{# consults}} <div class="common-question"> <p> - <span class="top-question"> + <span class="top-question clearfix"> <i class="iconfont"></i> <span class="question">{{question}}</span> <span class="right-time">{{date}}</span> diff --git a/public/hbs/product/package.hbs b/public/hbs/product/package.hbs index b0ef448..01ea367 100644 --- a/public/hbs/product/package.hbs +++ b/public/hbs/product/package.hbs @@ -21,7 +21,7 @@ <div class="package-priceList"> <p>销售价:<em class="sale-price">{{salesPrice}}</em></p> <p>套餐价:<em class="package-price red-color">{{pkgPrice}}</em></p> - <p class="save-text red-color">立省<em class="save-price">{{savePrice}}</em>元</p> + {{#if saveFlag}}<p class="save-text red-color">立省<em class="save-price">{{savePrice}}</em>元</p>{{/if}} <span id="buy-detail" class="buy-product red-color"> <em>立即购买</em> </span> diff --git a/public/img/help/a.png b/public/img/help/a.png new file mode 100644 index 0000000..4440ae3 Binary files /dev/null and b/public/img/help/a.png differ diff --git a/public/img/help/dot-red.png b/public/img/help/dot-red.png new file mode 100644 index 0000000..b9e2bc4 Binary files /dev/null and b/public/img/help/dot-red.png differ diff --git a/public/img/help/dot.png b/public/img/help/dot.png new file mode 100644 index 0000000..67fda2c Binary files /dev/null and b/public/img/help/dot.png differ diff --git a/public/img/help/file.png b/public/img/help/file.png new file mode 100644 index 0000000..a6829a8 Binary files /dev/null and b/public/img/help/file.png differ diff --git a/public/img/help/help-title.jpg b/public/img/help/help-title.jpg new file mode 100644 index 0000000..c474a50 Binary files /dev/null and b/public/img/help/help-title.jpg differ diff --git a/public/img/help/minus.png b/public/img/help/minus.png new file mode 100644 index 0000000..39b63c8 Binary files /dev/null and b/public/img/help/minus.png differ diff --git a/public/img/help/plus.png b/public/img/help/plus.png new file mode 100644 index 0000000..d9746be Binary files /dev/null and b/public/img/help/plus.png differ diff --git a/public/img/help/q.png b/public/img/help/q.png new file mode 100644 index 0000000..5e92171 Binary files /dev/null and b/public/img/help/q.png differ diff --git a/public/img/home/birth-card.jpg b/public/img/home/birth-card.jpg new file mode 100644 index 0000000..a6b874a Binary files /dev/null and b/public/img/home/birth-card.jpg differ diff --git a/public/img/home/message.png b/public/img/home/message.png index ad36460..b1f466d 100644 Binary files a/public/img/home/message.png and b/public/img/home/message.png differ diff --git a/public/img/product/after-service-1.png b/public/img/product/after-service-1.png deleted file mode 100644 index 33b56d8..0000000 Binary files a/public/img/product/after-service-1.png and /dev/null differ diff --git a/public/img/product/after-service-2.png b/public/img/product/after-service-2.png deleted file mode 100644 index 9dc77e4..0000000 Binary files a/public/img/product/after-service-2.png and /dev/null differ diff --git a/public/img/product/after-service.png b/public/img/product/after-service.png index 5624838..e99bd66 100644 Binary files a/public/img/product/after-service.png and b/public/img/product/after-service.png differ diff --git a/public/img/product/hot-search.png b/public/img/product/hot-search.png new file mode 100644 index 0000000..213e5c9 Binary files /dev/null and b/public/img/product/hot-search.png differ diff --git a/public/img/product/move.png b/public/img/product/move.png index b0679ae..8b12f6a 100644 Binary files a/public/img/product/move.png and b/public/img/product/move.png differ diff --git a/public/img/product/season-sort.png b/public/img/product/season-sort.png new file mode 100644 index 0000000..f8306c5 Binary files /dev/null and b/public/img/product/season-sort.png differ diff --git a/public/img/product/star.png b/public/img/product/star.png new file mode 100644 index 0000000..14b164e Binary files /dev/null and b/public/img/product/star.png differ diff --git a/public/img/sprite.help.png b/public/img/sprite.help.png new file mode 100644 index 0000000..a8bad27 Binary files /dev/null and b/public/img/sprite.help.png differ diff --git a/public/js/common/data-yas.js b/public/js/common/data-yas.js index 5ec742d..4d97a9c 100644 --- a/public/js/common/data-yas.js +++ b/public/js/common/data-yas.js @@ -69,9 +69,13 @@ function _getOtherFilterValue() { } /** *埋点方法***/ -function yasEvent(op, parameter) { +function yasEvent(op, parameter, flag) { var CID = 1; + if (typeof flag === 'undefined') { + flag = true; + } + if (!window._yas || !window._yas.sendCustomInfo) { return false; } @@ -103,21 +107,22 @@ function yasEvent(op, parameter) { window._yas.sendCustomInfo({ op: op, param: JSON.stringify(parameter) - }, true); + }, flag); } function getFilterValue() { return _getCommonFilterValue() + _getOtherFilterValue(); } -function givePoint(op, parameter) { +function givePoint(op, parameter, flag) { var sto = setInterval(function() { if (window._yas && window._yas.sendCustomInfo) { - yasEvent(op, parameter); + yasEvent(op, parameter, flag); clearInterval(sto); } }, 100); } -exports.givePoint = givePoint; +exports.givePoint = givePoint; // 页面初始化,yas.js 加载完成后埋点 +exports.yasEvent = yasEvent; // 直接埋点 exports.getFilterValue = getFilterValue; diff --git a/public/js/common/helpers/image2.js b/public/js/common/helpers/image2.js index 10e254c..6e9a877 100644 --- a/public/js/common/helpers/image2.js +++ b/public/js/common/helpers/image2.js @@ -13,7 +13,7 @@ function cdnReplace(cdn, imgUrl) { return imgUrl; } -module.exports = function (imageUrl, opts) { +module.exports = function(imageUrl, opts) { var cdn = window.cdn; if (imageUrl) { @@ -34,19 +34,19 @@ module.exports = function (imageUrl, opts) { if (query.indexOf('imageView2') === 0) { if (params.q && query.indexOf('/q/') > 0) { query = query.replace(/\/q\/\d+/g, '/q/' + params.q); - } else if(params.q) { + } else if (params.q) { query += '/q/' + params.q; } } else if (query.indexOf('imageMogr2') === 0) { if (params.q && query.indexOf('/quality/') > 0) { query = query.replace(/\/quality\/\d+/g, '/quality/' + params.q); - } else if(params.q) { + } else if (params.q) { query += '/quality/' + params.q; } } else if (query.indexOf('imageView/') === 0) { if (params.q && query.indexOf('/q/') > 0) { query = query.replace(/\/q\/\d+/g, '/q/' + params.q); - } else if(params.q) { + } else if (params.q) { query += '/q/' + params.q; } diff --git a/public/js/common/promise.js b/public/js/common/promise.js new file mode 100644 index 0000000..1317406 --- /dev/null +++ b/public/js/common/promise.js @@ -0,0 +1,35 @@ +var $ = require('yoho-jquery'); + +$.extend({ + defer: function(func) { + return function() { + var defer = $.Deferred(); // eslint-disable-line + var args = Array.prototype.slice.call(arguments); + + args.push(defer.resolve, defer.reject); + func && func.apply(undefined, args); // eslint-disable-line + return defer.promise(); + }; + }, + reject: function() { + var defer = $.Deferred(); // eslint-disable-line + var args = Array.prototype.slice.call(arguments); + + return defer.reject.apply(defer, args).promise(); + }, + resolve: function() { + var defer = $.Deferred(); // eslint-disable-line + var args = Array.prototype.slice.call(arguments); + + return defer.resolve.apply(defer, args).promise(); + }, + sleep: function(ms) { + var defer = $.Deferred(); // eslint-disable-line + + window.setTimeout(function() { + defer.resolve(); + }, ms); + + return defer.promise(); + } +}); diff --git a/public/js/help/help-common.js b/public/js/help/help-common.js new file mode 100644 index 0000000..3dad553 --- /dev/null +++ b/public/js/help/help-common.js @@ -0,0 +1,83 @@ +/** + * [帮助中心 常见问题弹框] + * @author: wsl(shuiling.wang@yoho.cn) + * @date: 2016/12/02 + */ + +var problemTpl = require('../../hbs/help/problem-box.hbs'); +var yas = require('../common/data-yas'); + +// 问题弹窗操作 +var problemBox = function() { + var $problemBox; + + $('.help-page').append(problemTpl()); + $problemBox = $('.problem-box'); + + $problemBox.css({lineHeight: $(window).height() + 'px'}); + + $('.problem a').on('click', function() { + var ask = $(this).data('ask') || ''; + var answer = $(this).data('answer') || ''; + + $problemBox.find('.a-area').html(ask); + $problemBox.find('.q-area').html(answer); + $problemBox.show(); + }); + + $('.problem-box .close, .problem-box .mark').on('click', function() { + $problemBox.hide(); + }); +}; + +var $subsets = $('.subsets'); + +/** + * 目录切换 + */ +$subsets.click(function() { + var $this = $(this); + var className = $this.attr('class').split(' ')[1]; + var parentId = 'parentId-' + className.split('-')[1]; + var $child = $this.parent().find('.' + parentId);// 当前子分类 + + if ($this.hasClass('open')) { + $child.hide(); + $this.removeClass('open').children('.icon').removeClass('minus').addClass('plus'); + } else { + $('.smll-category').hide(); + $('.subsets').children('.icon').removeClass('minus').addClass('plus'); + $child.show(); + $subsets.removeClass('open'); + $this.addClass('open').children('.icon').removeClass('plus').addClass('minus'); + } +}); + +// 左侧菜单栏点击埋点 +$('.help-navigation .nav li').on('click', function() { + var yasParams; + var id = $(this).attr('class').split(' ')[1].split('-')[1]; + var text = $(this).find('.menu-txt').html(); + var parentId; + + if ($(this).hasClass('big-category')) { + yasParams = { + MENU_ID1: id, + MENU_NM1: text, + MENU_ID2: id, + MENU_NM2: text + }; + } else { + parentId = $(this).data('parentId'); + yasParams = { + MENU_ID1: parentId, + MENU_NM1: $('.cateId-' + parentId).find('.menu-txt').html(), + MENU_ID2: id, + MENU_NM2: text + }; + } + + yas.yasEvent('YB_HELP_MENU_C', yasParams); +}); + +module.exports = problemBox; diff --git a/public/js/help/help-helper.js b/public/js/help/help-helper.js new file mode 100644 index 0000000..05e57b4 --- /dev/null +++ b/public/js/help/help-helper.js @@ -0,0 +1,62 @@ +/** + * [帮助中心 字符串截取] + * @author: wsl(shuiling.wang@yoho.cn) + * @date: 2016/12/02 + */ +// 字符串截取 +var cutStr = function(params) { + var strLength = 0; + var strCut = ''; + var i, curStr, addTxt, strLen; + + params.str = params.str.replace(/ /ig, ''); + params.str = params.str.replace(/(?=[^>]*(?=<))\s+/g, ''); + params.str = params.str.replace(/<(?!a|\/a).*?>/g, ''); + + strLen = params.str.length || 0; + + if (!strLen) { + return ''; + } + + if (params.type === 2) { + addTxt = ''; + } else { + addTxt = '<a href="' + params.url + '" class="show-all" target="_blank">查看详情></a>'; + } + + for (i = 0; i < strLen; i++) { + curStr = params.str.charAt(i); + strLength++; + if (escape(curStr).length > 4) { + // 中文字符的长度经编码之后大于4 + strLength++; + } + strCut = strCut.concat(curStr); + if (strLength >= params.len) { + strCut = strCut.slice(0, strCut.length - 10); + strCut = strCut.concat('...' + addTxt); + return strCut; + } + } + + // 如果给定字符串小于指定长度,则返回源字符串; + if (strLength < params.len) { + return params.str; + } +}; + +// 搜索关键词标蓝显示 +var keywordLabel = function(str, key) { + var reg = new RegExp(key, 'gm'); + + if (str === '') { + return str; + } + + str = str.replace(reg, '<i class="keyword">' + key + '</i>'); + return str; +}; + +exports.cutStr = cutStr; +exports.keywordLabel = keywordLabel; diff --git a/public/js/help/help-index.page.js b/public/js/help/help-index.page.js new file mode 100644 index 0000000..88ecd2b --- /dev/null +++ b/public/js/help/help-index.page.js @@ -0,0 +1,53 @@ +/** + * [帮助中心首页] + * @author: wsl(shuiling.wang@yoho.cn) + * @date: 2016/12/01 + */ +var helpSearch = require('./help-search'); +var problemBox = require('./help-common'); +var yas = require('../common/data-yas'); +var Scroller = require('./scroller'); + +require('../common'); + +$(function() { + helpSearch.init(); + problemBox(); + + setTimeout(function() { + new Scroller('notice', 30, 5); + + // 公告栏某一公告点击埋点 + $('.notice a').on('click', function() { + yas.yasEvent('YB_HELP_NOTICE_C', { + POS_ID: $(this).data('index'), + POS_NM: $(this).find('.notice-txt').html() + }); + }); + }, 5000); + + // 帮助中心右侧新手指南某一位置点击埋点 + $('.new-guide a').on('click', function() { + yas.yasEvent('YB_HELP_GUIDE_C', { + POS_ID: $(this).data('index'), + POS_NM: $(this).find('p').html() + }); + }); + + // 帮助中心右侧自助服务某一位置点击埋点 + $('.self-service a').on('click', function() { + yas.yasEvent('YB_HELP_SERVICE_C', { + POS_ID: $(this).data('index'), + POS_NM: $(this).find('p').html() + }); + }); + + // 帮助中心右侧常见问题某一位置点击埋点 + $('.problem a').on('click', function() { + yas.yasEvent('YB_HELP_QUESTION_C', { + POS_ID: $(this).index() + 1, + POS_NM: $(this).data('ask') + }); + }); +}); + diff --git a/public/js/help/help-search.js b/public/js/help/help-search.js new file mode 100644 index 0000000..9beabe5 --- /dev/null +++ b/public/js/help/help-search.js @@ -0,0 +1,87 @@ +/** + * [帮助中心 搜索] + * @author: wsl(shuiling.wang@yoho.cn) + * @date: 2016/12/02 + */ +var yas = require('../common/data-yas'); + +var helpSearch = { + $search: $('.help-search'), + init: function() { + var _this = this; + var $helpSearchForm = $('#help-search-form'); + var $searchBtn = $('.search-btn'); + + _this.searchDefaultVal(); + + $searchBtn.click(function() { + var key = _this.$search.val(); + + if (key === '请输入您想知道的帮助信息') { + _this.$search.val(''); + } + + _this.searchYas(key); + $helpSearchForm.submit(); + }); + + _this.$search.keyup(function(e) { + + var key = $(this).val(); + + if (key === '请输入您想知道的帮助信息') { + $(this).val(''); + } + + if (e.which === 13) { + if (key) { + _this.searchYas(key); + $helpSearchForm.submit(); + } + } + }); + + // 热搜词埋点 + $('.search-box .keyword a').on('click', function() { + yas.yasEvent('YB_HELP_SEARCH_C', { + POS_ID: 2, + POS_NM: '热搜词 ', + KEYWORD: $(this).html() + }, false); + }); + }, + searchYas: function(keyword) { // 搜索框埋点 + yas.yasEvent('YB_HELP_SEARCH_C', { + POS_ID: 1, + POS_NM: '搜索框', + KEYWORD: keyword + }, false); + }, + searchDefaultVal: function() { + var _this = this; + var defaultVal = '请输入您想知道的帮助信息'; + var startVal = defaultVal; + var defaultColor = '#989898'; + + if (_this.$search.val()) { + startVal = _this.$search.val(); + defaultColor = '#1b1b1b'; + } + + _this.$search.focus(function() { + var key = _this.$search.val(); + + if (key === defaultVal) { + _this.$search.val('').css('color', '#1b1b1b'); + } + }).blur(function() { + var key = _this.$search.val(); + + if ($.trim(key) === '') { + _this.$search.val(defaultVal).css('color', '#989898'); + } + }).val(startVal).css('color', defaultColor); + } +}; + +module.exports = helpSearch; diff --git a/public/js/help/help.page.js b/public/js/help/help.page.js new file mode 100644 index 0000000..8e0a03d --- /dev/null +++ b/public/js/help/help.page.js @@ -0,0 +1,72 @@ +/** + * [帮助中心] + * @author: wsl(shuiling.wang@yoho.cn) + * @date: 2016/07/25 + */ +var helpSearch = require('./help-search'); +var problemBox = require('./help-common'); +var helper = require('./help-helper'); +var searchTemplet = require('../../hbs/help/search-cont.hbs'); +var parentID, qs, queryId, page, keywords, $cate; + +require('../common'); + +qs = window.queryString(); +queryId = qs.id; +page = qs.page || 1; +keywords = qs.helpQuery; +$cate = $('.cateId-' + queryId);// 当前分类 + + +helpSearch.init(); +problemBox(); + +// 获取搜索的结果 +if (keywords) { + $.get('/help/search', { + page: page, + keywords: keywords + }, function(result) { + var id, + $detailCont = $('.detail-cont'); + + if (result.helper_list) { + $.each(result.helper_list, function(k, s) { + if (s.helperType === 2) { + s.problem = true; + } + + if (parseInt(s.secendCategoryId, 10) === 0) { + id = s.firstCategoryId; + } else { + id = s.secendCategoryId; + } + + + s.content = helper.cutStr({ + str: s.content, + len: 290, + type: s.helperType, + url: '/help/detail?id=' + id + '&contId=' + s.id + }); + + s.content = helper.keywordLabel(s.content, keywords); + s.caption = helper.keywordLabel(s.caption, keywords); + }); + + $detailCont.html(searchTemplet(result)); + } else { + $.get('/help/onlineService', {}, function(url) { + result.jumpUrl = url; + $detailCont.html(searchTemplet(result)); + }); + } + }); +} + +if (!$cate.hasClass('big-category')) { + parentID = $cate.data('parentId'); + + $('.parentId-' + parentID).show(); + $('.cateId-' + parentID).find('.icon').removeClass('plus').addClass('minus'); +} diff --git a/public/js/help/scroller.js b/public/js/help/scroller.js new file mode 100644 index 0000000..ab224bb --- /dev/null +++ b/public/js/help/scroller.js @@ -0,0 +1,81 @@ +/** + * [上下滚动] + * @author: wsl(shuiling.wang@yoho.cn) + * @date: 2016/12/13 + */ + +// 类创建函数 +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + }; + } +}; + +var Scroller = Class.create(); + +function $(element) { + var i, length, elements; + + if (arguments.length > 1) { + for (i = 0, length = arguments.length, elements = []; i < length; i++) { + elements.push($(arguments[i])); + } + return elements; + } + if (typeof element === 'string') { + return document.getElementById(element); + } else { + return element; + } +} + +// 对象属性方法扩展 +Function.prototype.bind = function(object) { // eslint-disable-line + var method = this; + + return function() { + method.apply(object, arguments); + }; +}; + +Scroller.prototype = { + + // 第一个参数定义要滚动的区域,第二个参数定义每次滚动的高度 + initialize: function(element, height, delay) { + this.element = $(element); + this.element.innerHTML += this.element.innerHTML; + this.height = height; + this.delay = delay * 1000; + this.maxHeight = this.element.scrollHeight / 2; + this.counter = 0; + this.scroll(); + this.timer = ''; + this.element.onmouseover = this.stop.bind(this); + this.element.onmouseout = function() { + this.timer = setTimeout(this.scroll.bind(this), 1000); + }.bind(this); + }, + scroll: function() { + if (this.element.scrollTop < this.maxHeight) { + this.element.scrollTop ++; + this.counter ++; + } else { + this.element.scrollTop = 0; + this.counter = 0; + } + + if (this.counter < this.height) { + this.timer = setTimeout(this.scroll.bind(this), 10); + } else { + this.counter = 0; + this.timer = setTimeout(this.scroll.bind(this), this.delay); + } + }, + stop: function() { + clearTimeout(this.timer); + } +}; + +module.exports = Scroller; diff --git a/public/js/home/message.page.js b/public/js/home/message.page.js index 561a3b0..eddf599 100644 --- a/public/js/home/message.page.js +++ b/public/js/home/message.page.js @@ -7,125 +7,53 @@ var $ = require('yoho-jquery'); var Dialog = require('../common/dialog'); -var $container = $('#message-main-container'), - $msgCheck = $container.find('.msg-check'), - $readBtn = $container.find('.read-choose-btn'), - $checked; - +var $container = $('#message-main-container'); var $pickBtn = $('.pick-coupon-btn'); -var operationId = []; - var pickBusy = false; var Alert = Dialog.Alert, - Confirm = Dialog.confirm; - -function hasNew() { - var newMsg = false; - - $checked = $container.find('.msg-check:checked'); - operationId = []; - - $checked.each(function() { - var $par = $(this).parent().parent(); - - operationId.push($(this).val()); - if ($par.hasClass('new-msg')) { - newMsg = true; - } - }); + Confirm = Dialog.Confirm; - if (newMsg) { - $readBtn.addClass('has-new'); - } else { - $readBtn.removeClass('has-new'); - } -} +require('../common'); -function msgOperation(type, data) { - var url; - - switch (type) { - case 'del': - url = '/home/message/del'; - break; - case 'read': - url = '/home/message/read'; - break; - default: - break; - } - - if (!url) { +function msgOperation(data) { + if (!data) { return; } $.ajax({ type: 'GET', - url: url, + url: '/home/message/del', data: data }).then(function(jsonData) { if (jsonData.code === 200) { - if (type === 'read') { - $checked.removeAttr('checked'); - $checked.parent().parent().removeClass('new-msg'); - hasNew(); - } else { - window.location.reload(); - } + window.location.reload(); } else { new Alert(jsonData.message); } }); } -$container.on('change', 'input[type="checkbox"]', function() { - var checked = $(this).attr('checked'); - - if ($(this).hasClass('choose-all')) { - if (checked === 'checked') { - $msgCheck.attr('checked', true); - } else { - $msgCheck.removeAttr('checked'); - } - } - hasNew(); -}); - $container.on('click', '.del-btn', function() { var data = $(this).data(); - new Confirm({ - content: '您确定要删除这条短消息?', - cb: function() { - msgOperation('del', data); - } - }).show(); -}); - -$container.on('click', '.del-choose-btn', function() { - if (!operationId.length) { - new Alert('请选中您要删除的消息'); - return; + if (data.id) { + new Confirm({ + content: '您确定要删除这条短消息?', + cb: function() { + msgOperation(data); + } + }).show(); } - - new Confirm({ - content: '确定要删除您选中的消息?', - cb: function() { - msgOperation('del', { - id: operationId.join(',') - }); - } - }).show(); }); -$container.on('click', '.read-choose-btn', function() { - if ($(this).hasClass('has-new')) { - msgOperation('read', { - id: operationId.join(',') - }); - } +$('.show-birth-coupon').click(function() { + var $this = $(this); + + $this.siblings('.birth-coupon-wrap').show(); + $this.hide().siblings('p').hide(); + $(window).scrollTop(0); }); $pickBtn.click(function() { diff --git a/public/js/passport/back/back.js b/public/js/passport/back/back.js index c3842c9..a5c652e 100644 --- a/public/js/passport/back/back.js +++ b/public/js/passport/back/back.js @@ -28,6 +28,7 @@ var $cr = $('#country-code-hide'), require('../../simple-header'); require('yoho-jquery-placeholder'); +require('../../common/promise'); function enableBtn() { if (hasPh) { @@ -153,7 +154,9 @@ $(document).click(function() { } }); -captcha.refresh(); +$.sleep(1000).then(function() { + captcha.refresh(); +}); $phoneNum.keyup(function() { vaPn($.trim($(this).val())); diff --git a/public/js/passport/bind/thirdlogin.js b/public/js/passport/bind/thirdlogin.js index 0912a13..eec770f 100644 --- a/public/js/passport/bind/thirdlogin.js +++ b/public/js/passport/bind/thirdlogin.js @@ -214,7 +214,7 @@ function changeSecond() { * @param {[type]} phonenum [description] * @return {[type]} [description] */ -function circleTime(phonenum) { +function circleTime() { $('.validatewrapper').html(nopermissionoption); window.setTimeout(changeSecond, 1000); } diff --git a/public/js/passport/login/index.js b/public/js/passport/login/index.js index a7501bd..1115f91 100644 --- a/public/js/passport/login/index.js +++ b/public/js/passport/login/index.js @@ -293,7 +293,7 @@ accountChangeEvent.add(function(type) { accountChangeEvent.add(function(type) { if (type === AccountLoginData.SMSLogin.name) { $accountInput2.val($accountInput1.val()); - refreshSmsCaptchaImg(); + refreshSmsCaptchaImg(); // eslint-disable-line } else { $accountInput1.val($accountInput2.val()); } @@ -308,7 +308,7 @@ mobileTipShowOnce.add(function() { }); refreshSmsImgCallBack.add(function() { - refreshSmsCaptchaImg(); + refreshSmsCaptchaImg(); // eslint-disable-line }); /** ************************************************************************/ diff --git a/public/js/passport/reg/reg.js b/public/js/passport/reg/reg.js index 5b77c54..52d1c19 100644 --- a/public/js/passport/reg/reg.js +++ b/public/js/passport/reg/reg.js @@ -42,6 +42,7 @@ var oldPhone = ''; // 如果手机号改变时刷新验证码 require('../../simple-header'); require('yoho-jquery-placeholder'); +require('../../common/promise'); // 密码规则提示 $pwd.focus(function() { @@ -121,7 +122,7 @@ function phoneAjaxFn(page, callback) { type: 'POST', data: data }).then(function(res) { - var defer = $.Deferred(); + var defer = $.Deferred(); // eslint-disable-line defer.always(callback); @@ -187,7 +188,7 @@ function msgCaptchaAjaxFn(page, callback) { area: $region.text().split('+')[1] } }).then(function(data) { - var defer = $.Deferred(); + var defer = $.Deferred(); // eslint-disable-line defer.always(callback); @@ -220,7 +221,7 @@ function validateRule(page, $element, callback) { // 对应的错误提示语也改了,感觉要不了多久就会改回来 // pwdReg = /^([a-zA-Z0-9\-\+_!@\#$%\^&\*\(\)\:\;\.=\[\]\\\',\?]){6,20}$/gi; - var defer = $.Deferred(); + var defer = $.Deferred(); // eslint-disable-line defer.always(callback); @@ -425,8 +426,9 @@ $(window).resize(function() { // Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题 // ( ▼-▼ )注册页和信息完善页面接口不同 exports.init = function(page) { - - captchaImage.refresh(); + $.sleep(1000).then(function() { + captchaImage.refresh(); + }); $('#agree-terms').click(function() { diff --git a/public/js/plugins/share.js b/public/js/plugins/share.js index bfeee2e..e8cdee4 100644 --- a/public/js/plugins/share.js +++ b/public/js/plugins/share.js @@ -33,7 +33,7 @@ function shareBase(options) { switch (defOption.channel) { case 'weibo': openUrl = 'http://service.weibo.com/share/share.php?url=' + defOption.url + '&title=' + - defOption.title + '&appkey=3739328910&searchPic=true&pic=' + defOption.image; + defOption.title + '&appkey=3739328910&searchPic=true&pic=' + defOption.image + '&searchPic=false'; break; case 'tweibo': openUrl = 'http://share.v.t.qq.com/index.php?c=share&a=index&url=' + defOption.url + '&title=' + diff --git a/public/js/product/detail.page.js b/public/js/product/detail.page.js index aa26c74..3e9f512 100644 --- a/public/js/product/detail.page.js +++ b/public/js/product/detail.page.js @@ -28,8 +28,8 @@ var yasAtHead = require('./yas-head'); var yasAtBottom = require('./yas-bottom'); var $main = $('.main'), id = $main.data('id'), - shopId = parseInt($main.data('shop')), - brandId = parseInt($('#brand-favour').data('id')), + shopId = parseInt($main.data('shop')), // eslint-disable-line + brandId = parseInt($('#brand-favour').data('id')), // eslint-disable-line md5 = $main.data('md5'), skn = $main.data('skn'), deposit = $main.data('deposit') === 'Y', @@ -137,7 +137,7 @@ function addCart() { $('#cart-num').text(data.data.goods_count); // 更新数目 - return $.Deferred().resolve().promise(); // eslint-diable-line + return $.Deferred().resolve().promise(); // eslint-disable-line } else if (code === 500) { if (deposit) { alert = new Alert('定金预售商品只能在APP端购买'); @@ -161,8 +161,8 @@ bindEvent.add(function() { var $size = $('#sizes'), $sizes = $size.children('.size'), - $sizeWarn = $size.find('.size-warn'), - $colorSizeTip = $size.children('.color-size-tip'); + $sizeWarn = $('.size-warn'), + $sizeTip = $size.children('.color-size-tip'); var $num = $('#num'), $plusNum = $('#plus-num'), @@ -229,7 +229,7 @@ bindEvent.add(function() { return window.jumpUrl(err.data.refer); } - alert(err.message); + alert(err.message); // eslint-disable-line }); break; default: @@ -299,11 +299,11 @@ bindEvent.add(function() { } // 查看细节图功能 - var moveWidth = 135, // eslint-disable-line + var moveWidth = 314, // eslint-disable-line + magnifier = 560, w = 420, h = 560, - _w = 1000, - radio = w / _w, + radio = moveWidth / magnifier, $moveObj = $('.move-object'), $max = $('.max'); @@ -368,13 +368,20 @@ bindEvent.add(function() { fold: '' }; + var promotionText = { // eslint-disable-line + unfold: '展开全部促销', + fold: '收起促销' + }; + $('.activity-title').click(function() { $(this).toggleClass('active'); if ($(this).hasClass('active')) { - $(this).find('span').html(icon.fold); + $(this).find('i').html(icon.fold); + $(this).find('span').html(promotionText.fold); $('.activity-container').slideDown(400); } else { - $(this).find('span').html(icon.unfold); + $(this).find('i').html(icon.unfold); + $(this).find('span').html(promotionText.unfold); $('.activity-container').slideUp(400); } }); @@ -495,29 +502,6 @@ bindEvent.add(function() { $sizeWarn.removeClass('hide'); } - // size title - (function() { - var $sizeTitleJson = $('#size-title-json'), - jsonHtml = $sizeTitleJson.html(), - sizeTitle; - - if (!jsonHtml) { - return; - } - - sizeTitle = $.parseJSON(jsonHtml); - - // 数据获取后删除 - $sizeTitleJson.remove(); - - $sizes.children('li').each(function() { - var $this = $(this), - key = $this.data('name'); - - $this.data('title', sizeTitle[key]); - }); - }()); - // 这个文件商品详情页专用 require('../plugins/share')(); require('yoho-jquery-qrcode'); @@ -531,9 +515,6 @@ bindEvent.add(function() { $maxColor = $this; - // 初始化color-size显示或隐藏 - $colorSizeTip.addClass('hide'); - // 隐藏尺码提示 $sizeWarn.addClass('hide'); @@ -589,6 +570,9 @@ bindEvent.add(function() { if (!maxStock) { maxStock = -1; $enableNotifyYou.addClass('hide'); // 没有 + + // 初始化color-size显示或隐藏 + $sizeTip.addClass('hide'); } resetNum(); @@ -620,7 +604,7 @@ bindEvent.add(function() { $this.siblings('.focus').removeClass('focus'); $this.addClass('focus'); - $colorSizeTip.html($this.data('title')).removeClass('hide'); + $sizeTip.html($this.data('info')).removeClass('hide'); $sizeWarn.addClass('hide'); @@ -716,7 +700,7 @@ bindEvent.add(function() { return; } - alert(err.message); + alert(err.message); // eslint-disable-line }).always(function() { dialog.close(); }); @@ -1019,11 +1003,11 @@ $('#brand-favour').click(function() { switch (type) { case BRAND_FAV.add: return favorite.addFav(shopId, brandId).then(function() { - $('.fav-num').html(parseInt($('.fav-num').text()) + 1); + $('.fav-num').html(parseInt($('.fav-num').text()) + 1); // eslint-disable-line }); case BRAND_FAV.cancel: return favorite.cancelFav(shopId, brandId).then(function() { - $('.fav-num').html(parseInt($('.fav-num').text()) - 1); + $('.fav-num').html(parseInt($('.fav-num').text()) - 1); // eslint-disable-line }); default: return $.Deferred.reject().promise(); @@ -1039,8 +1023,8 @@ $('.after-service-switch').click(function() { $content = $this.next('.after-service-content'); var html = { - down: '', - up: '' + down: '', + up: '' }; if ($content.css('display') === 'none') { @@ -1090,8 +1074,8 @@ function loadComment() { currentType = '7', // 当前评论展示的类型 cNumReady = false; // 只第一次请求后更新数量 - var commentsTpl = require('hbs/product/comment-item.hbs'), - loadingComments; + var commentsTpl = require('hbs/product/comment-item.hbs'); + var loadingComments; function loadComments(type, nowPage) { if (loadingComments) { @@ -1176,13 +1160,18 @@ function loadComment() { $('.comments ul').on('click', 'a', function() { var $this = $(this); var href = $this.data('page'); - var data = href.split('?')[1].split('&'); - var result = data.map(function(i) { + + if (!href) { + return; + } + + var data = href.split('?')[1].split('&'); // eslint-disable-line + var result = data.map(function(i) { // eslint-disable-line return i.split('=')[1]; }); loadAllComments(currentType, result[2]).then(function() { - _scrollTo($('#judgeTitle')); + _scrollTo($('#judgeTitle'));// eslint-disable-line }); }); @@ -1247,7 +1236,7 @@ $('.comments').on('click', '.img-preview [data-role="preview-right"]', function( var $img = $(this).closest('.img-preview').find('.img-wrap img'), rotate = ($img.data('rotate') || 0) * 1; - rotate -= 90; + rotate += 90; $img.data('rotate', rotate); $img.css('transform', 'rotate(' + rotate + 'deg)'); }); @@ -1255,15 +1244,15 @@ $('.comments').on('click', '.img-preview [data-role="preview-right"]', function( window.fetchComment = window.once(loadComment); function loadConsult() { - var consultsTpl = require('hbs/product/consult-item.hbs'), - $consultsUl = $('#consults-ul'), + var consultsTpl = require('hbs/product/consult-item.hbs'); + var $consultsUl = $('#consults-ul'), $consultNum = $('.consult-num'), loadingConsults = false; // 顾客咨询 function loadConsults(nowPage) { if (loadingConsults) { - return $.Deferred().reject().promise(); + return $.Deferred().reject().promise(); // eslint-disable-line } loadingConsults = true; @@ -1363,10 +1352,15 @@ function loadConsult() { $('.consults-pager').on('click', 'a', function() { var $this = $(this); var href = $this.data('page'); - var data = href.split('?')[1].split('&')[1].split('=')[1]; + + if (!href) { + return; + } + + var data = href.split('?')[1].split('&')[1].split('=')[1]; // eslint-disable-line loadConsults(data).always(function() { - _scrollTo($('#goodsAskTitle')); + _scrollTo($('#goodsAskTitle')); // eslint-disable-line }); }); @@ -1569,7 +1563,7 @@ $('.package-box').on('click', '#buy-detail', function() { return window.jumpUrl(window.signinUrl()); } - var isSingle = true, + var isSingle = true, // eslint-disable-line singleSkuList = []; for (var i = 0; i < pkgData.packageData.length; i++) { //eslint-disable-line @@ -1599,41 +1593,44 @@ $('.package-box').on('click', '#buy-detail', function() { var pkgDialog = new Dialog(opt); // eslint-disable-line pkgDialog.show(); - pkgDialog.$el.on('click', '#pay-pkg', function(){ + pkgDialog.$el.on('click', '#pay-pkg', function() { var product = pkgDialog.$el.find('.pkgDg-prodetal .pkg-product'); var idArr = []; - product.each(function(){ + product.each(function() { var $this = $(this); - var id = $this.find('.pkg-proImg').attr('href').split('_')[1]; - idArr.push(id); + var goodsId = $this.find('.pkg-proImg').attr('href').split('_')[1]; + + idArr.push(goodsId); }); - var option = { - PRD_ID : +$('.main').data('id'), - PACKAGE_GOODS : idArr.join(',') - }; - yas.givePoint('YB_GDS_NUMBER_C', option); + var option = { // eslint-disable-line + PRD_ID: +$('.main').data('id'), + PACKAGE_GOODS: idArr.join(',') + }; + + yas.givePoint('YB_GDS_NUMBER_C', option); }); - pkgDialog.$el.on('click', '.pkg-product .pkg-proImg', function(){ + pkgDialog.$el.on('click', '.pkg-product .pkg-proImg', function() { var $this = $(this); var $index = $this.parent('.pkg-product').index() + 1; var product = pkgDialog.$el.find('.pkgDg-prodetal .pkg-product'); var idArr = []; - product.each(function(){ - var $this = $(this); - var id = $this.find('.pkg-proImg').attr('href').split('_')[1]; - idArr.push(id); + product.each(function() { + var $product = $(this); + var goodsId = $product.find('.pkg-proImg').attr('href').split('_')[1]; + + idArr.push(goodsId); }); - var option = { - PRD_ID : +$('.main').data('id'), - PACKAGE_INDEX : $index, - PACKAGE_GOODS : idArr.join(',') + var option = { // eslint-disable-line + PRD_ID: +$('.main').data('id'), + PACKAGE_INDEX: $index, + PACKAGE_GOODS: idArr.join(',') }; yas.givePoint('YB_GDS_PACKAGE_DT_GOODS_C', option); @@ -1830,18 +1827,38 @@ $(function() { }); $(function() { - var font = $('.description-content .basic li'); - $('.size-table tbody tr:odd td').css('background-color', '#f9f9f9'); - font.each(function(i) { + + // 调整商品信息的间距 + $('.description-content .basic li').each(function(i) { if ((i + 1) % 4 === 0) { - $(this).find('.justpostion').css({display: 'inline-block', 'margin-left': '40px'}); + $(this).find('.justpostion').css({display: 'inline-block', 'margin-left': '70px'}); } else if ((i + 1) % 4 === 1) { return; } else { $(this).find('.justpostion').css('margin-left', '56px'); } }); + + // 调整模特卡的间距 + $('.model-card-item').each(function() { + var $this = $(this); + + $this.find('.item .key').each(function(i) { + var index = i + 1; + + if (index % 3 === 2) { + $(this).css({ + 'padding-left': '40px' + }); + } else if (index % 3 === 0) { + $(this).css({ + 'padding-left': '60px' + }); + } + }); + }); + }); yasAtBottom.yasBottom(); diff --git a/public/js/product/detail/notify.js b/public/js/product/detail/notify.js index c72e594..9665c62 100644 --- a/public/js/product/detail/notify.js +++ b/public/js/product/detail/notify.js @@ -2,7 +2,7 @@ var $ = require('yoho-jquery'); exports.statusAsync = function(sku) { - var uid = getUid(); + var uid = window.getUid(); if (!uid) { return $.Deferred().reject({ data: {// eslint-disable-line @@ -29,7 +29,7 @@ exports.statusAsync = function(sku) { }; exports.addAsync = function(skn, sku) { - var uid = getUid(); + var uid = window.getUid(); if (!uid) { return $.Deferred().reject({ // eslint-disable-line @@ -44,9 +44,9 @@ exports.addAsync = function(skn, sku) { return $.post('/product/detail/notify/add', {skn: skn, sku: sku}) .then(function(result) { if (result.code === 200) { - return $.Deferred().resolve().promise(); + return $.Deferred().resolve().promise(); // eslint-disable-line } else { - return $.Deferred().reject(result).promise(); + return $.Deferred().reject(result).promise(); // eslint-disable-line } }); } else { diff --git a/public/js/product/detail/pager.js b/public/js/product/detail/pager.js index 855b7fc..49b143a 100644 --- a/public/js/product/detail/pager.js +++ b/public/js/product/detail/pager.js @@ -29,7 +29,7 @@ module.exports = function(opts) { theme = options.theme || 'pager', currentClass = options.currentClass || 'cur', - // min full stand ellipsis or: f-首页, p-上一页, page-页码,n-下一页,l-最后一页,info-displayMsg,inout输入框,gobtn-goto Btn + // min full stand ellipsis or: f-首页, p-上一页, page-页码,n-下一页,l-最后一页,info-displayMsg,inout输入框,gobtn-goto Btn type = options.type || 'stand', pageVar = options.pageVar || 'page', pageSizeVar = options.pageSizeVar || 'pageSize'; @@ -43,16 +43,16 @@ module.exports = function(opts) { base = base.replace(clearSizeReg, ''); } - base += (base.indexOf('?') < 0 ? '?' : (/(\?|&)$/.test(base) ? '' : '&')) + - (options.pageSize ? (pageSizeVar + '=' + pageSize + '&') : '') + - pageVar + '='; + base += (base.indexOf('?') < 0 ? '?' : (/(\?|&)$/.test(base) ? '' : '&')) + // eslint-disable-line + (options.pageSize ? (pageSizeVar + '=' + pageSize + '&') : '') + + pageVar + '='; function getPageNums(ntype) { - /** 分页展示页码个数begin 规则:展示最靠近当前页的指定个数 **/ + /** 分页展示页码个数begin 规则:展示最靠近当前页的指定个数 **/ + var num = showNum; var pageShowMax = num % 2 === 0 ? page - 1 : page; var pageShowMin = page; var pageNums = []; - var num = showNum; var i, n; if (ntype === 'e') { @@ -93,7 +93,7 @@ module.exports = function(opts) { if (pageShowMax < totalPages - 2) { pageNums.push('.', totalPages); } else { - for (var x = pageShowMax + 1; x <= totalPages; x++) { + for (var x = pageShowMax + 1; x <= totalPages; x++) { // eslint-disable-line pageNums.push(x); } } @@ -112,8 +112,8 @@ module.exports = function(opts) { ret += '<a>...</a>'; } else { ret += '<a href="javascript:void(0)" data-page="' + base + val + '"' + - (page === val ? 'class="' + currentClass + '"' : '') + - ' title="第' + val + '页">' + val + '</a>'; + (page === val ? 'class="' + currentClass + '"' : '') + + ' title="第' + val + '页">' + val + '</a>'; } }); } @@ -137,12 +137,13 @@ module.exports = function(opts) { } } - var items = ALL_TYPES[type] ? ALL_TYPES[type] : type; + var items = ALL_TYPES[type] ? ALL_TYPES[type] : type; // eslint-disable-line items = $.isArray(items) ? items : (items || ALL_TYPES.stand).split('-'); - var hasPage = false; // 配置中如果配置了多次 page/pe 则将忽略,只第一次有效 - var ret = '<div class="pager' + ' ' + theme + '">'; + // 配置中如果配置了多次 page/pe 则将忽略,只第一次有效 + var hasPage = false; // eslint-disable-line + var ret = '<div class="pager' + ' ' + theme + '">'; // eslint-disable-line $.each(items, function(i, val) { switch (val) { @@ -156,13 +157,13 @@ module.exports = function(opts) { if (page > 1) { ret += '<a href="javascript:void(0)" data-page="' + base + (page - 1) + - '" title="上一页"><span class="iconfont"></span>上一页</a>'; + '" title="上一页"><span class="iconfont"></span>上一页</a>'; } break; case 'n' : if (page < totalPages) { ret += '<a href="javascript:void(0)" data-page="' + base + (page + 1) + - '" title="下一页">下一页<span class="iconfont"></span></a>'; + '" title="下一页">下一页<span class="iconfont"></span></a>'; } break; case 'l' : @@ -192,6 +193,8 @@ module.exports = function(opts) { } hasPage = true; break; + default: + break; } }); diff --git a/public/js/product/newArrive.page.js b/public/js/product/newArrive.page.js new file mode 100644 index 0000000..8822de9 --- /dev/null +++ b/public/js/product/newArrive.page.js @@ -0,0 +1,500 @@ +/** + * Created by DELL on 2016.12.28. + */ +var $ = require('yoho-jquery'), + lazyLoad = require('yoho-jquery-lazyload'); + +var yas = require('../common/data-yas'); +var $arriveList = $('.new-arrive-list'); +var $goodInfo = $arriveList.find('.good-info'); +var $fixedArea = $('.fixed-area'); + +require('../common'); +require('../plugins/slider'); +require('yoho-jquery-pjax'); + +$('.slide-container').slider(); +$('.left-one').slider(); + +var channel = window.queryString().channel || ''; + +// 获取最新上架,列表埋点数据 +function getProListData() { + var goodsData = []; + + $goodInfo.each(function() { + var $good = $(this), + recType = $good.attr('recommend-type'), + goodObj = { + I_INDEX: parseInt($good.index(), 10) + 1, + RECOMMEND_TYPE: recType + }, + cateIds = [], + keys = []; + + // 文章 + if (recType === 'fashionArticle') { + goodObj.ARTICLE_ID = $good.data('articalid'); + } + + // 热门品类 + if (recType === 'seasonSort') { + $good.find('.list-box li').each(function() { + cateIds.push($(this).data('cateid')); + }); + goodObj.CATE_ID = cateIds.join(','); + } + + // 店铺 + if (recType === 'hotShop') { + + goodObj.SHOP_ID = $good.data('shopid'); + } + + // 热门搜索 + if (recType === 'hotSearchTerm') { + $good.find('.list-box li').each(function() { + keys.push($(this).find('a').html()); + }); + goodObj.KEYWORD = keys.join(','); + } + + // 普通商品 + if (!recType) { + goodObj.PRD_SKN = $good.data('skn'); + delete goodObj.RECOMMEND_TYPE; + } + goodsData.push(goodObj); + }); + return goodsData; +} + +// 获取最新上架,点击埋点数据 +function getProData($good) { + var recType = $good.attr('recommend-type'), + goodObj = { + I_INDEX: parseInt($good.index(), 10) + 1, + RECOMMEND_TYPE: recType + }; + + // 文章 + if (recType === 'fashionArticle') { + goodObj.ARTICLE_ID = $good.data('articalid'); + goodObj.F_URL = $good.find('.msg-title').attr('href'); + } + + // 店铺 + if (recType === 'hotShop') { + goodObj.SHOP_ID = $good.data('shopid'); + goodObj.F_URL = $good.find('.btn-tag > a').attr('href'); + } + + // 普通商品 + if (!recType) { + goodObj.PRD_SKN = $good.data('skn'); + goodObj.F_URL = $good.find('.good-detail-text > a').attr('href'); + delete goodObj.RECOMMEND_TYPE; + } + + return goodObj; +} + +function fixAreaTop(scrollTop) { + var fixedAreaTop = $('#catagory-wrap').offset() ? $('#catagory-wrap').offset().top + 28 : 0; + + if (scrollTop > fixedAreaTop) { + $fixedArea.css({ + position: 'fixed', + top: 0 + }); + + } else { + $fixedArea.css({ + position: 'static', + top: 0 + }); + } +} + +var SwiperSingle = { + getSwiperWidth: function ($swiper) { + var $wrap = $swiper.find('.swiper-wrapper'), + sliders = $wrap.find('.swiper-slide'), + sliderWidth = sliders.outerWidth(true); + + $wrap.css('width', sliderWidth*sliders.length + 'px'); + }, + next: function ($swiper) { + var that = this; + var $wrap = $swiper.find('.swiper-wrapper'), + wrapWidth = $wrap.width(), + actionIndex = $wrap.attr('actionIndex') || 1, + sliders = $wrap.find('.swiper-slide'), + sliderWidth = sliders.outerWidth(true), + left = parseInt($wrap.css('margin-left'), 10); + + if (!this.moving && wrapWidth - (-left) > $swiper.width() + sliderWidth) { + left = left - sliderWidth; + this.moving = true; + $wrap.animate({'margin-left': left}, function () { + that.moving = false; + }); + $wrap.attr('actionIndex', ++actionIndex); + } + }, + prev: function ($swiper) { + var that = this; + var $wrap = $swiper.find('.swiper-wrapper'), + actionIndex = $wrap.attr('actionIndex') || 1, + sliders = $wrap.find('.swiper-slide'), + sliderWidth = sliders.outerWidth(true), + left = parseInt($wrap.css('margin-left'), 10); + + if (!this.moving && actionIndex > 1) { + left = left + sliderWidth; + this.moving = true; + $wrap.animate({'margin-left': left}, function () { + that.moving = false; + }); + $wrap.attr('actionIndex', --actionIndex); + } + }, + resize: function ($swiper) { + var $wrap = $swiper.find('.swiper-wrapper'), + actionIndex = $wrap.attr('actionIndex') || 1, + sliders = $wrap.find('.swiper-slide'), + sliderWidth = sliders.outerWidth(true), + left = (actionIndex-1) * sliderWidth; + + $wrap.css('margin-left', left); + } +} + +lazyLoad($('img.lazy')); + +require('./detail/latest-walk'); // 最近浏览 + +$(window).on('scroll', function() { + var scrollTop = $(this).scrollTop(); + + fixAreaTop(scrollTop); +}); + +$(document).pjax('.foot-pager .pager > a, .catagory-navs li.active > a', '#pjax-container', { + timeout: 2000 +}); + +$(document).pjax('.catagory-navs li:not(.active) > a', '#pjax-container', { + url: '?channel=' + channel, + timeout: 2000 +}); + +$(document).on('pjax:complete', function() { + /* 加载页面数据埋点 */ + var loadData = { + DATA: [{ + F_ID: 1005, + F_NM: '最新上架', + F_INDEX: 5, + SORT_ID: '0', + SORT_NAME: '所有品类', + LIST: getProListData() + }] + }; + var $selectCate = $('.catagory-navs > li.active'); + + if ($selectCate.length > 0) { + loadData.DATA[0].SORT_ID = $selectCate.data('cateid').toString(); + loadData.DATA[0].SORT_NAME = $selectCate.find('a').html(); + } + + $('html,body').scrollTop($('#new-product-floor').offset().top); + lazyLoad($('img.lazy')); + + yas.yasEvent('YB_SHOW_NEW_ARRIVAL', loadData); +}); + +$('#new-product-floor').on('click', '.catagory-navs li > a', function() { + var $li = $(this).parent(); + + if (!$li.hasClass('active')) { + $li.addClass('active').siblings().removeClass('active'); + } else { + $li.removeClass('active'); + } + +}); + +/* + * 页面加载完 + */ +$(function() { + // 轮播数量不够隐藏左右箭头 + var $recSwiper = $('#rec-swiper'), + $brandSwiper = $('#brand-swiper'), + recNum = $recSwiper.find('.swiper-wrapper > .swiper-slide').length, + brandNum = $brandSwiper.find('.swiper-wrapper > .swiper-slide').length; + + if (recNum <= 6) { + $recSwiper.find('.prev,.next').addClass('hide'); + } + if (brandNum <= 6) { + $brandSwiper.find('.prev,.next').addClass('hide'); + } + + SwiperSingle.getSwiperWidth($('#rec-swiper'));//初始化宽度 + SwiperSingle.getSwiperWidth($('#brand-swiper'));//初始化宽度 + + $('.next').on('click', function () { + SwiperSingle.next($(this).parent()); + }); + + $('.prev').on('click', function () { + SwiperSingle.prev($(this).parent()); + }); + + $(window).resize(function() { + SwiperSingle.getSwiperWidth($('#rec-swiper'));//初始化宽度 + SwiperSingle.getSwiperWidth($('#brand-swiper'));//初始化宽度 + }); + + fixAreaTop($(this).scrollTop()); +}); + +$(function() { + + var $bannerSlider = $('.slide-container .slide-wrapper li > a'), + $recSlider = $('#rec-swiper .swiper-slide > a'), + $brandSlider = $('#brand-swiper .swiper-slide > a'), + $lookSlider = $('.firstLook-floor .left-one .slide-wrapper li > a'), + $lookRight = $('.firstLook-floor .right-two > a'); + + var bannerData = [], + recData = [], + brandData = [], + lookData = []; + + /* 加载页面数据埋点 */ + var loadData = { + DATA: [{ + F_ID: 1001, + F_NM: 'banner', + F_INDEX: 1, + LIST: bannerData + }, { + F_ID: 1002, + F_NM: '为您推荐', + F_INDEX: 2, + LIST: recData + }, { + F_ID: 1003, + F_NM: '新品牌入驻', + F_INDEX: 3, + LIST: brandData + }, { + F_ID: 1004, + F_NM: '精彩抢先看', + F_INDEX: 4, + LIST: lookData + }, { + F_ID: 1005, + F_NM: '最新上架', + F_INDEX: 5, + SORT_ID: '0', + SORT_NAME: '所有品类', + LIST: getProListData() + }] + }; + + $bannerSlider.each(function() { + var $a = $(this), + index = $a.parent().index(); + + bannerData.push({ + I_INDEX: parseInt(index, 10) + 1, + IMAGE_URL: $a.find('img').attr('src'), + ACTION_URL: $a.attr('href') + }); + }); + + $recSlider.each(function() { + var $slider = $(this).parent(); + + recData.push({ + I_INDEX: parseInt($slider.index(), 10) + 1, + BRAND_ID: $slider.data('brandid').toString(), + SHOP_ID: $slider.data('shopid').toString() + }); + }); + + $brandSlider.each(function() { + var $slider = $(this).parent(); + + brandData.push({ + I_INDEX: parseInt($slider.index(), 10) + 1, + BRAND_ID: $slider.data('brandid').toString(), + SHOP_ID: $slider.data('shopid').toString() + }); + }); + + $lookSlider.each(function() { + var $a = $(this), + index = $a.parent().index(); + + lookData.push({ + I_INDEX: parseInt(index, 10) + 1, + IMAGE_URL: $a.find('img').attr('src'), + ACTION_URL: $a.attr('href') + }); + }); + + $lookRight.each(function() { + var $a = $(this), + index = $a.index(); + + lookData.push({ + I_INDEX: parseInt(index, 10) + 1 + $lookSlider.length, + IMAGE_URL: $a.find('img').attr('src'), + ACTION_URL: $a.attr('href') + }); + }); + + + yas.givePoint('YB_SHOW_NEW_ARRIVAL', loadData); + + /* banner点击埋点*/ + $bannerSlider.click(function() { + var $a = $(this), + index = $a.parent().index(); + var option = { + F_ID: 1001, + F_NM: 'banner', + F_URL: $a.attr('href'), + F_INDEX: 1, + I_INDEX: parseInt(index, 10) + 1 + }; + + yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option); + }); + + /* 为您推荐点击埋点*/ + $recSlider.click(function() { + var $a = $(this), + $slider = $a.parent(), + index = $slider.index(); + var option = { + F_ID: 1002, + F_NM: '为您推荐', + F_URL: $a.attr('href'), + F_INDEX: 2, + I_INDEX: parseInt(index, 10) + 1, + BRAND_ID: $slider.data('brandid').toString(), + SHOP_ID: $slider.data('shopid').toString() + }; + + yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option); + }); + + /* 新品牌入驻点击埋点*/ + $brandSlider.click(function() { + var $a = $(this), + $slider = $a.parent(), + index = $slider.index(); + var option = { + F_ID: 1003, + F_NM: '新品牌入驻', + F_URL: $a.attr('href'), + F_INDEX: 3, + I_INDEX: parseInt(index, 10) + 1, + BRAND_ID: $slider.data('brandid').toString(), + SHOP_ID: $slider.data('shopid').toString() + }; + + yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option); + }); + + /* 精彩抢先看左侧点击埋点*/ + $lookSlider.click(function() { + var $a = $(this), + index = $a.parent().index(); + var option = { + F_ID: 1004, + F_NM: '精彩抢先看', + F_URL: $a.attr('href'), + F_INDEX: 3, + I_INDEX: parseInt(index, 10) + 1 + }; + + yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option); + }); + + /* 精彩抢先看右侧点击埋点*/ + $lookRight.click(function() { + var $a = $(this), + index = $a.index(); + var option = { + F_ID: 1004, + F_NM: '精彩抢先看', + F_URL: $a.attr('href'), + F_INDEX: 3, + I_INDEX: parseInt(index, 10) + 1 + $lookSlider.length + }; + + yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', option); + }); + + /* 最新上架商品点击埋点*/ + $arriveList.on('click', '.good-detail-img,.good-detail-text,.brand-box,.guang-box', function() { + var goodData = { + F_ID: 1005, + F_NM: '最新上架', + F_INDEX: 5, + SORT_ID: '0', + SORT_NAME: '所有品类' + }; + var $selectCate = $('.catagory-navs > li.active'); + + if ($selectCate.length > 0) { + goodData.SORT_ID = $selectCate.data('cateid').toString(); + goodData.SORT_NAME = $selectCate.find('a').html(); + } + + $.extend(goodData, getProData($(this).closest('.good-info'))); + yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', goodData); + }); + + /* 最新上架商品点击埋点*/ + $arriveList.on('click', '.list-box a', function() { + var $selectCate = $('.catagory-navs > li.active'); + var goodData = { + F_ID: 1005, + F_NM: '最新上架', + F_INDEX: 5, + SORT_ID: '0', + SORT_NAME: '所有品类' + }; + var $good = $(this).closest('.good-info'), + recType = $good.attr('recommend-type'), + $li = $(this).parent(); + + goodData.F_URL = $(this).attr('href'); + goodData.L_INDEX = parseInt($li.index(), 10) + 1; + + if ($selectCate.length > 0) { + goodData.SORT_ID = $selectCate.data('cateid').toString(); + goodData.SORT_NAME = $selectCate.find('a').html(); + } + + // 应季品类 + if (recType === 'seasonSort') { + goodData.CATE_ID = $li.data('cateid').toString(); + } + + // 热门搜索 + if (recType === 'hotSearchTerm') { + goodData.KEYWORD = $(this).html(); + } + $.extend(goodData, getProData($good)); + yas.yasEvent('YB_NEW_ARRIVAL_FLR_C', goodData); + }); +}); diff --git a/public/js/product/yas-bottom.js b/public/js/product/yas-bottom.js index 21dde63..f172dab 100644 --- a/public/js/product/yas-bottom.js +++ b/public/js/product/yas-bottom.js @@ -93,11 +93,11 @@ exports.yasBottom = function() { var arr = []; var good = $('.package-box .package-pro').find('.good-info'); - good.each(function(i, ele) { + good.each(function() { var $this = $(this); - var id = $this.find('.good-thumb').attr('href').split('_')[1]; + var goodsId = $this.find('.good-thumb').attr('href').split('_')[1]; - arr.push(id); + arr.push(goodsId); }); yas.givePoint('YB_GDS_PACKAGE_BUY_NOW_C', { PRD_ID: getPrdId(), diff --git a/public/js/product/yas-head.js b/public/js/product/yas-head.js index 4dd55be..b28e9dc 100644 --- a/public/js/product/yas-head.js +++ b/public/js/product/yas-head.js @@ -71,7 +71,7 @@ /* 点击商品详情页尺寸时埋点*/ $('#sizes .size').on('click', 'li', function() { var $this = $(this); - + yas.givePoint('YB_GDS_SIZE_C', {PRD_ID: getPrdId(), SIZE: $this.data('name')}); }); diff --git a/public/scss/common/_header.css b/public/scss/common/_header.css index 9e35edc..7058add 100644 --- a/public/scss/common/_header.css +++ b/public/scss/common/_header.css @@ -101,6 +101,15 @@ color: #000; } + .help { + .iconfont { + font-size: 14px; + color: #898989; + position: relative; + top: -1px; + } + } + .tag-seprate { width: 0; margin-top: 11px; diff --git a/public/scss/common/_swiper.css b/public/scss/common/_swiper.css new file mode 100644 index 0000000..50d7cc4 --- /dev/null +++ b/public/scss/common/_swiper.css @@ -0,0 +1,13 @@ +.swiper-container { + position: relative; + overflow: hidden; +} + +.swiper-slide { + width: 185px; + margin-right: 8px; + float: left; +} +.swiper-wrapper { + margin-left: 0px; +} diff --git a/public/scss/help/_contact.css b/public/scss/help/_contact.css deleted file mode 100644 index a02396a..0000000 --- a/public/scss/help/_contact.css +++ /dev/null @@ -1,35 +0,0 @@ -.contact-about-page { - - .main-container { - width: 720px; - border: 1px solid #d7d7d7; - border-radius: 5px; - overflow: hidden; - - .text-title { - border-bottom: #ff0000 4px solid; - font-family: 微软雅黑; - font-weight: bold; - height: 100px; - line-height: 100px; - font-weight: bold; - font-size: 36px; - color: #333; - text-align: center; - - } - - .text-info { - padding: 20px; - color: #333; - overflow: hidden; - font-size: 12px; - font-weight: normal; - line-height: 24px; - } - - strong { - font-weight: bold; - } - } -} diff --git a/public/scss/help/_detail.css b/public/scss/help/_detail.css new file mode 100644 index 0000000..87c3764 --- /dev/null +++ b/public/scss/help/_detail.css @@ -0,0 +1,178 @@ +.help-page { + .detail-search { + height: 116px; + background: #f5f5f5; + padding-top: 30px; + border-bottom: 1px solid #dfdfdf; + box-sizing: border-box; + } + + .detail-cont { + padding-top: 20px; + } + + .common-problem { + .problem { + margin-bottom: 20px; + } + } + + .detail-problem { + width: 740px; + margin: 0 auto; + padding: 20px 0; + + a { + width: 48%; + text-align: left; + line-height: 30px; + display: inline-block; + height: 30px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + box-sizing: border-box; + font-size: 14px; + padding-left: 20px; + } + + a:hover, + .active { + color: #d2021c; + + .dot-icon { + background: url("/help/dot-red.png") no-repeat; + } + } + } + + .all-problem, + .search-list-area { + width: 720px; + margin: 0 auto; + height: auto; + overflow: hidden; + + p { + font-size: 14px; + line-height: 22px; + } + + a { + color: #ce021b; + } + + .keyword { + color: #ce021b; + } + + .titile { + color: #000; + } + + .cont { + color: #989898; + margin-top: 14px; + font-size: 14px; + line-height: 23px; + overflow: hidden; + } + + .show-all { + color: #ce021b; + cursor: pointer; + } + } + + .all-problem { + .cont { + height: auto; + + img { + max-width: 100%; + } + } + } + + .help-cont { + .cont { + padding: 25px 20px 0; + box-sizing: border-box; + width: 740px; + margin: 0 auto; + font-size: 14px; + overflow: hidden; + line-height: 24px; + + img { + max-width: 100%; + } + } + } + + .problem-li { + float: left; + margin-top: 30px; + position: relative; + padding-left: 36px; + width: 100%; + box-sizing: border-box; + + .title:before { + content: ""; + width: 18px; + height: 18px; + background: url("/help/q.png") no-repeat; + position: absolute; + left: 0; + top: 2px; + } + + .cont:before { + content: ""; + width: 18px; + height: 18px; + background: url("/help/a.png") no-repeat; + position: absolute; + left: 0; + } + } + + .search-list-area { + .article-li { + float: left; + margin-top: 30px; + position: relative; + padding-left: 35px; + width: 100%; + box-sizing: border-box; + + .title:before { + content: ""; + width: 13px; + height: 16px; + background: url("/help/file.png") no-repeat; + position: absolute; + left: 3px; + top: 2px; + } + } + } + + .result-error { + width: 740px; + margin: 0 auto; + line-height: 30px; + font-size: 14px; + padding-left: 30px; + + &.mt15 { + margin-top: 15px; + } + + a { + color: #ce021b; + padding: 0 5px; + } + } +} diff --git a/public/scss/help/_help.css b/public/scss/help/_help.css new file mode 100644 index 0000000..67b3fcf --- /dev/null +++ b/public/scss/help/_help.css @@ -0,0 +1,187 @@ +.help-page { + .search-box { + width: 310px; + margin: 0 auto; + + .search-area { + width: 308px; + height: 33px; + border: 1px solid #3a3a3a; + background: #fff; + + input { + width: 250px; + border: none; + padding: 6px 0 6px 20px; + line-height: 21px; + display: inline-block; + } + + .iconfont { + font-size: 16px; + color: #3a3a3a; + cursor: pointer; + position: relative; + top: 2px; + } + } + + .keyword { + margin: 10px 0 45px; + font-size: 14px; + color: #000; + text-align: center; + + a { + margin: 0 6px; + display: inline-block; + color: #3a3a3a; + line-height: 18px; + text-align: left; + } + + a:hover { + color: #d2021c; + } + } + } + + .dot-icon { + background: url("/help/dot.png") no-repeat; + position: relative; + left: -3px; + top: -2px; + width: 4px; + height: 4px; + display: inline-block; + } + + .nav-top { + height: 220px; + background: #f5f5f5; + padding-top: 25px; + border-bottom: 1px solid #e0e0e0; + margin-bottom: 25px; + + .title-img { + width: 229px; + height: 68px; + display: block; + background: url("/help/help-title.jpg") no-repeat; + margin: 0 auto; + } + } + + .notice { + margin: 3px 0 5px; + height: 30px; + overflow: hidden; + + li { + text-align: center; + line-height: 30px; + height: 30px; + } + + .notice-cont { + display: inline-block; + overflow: hidden; + height: 30px; + font-size: 14px; + margin: 0 5px; + padding-left: 3px; + color: #3a3a3a; + } + + .notice-cont:hover { + color: #d2021c; + + .dot-icon { + background: url("/help/dot-red.png") no-repeat; + } + } + } + + .nav-title { + width: 740px; + height: 30px; + line-height: 30px; + font-size: 14px; + background: #f0f0f0; + margin: 0 auto; + padding-left: 15px; + box-sizing: border-box; + } + + .menu-common { + width: 740px; + margin: 0 auto 30px; + height: auto; + overflow: hidden; + padding: 0 15px; + box-sizing: border-box; + + li { + float: left; + margin-top: 30px; + } + + a { + width: 56px; + text-align: center; + display: block; + float: left; + } + + p { + width: 100%; + font-size: 14px; + color: #3a3a3a; + line-height: 15px; + margin-top: 12px; + text-align: center; + } + } + + .new-guide a { + margin-left: 74px; + } + + .self-service { + padding: 0 20px; + + a { + margin-left: 158px; + } + } + + .problem { + width: 700px; + margin: 0 auto; + padding-top: 21px; + + a { + width: 48%; + text-align: left; + line-height: 30px; + margin-left: 10px; + display: inline-block; + height: 30px; + overflow: hidden; + padding-left: 3px; + text-overflow: ellipsis; + white-space: nowrap; + box-sizing: border-box; + font-size: 14px; + color: #3a3a3a; + } + + a:hover { + color: #d2021c; + + .dot-icon { + background: url("/help/dot-red.png") no-repeat; + } + } + } +} diff --git a/public/scss/help/_index.css b/public/scss/help/_index.css index f320cf9..2550bd9 100644 --- a/public/scss/help/_index.css +++ b/public/scss/help/_index.css @@ -1,52 +1,231 @@ -.about-page { - width: 990px; - padding: 10px 0 20px; - - .about-nav { - width: 210px; - padding: 10px 20px; - background-color: #EBE9EA; - border: 1px solid #d7d7d7; - border-radius: 5px; - - li { - line-height: 30px; - font-size: 12px; - text-align: center; - border-bottom: #ddd 1px solid; - border-top: #fff 1px solid; - - a { - color: #333; - font-weight: bold; - } - - a:hover { - color: #f60; - } - } - - li:first-child { - border-top: 0px; - } - - .act { - a { - color: #ed004c; - cursor: pointer; - } - - a:hover { - color: #ed004c; - } - } - } -} - - - -@import "_yohobuy.css"; -@import "_newpower.css"; -@import "_contact.css"; -@import "_privacy.css"; -@import "_link.css"; +.help-page { + .center-content { + width: 990px; + } + + .home-icon { + font-size: 16px; + } + + .red { + color: #ce021b; + margin: 0 5px; + } + + .foot-pager { + border-top: none; + width: 740px; + margin: 0 auto; + padding-bottom: 10px + } + + .help-navigation { + width: 163px; + background: #fff; + margin-bottom: 20px; + + .title { + width: 100%; + height: 54px; + background: #eaeaea; + padding-left: 20px; + line-height: 54px; + font-size: 18px; + box-sizing: border-box; + } + + .nav { + background: #fbfbfb; + + li { + cursor: pointer; + padding-left: 20px; + width: 100%; + box-sizing: border-box; + } + + .icon { + cursor: pointer; + margin-right: 10px; + height: 13px; + width: 13px; + display: inline-block; + position: relative; + top: 1px; + } + + .plus { + background-image: resolve("help/plus.png"); + } + + .minus { + background-image: resolve("help/minus.png"); + } + + .mult { + margin-right: 26px; + height: 14px; + width: 14px; + } + + li.selected > a { + color: #ce021b; + } + } + + .big-category { + height: 59px; + line-height: 59px; + font-size: 16px; + border-top: 1px solid #e8e8e8; + } + + .smll-category { + display: none; + height: 16px; + line-height: 16px; + margin-bottom: 14px; + font-size: 14px; + + a { + color: #6b6b6b; + } + } + } + + .help-main { + width: 785px; + margin: 0 0 60px 40px; + border: 1px solid #e0e0e0; + padding-bottom: 20px; + } + + .problem-box { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + line-height: calc(100vh); + text-align: center; + display: none; + + .mark { + background: #000; + opacity: 0.5; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 1; + cursor: pointer; + } + + .problem-area { + min-width: 345px; + max-width: 610px; + max-height: 380px; + position: relative; + z-index: 2; + vertical-align: middle; + display: inline-block; + line-height: 24px; + text-align: left; + border: 5px solid rgba(0, 0, 0, 0.4); + } + + .problem-cont { + max-width: 610px; + max-height: 380px; + background: #fff; + } + + .cont-area { + margin: 0 auto; + padding: 53px 18px 53px 45px; + } + + .a-area, + .q-area { + position: relative; + font-size: 14px; + color: #444; + min-height: 20px; + margin-top: 15px; + padding-left: 30px; + + &:before { + content: ""; + width: 18px; + height: 18px; + display: block; + position: absolute; + left: 0; + top: 2px; + } + } + + .a-area { + margin-top: 10px; + font-size: 18px; + color: #000; + } + + .q-area { + line-height: 24px; + max-height: 210px; + overflow-y: auto; + overflow-x: hidden; + + img { + max-width: 100%; + } + } + + .a-area:before { + background: url("/help/q.png") no-repeat; + } + + .q-area:before { + background: url("/help/a.png") no-repeat; + } + + .iconfont { + position: absolute; + right: 28px; + top: 21px; + cursor: pointer; + font-size: 30px; + z-index: 4; + } + } + + ::-webkit-scrollbar { + width: 16px; + height: 16px; + } + + ::-webkit-scrollbar-track, + ::-webkit-scrollbar-thumb { + border-radius: 999px; + border: 5px solid transparent; + } + + ::-webkit-scrollbar-track { + box-shadow: 0 0 6px rgba(0, 0, 0, 0) inset; + } + + ::-webkit-scrollbar-thumb { + min-height: 20px; + background-clip: content-box; + box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.3) inset; + } + + ::-webkit-scrollbar-corner { + background: transparent; + } +} + +@import "help"; +@import "detail"; diff --git a/public/scss/help/_link.css b/public/scss/help/_link.css deleted file mode 100644 index 0400161..0000000 --- a/public/scss/help/_link.css +++ /dev/null @@ -1,46 +0,0 @@ -.link-about-page { - - .main-container { - width: 720px; - border: 1px solid #d7d7d7; - border-radius: 5px; - overflow: hidden; - - .text-title { - border-bottom: #ff0000 4px solid; - font-family: 微软雅黑; - font-weight: bold; - height: 100px; - line-height: 100px; - font-weight: bold; - font-size: 36px; - color: #333; - text-align: center; - - } - - .text-info { - padding: 20px; - color: #333; - overflow: hidden; - font-size: 12px; - font-weight: normal; - line-height: 24px; - } - - h2 { - font-size: 14px; - line-height: 30px; - border-bottom: 1px dashed #ccc; - } - - ul { - padding: 10px 0px; - list-style: none; - } - - strong { - font-weight: bold; - } - } -} diff --git a/public/scss/help/_newpower.css b/public/scss/help/_newpower.css deleted file mode 100644 index 5cfd559..0000000 --- a/public/scss/help/_newpower.css +++ /dev/null @@ -1,19 +0,0 @@ -.newpower-about-page { - - .main-container { - width: 720px; - border: 1px solid #d7d7d7; - border-radius: 5px; - overflow: hidden; - - .text-info { - line-height: 30px; - font-size: 14px; - font-weight: bold; - text-align: center; - color: #333; - padding: 20px; - overflow: hidden; - } - } -} diff --git a/public/scss/help/_privacy.css b/public/scss/help/_privacy.css deleted file mode 100644 index 8883676..0000000 --- a/public/scss/help/_privacy.css +++ /dev/null @@ -1,35 +0,0 @@ -.privacy-about-page { - - .main-container { - width: 720px; - border: 1px solid #d7d7d7; - border-radius: 5px; - overflow: hidden; - - .text-title { - border-bottom: #ff0000 4px solid; - font-family: 微软雅黑; - font-weight: bold; - height: 100px; - line-height: 100px; - font-weight: bold; - font-size: 36px; - color: #333; - text-align: center; - - } - - .text-info { - padding: 20px; - color: #333; - overflow: hidden; - font-size: 12px; - font-weight: normal; - line-height: 24px; - } - - strong { - font-weight: bold; - } - } -} diff --git a/public/scss/help/_yohobuy.css b/public/scss/help/_yohobuy.css deleted file mode 100644 index 8c980ef..0000000 --- a/public/scss/help/_yohobuy.css +++ /dev/null @@ -1,32 +0,0 @@ -.yohobuy-about-page { - - .main-container { - width: 720px; - border: 1px solid #d7d7d7; - border-radius: 5px; - overflow: hidden; - - .text-title { - border-bottom: #ff0000 4px solid; - font-family: 微软雅黑; - font-weight: bold; - height: 100px; - line-height: 100px; - font-weight: bold; - font-size: 36px; - color: #333; - text-align: center; - - } - - .text-info { - padding: 20px; - color: #333; - overflow: hidden; - font-size: 12px; - font-weight: normal; - line-height: 24px; - } - - } -} diff --git a/public/scss/home/_message-detail.css b/public/scss/home/_message-detail.css index fc6dc59..41a0b0a 100644 --- a/public/scss/home/_message-detail.css +++ b/public/scss/home/_message-detail.css @@ -32,6 +32,19 @@ } } + .birth-card > img { + width: 100%; + margin: 6px 0; + } + + .show-birth-coupon { + cursor: pointer; + } + + .birth-coupon-wrap { + display: none; + } + .coupon-item { display: table-row; @@ -83,6 +96,7 @@ overflow: hidden; img { + max-width: 100%; vertical-align: top; } } diff --git a/public/scss/home/_message.css b/public/scss/home/_message.css index c7dadc4..27c7054 100644 --- a/public/scss/home/_message.css +++ b/public/scss/home/_message.css @@ -1,118 +1,98 @@ .message-me-page { - .message .title { + .message > .title { background-image: resolve('home/message.png'); } - .message-table-header { - font-size: 12px; - - .sender { - width: 118px; - padding-left: 38px; - text-align: left; - } - - .heading { - width: 408px; - text-align: left; - } + .msg-tabs-wrap { + padding: 0 10px; + } - .time { - width: 130px; - } + .tabs-list { + height: 31px; + font-size: 14px; + padding-left: 4px; + margin-top: 8px; + border-bottom: 1px solid #e6e6e6; + + li { + display: block; + float: left; + min-width: 80px; + height: 30px; + line-height: 30px; + padding: 0 10px; + text-align: center; + background-color: #eaeaea; + border: 1px solid #e6e6e6; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + margin-left: 6px; + color: #333; + cursor: pointer; + + &.active { + background-color: #fff; + border-bottom-color: #fff; + } - .action { - padding-left: 10px; - width: 66px; + > a { + display: block; + } } } .message-list { padding: 10px; - font-size: 12px; - - table { - width: 100%; - line-height: 38px; - - tr { - color: #999; - border: 1px solid #e6e6e6; - - td { - text-align: center; - } - - input { - vertical-align: middle; - margin: 0; - } + font-size: 14px; + color: #3a3a3a; + } - .del-btn { - color: #468fa2; - text-decoration: none; - cursor: pointer; - } - } + .msg-item:first-child { + border-top: 1px solid #e6e6e6; + } - .list-foot { - background: #f8f8f8; + .msg-item { + padding: 10px 150px 10px 30px; + position: relative; + border-bottom: 1px solid #e6e6e6; - button { - float: left; - line-height: 18px; - padding: 2px 10px; - border: 1px solid #ccc; - border-radius: 2px; - cursor: pointer; - outline: none; - } + .it-title { + line-height: 2; + padding-bottom: 10px; + } - .del-choose-btn { - background: #da044a; - border-color: #cc0345; - margin-right: 10px; - color: #fff; - } + &.new-msg .it-title { + color: #468fa2; + } - .read-choose-btn { - background: #ddd; - color: #b3b3b3; - } - .has-new { - background: #3797af; - border-color: #147e98; - color: #fff; - } - } + .it-content { + line-height: 1.5; + } - .td-sender { - width: 110px; - color: #666; - text-align: left; - white-space: nowrap; - overflow: hidden; - } + .it-time { + color: #b0b0b0; + line-height: 2; + } - .td-title { - width: 410px; - padding-left: 10px; - color: #666; - text-align: left; - white-space: nowrap; - overflow: hidden; + .del-btn { + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; + position: absolute; + top: 50%; + right: 20px; + margin-top: -15px; + cursor: pointer; + display: none; + + .iconfont { + font-size: 26px; } + } - .new-msg { - background: #f0f5f8; - border-bottom: 1px #becfd3 solid; - - .td-sender a, - .td-title a { - font-weight: bold; - color: #468fa2; - } - } + &:hover > .del-btn { + display: block; } } } diff --git a/public/scss/index.css b/public/scss/index.css index d7f67bb..5299a3b 100644 --- a/public/scss/index.css +++ b/public/scss/index.css @@ -8,6 +8,7 @@ @import "path-nav"; /* 模块 */ +@import 'help/index'; @import "channel/index"; @import "product/index"; @import "passport/index"; @@ -15,5 +16,4 @@ @import 'home/index'; @import 'guang/index'; @import 'cart/index'; -@import 'help/index'; @import 'service/index'; diff --git a/public/scss/product/_detail.css b/public/scss/product/_detail.css index 7df3f03..7e31691 100644 --- a/public/scss/product/_detail.css +++ b/public/scss/product/_detail.css @@ -1,9 +1,10 @@ .product-detail-page { $theme-color: #d0021b; - .m-hide{ - display:none; + .m-hide { + display: none; } + .brand-banner { height: 45px; width: 100%; @@ -239,12 +240,10 @@ } } - .has-other-price { color: #444444; text-decoration: line-through; font-size: 13px; - font-weight: normal; } .arrival-date { @@ -262,19 +261,19 @@ .desc { display: inline-block; - height: 22px; margin-left: 20px; } .price-row { display: inline-block; height: 20px; - margin-bottom: 11px; + margin-bottom: 10px; } - .promotion-price { + .promotioGn-price { display: inline-block; height: 24px; + margin-bottom: 10px; } .vip-price { @@ -361,9 +360,9 @@ } .activity-wrapper { - margin-top: 16px; position: relative; width: 100%; + margin-top: 10px; .activity { @@ -406,7 +405,6 @@ .small-coupon-list { height: 18px; - margin-top: 10px; .small-pre { line-height: 18px; @@ -490,24 +488,24 @@ &.small { width: 320px; } + + a:hover { + color: $theme-color; + } } .row { - margin-bottom: 12px; + margin-bottom: 10px; } - .trade-content { - padding-top: 20px; - margin-top: 20px; - border-top: 1px solid #eaeceb; } .chose-color { font-size: 12px; .title { - margin-top: 10px; + margin-top: 8px; } img { @@ -520,6 +518,7 @@ ul { list-style: none; width: 510px; + margin-top: -8px; } li { @@ -527,6 +526,8 @@ cursor: pointer; border: 1px solid #999999; height: 34px; + margin-top: 8px; + margin-bottom: 0; &.focus { border-color: black; @@ -538,7 +539,7 @@ } .color-name { - float:left; + float: left; height: 34px; line-height: 34px; text-align: center; @@ -561,7 +562,7 @@ height: 24px; line-height: 24px; margin-right: 8px; - margin-bottom: 5px; + margin-top: 8px; padding: 0 10px; border: 1px solid #999999; text-align: center; @@ -588,6 +589,7 @@ .size { float: left; color: black; + margin-top: -8px; } .size-ruler { @@ -600,13 +602,6 @@ cursor: pointer; } - .size-warn { - display: inline-block; - height: 21px; - left: 0; - bottom: -21px; - } - .num-warn { float: left; height: 24px; @@ -614,9 +609,10 @@ } .color-size-tip { + font-size: 13px; color: #999; clear: both; - line-height: 18px; + line-height: 25px; } .line { @@ -714,7 +710,7 @@ .lc-arrow { position: absolute; top: $arrowTop; - left: calc(0 - (width($arrow) -1px)); + left: calc(0 - (width($arrow) - 1px)); width: width($arrow); height: height($arrow); background: resolve($arrow); @@ -798,7 +794,6 @@ } } - .collect-product, .keep-shopping { display: inline-block; @@ -864,7 +859,6 @@ } - /**套餐**/ .package-box { margin-top: 30px; @@ -946,141 +940,67 @@ } } + .bottom-tab { - .fixednav{ - - position: fixed; - top:-30px; - margin-left: 961px; - } - - .shoppingCar { - background-color: #f5f5f5; - float: left; - height: 240px; - width: 186px; - border-right: 1px solid #eaeceb; - height: 1000px; - margin-top: 29px; - - .shoppingCar-btn{ - - display:none; - height: 48px; - line-height: 45px; - text-align: center; - color: #fff; - background-color: #d0021b; - font-size: 16px; - cursor: pointer; - - .iconfont { - font-size: 22px; - margin-right: 5px; - } - - &:hover{ - background: #eb3b19; - background: rgba(233, 38, 1, 0.8); - } - - &.disable { - background: #ccc; - border: 1px solid #ccc; - color: white; - } - - - } - - .shoppingCar-nav{ - padding: 20px 30px 0px 30px; - - li{ - display: block; - font-size: 16px; - line-height: 36px; - text-align: center; - - a{ - color: #999; - font-size: 15px; - } - - .fixed{ - color: #000; - font-size: 18px; - } - } + .bottom-title { + font-size: 15px; + display: inline-block; + padding-bottom: 12px; + margin: 10px 45px -2px 0; + font-weight: bold; + cursor: pointer; } - } - - .bottom-tab{ - - .bottom-title{ - font-size: 15px; - display: inline-block; - padding-bottom: 12px; - margin: 10px 45px -2px 0; - font-weight: bold; - cursor: pointer; + .bottom-cur { + border-bottom: 2px solid #000; } - .bottom-cur{ - border-bottom: 2px solid #000; - } - - .change{ + .change { float: right; - margin-right: 0 !important; - - .change-icon{ - font-size: 18px; - } - } - - } - + margin-right: 0 !important; + .change-icon { + font-size: 10px; + } + } - .description-content{ - margin-left: 80px; - margin-right: 80px; - } + } + .description-content { + } .info-block { - margin-top: 36px; - margin-left: 80px; - margin-right: 80px; + margin-top: 55px; + margin-left: 175px; + margin-right: 175px; color: #999; border-top: 1px solid #e0e0e0; font-size: 12px; &.head { + margin-top: 35px; border-top: none !important; } .basic { - width: 990px; - margin: 0 auto; + width: 100%; + margin: -10px auto 0; li { float: left; - width: 200px; + width: 25%; margin-top: 10px; - margin-bottom: 10px; - font-size:14px; + font-size: 14px; + line-height: 22px; color: #444; .valueSpace { - margin-left:7px; + margin-left: 7px; } #desc-color { - margin-left:7px; + margin-left: 7px; width: 35%; display: inline-block; vertical-align: bottom; @@ -1091,11 +1011,10 @@ } } - .comfort { width: 510px; border: 1px solid #e0e0e0; - margin: 20px auto; + margin: 20px auto 0; padding-bottom: 10px; padding-top: 10px; color: #444; @@ -1124,36 +1043,36 @@ } .info-bottom { - margin: 0px; + margin: 0px; } - .block-title { + .block-title { margin-bottom: 30px; margin-top: -16px; text-align: center; - .title-head{ + .title-head { border-left: 20px solid #fff; border-right: 20px solid #fff; - .title { - display: inline-block; - padding-top: 15px; - font-size: 16px; - margin-left: auto; - margin-right: auto; + .title { + display: inline-block; + padding-top: 15px; + font-size: 16px; + margin-left: auto; + margin-right: auto; - &.cur { - color: #444; - border: 1px solid #444; - padding: 7px 28px 6px; - text-align: center; - background-color: #fff; - } + &.cur { + color: #444; + border: 1px solid #444; + padding: 7px 28px 6px; + text-align: center; + background-color: #fff; + } } - } + } .sep { display: inline-block; @@ -1171,29 +1090,30 @@ .material-content { /*display: none;*/ - overflow: hidden; + overflow: visible; } - .description-material-tab{ - .info-block{ - color: #999; - font-size: 12px; - margin-top: 0px; - border: none; - } - } + .description-material-tab { + .info-block { + color: #999; + font-size: 12px; + margin-top: 0px; + border: none; + } + } .material-detail li { position: relative; - width: 860px; - min-height: 40px; - padding-bottom: 10px; - margin: 0 auto 20px; + margin-bottom: 30px; + + &:last-child { + margin-bottom: 0; + } .img-wrap { position: absolute; top: 50%; - margin-top: -30px; + margin-top: -20px; img { float: left; @@ -1205,7 +1125,6 @@ float: left; width: 120px; line-height: 20px; - border-right: 1px dotted #eaeceb; color: #000; text-align: center; font-size: 16px; @@ -1214,8 +1133,8 @@ .text { float: left; - width: 538px; - padding-left: 20px; + width: 530px; + padding-left: 40px; margin-left: 240px; line-height: 24px; font-size: 14px; @@ -1240,28 +1159,28 @@ } .size-table, - .reference-table{ - width: 100%; - font-size: 14px; - color: #666; - border: 1px solid #e0e0e0; + .reference-table { + width: 100%; + font-size: 14px; + color: #666; + border: 1px solid #e0e0e0; - thead{ - background-color: #f5f5f5; - color: #666; - font-size: 14px; - border-bottom: 1px solid #e0e0e0; - } + thead { + background-color: #f5f5f5; + color: #666; + font-size: 14px; + border-bottom: 1px solid #e0e0e0; + } } - .reference-table{ + .reference-table { - tbody{ + tbody { - tr{ - height: 42px; + tr { + height: 42px; + } } - } } .size-table, @@ -1318,34 +1237,106 @@ } } - .ref-model { - padding-top: 10px; - - .model { - width: 444px; - height: 35px; - padding-top: 47px; - padding-left: 316px; - color: #666; - overflow: hidden; - margin: 10px auto 0; - - em { - margin-left: 5px; - } - } - } - .size-tip { color: #999; font-size: 14px; line-height: 20px; text-align: center; - margin-top: 30px; + margin-top: 20px; margin-bottom: 30px; } + .model-cards-wrapper { + height: 60px; + color: black; + margin-bottom: 30px; + + .model-card-item { + + &.model-header { + display: inline-block; + width: 220px; + float: left; + + .avatar { + display: inline-block; + width: 60px; + height: 60px; + float: left; + } + + $width: 160px; + + .info { + display: inline-block; + float: left; + width: 160px; + height: 60px; + + .name { + display: inline-block; + width: 100%; + float: left; + font-size: 18px; + line-height: 30px; + text-align: center; + } + + .try-on-size { + display: inline-block; + width: 100%; + float: left; + font-size: 14px; + line-height: 30px; + text-align: center; + } + } + + } + + &.line { + display: inline-block; + float: left; + width: 0px; + height: 60px; + border-right: 1px solid #e0e0e0; + margin-right: 40px; + } + + &.model-body { + $width : 585px; + + float: left; + display: inline-block; + vertical-align: top; + width: 535px; + + .item { + display: inline-block; + font-size: 14px; + line-height: 30px; + width: 170px; + + .key { + + } + + .value { + + } + + &.middle { + + } + + &.right { + + } + } + } + } + } .details { text-align: center; @@ -1362,7 +1353,7 @@ line-height: 22px; color: #444; - .details-word{ + .details-word { font-size: 14px; color: #444; display: inline-block; @@ -1380,6 +1371,7 @@ img { max-width: 100%; + margin-bottom: 10px; } .img-responsive { @@ -1399,45 +1391,46 @@ } } - .cc-content { + .cc-content { padding: 0px 0px 0px; font-size: 12px; .comment-star { position: relative; display: inline-block; - height: 20px; - width: 90px; + height: 13px; + width: 70px; cursor: pointer; - background: resolve("home/star.png") 0 -20px repeat-x; + background: resolve("product/star.png") 0 -29px repeat-x; + vertical-align: top; - .star-1, .star-2, .star-3, .star-4, .star-5{ + .star-1, .star-2, .star-3, .star-4, .star-5 { position: absolute; - left:0; - top:0; - display:inline-block; - height:20px; - width: 18px; + left: 0; + top: 0; + display: inline-block; + height: 14px; + width: 14px; &.active { - background: resolve("home/star.png") repeat-x; + background: resolve("product/star.png") repeat-x; } } - .star-2{ - width:36px; + .star-2 { + width: 28px; } - .star-3{ - width:54px; + .star-3 { + width: 42px; } - .star-4{ - width:72px; + .star-4 { + width: 56px; } - .star-5{ - width:90px; + .star-5 { + width: 70px; } - &.editable > span{ - &:hover{ + &.editable > span { + &:hover { background: resolve("home/star.png") repeat-x; } } @@ -1451,12 +1444,8 @@ } - li:first-child { - border-top: 0px; - } - li { - border-top: 1px solid #eaeceb; + border-bottom: 1px solid #eaeceb; padding: 20px 0; min-height: 150px; } @@ -1464,6 +1453,7 @@ .user-info { color: #999; line-height: 16px; + height: 16px; > * { float: left; @@ -1472,6 +1462,7 @@ .name { color: #444; font-size: 14px; + margin-right: 20px; } .date { @@ -1482,14 +1473,14 @@ color: #222; } - &+dl{ - margin-right: 0; + & + dl { + margin-right: 0; dd { width: 100%; margin-right: 0; - span{ + span { display: inline-block; width: 62px; overflow: hidden; @@ -1507,65 +1498,71 @@ margin-right: 5px; } - .comment-detail{ + .comment-detail { - .comment-date{ - font-size: 13px; - color: #b0b0b0; + .comment-date { + font-size: 14px; + color: #b0b0b0; + line-height: 20px; } - .tag-list{ - height:24px; + .tag-list { + height: 24px; } - .img-preview{ + .img-preview { img { /*width:100%;*/ } - .img-thumb{ - display:inline-block; - max-width:70px; - max-height:100px; - border:2px solid #999; - display:block; - width:70px; - height:100px; - border:2px solid white; + .img-thumb { + display: inline-block; + max-width: 70px; + max-height: 100px; + border: 2px solid #999; + display: block; + width: 70px; + height: 100px; + border: 2px solid white; margin-bottom: 10px; &.active, - &:hover{ - border-color:#000; + &:hover { + border-color: #000; } - img{ - max-width:70px; - max-height:100px; + img { + max-width: 70px; + max-height: 100px; vertical-align: top; } } - .img-detail{ + .img-detail { padding: 5px 0px 10px 0; font-size: 13px; - display:none; + display: none; .toolbar { dd { display: inline-block; margin-left: 10px; margin-right: 10px; - cursor:pointer; + cursor: pointer; + } + + .iconfont { + font-size: 10px; + margin-right: 2px; } } - .img-wrap{ - max-width:345px; - max-height:345px; - overflow:hidden; + .img-wrap { + max-width: 345px; + max-height: 345px; + overflow: hidden; - img{ - max-width:345px; - max-height:345px; + img { + max-width: 345px; + max-height: 345px; vertical-align: top; } } @@ -1575,42 +1572,23 @@ } dl { - line-height:1.5; + line-height: 1.5; color: #999; - margin-right:20px; + margin-right: 20px; dd { - margin:0 20px 5px 20px; + margin: 0 20px 5px 20px; } - &.horizontal-list{ + &.horizontal-list { dd { - float:left; + float: left; width: 100px; text-align: center; } } } - .more-wrap { - text-align: center; - color: #666; - border-top: 1px solid #eaeceb; - padding: 20px 0; - font-size: 14px; - font-weight: bold; - color: #666; - } - - .btn-wrap { - padding: 20px 0; - border-top: 1px solid #eaeceb; - } - - .load-more { - cursor: pointer; - } - .btn { display: block; width: 140px; @@ -1633,35 +1611,32 @@ margin-top: 10px; } .comment { - margin-bottom:10px; + margin-bottom: 10px; line-height: 20px; font-size: 14px; color: #444; } - /*.consults { - display: none; - }*/ &.comments { h2 { font-size: 14px; - font-weight:normal; + font-weight: normal; color: #666; height: 28px; - float:left; + float: left; padding: 4px 15px 2px 15px; line-height: 26px; cursor: pointer; - margin-bottom:0; + margin-bottom: 0; border-top: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0; background-color: #eee; - &.active{ + &.active { margin-bottom: 0px; - color:#000; + color: #000; border-top: 2px solid #444; border-right: 1px solid #444; border-left: 1px solid #444; @@ -1676,7 +1651,7 @@ text-overflow: ellipsis; > * { - float:none; + float: none; } } @@ -1755,10 +1730,6 @@ } } - .orange { - color: #f9761a; - } - h4 { font-weight: bold; font-size: 14px; @@ -1771,11 +1742,10 @@ } } - .img-3{ - width: 982px; - height: 330px; - margin: 60px auto; - background: resolve("product/after-service.png"); + .img-3 { + width: 801px; + height: 339px; + background: resolve("product/after-service.png"); } a { @@ -1808,9 +1778,8 @@ .goods { width: 1150px; - margin: 0 auto; height: 410px; - margin-top: 20px; + margin: 20px auto 0; > div { float: left; @@ -1839,6 +1808,7 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + text-align: center; } .price { @@ -1859,12 +1829,13 @@ } .warn-tip { - display: inline-block; + font-size: 13px; color: #d0021b; - font-size: 12px; + clear: both; + line-height: 25px; - i { - font-size: 14px; + .iconfont { + font-size: 10px !important; } } @@ -1951,11 +1922,11 @@ .block-title { - .sep { - &+.title { - margin-right: 34px; - } - } + .sep { + & + .title { + margin-right: 34px; + } + } } } @@ -2067,8 +2038,17 @@ .coupon-big { width: 380px; + .close { + .iconfont { + position: absolute; + top: 10px; + right: 10px; + font-size: 30px !important; + } + } + .header { - font-size: 25px; + font-size: 20px; text-align: center; margin-bottom: 20px; width: 100%; @@ -2076,13 +2056,13 @@ .coupon-big-list { width: 100%; - height: 560px; + max-height: 560px; overflow: auto; } .coupon-small-list { width: 100%; - height: 300px; + max-height: 300px; overflow: auto; } @@ -2100,12 +2080,12 @@ .title { position: relative; line-height: 30px; - font-size: 18px; + font-size: 16px; color: #999; text-align: center; background-color: #f8f8f8; - margin-right: 125px; - margin-left: 125px; + margin-right: 130px; + margin-left: 130px; text-align: center; z-index: 2; } @@ -2115,21 +2095,21 @@ height: 100%; float: left; font-size: 18px; - color:white; + color: white; margin-left: 16px; margin-right: 20px; margin-top: 10px; } .desc { - float:left; + float: left; width: 180px; margin-left: 20px; height: 100%; } .amount { - font-size:30px; + font-size: 30px; color: white; margin-top: 10px; text-align: left; @@ -2143,7 +2123,7 @@ } .status { - float:left; + float: left; width: 70px; margin-left: 10px; height: 100%; @@ -2182,273 +2162,299 @@ background: resolve("product/coupon-big.png") no-repeat; margin: 20px auto; } -} - .common-consults{ - margin: 10px auto; + ::-webkit-scrollbar { + width: 14px; + height: 14px; + margin-right: -10px; + } - .common-question{ - width: 100%; - font-size: 14px; - margin-bottom: 30px; + ::-webkit-scrollbar-track, + ::-webkit-scrollbar-thumb { + border-radius: 999px; + border: 5px solid transparent; + } + ::-webkit-scrollbar-track { + box-shadow: 0 0 6px rgba(0, 0, 0, 0) inset; + } - &.input { - width: 100%; - font-size: 14px; - padding-top: 30px; - margin: 0; - } + ::-webkit-scrollbar-thumb { + min-height: 20px; + background-clip: content-box; + box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.2) inset; + } - textarea{ - width: 96%; - height: 100px; - padding: 0; - outline: #e0e0e0; - resize: none; - background-color: #fff; - border: 1px solid #e0e0e0; - font-size: 14px; - padding: 15px 2%; - } + ::-webkit-scrollbar-corner { + background: transparent; + } +} - .err{ - border: 1px solid #d0021b; - } +.common-consults { + margin: 10px auto; - .btn{ - display: block; - padding: 0; - width: 100%; - height: 38px; - line-height: 38px; - color: #000; - background: #f5f5f5; - text-align: center; - font-size: 14px; - margin: 0 auto; - cursor: pointer; - margin-top: -2px; - border-left: 1px solid #e0e0e0; - border-right: 1px solid #e0e0e0; - border-bottom: 1px solid #e0e0e0; - } - - - span{ - display:block; - margin-bottom: 5px; - line-height: 20px; - font-family: initial; - - i{ - margin-right: 8px; - /*color: #000;*/ - font-size: 18px; - } + .common-question { + width: 100%; + font-size: 14px; + margin-bottom: 30px; - .leave-message{ - color: #000; - } + &.input { + width: 100%; + font-size: 14px; + padding-top: 30px; + margin: 0; + } + + textarea { + width: 96%; + height: 100px; + padding: 0; + outline: #e0e0e0; + resize: none; + background-color: #fff; + border: 1px solid #e0e0e0; + font-size: 14px; + padding: 15px 2%; + } + + .err { + border: 1px solid #d0021b; + } + + .btn { + display: block; + padding: 0; + width: 100%; + height: 38px; + line-height: 38px; + color: #000; + background: #f5f5f5; + text-align: center; + font-size: 14px; + cursor: pointer; + margin: -2px auto 0; + border-left: 1px solid #e0e0e0; + border-right: 1px solid #e0e0e0; + border-bottom: 1px solid #e0e0e0; + } - } + span { + display: block; + line-height: 20px; + font-family: initial; - .top-question{ - color: #000; - font-size: 14px; + i { + font-size: 18px; + line-height: 18px; + margin-right: 10px; + } + .leave-message { + color: #000; + } + } - .question { - display: inline-block; - margin-left: -5px; - } + .top-question { + color: #000; + font-size: 14px; + display: block; + margin-bottom: 10px; - .right-time{ - display: inline-block; - float: right; - color: #999; - } + .question { + display: inline-block; + float: left; + width: 75%; + } - } + .iconfont { + float: left; + } + .right-time { + display: inline-block; + float: right; + color: #999; + } + + } - .common-advice{ + .common-advice { color: #d0021b; - .advice{ - color: #d0021b; + .advice { + color: #d0021b; + } + + .click { + font-size: 14px; } - } + } - a{ + a { color: #d0021b; cursor: pointer; - } + } - .common-message{ + .common-message { border-bottom: 2px solid #ccc; min-height: 30px; - } - - .common-zan{ - border-bottom: 1px solid #e0e0e0; - padding-bottom: 20px; - - .zan-content{ - margin: 0 auto; - width: 60%; - text-align: center; - - span{ - display: inline-block; - width: 49%; - - i{ - color: #ccc; - cursor: pointer; - font-size: 20px; - } - - .getzan{ - color:#d0021b; - font-size: 22px; - } - - } - - .icon-border{ - border-right: 2px solid #eaeceb; - } - - } - - } - - .answer-wrapper { - .iconfont { - float: left; - } - - .answer { - display: inline-block; - width: 960px; - float: left; - margin-top: 0 !important; - } - } - - - } - - .buy-consults{ - border-top: 1px solid #e0e0e0; - margin-top: 45px; - - .block-title { - margin-bottom: 30px; - margin-top: -18px; - text-align: center; - - .title-head{ - border-left: 20px solid #fff; - border-right: 20px solid #fff; - - .title { - display: inline-block; - font-weight: bold; - font-size: 14px; - margin-left: auto; - margin-right: auto; - - &.cur{ - color: #fff; - border: 1px solid #000; - padding: 8px 26px; - text-align: center; - background-color: #444; - font-weight: 100; - } - } - } - } - } - - } - - #judge{ - margin: 30px 80px 10px 80px; - - - .judge-content{ - background-color: #fff; - - .pull-right{ - color: #444; - font-size: 14px; - } - - .img-4{ - width: 135px; - height: 200px; - margin: 60px auto; - background: resolve("product/no-comment-pic.png"); - background-size: 135px; - background-repeat: no-repeat; - - .img-4-message{ + } + + .common-zan { + border-bottom: 1px solid #e0e0e0; + padding-bottom: 20px; + padding-top: 25px; + + .zan-content { + margin: 0 auto; + width: 60%; + text-align: center; + + span { + display: inline-block; + width: 49%; + + i { + color: #ccc; + cursor: pointer; + font-size: 20px; + } + + .getzan { + color: #d0021b; + font-size: 22px; + } + + } + + .icon-border { + border-right: 2px solid #eaeceb; + } + + } + + } + + .answer-wrapper { + .iconfont { + float: left; + } + + .answer { + display: inline-block; + width: 770px; + float: left; + margin-top: 0 !important; + } + } + + } + + .buy-consults { + border-top: 1px solid #e0e0e0; + margin-top: 45px; + + .block-title { + margin-bottom: 30px; + margin-top: -18px; text-align: center; - padding-top: 130px; - padding-left: 18px; - width: 100px; - font-size: 18px; - color: #444; - height: 40px; - display: inline-block; - } - } - .msg-pager{ - text-align: center; - margin: 10px auto; + .title-head { + border-left: 20px solid #fff; + border-right: 20px solid #fff; - } - } + .title { + display: inline-block; + font-weight: bold; + font-size: 14px; + margin-left: auto; + margin-right: auto; + + &.cur { + color: #fff; + border: 1px solid #000; + padding: 8px 26px; + text-align: center; + background-color: #444; + font-weight: 100; + } + } + } + } + } - .comment-tabs{ - border-bottom: 1px solid #444; - height: 35px; - } +} - } +#judge { - .judge-head{ + .judge-content { + background-color: #fff; + .pull-right { + color: #444; + font-size: 14px; + } - span{ - display: inline-block; - margin-right: 20px; + .img-4 { + width: 135px; + height: 200px; + margin: 60px auto; + background: resolve("product/no-comment-pic.png") no-repeat; + background-size: 135px; + .img-4-message { + text-align: center; + padding-top: 130px; + padding-left: 18px; + width: 100px; + font-size: 18px; + color: #444; + height: 40px; + display: inline-block; + } } - .name{ - vertical-align: top; - line-height: 20px; - font-size: 16px; + .msg-pager { + text-align: center; + margin: 30px auto 0; + } + } + + .comment-tabs { + border-bottom: 1px solid #444; + height: 35px; + } + +} + +.judge-head { + + span { + display: inline-block; + margin-right: 20px; + + } + + .name { + vertical-align: top; + line-height: 20px; + font-size: 16px; + } - } +} - .total-content{ - position: relative; - width: 100%; - overflow: hidden; - border: 1px solid #e0e0e0; +.total-content { + position: relative; + width: 100%; + overflow: hidden; + border: 1px solid #e0e0e0; - margin-top: 30px; - } + margin-top: 30px; +} .buy-product { display: inline-block; @@ -2492,7 +2498,7 @@ } .color-name { - float:left; + float: left; height: 34px; line-height: 34px; text-align: center; @@ -2535,9 +2541,9 @@ /****放大镜****/ .magnifier { &.move-object { - height: 135px; - width: 135px; - background: resolve("product/move.png") no-repeat; + height: 314px; + width: 314px; + background: resolve("product/move.png"); top: 0; right: 0; position: absolute; @@ -2613,7 +2619,7 @@ > img { width: 100%; - height:100%; + height: 100%; } } @@ -2688,10 +2694,10 @@ } .consults-pager { - .msg-pager { - text-align: center; - margin: 0 auto; - } + .msg-pager { + text-align: center; + margin: 0 auto; + } } .notify-goods-wrapper { @@ -2710,7 +2716,7 @@ line-height: 20px; margin-top: 20px; - .qr-img{ + .qr-img { display: inline-block; width: 100px; height: 100px; @@ -2720,7 +2726,7 @@ } .checked { - font-size:12px; + font-size: 12px; color: black; } @@ -2764,83 +2770,84 @@ } } - - } +.consult-alert { + width: 500px; + background-color: #fff; + .content { - .consult-alert{ - width: 500px; - background-color: #fff; - .content{ - - .consult-head{ - margin: 20px auto; + .consult-head { + margin: 20px auto; - i{ - color: #d0021b; - font-size: 18px; - } + i { + color: #d0021b; + font-size: 18px; + } - span{ - font-size: 20px; - margin-left: 10px; - } + span { + font-size: 20px; + margin-left: 10px; + } } - .consult-qr{ - margin: 30px auto; - div{ - display: inline-block; - } + .consult-qr { + margin: 30px auto; + div { + display: inline-block; + } - .qr-img{ - width: 100px; - height: 100px; - background: resolve("layout/qr.png"); - background-repeat: no-repeat; - background-size: 100px; - } + .qr-img { + width: 100px; + height: 100px; + background: resolve("layout/qr.png"); + background-repeat: no-repeat; + background-size: 100px; + } - .qr-line{ - width: 40px; - height: 100px; - background: resolve("product/qr-line.png"); - background-repeat: no-repeat; - background-size: 40px, 100px; - } + .qr-line { + width: 40px; + height: 100px; + background: resolve("product/qr-line.png"); + background-repeat: no-repeat; + background-size: 40px, 100px; + } - .learn-more{ + .learn-more { - .downapp{ - position: relative; - top: -45px; - } + .downapp { + position: relative; + top: -45px; + } - .learn-content{ - position: relative; - top: -15px; + .learn-content { + position: relative; + top: -15px; + } } - } - } - } + } - .btns{ + .btns { - #dialog-consult-sure{ - line-height: 40px; - width: 180px; - height: 40px; - background-color: #d0021b; - border: none; - } - } + #dialog-consult-sure { + line-height: 40px; + width: 180px; + height: 40px; + background-color: #d0021b; + border: none; + } } +} .img-responsive { display: block; height: auto; max-width: 100% } + +.lazy-load-object { + width: 0; + height: 0; +} diff --git a/public/scss/product/_index.css b/public/scss/product/_index.css index 9487a0c..d6c2fa4 100644 --- a/public/scss/product/_index.css +++ b/public/scss/product/_index.css @@ -14,7 +14,7 @@ @import "shop-index"; @import "students/index"; @import "top-coupon"; - +@import "new-arrive"; .product-page { .list-left { width: 160px; diff --git a/public/scss/product/_list.css b/public/scss/product/_list.css index 983677b..3985395 100644 --- a/public/scss/product/_list.css +++ b/public/scss/product/_list.css @@ -15,6 +15,13 @@ width: 970px; } + .phrase { + text-align: center; + font-size: 18px; + height: 50px; + line-height: 50px; + } + .brand-banner { position: relative; diff --git a/public/scss/product/_new-arrive.css b/public/scss/product/_new-arrive.css new file mode 100644 index 0000000..7aff6a7 --- /dev/null +++ b/public/scss/product/_new-arrive.css @@ -0,0 +1,475 @@ +@import "../common/swiper"; + +.new-arrival-swiper { + width: 100%; + + .prev, .next { + position: absolute; + top: 50%; + width: 40px; + height: 40px; + line-height: 40px; + text-align: center; + margin-top: -22px; + z-index: 10; + cursor: pointer; + -moz-background-size: 27px 44px; + -webkit-background-size: 27px 44px; + background-size: 27px 44px; + background-position: center; + background-repeat: no-repeat; + + > .iconfont { + font-size: 25px; + } + } + + .prev { + left: 0; + right: auto; + } + + .next { + right: 0; + left: auto; + } +} + +.rec-swiper .prev, .rec-swiper .next { + background: #444; + color: #fff; +} + +.rec-swiper .swiper-wrapper{ + height: 116px; +} + +.brand-swiper .swiper-wrapper{ + height: 86px; +} + +.recommond-floor { + .rec-pro { + display: block; + + .new-num { + background: #027cf9; + opacity: .6; + text-align: center; + line-height: 30px; + font-size: 14px; + color: #fff; + margin-top: -3px; + + > span { + margin: 0 5px; + } + } + } +} + +.swiper-slide > a img { + width: 100%; + height: 86px; +} + +.swiper-wrapper { + +} + +.firstLook-floor { + .left-one { + width: 785px; + height: 420px; + position: relative; + margin-right: 10px; + float: left; + + .slide-wrapper { + height: 420px; + } + + .slide-wrapper li a { + width: 100%; + } + + .slide-switch a { + width: 40px; + height: 40px; + line-height: 40px; + margin-top: -20px; + + .iconfont { + font-size: 25px; + } + } + + .slide-switch a.prev { + margin-left: -393px; + } + + .slide-switch a.next { + margin-right: -393px; + } + } + + .right-two { + width: 355px; + float: left; + + .first-right-img { + height: 205px; + margin-bottom: 10px; + display: block; + + > img { + width: 100%; + height: 100%; + } + } + } +} + +.all-catagory { + line-height: 28px; + height: 28px; + width: 1150px; + font-size: 14px; + background: #fff; + padding: 10px 0; + z-index: 999; + + .catagory-text { + float: left; + font-size: 16px; + height: 28px; + color: #d0021b; + font-weight: bold; + padding: 0 15px 0 0; + border-right: 1px solid #000; + } + + .catagory-navs { + float: left; + width: 1068px; + height: 28px; + overflow: hidden; + } + + .catagory-navs li { + float: left; + padding: 0 15px; + line-height: 28px; + + &.active { + background: #000; + + a { + color: #fff; + } + } + } + + .catagory-navs li:first-child { + margin-left: 15px; + } + + .catagory-more { + float: right; + + a:hover { + border-bottom: 1px solid #000; + } + } +} + +.new-arrive-list { + margin-top: 20px; + margin-right: -10px; + + .list-top-img { + width: 100%; + height: 110px; + background: resolve('product/season-sort.png') no-repeat; + } + + .list-top-img.hot-search-img { + background: resolve('product/hot-search.png') no-repeat; + } + + .list-box { + border: 1px solid #e0e0e0; + border-top: 0; + height: 151px; + padding-top: 18px; + padding-bottom: 18px; + padding-left: 5px; + padding-right: 5px; + font-size: 14px; + overflow: hidden; + + li { + float: left; + width: 95px; + height: 30px; + line-height: 30px; + background: #f8f8f8; + margin: 4px 5px; + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + .logo-wrap { + width: 185px; + height: 86px; + margin: 35px auto 8px; + + img { + width: 100%; + height: 100%; + } + } + + .brand-box { + display: inline-block; + width: 100%; + background: #f5f5f5; + cursor: pointer; + } + + .brand-info { + padding: 0 15px; + text-align: center; + + .num-info { + margin: 40px 0 40px 0; + + span { + color: #ee0011; + } + } + + .shop-name { + color: #b0b0b0; + font-size: 14px; + } + + .btn-tag { + font-size: 14px; + line-height: 28px; + height: 28px; + } + + .btn-tag.tag-col { + background: #ee0011; + } + + .btn-tag.tag-home { + border: 1px solid #000; + color: #000; + display: inline-block; + width: 108px; + + em { + margin-left: 4px; + } + } + + .btn-tag.tag-home > a { + color: #000; + } +} + + .good-info { + position: relative; + height: 365px; + } + + .good-detail-img, .guang-box, .brand-box { + height: 298px; + overflow: hidden; + } + + .good-detail-text { + height: 65px; + + > a { + text-align: center; + } + + .price { + text-align: center; + } + } + + .ka-detail-text { + position: relative; + background: #fb452c; + color: #fff; + + > a { + color: #fff; + } + } + + .ka-tag { + text-align: center; + position: absolute; + width: 100%; + top: 285px; + z-index: 10; + + .ka-name { + display: inline-block; + background: #000; + padding: 5px 10px; + color: #fff; + } + } + + .guang-box { + position: relative; + overflow: hidden; + + .guang-img { + width: 100%; + height: 140px; + display: block; + + img { + width: 100%; + height: 100%; + } + } + + .classification { + position: absolute; + background-color: #000; + color: #fff; + text-align: center; + width: 75px; + height: 32px; + line-height: 32px; + padding-right: 5px; + font-size: 13px; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)"; + opacity: .9; + z-index: 99; + } + + .type-icon { + position: absolute; + top: 0; + left: 66px; + height: 32px; + width: 32px; + background: resolve('guang/msg-reco.png') no-repeat; + background-size: 100% 100%; + z-index: 100; + } + + .type-icon.fashion-good { + background: resolve('guang/fashion-good.png') no-repeat; + } + + .msg-info { + position: relative; + height: 118px; + background: #027cf9; + color: #fff; + padding: 20px 10px 20px 10px; + + > a { + color: #fff; + line-height: 26px; + } + + .msg-app { + position: absolute; + bottom: 20px; + font-size: 12px; + + .page-view { + margin-left: 10px; + } + + .iconfont { + font-size: 14px; + } + } + } + } + + .foot-pager { + display: inline-block; + width: 100%; + } +} + +.new-arrive-latest { + margin-top: 30px; + + &.latest-walk { + border-top: 0; + } +} + +.min-screen { + .firstLook-floor { + .left-one { + width: 675px; + height: 361px; + + .slide-wrapper { + height: 361px; + } + + .slide-switch a.prev { + margin-left: -338px; + } + + .slide-switch a.next { + margin-right: -338px; + } + } + + .right-two { + width: 305px; + + .first-right-img { + height: 176px; + } + } + } + + .all-catagory { + width: 990px; + } + + .all-catagory .catagory-navs { + width: 900px; + } + + .swiper-slide { + width: 158px; + } + + .rec-swiper .swiper-wrapper{ + height: 104px; + + img { + height: 73px; + } + } + + .brand-swiper .swiper-wrapper{ + height: 86px; + + img { + height: 73px; + } + } +} diff --git a/public/scss/product/_shop-entry.css b/public/scss/product/_shop-entry.css index 0859064..895b7fa 100644 --- a/public/scss/product/_shop-entry.css +++ b/public/scss/product/_shop-entry.css @@ -24,6 +24,7 @@ color: #999; font-size: 12px; line-height: 18px; + width: 500px; a { color: #999; diff --git a/utils/helpers.js b/utils/helpers.js index 66d4f53..aa4d067 100644 --- a/utils/helpers.js +++ b/utils/helpers.js @@ -19,7 +19,7 @@ function cdnReplace(cdn, imgUrl) { } module.exports = { - image2: function (imageUrl, opts) { + image2: function(imageUrl, opts) { let cdn = _.get(opts, 'data.root.cdn'); if (imageUrl && _.isString(imageUrl)) { @@ -40,7 +40,7 @@ module.exports = { if (query.indexOf('imageView2') === 0) { if (params.q && query.indexOf('/q/') > 0) { query = query.replace(/\/q\/\d+/g, '/q/' + params.q); - } else if (params.q){ + } else if (params.q) { query += '/q/' + params.q; } } else if (query.indexOf('imageMogr2') === 0) { diff --git a/utils/pager.js b/utils/pager.js index 35908b3..fe98ede 100644 --- a/utils/pager.js +++ b/utils/pager.js @@ -38,6 +38,11 @@ exports.setPager = (total, params)=>{ let pages = []; let currentPage = parseInt(params.page || 1, 10); // 当前页 + // 小于两页直接退出 + if (total < 2) { + return resData; + } + for (i = currentPage - 2; i <= currentPage + 2; i++) { if (i < 1) { cutStatus = 1;