Showing 77 changed files with 928 additions and 224 deletions
{
"extends": "yoho"
"extends": "yoho",
"parserOptions": {
"sourceType": "module"
}
}
... ...
... ... @@ -17,8 +17,10 @@ const path = require('path');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const favicon = require('serve-favicon');
const session = require('express-session');
const memcached = require('connect-memcached');
const session = require('yoho-express-session');
const memcached = require('yoho-connect-memcached');
const uuid = require('uuid');
const _ = require('lodash');
const pkg = require('./package.json');
const app = express();
... ... @@ -40,17 +42,35 @@ app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(cookieParser());
app.use(session({
secret: '3e5fec7deca0b8305cefe2ad9d90ff5e',
name: 'PHPSESSID',
prefix: 'yohobuy',
proxy: true,
resave: true,
resave: false,
saveUninitialized: true,
unset: 'destroy',
secret: 'nothing', // 兼容 PHP SESSION,sessionID 不加密
name: 'PHPSESSID', // 兼容 PHP SESSION
genid: () => {
return uuid.v4(); // 兼容 PHP SESSION
},
cookie: {
domain: 'yohobuy.com'
},
store: new MemcachedStore({
hosts: config.memcache.session
hosts: config.memcache.session,
prefix: 'qinsessionsession:', // 兼容 PHP SESSION
key: 'yohobuy_session' // 兼容 PHP SESSION
})
}));
app.use((req, res, next) => {
req.user = {};
// 从 PHP 写的 SESSION 中获取到当前登录用户的 UID
if (req.session && _.isNumber(req.session._LOGIN_UID)) {
req.user.uid = req.session._LOGIN_UID;
}
next();
});
// dispatcher
require('./dispatch')(app);
... ...
... ... @@ -6,8 +6,27 @@
'use strict';
const headerModel = require('../../../doraemon/models/header');
const specialModel = require('../models/special');
const _ = require('lodash');
exports.special = (req, res) => {
let id = req.params[0] || 0;
let channel = req.query.channel ? req.query.channel : 'boys';
specialModel.getSpecialData(id).then((result) => {
let headerData = headerModel.setHeaderData(result[0].data, channel);
result[1].title = result[1].pageTitle;
result[1].keywords = result[1].keyWord;
result[1].description = result[1].pageDesc;
res.send(id);
res.render('special', _.merge({
module: 'index',
page: 'index',
footerTop: true
}, headerData, result[1]));
}).catch((err) => {
res.send(err);
});
};
... ...
... ... @@ -13,13 +13,17 @@ 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.set('views', path.join(__dirname, 'views/action'));
app.engine('.hbs', hbs({
extname: '.hbs',
defaultLayout: 'layout',
layoutsDir: doraemon,
partialsDir: [path.join(__dirname, 'views/partial'), `${doraemon}/partial`],
helpers: 'helpers'
helpers: require('../../library/helpers')
}));
// router
... ...
/**
* activity model
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/05/18
*/
'use strict';
const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
const sign = require(`${global.library}/sign`);
const logger = require(`${global.library}/logger`);
const headerModel = require('../../../doraemon/models/header');
var api = new ServiceAPI();
const getstaticFile = (id) => {
return api.get('staticFileManage/queryById', sign.apiSign({
id: id
})).then(result => {
if (result && result.code === 200) {
return result.data;
} else {
logger.error(`专题活动ID: ${id} 接口返回数据错误`);
return {};
}
});
};
exports.getSpecialData = (id) => {
return Promise.all([headerModel.requestHeaderData(), getstaticFile(id)]);
};
... ...
<div class="yoho-page center-content">
<p>body</p>
</div>
{{{content}}}
<!-- updateAt {{updateTime}} -->
... ...
... ... @@ -12,12 +12,13 @@ const isTest = process.env.NODE_ENV === 'test';
module.exports = {
port: 6002,
domains: {
api: 'http://192.168.102.205:8080/gateway',
service: 'http://testservice.yoho.cn:28077/', // 'http://service.api.yohobuy.com/',
api: 'http://192.168.102.205:8080/gateway/',
service: 'http://testservice.yoho.cn:28077/',
// service: 'http://testservice.yoho.cn:28077/', // 'http://service.api.yohobuy.com/',
search: 'http://192.168.10.64:8080/yohosearch/'
},
useOneapm: false,
useCache: true,
useCache: false,
memcache: {
master: ['192.168.102.168:12580'],
slave: ['192.168.102.168:12580'],
... ... @@ -52,11 +53,13 @@ module.exports = {
if (isProduction) {
Object.assign(module.exports, {
appName: 'www.yohobuy.com',
useOneapm: true
useOneapm: true,
useCache: true
});
} else if (isTest) {
Object.assign(module.exports, {
appName: 'www.yohobuy.com for test',
useOneapm: true
useOneapm: true,
useCache: true
});
}
... ...
... ... @@ -206,5 +206,5 @@ exports.requestHeaderData = () => {
/* eslint-enable */
});
return serviceApi.get('/operations/api/v6/category/getCategory', data, true);
return serviceApi.get('operations/api/v6/category/getCategory', data, true);
};
... ...
... ... @@ -15,9 +15,9 @@
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
{{#if devEnv}}
<link rel="stylesheet" href="//localhost:5002/css/index.css">
<link rel="stylesheet" href="//localhost:5002/css/index.css">
{{^}}
<link rel="stylesheet" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/index.css">
<link rel="stylesheet" href="//cdn.yoho.cn/yohobuy-node/{{version}}/index.css">
{{/if}}
</head>
<body>
... ... @@ -29,9 +29,9 @@
{{/if}}
{{> footer}}
{{#if devEnv}}
<script src="//localhost:5002/{{module}}.{{page}}.js"></script>
<script src="//localhost:5002/{{module}}.{{page}}.js"></script>
{{^}}
<script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.js"></script>
<script src="//cdn.yoho.cn/yohobuy-node/{{version}}/{{module}}.{{page}}.js"></script>
{{/if}}
</body>
</html>
... ...
... ... @@ -15,25 +15,25 @@
<ul class="two-dim clearfix">
<li class="left">
{{#if devEnv}}
<img class="dim-img lazy" data-original="http://webstatic.dev.yohobuy.com/img/index/qr-app.png">
<img class="dim-img lazy" data-original="http://localhost:3000/img/layout/qr-app.png">
{{^}}
<img class="dim-img lazy" data-original="http://cdn.yoho.cn/yohobuy/assets/img/index/qr-app.png">
<img class="dim-img lazy" data-original="http://cdn.yoho.cn/yohobuy-node/assets/img/layout/qr-app.png">
{{/if}}
<p>YOHO!有货</p>
</li>
<li class="left">
{{#if devEnv}}
<img class="dim-img lazy" data-original="http://webstatic.dev.yohobuy.com/img/index/qr-weixin.png">
<img class="dim-img lazy" data-original="http://localhost:3000/img/layout/qr-weixin.png">
{{^}}
<img class="dim-img lazy" data-original="http://cdn.yoho.cn/yohobuy/assets/img/index/qr-app.png">
<img class="dim-img lazy" data-original="http://cdn.yoho.cn/yohobuy-node/assets/img/layout/qr-weibo.png">
{{/if}}
<p>微信</p>
</li>
<li class="left">
{{#if devEnv}}
<img class="dim-img lazy" data-original="http://webstatic.dev.yohobuy.com/img/index/qr-weibo.png">
<img class="dim-img lazy" data-original="http://localhost:3000/img/layout/qr-weibo.png">
{{^}}
<img class="dim-img lazy" data-original="http://cdn.yoho.cn/yohobuy/assets/img/index/qr-app.png">
<img class="dim-img lazy" data-original="http://cdn.yoho.cn/yohobuy-node/assets/img/layout/qr-weixin.png">
{{/if}}
<p>微博</p>
</li>
... ... @@ -41,7 +41,7 @@
</div>
</div>
<p class="item-nav center">
<span class="iconfont cur" key="0">&#xe619;</span>
<span class="iconfont cur" key="0">&#xe606;</span>
</p>
</dd>
<dd>
... ... @@ -121,9 +121,9 @@
</ul>
</div>
<p id="feed-back-page" class="item-nav center">
<span class="iconfont cur">&#xe619;</span>
<span class="iconfont ">&#xe619;</span>
<span class="iconfont ">&#xe619;</span>
<span class="iconfont cur">&#xe606;</span>
<span class="iconfont ">&#xe606;</span>
<span class="iconfont ">&#xe606;</span>
</p>
</dd>
<dd class="last">
... ... @@ -139,27 +139,27 @@
<li>
<a href="http://www.yohomars.com/" target="_blank">
{{#if devEnv}}
<img class="lazy" data-original="http://webstatic.dev.yohobuy.com/img/index/mars.png">
<img class="lazy" data-original="http://localhost:3000/img/layout/mars.png">
{{^}}
<img class="lazy" data-original="http://cdn.yoho.cn/yohobuy/assets/img/index/mars.png">
<img class="lazy" data-original="http://cdn.yoho.cn/yohobuy-node/assets/img/layout/mars.png">
{{/if}}
</a>
</li>
<li>
<a href="http://app.yohoshow.com/" target="_blank">
{{#if devEnv}}
<img class="lazy" data-original="http://webstatic.dev.yohobuy.com/img/index/show.png">
<img class="lazy" data-original="http://localhost:3000/img/layout/show.png">
{{^}}
<img class="lazy" data-original="http://cdn.yoho.cn/yohobuy/assets/img/index/show.png">
<img class="lazy" data-original="http://cdn.yoho.cn/yohobuy-node/assets/img/layout/show.png">
{{/if}}
</a>
</li>
<li>
<a href="http://www.yoho.cn/product#yoho" target="_blank">
{{#if devEnv}}
<img class="lazy" data-original="http://webstatic.dev.yohobuy.com/img/index/yoho.png">
<img class="lazy" data-original="http://localhost:3000/img/layout/yoho.png">
{{^}}
<img class="lazy" data-original="http://cdn.yoho.cn/yohobuy/assets/img/index/yoho.png">
<img class="lazy" data-original="http://cdn.yoho.cn/yohobuy-node/assets/img/layout/yoho.png">
{{/if}}
</a>
</li>
... ... @@ -167,7 +167,7 @@
</div>
</div>
<p class="item-nav center">
<span class="iconfont cur">&#xe619;</span>
<span class="iconfont cur">&#xe606;</span>
</p>
</dd>
</dl>
... ...
{{# headerData}}
<div class="yoho-header {{headType}}">
<div class="yoho-header {{headtype}}">
<div class="tool-wrapper clearfix">
<div class="center-content">
<div class="yoho-group-map left">
... ... @@ -84,8 +84,10 @@
</form>
</div>
<div class="go-cart">
<span class="iconfont ">&#xe600;</span>
<span class="goods-num-tip">0</span>
<a href="http://www.yohobuy.com/shopping/cart">
<span class="iconfont ">&#xe600;</span>
<span class="goods-num-tip">0</span>
</a>
<div class="mini-cart-wrapper">
<div class="loading-cart">
<h3>加载中,请稍后</h3>
... ...
... ... @@ -19,12 +19,10 @@ const serviceApi = config.domains.service;
const searchApi = config.domains.search;
let ApiUrl;
class Http {
class API {
constructor() {
ApiUrl = api;
constructor(baseUrl) {
this.ApiUrl = baseUrl;
}
/**
... ... @@ -39,39 +37,46 @@ class API {
*/
_requestFromAPI(options, cacheOption, reqId) {
let timer = new Timer();
let method = options.method || 'get';
log.info(`${method} api: ${options.url}?${qs.stringify(options.qs)}`);
timer.put('getApi');// 统计时间开始
log.info(`get api: ${options.url}?${qs.stringify(options.qs)}`);
return rp(options).then((result) => {
let duration = timer.put('getApi');// 统计时间结束
log.info(`get api success: use: ${duration}ms`);
if (config.useCache && cacheOption) {
reqId = reqId || this._getReqId(options);
// 数据校验
if (!result || !result.code) {
log.error('error: 接口返回的数据结构错误,非 JSON');
return Promise.reject({
statusCode: 500,
message: '接口返回内容格式错误'
});
}
// 数据校验无误,写缓存, 否则返回 Slave 缓存服务器的数据
if (result && result.code) {
let cacheTime = _.isNumber(cacheOption) ? cacheOption : 60;
// 写缓存, 否则返回 Slave 缓存服务器的数据
if (config.useCache && cacheOption) {
let cacheTime = _.isNumber(cacheOption) ? cacheOption : 60;
cache.set(`apiCache:${reqId}`, result, cacheTime);
cache.setSlave(`apiCache:${reqId}`, result, cacheTime);
} else {
return this._requestFromCache(options, true);
}
reqId = reqId || this._getReqId(options);
cache.set(`apiCache:${reqId}`, result, cacheTime);
cache.setSlave(`apiCache:${reqId}`, result, 86400); // 二级缓存存储一天
}
log.info(`get api success: use: ${duration}ms`);
return result;
}).catch((error)=>{
}).catch((err)=> {
let duration = timer.put('getApi');// 统计时间结束
log.error(`get api fail: use: ${duration}ms, statusCode: ${error.statusCode}, error: ${error.message}`);
log.error(`${method} api fail: use: ${duration}ms, code:${err.statusCode}, error: ${err.message}`);
log.error(`API: ${options.url}?${qs.stringify(options.qs)}`);
// 使用缓存的时候,读取二级缓存
if (config.useCache) {
if (config.useCache && cacheOption) {
return this._requestFromCache(options, true);
}
return Promise.reject({
error: '接口调用失败'
code: 500,
message: '接口调用失败'
});
});
}
... ... @@ -97,14 +102,22 @@ class API {
}
}
// 读取缓存失败,并且不是二级缓存的时候,调用 API
if (!slave) {
return this._requestFromAPI(options, true, reqId);
}
}).catch(() => {
log.error(slave ? 'get slave cache fail' : 'get master cache fail');
// 读取缓存失败,并且不是二级缓存的时候,调用 API
if (!slave) {
return this._requestFromAPI(options, true, reqId);
}
return Promise.reject({
code: 500,
message: '接口调用失败'
});
});
}
... ... @@ -117,7 +130,7 @@ class API {
*/
get(url, data, cacheOption) {
let options = {
url: `${ApiUrl}${url}`,
url: `${this.ApiUrl}${url}`,
qs: data,
json: true,
timeout: 3000
... ... @@ -138,7 +151,7 @@ class API {
*/
post(url, data) {
let options = {
url: `${ApiUrl}${url}`,
url: `${this.ApiUrl}${url}`,
form: data,
method: 'post',
json: true,
... ... @@ -151,22 +164,27 @@ class API {
all(list) {
if (_.isArray(list)) {
return Promise.all(list);
} else {
return Promise.reject(Error('the parameters of api all method should be Array!'));
}
throw Error('the parameters of api all method should be Array!');
}
}
class ServiceAPI extends API {
class API extends Http {
constructor() {
super(api);
}
}
class ServiceAPI extends Http {
constructor() {
super();
ApiUrl = serviceApi;
super(serviceApi);
}
}
class SearchAPI extends API {
class SearchAPI extends Http {
constructor() {
super();
ApiUrl = searchApi;
super(searchApi);
}
}
... ...
... ... @@ -26,12 +26,10 @@ camelCaseArray = (list) => {
};
camelCase = (data) => {
if (_.isObject(data)) {
data = camelCaseObject(data);
}
if (_.isArray(data)) {
data = camelCaseArray(data);
} else if (_.isObject(data)) {
data = camelCaseObject(data);
}
return data;
... ...
/**
* 获取 UID
* @param {[object]} req
* @return {[string]}
*/
exports.getUid = (req) => {
var _uid = 0,
cookie = req.cookies._UID,
cookieList;
if (req.isApp) {
return req.query.uid || 0;
}
if (cookie) {
cookieList = cookie.split('::');
if (cookieList[1] && !isNaN(cookieList[1])) {
_uid = cookieList[1];
}
}
return _uid;
};
... ...
... ... @@ -6,6 +6,7 @@
'use strict';
const querystring = require('querystring');
const _ = require('lodash');
const moment = require('moment');
const config = require('../config/common');
/**
... ... @@ -29,8 +30,8 @@ exports.image = (url, width, height, mode) => {
* @param {[string]} module 模块
* @return {[string]}
*/
exports.url = (uri, qs, module) => {
const subDomain = '.m.yohobuy.com';
exports.urlFormat = (uri, qs, module) => {
const subDomain = '.yohobuy.com';
const subName = {
default: config.siteUrl,
guang: '//guang' + subDomain,
... ... @@ -75,3 +76,62 @@ exports.upperCase = (str) => {
str = str || '';
return str.toUpperCase();
};
/**
* 时间格式化
* @param format 格式化token @see{http://momentjs.cn/docs/#/displaying/format/}
* @param date 日期或者数字
* @return string
*
*/
exports.dateFormat = (format, date) => {
if (typeof format !== 'string' || typeof date === 'undefined') {
return '';
} else {
if (date instanceof Date) {
return moment(date).format(format);
} else {
let d = moment.unix(date);
return moment(d).utc().format(format);
}
}
};
/**
* 时间差格式化
* @param {[string]} format 格式化字符串
* @param {[number]} diff 相差值
* @param {[string]} type diff时间类型 默认ms
*
* Key Shorthand
* years y
* quarters Q
* months M
* weeks w
* days d
* hours h
* minutes m
* seconds s
* milliseconds ms
*
* @example
* let diff = 60 * 60 * 24 * (1.3) + 2;
*
* let s = helpers.dateDiffFormat('{d}天{h}小时', diff, 's');
* >>> 1天7小时
*/
exports.dateDiffFormat = (format, diff, type) => {
if (typeof format !== 'string' || typeof diff === 'undefined') {
return '';
} else {
type = type || 'ms';
let m = moment.duration(diff, type);
format.match(/(\{.*?\})/g).forEach((s) => {
format = format.replace(s, m.get(s.substring(1, s.length - 1)));
});
return format;
}
};
... ...
... ... @@ -25,7 +25,7 @@ class Timer {
if (labelTime) {
let duration = process.hrtime(labelTime);
return this._round(duration[1]);
return this._round(duration[0], duration[1]);
} else {
this.timers[label] = process.hrtime();
}
... ... @@ -35,8 +35,8 @@ class Timer {
* 格式化成毫秒
* @param {Number} value 纳秒
*/
_round(value) {
return Math.round(value / 10000) / 100;
_round(seconds, nanoseconds) {
return Math.round((seconds * 1e9 + nanoseconds) / 10000) / 100;
}
}
... ...
{
"name": "m-yohobuy-node",
"name": "yohobuy-node",
"version": "0.0.1",
"private": true,
"description": "A New Yohobuy Project With Express",
... ... @@ -11,33 +11,51 @@
"start": "node app.js",
"dev": "node_modules/.bin/nodemon -e js,hbs -i public/ app.js",
"online": "NODE_ENV=\"production\" node app.js",
"debug": "DEBUG=\"express:*\" node app.js",
"debug": "DEBUG=\"express:*\" node_modules/.bin/nodemon -e js,hbs -i public/ app.js",
"lint-js": "./node_modules/.bin/eslint -c .eslintrc --cache --fix .",
"lint-css": "./node_modules/.bin/stylelint --config .stylelintrc public/**/*.css",
"precommit": "node lint.js"
"lint-css": "./node_modules/.bin/stylelint --config .stylelintrc public/scss/**/*.css",
"precommit": "node lint.js",
"test": "NODE_ENV=test ./node_modules/.bin/nyc ./node_modules/.bin/ava",
"posttest": "./node_modules/.bin/nyc report --reporter=html"
},
"ava": {
"tap": true,
"require": [
"babel-register"
],
"babel": {
"presets": [
"es2015"
]
}
},
"license": "MIT",
"dependencies": {
"bluebird": "^3.3.5",
"bluebird": "^3.4.0",
"body-parser": "^1.15.0",
"connect-memcached": "^0.2.0",
"cookie-parser": "^1.4.1",
"express": "^4.13.1",
"express-handlebars": "^3.0.0",
"express-session": "^1.13.0",
"influxdb-winston": "^1.0.1",
"lodash": "^4.12.0",
"md5": "^2.1.0",
"memcached": "^2.2.1",
"memcached": "^2.2.2",
"moment": "^2.13.0",
"morgan": "^1.7.0",
"oneapm": "^1.2.20",
"request-promise": "^3.0.0",
"serve-favicon": "^2.3.0",
"uuid": "^2.0.2",
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.0.1"
"winston-daily-rotate-file": "^1.0.1",
"yoho-connect-memcached": "^1.0.3",
"yoho-express-session": "^1.0.2"
},
"devDependencies": {
"autoprefixer": "^6.3.6",
"ava": "^0.14.0",
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.9.0",
"eslint": "^2.10.2",
"eslint-config-yoho": "^1.0.1",
"gulp": "^3.9.1",
... ... @@ -47,8 +65,8 @@
"gulp-sourcemaps": "^2.0.0-alpha",
"gulp-util": "^3.0.7",
"husky": "^0.11.4",
"mocha": "^2.4.5",
"nodemon": "1.9.2",
"nyc": "^6.4.3",
"postcss-assets": "^4.0.1",
"postcss-cachebuster": "^0.1.2",
"postcss-calc": "^5.2.1",
... ... @@ -57,19 +75,23 @@
"postcss-crip": "^2.0.0",
"postcss-opacity": "^3.0.0",
"postcss-position": "^0.4.0",
"postcss-pxtorem": "^3.3.1",
"postcss-short": "^1.4.0",
"postcss-sprites": "^3.1.2",
"postcss-use": "^2.1.0",
"postcss-use": "^2.0.2",
"precss": "^1.4.0",
"rewire": "^2.5.1",
"shelljs": "^0.7.0",
"stylelint": "^6.3.3",
"stylelint": "^6.4.1",
"stylelint-config-yoho": "^1.2.3",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-stream": "^3.1.0",
"yoho-fastclick": "^1.0.6",
"yoho-hammer": "^2.0.7",
"yoho-handlebars": "^4.0.5",
"yoho-jquery": "^1.9.1",
"yoho-jquery-lazyload": "^1.9.7"
"yoho-jquery-lazyload": "^1.9.7",
"yoho-swiper": "^3.3.1"
}
}
... ...
/** ****/ (function(modules) { // webpackBootstrap
/** ****/ // The module cache
/** ****/ var installedModules = {};
/** ****/ // The require function
/** ****/ function __webpack_require__(moduleId) {
/** ****/ // Check if module is in cache
/** ****/ if (installedModules[moduleId])
/** ****/ return installedModules[moduleId].exports;
/** ****/ // Create a new module (and put it into the cache)
/** ****/ var module = installedModules[moduleId] = {
/** ****/ exports: {},
/** ****/ id: moduleId,
/** ****/ loaded: false
/** ****/ };
/** ****/ // Execute the module function
/** ****/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/** ****/ // Flag the module as loaded
/** ****/ module.loaded = true;
/** ****/ // Return the exports of the module
/** ****/ return module.exports;
/** ****/ }
/** ****/ // expose the modules object (__webpack_modules__)
/** ****/ __webpack_require__.m = modules;
/** ****/ // expose the module cache
/** ****/ __webpack_require__.c = installedModules;
/** ****/ // __webpack_public_path__
/** ****/ __webpack_require__.p = '';
/** ****/ // Load entry module and return exports
/** ****/ return __webpack_require__(0);
/** ****/ })([
/* 0 */
/** */ function(module, exports) {
console.log(1);
/** */ }
/** ****/ ]);
... ...
a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,td,th{text-align:left;font-weight:400;vertical-align:middle}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}.clearfix:after{content:'';display:block;clear:both}body{font-family:arial,Microsoft YaHei}@font-face{font-family:iconfont;src:url(../assets/font/iconfont.eot?v154cdedb881);src:url(../assets/font/iconfont.eot?v154cdedb881#iefix) format('embedded-opentype'),url(../assets/font/iconfont.woff?v154cdedb8de) format('woff'),url(../assets/font/iconfont.ttf?v154cdedb8a4) format('truetype'),url(../assets/font/iconfont.svg?v154cdedb89f#iconfont) format('svg')}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;text-decoration:none;-webkit-font-smoothing:antialiased;-webkit-text-stroke-width:.2px;-moz-osx-font-smoothing:grayscale}.center-content{width:1150px;margin-left:auto;margin-right:auto}.min-screen .center-content{width:990px}.left,.pull-left{float:left}.pull-right,.right{float:right}.center{text-align:center}.hide{display:none!important}a:focus,input,textarea{outline:none}a{text-decoration:none;color:#000}.body-mask{position:absolute;z-index:2;background:#000;opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";top:0;left:0}.yoho-header .tool-wrapper{width:100%;height:32px;line-height:32px;font-size:12px;background-color:#f4f4f4}.yoho-header .tool-wrapper .yoho-group-map{padding:0 5px}.yoho-header .tool-wrapper .yoho-group-map .yoho-group-list{position:absolute;display:none;width:170px;top:32px;margin-left:-5px;background-color:#f4f4f4;padding:20px 0 20px 20px;z-index:4}.yoho-header .tool-wrapper .yoho-group-map li a{color:#9196a0;font-size:14px}.yoho-header .tool-wrapper .yoho-group-map li:hover a{color:#000}.yoho-header .tool-wrapper .yoho-group-map:hover{background-color:#dcdcdc}.yoho-header .tool-wrapper .yoho-group-map:hover .yoho-group-list{display:block}.yoho-header .tool-wrapper .yoho-buy-tools li{float:left;padding-right:10px}.yoho-header .tool-wrapper .yoho-buy-tools li span{display:inline-block;vertical-align:middle;line-height:30px}.yoho-header .tool-wrapper .yoho-buy-tools li .hi{vertical-align:top}.yoho-header .tool-wrapper .yoho-buy-tools li a{color:#8e8e8e}.yoho-header .tool-wrapper .yoho-buy-tools .nick-name{color:#000}.yoho-header .tool-wrapper .yoho-buy-tools .tag-seprate{width:0;margin-top:11px;margin-right:12px;height:14px;float:left;border-left:1px solid #dcdcdc}.yoho-header .tool-wrapper .simple-user-center{top:32px;margin-left:-110px;width:300px;position:absolute;background-color:#f8f8f8;z-index:2;display:none}.yoho-header .tool-wrapper .simple-user-center .account-info-header{margin:17px auto 0;width:257px;border-bottom:1px solid #dcdcdc;text-align:center;padding-bottom:15px}.yoho-header .tool-wrapper .simple-user-center .user-img{width:63px;height:63px;margin:0 auto;border-radius:50%;overflow:hidden;background:url(../assets/img/layout/default-thumb.png?v154cdedb8a1) 50%;filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale')";background-size:100% 100%;-moz-background-size:100% 100%}.yoho-header .tool-wrapper .simple-user-center .user-name{margin-top:14px;line-height:25px}.yoho-header .tool-wrapper .simple-user-center .user-level{color:#000;height:20px;line-height:20px;font-size:18px}.yoho-header .tool-wrapper .simple-user-center .user-level span{color:#8cc4f9}.yoho-header .tool-wrapper .simple-user-center .level-detail{font-size:14px;line-height:14px;padding-top:10px;padding-left:20px}.yoho-header .tool-wrapper .simple-user-center .level-view-bar{width:150px;height:14px;margin-right:5px;text-align:left;background-color:#e2e2e2;display:inline-block;vertical-align:middle;overflow:hidden}.yoho-header .tool-wrapper .simple-user-center .level-view-bar .text-span{font-size:16px;line-height:16px;padding-left:3px;position:absolute}.yoho-header .tool-wrapper .simple-user-center .level-view-bar .integrate{height:14px;background-color:#ceae64;padding-left:5px}.yoho-header .tool-wrapper .simple-user-center .account-info-content{padding:20px 30px 0;border-bottom:1px solid #dcdcdc}.yoho-header .tool-wrapper .simple-user-center .account-info-content li{float:none;font-size:16px}.yoho-header .tool-wrapper .simple-user-center .account-info-content a{font-size:14px;color:#000}.yoho-header .tool-wrapper .simple-user-center .account-info-footer{height:51px;line-height:51px;text-align:center}.yoho-header .tool-wrapper .simple-user-center .account-info-footer a{font-size:14px;color:#000}.yoho-header .tool-wrapper .myyoho:hover{background-color:#dcdcdc}.yoho-header .tool-wrapper .myyoho:hover .simple-user-center{display:block}.yoho-header .tool-wrapper .download-app-box{position:absolute;top:32px;margin-left:-100px;width:231px;height:290px;background-color:#f8f8f8;z-index:4;display:none}.yoho-header .tool-wrapper .download-app-box .qr-img{position:relative;background-image:url(../assets/img/layout/qr.png?v154cdedbbc0);background-repeat:no-repeat;background-size:100% 100%;margin:32px auto 15px;width:143px;height:147px}.yoho-header .tool-wrapper .download-app-box .qr-words{height:25px;line-height:25px;font-size:16px;text-align:center}.yoho-header .tool-wrapper .download-app-box .qr-more{margin-top:6px;line-height:25px;font-size:14px;text-align:center}.yoho-header .tool-wrapper .phoneapp:hover{background-color:#dcdcdc}.yoho-header .tool-wrapper .phoneapp:hover .download-app-box{display:block}.yoho-header .tool-wrapper .icon-hamburger{background:url(../assets/img/layout/hamburger.png?v154cdedb924) no-repeat;width:16px;height:12px;display:inline-block;vertical-align:middle}.yoho-header .tool-wrapper .icon-bottomarrow{background:url(../assets/img/layout/bottom-arrow.png?v154cdedb899) no-repeat;width:10px;height:5px;margin-top:-2px}.yoho-header .tool-wrapper .icon-papers{background:url(../assets/img/layout/paper.png?v154cdedbbb8) no-repeat;width:10px;height:14px;margin-top:-2px}.yoho-header .tool-wrapper .icon-heart{background:url(../assets/img/layout/heart.png?v154cdedb933) no-repeat;width:12px;height:11px;margin-top:-2px}.yoho-header .tool-wrapper .icon-mail{background:url(../assets/img/layout/mail.png?v154cdedbbaf) no-repeat;width:16px;height:10px;margin-top:-2px}.yoho-header .tool-wrapper .icon-phone{background:url(../assets/img/layout/iphone.png?v154cdedbb70) no-repeat;width:8px;height:14px;margin-top:-2px}.yoho-header .head-wrapper{width:100%}.yoho-header .head-wrapper .main-nav-list{display:inline-block;vertical-align:top;padding-top:45px}.yoho-header .head-wrapper .main-nav-list li{float:left;padding:8px 23px 5px}.yoho-header .head-wrapper .main-nav-list li a{font-size:12px;line-height:14px}.yoho-header .head-wrapper .main-nav-list li .name-cn a{font-size:16px}.yoho-header .head-wrapper .main-nav-list .cure{color:#fff;background-color:#3a3a3a}.yoho-header .head-wrapper .main-nav-list .cure a{color:#fff}.yoho-header .head-wrapper .main-logo{background:url(../assets/img/layout/logo-en.png?v154cdedbbaa) no-repeat 50%;width:182px;height:53px;left:42%;margin-top:22px;position:absolute;animation:logoflip 20s infinite;-moz-animation:logoflip 20s infinite;-webkit-animation:logoflip 20s infinite;-o-animation:logoflip 20s infinite}.yoho-header .head-wrapper .main-logo .main-link{display:block;width:100%;height:100%}.yoho-header .head-wrapper .func-area{float:right;width:378px;padding-right:18px;margin-top:45px}.yoho-header .head-wrapper .search-2016{width:320px;height:28px;background-color:#3a3a3a;border:1px solid #3a3a3a;display:inline-block;overflow:hidden}.yoho-header .head-wrapper .search-2016 input{width:240px;height:100%;border:none;background:#fff;box-sizing:border-box;padding:7px 0 9px 10px}.yoho-header .head-wrapper .search-2016 .search-btn{background:url(../assets/img/layout/search.png?v154cdedbbc2) no-repeat 50%;width:80px;height:28px;float:right;border:none;cursor:pointer}.yoho-header .head-wrapper .search-suggest{position:absolute;width:320px;border:1px solid #000;margin-top:29px;padding-top:20px;background-color:#fff;display:none;z-index:4}.yoho-header .head-wrapper .search-suggest .action,.yoho-header .head-wrapper .search-suggest li:hover{background-color:#eee}.yoho-header .head-wrapper .search-suggest a{display:block;padding:5px;height:25px;line-height:25px;font-size:12px}.yoho-header .head-wrapper .search-suggest .valuenum{float:right}.yoho-header .head-wrapper .go-cart{width:30px;height:30px;float:right;cursor:pointer;position:relative}.yoho-header .head-wrapper .go-cart .iconfont{font-size:26px;color:#3a3a3a}.yoho-header .head-wrapper .go-cart .goods-num-tip{position:absolute;background:url(../assets/img/layout/ic-information.png?v154cdedb963) no-repeat;width:27px;height:20px;top:-10px;right:-15px;color:#fff;text-align:center;line-height:20px;font-size:12px}.yoho-header .head-wrapper .mini-cart-wrapper{position:absolute;top:30px;right:-14px;width:378px;background:#f8f8f8 url(../assets/img/layout/empty_car.png?v154cdedb8a5) no-repeat 106px 132px;z-index:4;display:none}.yoho-header .head-wrapper .mini-cart-wrapper .empty-cart{padding:280px 0 200px;text-align:center}.yoho-header .head-wrapper .mini-cart-wrapper .loading-cart{padding:200px 0;text-align:center;background:#f8f8f8 reslove('layout/loading.gif') no-repeat center 170px}.yoho-header .head-wrapper .mini-cart-wrapper .rich-cart{background:#f8f8f8}.yoho-header .head-wrapper .mini-cart-wrapper .goods-list{padding-top:20px;margin-bottom:15px;max-height:444px;overflow-x:hidden}.yoho-header .head-wrapper .mini-cart-wrapper .goods-item{padding:0 0 18px 18px}.yoho-header .head-wrapper .mini-cart-wrapper .goods-item>div{font-size:14px;display:inline-block;vertical-align:top}.yoho-header .head-wrapper .mini-cart-wrapper .goods-item p{margin-bottom:12px}.yoho-header .head-wrapper .mini-cart-wrapper .goods-item .goods-img{width:60px}.yoho-header .head-wrapper .mini-cart-wrapper .goods-item .goods-info{width:170px;color:#b0b0b0}.yoho-header .head-wrapper .mini-cart-wrapper .goods-item .goods-price{min-width:90px;text-align:right}.yoho-header .head-wrapper .mini-cart-wrapper .goods-item .title{width:170px;height:14px;font-size:14px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.yoho-header .head-wrapper .mini-cart-wrapper .goods-item .title>a{color:#666}.yoho-header .head-wrapper .mini-cart-wrapper .activity-item{font-size:14px;margin-bottom:8px;padding-left:18px;line-height:18px}.yoho-header .head-wrapper .mini-cart-wrapper .activity-item label{width:60px;height:18px;background-color:#3a3a3a;color:#fff;text-align:center;margin-right:13px;vertical-align:top;display:inline-block}.yoho-header .head-wrapper .mini-cart-wrapper .activity-item h3{width:250px;color:#3a3a3a;font-size:12px;word-break:break-all;display:inline-block}.yoho-header .head-wrapper .mini-cart-wrapper .go-full-cart{padding:0 18px}.yoho-header .head-wrapper .mini-cart-wrapper .go-full-cart>div{height:61px;line-height:61px;border-top:1px solid #dcdcdc;text-align:center}.yoho-header .head-wrapper .on-hover .mini-cart-wrapper{display:block}.yoho-header .nav-wrapper{height:40px;width:100%;background-color:#3a3a3a;position:relative}.yoho-header .nav-wrapper .sub-nav-list{float:left}.yoho-header .nav-wrapper .sub-nav-list li{float:left;line-height:40px;padding-right:46px;box-sizing:border-box;margin-right:38px}.yoho-header .nav-wrapper .sub-nav-list .newlogo{display:block;width:26px;height:12px;background-image:url(../assets/img/layout/new.png?v154cdedbbb5);background-repeat:no-repeat;position:absolute;margin-top:-20px;margin-left:16px}.yoho-header .nav-wrapper .sub-nav-list a{color:#fff;font-size:14px;line-height:14px;display:inline-block}.yoho-header .nav-wrapper .sub-nav-list li:hover a{padding-bottom:3px;border-bottom:2px solid #fff}.yoho-header .nav-wrapper .third-nav-wrapper{width:100%;height:410px;box-sizing:border-box;position:absolute;left:0;top:38px;display:none;padding:30px 0;background-color:#f8f8f8;z-index:3}.yoho-header .nav-wrapper .third-nav-wrapper a{font-size:14px;border-bottom:none!important}.yoho-header .nav-wrapper .third-nav-wrapper dl{float:left;width:278px;height:352px;box-sizing:border-box;border-left:1px solid #ccc;padding:0 50px}.yoho-header .nav-wrapper .third-nav-wrapper dl:first-child{width:228px;border-left:0;padding-left:0}.yoho-header .nav-wrapper .third-nav-wrapper dt{width:180px;padding-bottom:10px;border-bottom:1px solid #000;line-height:18px;margin-bottom:20px}.yoho-header .nav-wrapper .third-nav-wrapper dt a{color:#000}.yoho-header .nav-wrapper .third-nav-wrapper dd{line-height:14px;height:14px;margin-bottom:24px}.yoho-header .nav-wrapper .third-nav-wrapper dd a{color:#a1a1a1}.yoho-header .nav-wrapper .third-nav-wrapper dd a:hover{text-decoration:underline}.yoho-header .nav-wrapper .third-nav-wrapper .hot{color:#e01}.yoho-header .nav-wrapper .show-detail{box-sizing:border-box;padding-left:19px;padding-right:19px;width:337px;height:250px;float:right}.yoho-header .nav-wrapper .show-detail .title{width:100%;margin-top:40px;text-align:center;font-size:14px;color:#000;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoho-header.girls .search-2016{background-color:#ff88ae;border-color:#ff88ae}.yoho-header.girls .cure,.yoho-header.girls .nav-wrapper{background-color:#ff88ae!important}.yoho-header.girls .go-cart .iconfont{color:#ff88ae}.yoho-header.kids .search-2016{background-color:#7bd3f9;border-color:#7bd3f9}.yoho-header.kids .cure,.yoho-header.kids .nav-wrapper{background-color:#7bd3f9!important}.yoho-header.kids .go-cart .iconfont{color:#7bd3f9}.yoho-header.lifestyle .search-2016{background-color:#5e4b3c;border-color:#5e4b3c}.yoho-header.lifestyle .cure,.yoho-header.lifestyle .nav-wrapper{background-color:#5e4b3c!important}.yoho-header.lifestyle .go-cart .iconfont{color:#5e4b3c}.min-screen .head-wrapper .main-nav-list>li{padding:8px 14px 5px}.min-screen .nav-wrapper .sub-nav-list>li{margin-right:15px}.min-screen .nav-wrapper .show-detail{width:190px;padding-right:0}.min-screen .head-wrapper .main-logo{left:39%}.yoho-footer{font-size:12px}.yoho-footer *{box-sizing:border-box}.yoho-footer .red{color:#e01}.yoho-footer .rgb6{color:#666}.yoho-footer .rgb9{color:#999}.yoho-footer .rgbf{color:#fff}.yoho-footer .index-foot{background:#eee;padding:20px 0}.yoho-footer .index-foot dd{float:left;width:370px;margin-right:20px;overflow:hidden}.yoho-footer .index-foot dd ul{margin-top:18px;padding-top:18px}.yoho-footer .index-foot dd.last{margin-right:0}.yoho-footer .foot-panel{background:#fff;padding:20px}.yoho-footer .title{position:relative;text-align:center}.yoho-footer .title-line{border-bottom:1px solid #ddd;position:absolute;top:9px;width:100%;left:0}.yoho-footer .text{position:absolute;width:100%;text-align:center;left:0;top:0}.yoho-footer .text span{background:#fff;font-size:18px;line-height:18px;padding:0 10px}.yoho-footer .item-nav{padding-top:20px}.yoho-footer .item-nav span{color:#fff;padding:0 3px;cursor:pointer;font-size:20px}.yoho-footer .item-nav .cur{color:#999}.yoho-footer .vote{line-height:24px}.yoho-footer .vote input{margin:0 5px 0 1px}.yoho-footer .vote .button{height:24px;line-height:24px;width:55px;font-size:12px;margin-top:11px;margin-right:10px;background:#222;color:#fff;display:inline-block;text-align:center;cursor:pointer}.yoho-footer .vote p{height:24px;overflow:hidden}.yoho-footer .vote textarea{width:98%;height:68px;vertical-align:middle;margin:5px 0 0;resize:none}.yoho-footer .vote-item p{float:left;width:50%}.yoho-footer .mobile{margin-right:-10px}.yoho-footer .mobile li{margin-right:10px;float:left}.yoho-footer .mobile img{display:block;width:103px;height:131px}.yoho-footer .index-banner{width:100%;margin-top:20px}.yoho-footer .two-dim{margin-right:-10px;overflow:hidden}.yoho-footer .two-dim li{border:1px solid #ddd;padding:7px;margin-right:10px}.yoho-footer .two-dim li a{display:block}.yoho-footer .two-dim li p{text-align:center;margin-top:13px;margin-bottom:3px;line-height:12px}.yoho-footer .dim-img{display:block;width:87px;height:87px}.yoho-footer .dim-hover{position:absolute}.yoho-footer .dim-hover img{width:38px;height:38px}.yoho-footer .dim-active .dim-img{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"}.yoho-footer .dim-active .dim-hover{display:none}.yoho-footer .footerbottom{width:100%}.yoho-footer .promise{padding:20px 0 10px;background:#000}.yoho-footer .promise .left{margin-right:60px;line-height:30px;font-size:12px;font-weight:700}.yoho-footer .promise .left .iconfont{display:inline-block;font-weight:400;font-size:22px;vertical-align:middle;margin-right:5px}.yoho-footer .promise .left:first-child .iconfont{font-size:27px}.yoho-footer .subscribe{border:1px solid #262626;width:240px}.yoho-footer .subscribe input{width:180px;height:32px;padding:0 10px;line-height:32px;border:none;margin:0;background:#000}.yoho-footer .subscribe a{display:block;float:right;margin-right:20px;font-size:20px;line-height:28px;opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"}.yoho-footer .footer-help{background:#000;font-size:12px;overflow:hidden}.yoho-footer .footer-help>div{padding:15px 0;border-top:1px solid #262626}.yoho-footer .footer-help ul{width:110%}.yoho-footer .footer-help p{line-height:24px}.yoho-footer .footer-help p span{color:#fff}.yoho-footer .footer-help p a{color:#666}.yoho-footer .footer-help p a:hover{text-decoration:underline}.yoho-footer .footer-help li{width:180px}.yoho-footer .footer-help .screen{border-top:1px solid #262626;padding:15px 0}.yoho-footer .footer-link{background:#000;padding:10px 0 30px;font-size:12px}.yoho-footer .footer-link .right-flag{margin-top:3px}.yoho-footer .footer-link .right-flag a{margin-right:5px}.yoho-footer .footer-link .about-us{line-height:20px;color:#666;margin-left:10px}.yoho-footer .footer-link .about-us a{color:#666}.yoho-footer .footer-link .about-us span{padding:0 10px}.yoho-footer .return-top{position:fixed;width:60px;height:60px;left:50%;margin-left:595px;text-align:center;line-height:50px;color:#fff;background:#000;opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";bottom:20px;cursor:pointer;z-index:1}.yoho-footer .return-top .iconfont{font-size:34px}.yoho-footer .return-top:hover{opacity:.9;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=90)"}.yoho-footer .return-top.min{left:100%;right:20px;margin-left:auto}.min-screen .yoho-footer .index-foot dd{width:316px}.min-screen .yoho-footer .two-dim{margin-top:26px;margin-bottom:10px;overflow:hidden}.min-screen .yoho-footer .dim-img{width:69px;height:69px}.min-screen .yoho-footer .mobile{margin-top:26px;padding-bottom:15px}.min-screen .yoho-footer .mobile img{width:85px;height:108px}.min-screen .yoho-footer .promise .left{margin-right:45px}.min-screen .yoho-footer .subscribe{width:200px}.min-screen .yoho-footer .subscribe input{width:140px}.min-screen .yoho-footer .footer-help li{width:150px}.wrapper-404{padding:80px 0}.wrapper-404 .main-error{width:560px;height:240px;margin:0 auto}.wrapper-404 .main-error .text1{font-size:24px;margin-top:60px;line-height:24px}.wrapper-404 .main-error .text2{margin:18px 0 10px;line-height:12px}.wrapper-404 .main-error .text3 a{text-decoration:none;color:#666;font-size:12px;outline:none}
\ No newline at end of file
... ...
This diff could not be displayed because it is too large.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {
/***/ }
/******/ ]);
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?>
<!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 Wed May 11 14:40:20 2016
By admin
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
panose-1="2 0 6 3 0 0 0 0 0 0"
ascent="896"
descent="-128"
x-height="792"
bbox="0 -212 1158 896"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E606"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
<glyph glyph-name=".notdef" horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
<glyph glyph-name=".null" horiz-adv-x="0"
/>
<glyph glyph-name="nonmarkingreturn" horiz-adv-x="341"
/>
<glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
<glyph glyph-name="uniE600" unicode="&#xe600;" horiz-adv-x="1048"
d="M832 -126.5q0 -35.5 -25 -60.5t-60.5 -25t-60.5 25t-25 60.5t25 60.5t60.5 25t60.5 -25t25 -60.5zM533 -126.5q0 -35.5 -25 -60.5t-60 -25t-60 25t-25 60.5t25 60.5t60 25t60 -25t25 -60.5zM277 620l-35 159q-3 14 -15 23.5t-27 9.5h-147q-22 0 -37.5 -15.5t-15.5 -37.5
t15.5 -38t37.5 -16h54l157 -627q6 -25 25.5 -40t44.5 -15h527q25 0 44.5 15t25.5 40l113 452q9 34 -13 62t-57 28h-697z" />
<glyph glyph-name="uniE601" unicode="&#xe601;"
d="M505 337l2 -2q2 -1 3.5 -1t3.5 1l430 364q2 2 1 5.5t-5 3.5h-435h-424q-4 0 -5 -3.5t1 -5.5zM72 669q-3 2 -6 0.5t-3 -4.5v-584q0 -4 3.5 -5t5.5 1l288 346zM953 669.5q-3 1.5 -5 -0.5l-288 -246l287 -346q3 -2 6 -1t3 5v584q0 3 -3 4.5zM641 406l-131 -111l-5 5
l-125 103l-275 -328q-2 -3 -1 -6t5 -3h396h407q4 0 5 3t-1 6z" />
<glyph glyph-name="uniE602" unicode="&#xe602;" horiz-adv-x="1048"
d="M297.5 528q-20.5 0 -35 -14.5t-14.5 -35t14.5 -35.5t35 -15t35.5 15t15 35.5t-15 35t-35.5 14.5zM381 251q0 96 84 164t202 68t202 -68t84 -163.5t-84 -163.5t-202 -68t-202 68t-84 163zM286 251q0 -17 2 -35v1q-88 42 -140.5 114t-52.5 157t51.5 157t139.5 114t192 42
q142 0 249.5 -76.5t128.5 -189.5q-88 43 -189 43q-104 0 -191.5 -43.5t-138.5 -119t-51 -164.5zM953 36q95 93 95 215t-94 214q2 20 2 23q0 111 -64 205t-174.5 148.5t-240 54.5t-239.5 -54.5t-174 -148.5t-64 -205q0 -78 33 -148.5t93 -125.5l-77 -123q-8 -12 -6.5 -26
t10.5 -25q13 -15 32 -15q9 0 18 4l180 80q4 2 7 4q20 -7 39 -12q48 -80 138.5 -128t199.5 -48q75 0 145 25q1 -1 2 -1l140 -62q8 -4 17 -4q20 0 32 15q10 10 11 24t-7 26zM527 282q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11z
M667 282q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11zM806 282q-16 0 -27 -11t-11 -27t11 -27.5t27 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11z" />
<glyph glyph-name="uniE603" unicode="&#xe603;" horiz-adv-x="1158"
d="M1069 181h-245v378h132l113 -169v-209zM1158 417l-155 231h-268v-467h-45v508q0 20 -14 34t-34 14h-63l-67 -89h89v-467h-512v467h45l22 89h-108q-20 0 -34 -14t-14 -34v-549q0 -20 14 -34t34 -14h139q-33 -37 -33 -87q0 -53 37.5 -91t91 -38t91.5 38t38 91q0 50 -34 87
h264h191q-34 -37 -34 -87q0 -53 38 -91t91.5 -38t91 38t37.5 91q0 50 -33 87h134v325zM326 668q-89 -153 -94 -296v-12h129v12q0 43 17 112q17 68 39 116q27 61 67.5 118t62.5 79l4 3v96h-390l-2 -114h245q-33 -40 -78 -114z" />
<glyph glyph-name="uniE604" unicode="&#xe604;"
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.5zM751 552v83h-473v-83h206v-298h-72v237h-87v-237h-66v-84h506v84h-193v119h151v83h-151v96h179z" />
<glyph glyph-name="uniE605" unicode="&#xe605;"
d="M903 577l-68 69l-388 -388l-231 230l-68 -68l299 -298l65 65z" />
<glyph glyph-name="uniE606" unicode="&#xe606;"
d="M512 599q47 0 88 -18t72 -49t49 -72t18 -89q0 -46 -18 -87t-49 -72t-72 -49t-88 -18t-88 18t-72 49t-49 72t-18 87q0 48 18 89t49 72t72 49t88 18v0zM512 599z" />
</font>
</defs></svg>
... ...
No preview for this file type
... ... @@ -2,11 +2,11 @@
<!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 Tue May 3 14:50:34 2016
Created by FontForge 20120731 at Wed May 11 14:40:20 2016
By admin
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1048" >
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Tue May 3 14:50:34 2016
bbox="0 -212 1158 896"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E604"
unicode-range="U+0078-E606"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -33,13 +33,13 @@ d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
<glyph glyph-name="uniE600" unicode="&#xe600;"
<glyph glyph-name="uniE600" unicode="&#xe600;" horiz-adv-x="1048"
d="M832 -126.5q0 -35.5 -25 -60.5t-60.5 -25t-60.5 25t-25 60.5t25 60.5t60.5 25t60.5 -25t25 -60.5zM533 -126.5q0 -35.5 -25 -60.5t-60 -25t-60 25t-25 60.5t25 60.5t60 25t60 -25t25 -60.5zM277 620l-35 159q-3 14 -15 23.5t-27 9.5h-147q-22 0 -37.5 -15.5t-15.5 -37.5
t15.5 -38t37.5 -16h54l157 -627q6 -25 25.5 -40t44.5 -15h527q25 0 44.5 15t25.5 40l113 452q9 34 -13 62t-57 28h-697z" />
<glyph glyph-name="uniE601" unicode="&#xe601;" horiz-adv-x="1024"
<glyph glyph-name="uniE601" unicode="&#xe601;"
d="M505 337l2 -2q2 -1 3.5 -1t3.5 1l430 364q2 2 1 5.5t-5 3.5h-435h-424q-4 0 -5 -3.5t1 -5.5zM72 669q-3 2 -6 0.5t-3 -4.5v-584q0 -4 3.5 -5t5.5 1l288 346zM953 669.5q-3 1.5 -5 -0.5l-288 -246l287 -346q3 -2 6 -1t3 5v584q0 3 -3 4.5zM641 406l-131 -111l-5 5
l-125 103l-275 -328q-2 -3 -1 -6t5 -3h396h407q4 0 5 3t-1 6z" />
<glyph glyph-name="uniE602" unicode="&#xe602;"
<glyph glyph-name="uniE602" unicode="&#xe602;" horiz-adv-x="1048"
d="M297.5 528q-20.5 0 -35 -14.5t-14.5 -35t14.5 -35.5t35 -15t35.5 15t15 35.5t-15 35t-35.5 14.5zM381 251q0 96 84 164t202 68t202 -68t84 -163.5t-84 -163.5t-202 -68t-202 68t-84 163zM286 251q0 -17 2 -35v1q-88 42 -140.5 114t-52.5 157t51.5 157t139.5 114t192 42
q142 0 249.5 -76.5t128.5 -189.5q-88 43 -189 43q-104 0 -191.5 -43.5t-138.5 -119t-51 -164.5zM953 36q95 93 95 215t-94 214q2 20 2 23q0 111 -64 205t-174.5 148.5t-240 54.5t-239.5 -54.5t-174 -148.5t-64 -205q0 -78 33 -148.5t93 -125.5l-77 -123q-8 -12 -6.5 -26
t10.5 -25q13 -15 32 -15q9 0 18 4l180 80q4 2 7 4q20 -7 39 -12q48 -80 138.5 -128t199.5 -48q75 0 145 25q1 -1 2 -1l140 -62q8 -4 17 -4q20 0 32 15q10 10 11 24t-7 26zM527 282q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11z
... ... @@ -47,8 +47,12 @@ M667 282q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5t27.5 11.5t11.5 27.5t-11
<glyph glyph-name="uniE603" unicode="&#xe603;" horiz-adv-x="1158"
d="M1069 181h-245v378h132l113 -169v-209zM1158 417l-155 231h-268v-467h-45v508q0 20 -14 34t-34 14h-63l-67 -89h89v-467h-512v467h45l22 89h-108q-20 0 -34 -14t-14 -34v-549q0 -20 14 -34t34 -14h139q-33 -37 -33 -87q0 -53 37.5 -91t91 -38t91.5 38t38 91q0 50 -34 87
h264h191q-34 -37 -34 -87q0 -53 38 -91t91.5 -38t91 38t37.5 91q0 50 -33 87h134v325zM326 668q-89 -153 -94 -296v-12h129v12q0 43 17 112q17 68 39 116q27 61 67.5 118t62.5 79l4 3v96h-390l-2 -114h245q-33 -40 -78 -114z" />
<glyph glyph-name="uniE604" unicode="&#xe604;" horiz-adv-x="1024"
<glyph glyph-name="uniE604" unicode="&#xe604;"
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.5zM751 552v83h-473v-83h206v-298h-72v237h-87v-237h-66v-84h506v84h-193v119h151v83h-151v96h179z" />
<glyph glyph-name="uniE605" unicode="&#xe605;"
d="M903 577l-68 69l-388 -388l-231 230l-68 -68l299 -298l65 65z" />
<glyph glyph-name="uniE606" unicode="&#xe606;"
d="M512 599q47 0 88 -18t72 -49t49 -72t18 -89q0 -46 -18 -87t-49 -72t-72 -49t-88 -18t-88 18t-72 49t-49 72t-18 87q0 48 18 89t49 72t72 49t88 18v0zM512 599z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -61,7 +61,8 @@ const postcssPlugin = (et) => {
// assets & sprites config in both dev and pro
if (et === env.pro) {
assets = {
loadPaths: [dist.img, dist.font]
loadPaths: [dist.img, dist.font],
relativeTo: dist.css
};
Object.assign(sprites, {
... ...
... ... @@ -8,7 +8,6 @@ var $ = require('yoho-jquery');
var $body = $('body');
require('./footer');
function cookie(name) {
var re = new RegExp(name + '=([^;$]*)', 'i'),
... ... @@ -99,7 +98,7 @@ function getShoppingKey() {
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
}(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas'));
(function() {
var uid = getUid();
... ... @@ -177,3 +176,6 @@ window.getUid = getUid;
window.getShoppingKey = getShoppingKey;
window.queryString = queryString;
require('./header');
require('./footer');
... ...
... ... @@ -4,10 +4,13 @@
* @date: 2015/12/01
*/
var $ = require('yoho-jquery');
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
var $returnTop = $('.return-top');
lazyLoad($('img.lazy'));
/**
* 订阅
* @return {[type]} [description]
... ... @@ -18,8 +21,8 @@ function actionSubscription() {
emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/;
var iconCode = {
mail: '&#xe61b;',
tick: '&#xe61a'
mail: '&#xe601;',
tick: '&#xe605;'
};
$subscriberBox.focus(function() {
... ... @@ -33,7 +36,7 @@ function actionSubscription() {
if (email !== '' && emailReg.test(email)) {
try {
$.ajax({
url: 'http://www.yohobuy.com/common/emailSubscriber',
url: 'http://new.yohobuy.com/common/emailsubscriber',
dataType: 'jsonp',
data: {
email: email,
... ... @@ -94,7 +97,7 @@ function actionhomeFootChange() {
});
$.ajax({
url: 'http://www.yohobuy.com/common/suggestFeedback',
url: 'http://new.yohobuy.com/common/suggestfeedback',
dataType: 'jsonp',
data: {
feedback_id: _feedback || 0,
... ... @@ -107,7 +110,7 @@ function actionhomeFootChange() {
if (~~data.data.result === 1) {
if (index === count - 1) {
alert('感谢您的参与!');
alert('感谢您的参与!'); // eslint-disable-line
return;
}
... ...
... ... @@ -3,10 +3,8 @@
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/5/9
*/
/* eslint-disable */
var $ = require('yoho-jquery');
// handlebars = require('yoho.handlebars'),
// json2 = require('json2');
var $ = require('yoho-jquery'),
handlebars = require('yoho-handlebars');
var $tool = $('.tool-wrapper'),
$yohoGroup = $tool.find('.yoho-group'),
... ... @@ -21,29 +19,25 @@ var $head = $('.head-wrapper'),
var $subNav = $('.sub-nav-list .contain-third');
var apiDomain = $('#api-domain').val(), // 获取登陆状态的地址
apiBanner = 'http://new.yohobuy.com/common/getbanner',
thirdLineNum = 9,
var thirdLineNum = 9,
delayer,
centerFn,
loginFn,
cartFn;
$('#api-domain').remove(); // 删除地址信息
// handlebars模板
// centerFn = handlebars.compile($('#simple-account-info-tpl').html());
// loginFn = handlebars.compile($('#header-login-info-tpl').html());
// cartFn = handlebars.compile($('#mini-cart-tpl').html());
centerFn = handlebars.compile($('#simple-account-info-tpl').html());
loginFn = handlebars.compile($('#header-login-info-tpl').html());
cartFn = handlebars.compile($('#mini-cart-tpl').html());
// handlebars helper
// handlebars.registerHelper('notzero', function(v1, options) {
// if (v1 !== '0') {
// return options.fn(this);
// } else {
// return options.inverse(this);
// }
// });
handlebars.registerHelper('notzero', function(v1, options) {
if (v1 !== '0') {
return options.fn(this);
} else {
return options.inverse(this);
}
});
// 格式化三级菜单
function formatThirdMenu() {
... ... @@ -91,7 +85,7 @@ function syncLoginInfo() {
method: 'open.passport.get'
};
$.getJSON(apiDomain + '/?callback=?', param, function(jsonData) {
$.getJSON('http://www.yohobuy.com/common/passport/?callback=?', param, function(jsonData) {
if (jsonData && jsonData.data && jsonData.data.result !== -1) {
updateLoginInfo(jsonData.data.data);
} else {
... ... @@ -110,7 +104,7 @@ function searchSuggest(key) {
query: key
};
$.getJSON('http://search.yohobuy.com/api/suggest/?callback=?', param, function(jsonData) {
$.getJSON('http://search.yohobuy.com/api/suggest?callback=?', param, function(jsonData) {
if (jsonData.code === 200) {
if (jsonData.data && jsonData.data.length) {
$searchSug.html(jsonData.data).show();
... ... @@ -123,72 +117,72 @@ function searchSuggest(key) {
// 同步mini购物车数据
function syncCratInfo(strG) {
// var info, total;
//
// if (strG) {
// window.setCookie('_g', strG, {
// path: '/',
// domain: '.yohobuy.com'
// });
// }
// if (window.cookie('_g')) {
// info = json2.parse(window.cookie('_g'));
// total = parseInt(info._nac) + parseInt(info._ac);
// total = total > 0 ? total : 0;
// $goCart.data({
// key: info._k,
// num: total
// });
// $goodsNum.text(total);
// }
var info, total;
if (strG) {
window.setCookie('_g', strG, {
path: '/',
domain: '.yohobuy.com'
});
}
if (window.cookie('_g')) {
info = $.parseJSON(window.cookie('_g'));
total = parseInt(info._nac, 10) + parseInt(info._ac, 10);
total = total > 0 ? total : 0;
$goCart.data({
key: info._k,
num: total
});
$goodsNum.text(total);
}
}
function loadCartDetail(key) {
// var param = {
// return_type: 'jsonp',
// method: 'open.Shoppingcart.getCartData',
// shopping_key: key
// };
//
// $.getJSON(apiDomain + '/?callback=?', param, function(jsonData) {
// var totalGoods, data;
//
// if (jsonData.code === 200) {
// data = jsonData.data;
// totalGoods = $.merge(data.main_goods, data.advance_goods);
// totalGoods = $.merge(totalGoods, data.outlet_goods);
// totalGoods = $.merge(totalGoods, data.gift_goods);
// totalGoods = $.merge(totalGoods, data.need_pay_gifts);
// if (totalGoods && totalGoods.length) {
// data.totalGoods = totalGoods;
// $miniCart.html(cartFn({
// carData: data
// }));
// } else {
// $miniCart.html('<div class="empty-cart"><h3>您的购物车暂无商品</h3></div>');
// }
// }
// });
var param = {
return_type: 'jsonp',
method: 'open.Shoppingcart.getCartData',
shopping_key: key
};
$.getJSON('http://www.yohobuy.com/common/shoppingCart/?callback=?', param, function(jsonData) {
var totalGoods, data;
if (jsonData.code === 200) {
data = jsonData.data;
totalGoods = $.merge(data.main_goods, data.advance_goods);
totalGoods = $.merge(totalGoods, data.outlet_goods);
totalGoods = $.merge(totalGoods, data.gift_goods);
totalGoods = $.merge(totalGoods, data.need_pay_gifts);
if (totalGoods && totalGoods.length) {
data.totalGoods = totalGoods;
$miniCart.html(cartFn({
carData: data
}));
} else {
$miniCart.html('<div class="empty-cart"><h3>您的购物车暂无商品</h3></div>');
}
}
});
}
function delCartGoods(data, callback) {
// var param = {
// return_type: 'jsonp',
// method: 'open.Shoppingcart.delone',
// shopping_key: data.key,
// id: data.id,
// isreduce: data.isreduce
// };
//
// $.getJSON(apiDomain + '/?callback=?', param, function(jsonData) {
// var strG = '';
//
// if (jsonData.code === 200) {
// callback();
// strG = '{"_k":"' + data.key + '","_nac":' + jsonData.data.total_goods_num + ',"_ac":0,"_r":0}';
// syncCratInfo(strG);
// }
// });
var param = {
return_type: 'jsonp',
method: 'open.Shoppingcart.delone',
shopping_key: data.key,
id: data.id,
isreduce: data.isreduce
};
$.getJSON('http://www.yohobuy.com/common/shoppingCart/?callback=?', param, function(jsonData) {
var strG = '';
if (jsonData.code === 200) {
strG = '{"_k":"' + data.key + '","_nac":' + jsonData.data.total_goods_num + ',"_ac":0,"_r":0}';
syncCratInfo(strG);
return callback();
}
});
}
syncLoginInfo();
... ... @@ -240,9 +234,10 @@ $searchForm.on('keyup', '.search-key', function(e) {
$(this).val(val);
searchSuggest(val);
}
// http://search.yohobuy.com/api/suggest
// searchSuggest
}).on('blur', '.search-key', function() {
setTimeout(function() {
$searchSug.hide();
}, 200);
});
$goCart.hover(function() {
... ... @@ -265,7 +260,7 @@ $goCart.hover(function() {
$goCart.removeClass('on-hover');
});
$goCart.on('click', '.cart-goods-del', function(e) {
$goCart.on('click', '.cart-goods-del', function() {
var $dom = $(this),
data = $dom.data(),
callback;
... ... @@ -297,14 +292,14 @@ $subNav.on({
param.width = 174;
param.height = 155;
param._ = new Date();
// $.getJSON(apiBanner + '/?callback=?', param, function(JsonData) {
// if (JsonData.code === 200) {
// $show.addClass('show');
// $show.find('img').attr('src', JsonData.data.src);
// $show.find('a').attr('href', JsonData.data.url);
// $show.find('.title').text(JsonData.data.title);
// }
// });
$.getJSON('http://new.yohobuy.com/common/getbanner?callback=?', param, function(JsonData) {
if (JsonData.code === 200) {
$show.addClass('show');
$show.find('img').attr('src', JsonData.data.src);
$show.find('a').attr('href', JsonData.data.url);
$show.find('.title').text(JsonData.data.title);
}
});
},
mouseleave: function() {
var $thirdNav = $(this).children('.third-nav-wrapper');
... ... @@ -315,6 +310,3 @@ $subNav.on({
$thirdNav.hide();
}
});
/* eslint-ensable */
... ...
require('../header');
require('../common');
... ...
... ... @@ -387,4 +387,4 @@
.footer-help li {
width: 150px;
}
}
}
... ...
... ... @@ -48,6 +48,7 @@
span {
display: inline-block;
vertical-align: middle;
line-height: 30px;
}
.hi {
... ... @@ -343,7 +344,7 @@
border: none;
background: #fff;
box-sizing: border-box;
padding: 7px 0 7px 10px;
padding: 7px 0 9px 10px;
}
.search-btn {
... ... @@ -415,7 +416,7 @@
top: 30px;
right: -14px;
width: 378px;
background: #f8f8f8 reslove('layout/empty_car.png') no-repeat 106px 132px;
background: #f8f8f8 resolve('layout/empty_car.png') no-repeat 106px 132px;
z-index: 1000;
display: none;
... ...
/**
* http api 测试
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 2016/05/17
*/
'use strict';
const test = require('ava');
const sign = require('../../library/sign');
const API = require('../../library/api').API;
const ServiceAPI = require('../../library/api').ServiceAPI;
const SearchAPI = require('../../library/api').SearchAPI;
const getUrl = 'operations/api/v6/category/getCategory';
test('api constructor test', (t) => {
let api = new ServiceAPI();
let api2 = new API();
let api3 = new SearchAPI();
t.true(api !== null);
t.true(api2 !== null);
t.true(api3 !== null);
});
test('api get test', t => {
let api = new ServiceAPI();
return api.get(getUrl, sign.apiSign({})).then(result => {
if (result && result.code) {
t.pass();
} else {
t.fail();
}
});
});
test('api get test, api return an error', t => {
let api = new ServiceAPI();
return api.get(getUrl + '/error', sign.apiSign({})).catch(err => {
// 故意调用一个错误的接口
if (err && err.code === 500) {
t.pass();
} else {
t.fail();
}
});
});
test('api get use cache test', t => {
let api = new ServiceAPI();
return api.get(getUrl, sign.apiSign({}), true).then(result => {
if (result && result.code) {
t.pass();
} else {
t.fail();
}
});
});
test('api post test', t => {
let api = new ServiceAPI();
return api.post(getUrl, sign.apiSign({})).then(result => {
if (result && result.code) {
t.pass();
} else {
t.fail();
}
});
});
test('api multiple call test', (t) => {
let api = new ServiceAPI();
let multi = [api.get(getUrl, sign.apiSign({})), api.get(getUrl, sign.apiSign({}))];
return api.all(multi).then(result => {
if (result.length === 2) {
t.pass();
} else {
t.fail();
}
});
});
test('api multiple fail call test', (t) => {
let api = new ServiceAPI();
return api.all(1).catch((e) => {
if (e) {
t.pass();
} else {
t.fail();
}
});
});
... ...
/**
* cache 测试
*
* @author: jf<jeff.jiang@yoho.cn>
* @date: 2016/5/18
*/
'use strict';
import test from 'ava';
import cache from '../../library/cache';
let testKey = 'test_unit_key:' + (new Date()).getTime();
let testValue = 'anotherValue';
let anotherKey = 'test_unit_key2:' + (new Date()).getTime();
let anotherValue = {a: 1};
let slaveTestKey = 'test_unit_key3:' + (new Date()).getTime();
let slaveTestValue = 'anotherValue3';
test.before('set test key', (t) => {
cache.set(testKey, testValue);
cache.set(anotherKey, anotherValue);
t.pass();
});
test.after('del test key', (t) => {
cache.del(testKey);
cache.del(anotherKey);
t.pass();
});
test('cache get test', (t) => {
return cache.get(testKey).then((v) => {
t.is(v, testValue);
});
});
test('cache get multi test', (t) => {
cache.set(anotherKey, anotherValue);
return cache.getMulti([testKey, anotherKey]).then((values) => {
t.is(values[testKey], testValue);
t.is(values[anotherKey], JSON.stringify(anotherValue));
});
});
test('cache get from slave test', (t) => {
return cache.getFromSlave(testKey).then((v) => {
t.is(v, testValue);
});
});
test('cache get multi from slave test', (t) => {
cache.set(anotherKey, anotherValue);
return cache.getMultiFromSlave([testKey, anotherKey]).then((values) => {
t.is(values[testKey], testValue);
t.is(values[anotherKey], JSON.stringify(anotherValue));
});
});
test('cache set to slave', (t) => {
return cache.setSlave(slaveTestKey, {
value: slaveTestValue
}).then(() => {
return cache.getFromSlave(slaveTestKey);
}).then((v) => {
v = JSON.parse(v);
t.is(v.value, slaveTestValue);
cache.del(slaveTestKey);
});
});
test('cache get test, key is not a string', (t) => {
return cache.get(123).then((v) => {
t.notOk(v);
});
});
test('cache get multi test, key is not an array', (t) => {
return cache.getMulti(123).then((v) => {
t.notOk(v);
});
});
test('cache get from slave test, key is not a string', (t) => {
return cache.getFromSlave(123).then((v) => {
t.notOk(v);
});
});
test('cache get multi from slave test, key is not an array', (t) => {
return cache.getMultiFromSlave(123).then((v) => {
t.notOk(v);
});
});
test('cache set test, key is not a string', (t) => {
return cache.set(123).then((v) => {
t.notOk(v);
});
});
test('cache set multi test, key is not an array', (t) => {
return cache.setSlave(123).then((v) => {
t.notOk(v);
});
});
test('cache del test, key is not a string', (t) => {
return cache.del(123).then((v) => {
t.notOk(v);
});
});
... ...
/**
* 对象键名驼峰测试
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 2016/05/17
*/
import {test} from 'ava';
const camelCase = require('../../library/camel-case');
test('camel case object', t => {
let o = {
A_B: 'ab_cd'
};
t.is(camelCase(o).aB, 'ab_cd');
});
test('camel case array', t => {
let arr = [{
A_B: 'ab_cd'
}, {
A_B: 'ab_cd'
}];
t.is(camelCase(arr)[1].aB, 'ab_cd');
});
... ...
/**
* library helpers 类单元测试
* @author jeff.jiang<jeff.jiang@yoho.cn>
* @date 2016/05/17
*/
'use strict';
const test = require('ava');
const helpers = require('../../library/helpers');
test('qiniu image url handle', t => {
let url = 'http://img11.static.yhbimg.com/yhb-img01/2016/04/18/03/016d50b20cfdec5a91c614b68546bc9d72.jpg?imageView2/{mode}/w/{width}/h/{height}';
let expected = 'http://img11.static.yhbimg.com/yhb-img01/2016/04/18/03/016d50b20cfdec5a91c614b68546bc9d72.jpg?imageView2/2/w/400/h/300';
t.is(helpers.image(url, 400, 300), expected);
});
test('uri format', t => {
let uri = '/test';
let qs = { name: 'yoho' };
let mod = 'list';
let expected = '//list.m.yohobuy.com/test?name=yoho';
t.is(helpers.urlFormat(uri, qs, mod), expected);
});
test('upper char to lowercase', t => {
let str = 'ABc';
let expected = 'abc';
t.is(helpers.lowerCase(str), expected);
});
test('lower char to uppercase', t => {
let str = 'abc!';
let expected = 'ABC!';
t.is(helpers.upperCase(str), expected);
});
... ...
/**
* logger 工具类测试
*/
const test = require('ava');
const logger = require('../../library/logger');
test('logger error test', t => {
logger.error('error test', () => {
t.pass();
});
});
test('logger info test', t => {
logger.info('info test', () => {
t.pass();
});
});
... ...
/**
* 签名类测试
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 2016/05/17
*/
const test = require('ava');
const sign = require('../../library/sign');
test('app sign test', t => {
let params = {
client_type: 'h5', // eslint-disable-line
a: 1,
b: 'b'
};
let signedParams = sign.apiSign(params);
t.true(sign.checkSign(signedParams));
});
test('app sign test webSign', t => {
let params = {
uid: '123',
key: '3fc5a9fcea9fea49cce5432202a167ad'
};
t.true(sign.webSign(params));
});
... ...
let expect = require('expect.js');
let Timer = require('../../library/timer');
/**
* Timer 计时类测试
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 2016/05/17
*/
const test = require('ava');
const Timer = require('../../library/timer');
describe('/library/timer', function() { // eslint-disable-line
it('延迟100ms,期望大于或等于100ms', function(done) {// eslint-disable-line
let t = new Timer();
const sleep = (timeout) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, timeout);
});
};
test.cb('timer class ', t => {
let timer = new Timer();
t.put('aa');
setTimeout(function() {
let time = t.put('aa');
timer.put('test');
sleep(300).then(() => {
let diff = timer.put('test');
expect(Math.round(time) >= 100).to.be.ok();
done();
}, 100);
t.true(diff >= 300);
t.end();
});
});
... ...
require('./library/timer.test');