Authored by htoooth

Merge remote-tracking branch 'origin/release/1.0' into release/1.0

# Conflicts:
#	config/common.js
Showing 58 changed files with 1124 additions and 450 deletions
... ... @@ -16,7 +16,7 @@ const index = (req, res, next) => {
// let gender = req.query.brand || 1;
editorialModel.getIndexData(type, pageNum, limit).then((result) => {
console.log();
res.display('index', {
module: 'editorial',
page: 'index',
... ... @@ -34,7 +34,7 @@ const index = (req, res, next) => {
}
],
msgTypes: result.msgTypes,
msg: result.msg.list.artList,
msg: result.msg.tabs,
paginationOpts: {
page: pageNum, // current page: http://host/?page=2
limit: 20, // per_page records' number
... ... @@ -58,12 +58,13 @@ const index = (req, res, next) => {
const list = (req, res) => {
let pageNum = req.query.page || 1;
let limit = req.query.limit || 20;
let tag = req.params.tag || '暗黑';
let authorId = req.params.authorId || 0;
let tag = req.query.query;
let authorId = req.query.authorId;
// let curChannel = getChannelData(req.channel, req.query.query);
editorialModel.getListData(pageNum, limit, tag, authorId).then((result) => {
res.display('list', {
module: 'editorial',
page: 'list',
... ... @@ -85,8 +86,8 @@ const list = (req, res) => {
name: req.query.query
}
],
pathTitle: req.query.query,
msg: result.list.artList,
pathTitle: req.query.query || result.authorName,
msg: result.tabs,
paginationOpts: {
page: pageNum, // current page: http://host/?page=2
limit: 20, // per_page records' number
... ... @@ -103,7 +104,7 @@ const list = (req, res) => {
};
const detail = (req, res, next) => {
let id = req.params.id || 52571;
let id = req.params.id;
editorialModel.getDetailData(id).then((result) => {
res.display('detail', {
... ... @@ -127,8 +128,9 @@ const detail = (req, res, next) => {
name: result.head.title
}
],
id: id,
header: result.head,
content: result.content,
content: result.content.contents,
tags: result.tags,
userInfo: result.head,
comment: result.comment,
... ... @@ -137,56 +139,10 @@ const detail = (req, res, next) => {
nextChapter: '来来来,让我们好好聊聊',
lastChapter: '除了黑白灰'
},
// content: {
// goods: [
// {
// img: 'http://placehold.it/274x366',
// link: '',
// name: 'Fred Perry Bomber jacket',
// price: '1015.00'
// }
// ]
// },
// relatedGoods: {
// relatedTitle: '推荐搭配',
// goods: [
// {
// img: 'http://placehold.it/274x366',
// link: '',
// name: 'Fred Perry Bomber jacket',
// price: '1015.00'
// }
//
// ]
// }
// },
// brands: [
// {
// url: 'http://placehold.it/274x366',
// thumb: 'wed',
// name: 'Fred Perry'
// },
// {
// url: 'http://placehold.it/274x366',
// thumb: 'wed',
// name: 'Fred Perry'
// },
// {
// url: 'http://placehold.it/274x366',
// thumb: 'wed',
// name: 'Fred Perry'
// },
// {
// url: 'http://placehold.it/274x366',
// thumb: 'wed',
// name: 'Fred Perry'
// }
// ],
share: {
shareImg: 'hjchsk',
shareDesc: 'wjhdfwe',
weixinUrl: 'www.baidu.com'
shareImg: result.content.shareImg,
shareDesc: result.head.title,
weixinUrl: req.originalUrl
}
... ... @@ -202,7 +158,7 @@ const detail = (req, res, next) => {
let setCollect = (req, res, next) => {
let uid = req.user.uid;
let id = req.params.id || 52571;
let id = req.body.id;
editorialModel.setCollect(id, uid).then((result) => {
res.json(result);
... ... @@ -211,7 +167,7 @@ let setCollect = (req, res, next) => {
let cancelCollect = (req, res, next) => {
let uid = req.user.uid;
let id = req.params.id || 52571;
let id = req.body.id;
editorialModel.setCollect(id, uid).then((result) => {
res.json(result);
... ... @@ -221,7 +177,7 @@ let cancelCollect = (req, res, next) => {
// 点赞
let setPraise = (req, res, next) => {
let udid = req.user.uid;
let id = req.params.id || 52571;
let id = req.query.id;
editorialModel.setPraise(id, udid).then((result) => {
res.json(result);
... ... @@ -230,7 +186,7 @@ let setPraise = (req, res, next) => {
let cancelPraise = (req, res, next) => {
let udid = req.user.uid;
let id = req.params.id || 52571;
let id = req.query.id;
editorialModel.cancelPraise(id, udid).then((result) => {
res.json(result);
... ... @@ -239,10 +195,10 @@ let cancelPraise = (req, res, next) => {
let addComment = (req, res, next) => {
let uid = req.user.uid;
let id = req.params.id || 52571;
let content = req.body.content;
let id = req.body.id;
let content = req.body.comment;
editorialModel.setCollect(id, uid, content).then((result) => {
editorialModel.addComment(id, uid, content).then((result) => {
res.json(result);
}).catch(next);
};
... ...
... ... @@ -33,7 +33,17 @@ const _processListData = (list) => {
list = list || [];
list = camelCase(list);
_.forEach(list.list.artList, (data) => {
let listData = {
tabs: []
};
_.forEach(list.list.artList, (data, index) => {
if (index === 0) {
listData = _.assign(listData, {
authorName: data.author.name
});
}
data.publishTime = data.publishTime.replace(/年|月/g, '/');
data.publishTime = data.publishTime.replace(/日/g, '');
... ... @@ -44,8 +54,9 @@ const _processListData = (list) => {
}
});
listData.tabs = list.list.artList;
return list;
return listData;
};
const _getResources = (type) => {
... ... @@ -87,12 +98,20 @@ const getIndexData = (type, pageNum, limit) => {
};
const getListData = (pageNum, limit, tag, authorId) => {
return serviceAPI.get('guang/api/*/article/getList', {
let param = {
page: pageNum,
limit: limit,
tag: tag,
author_id: authorId
}).then((result) => {
limit: limit
};
if (tag) {
param.tag = tag;
}
if (authorId) {
param.author_id = authorId;
}
return serviceAPI.get('guang/api/*/article/getList', param).then((result) => {
if (result && result.code === 200) {
return _processListData(result.data);
} else {
... ... @@ -103,7 +122,6 @@ const getListData = (pageNum, limit, tag, authorId) => {
};
// 详情页
const _getAuthorData = (id) => {
return serviceAPI.get('/guang/service/*/author/getAuthor', {
... ... @@ -157,7 +175,8 @@ const _processHeadData = (list) => {
if (index === 1) {
newData.headData = _.assign(newData.headData, {
authorId: data.authorId
authorId: data.authorId,
authorUrl: `/editorial/list/?authorId=${data.authorId}`
});
_.forEach(data.tags, function(value) {
... ... @@ -185,7 +204,6 @@ const _processHeadData = (list) => {
let data = yield _getAuthorData(id);
newData.headData = _.assign(newData.headData, {
authorUrl: data.url,
avatar: data.avatar,
name: data.name
});
... ... @@ -194,65 +212,36 @@ const _processHeadData = (list) => {
})();
};
// const _getGoodsSort = (skn) => {
// return api.get('', {
// product_skn: 51137901,
// method: 'h5.product.data'
// }).then((result) => {
// if (result && result.code === 200) {
// console.log(result)
// return result;
// } else {
// logger.error('数据返回 code 不是 200');
// return {};
// }
// });
// };
const _processContentData = (list) => {
list = list || [];
list = camelCase(list);
_.forEach(list, function(data) {
if (data.text) {
data.text.data.text = data.text.data.text.replace(/<.*?>/ig, '');
}
// if (data.goods) {
// console.log(data.goods)
// _.forEach(data.goods, function(data, index) {
let contentData = {
contents: []
};
// console.log(index)
// _.forEach(data, function(value) {
// // console.log(value)
// // // _getGoodsSort(value.id);
_.forEach(list, function(value) {
// });
// });
if (value.singleImage) {
_.forEach(value.singleImage.data, function(data, index) {
if (index === 0) {
contentData = _.assign(contentData, {
shareImg: data.src
});
}
// }
});
return false;
}
});
return list;
};
// // const _processCommentsData = (list) => {
// // list = list || [];
// // list = camelCase(list);
// // //let commentNum = list.list.length;
// // console.log(list)
// // }
contentData.contents = list;
return contentData;
};
// // head数据
// head数据
const _getHeadData = (id) => {
return serviceAPI.get('/guang/api/*/article/getArticleBaseInfo', {
id: id
... ... @@ -316,7 +305,7 @@ const _getRelateBrand = (id) => {
if (result && result.code === 200) {
return camelCase(result.data);
} else {
logger.error('相关文章数据返回 code 不是 200');
logger.error('相关品牌返回 code 不是 200');
return {};
}
});
... ...
... ... @@ -2,7 +2,7 @@
{{# editorialDetail}}
{{> path-nav}}
<div class="detail-body">
<div class="detail-body" data-id="{{id}}">
{{# header}}
<div class="detail-title">{{title}}</div>
... ... @@ -37,12 +37,12 @@
{{# text}}
<div class="article-text block">
{{# data}}
<p>{{text}}</p>
<p>{{{text}}}</p>
{{/ data}}
</div>
{{/ text}}
{{# goodsGroup}}
{{!-- {{# goodsGroup}}
<div class="related-reco">
<div class="article-title">
<div class="title-line"></div>
... ... @@ -71,7 +71,7 @@
{{/ goods}}
</div>
</div>
{{/ relatedGoods}}
{{/ relatedGoods}} --}}
{{/ content}}
{{#if brands}}
... ... @@ -122,7 +122,7 @@
<div class="article-tag">
<i class="tag-icon iconfont">&#xe648;</i>
<ul>
<ul id="tags">
{{# tags}}
<li>
<a href="{{url}}" target="_blank">{{name}}</a>
... ...
... ... @@ -14,12 +14,9 @@ const accountModel = require('../models/account');
*/
const changePwd = (req, res) => {
let uid = req.user.uid;
// let uid = req.user.uid||"20000190" ;
let pwd = req.body.password;
accountModel.changePwd(uid, pwd).then(result=> {
// console.log("修改result", result);
res.send(result);
});
};
... ... @@ -31,14 +28,10 @@ const changePwd = (req, res) => {
*/
const checkVerifyMobile = (req, res)=> {
let uid = req.user.uid;
// let uid = req.user.uid||"20000190";
let mobile = req.body.mobile;
let area = req.body.area;
// console.log(uid, mobile, area);
accountModel.checkVerifyMobile(uid, mobile, area).then(result=> {
// console.log("验证手机号码", result);
res.send(result);
});
};
... ... @@ -50,14 +43,10 @@ const checkVerifyMobile = (req, res)=> {
*/
const sendMobileMsg = (req, res)=> {
let uid = req.user.uid;
// let uid = req.user.uid||"20000190";
let mobile = req.body.mobile;
let area = req.body.area || '+86';
// console.log(uid, mobile, area);
accountModel.sendMobileMsg(uid, mobile, area).then(result=> {
// console.log("发送短信result", result);
res.send(result);
});
};
... ... @@ -74,7 +63,6 @@ const checkVerifyMsg = (req, res)=> {
let area = req.body.area || '+86';
accountModel.checkVerifyMsg(code, mobile, area).then(result=> {
// console.log("短信验证result", result);
res.send(result);
});
};
... ... @@ -86,12 +74,9 @@ const checkVerifyMsg = (req, res)=> {
*/
const sendVerifyEmail = (req, res)=> {
let uid = req.user.uid;
// let uid = req.user.uid||"20000190";
let email = req.body.email;
accountModel.sendVerifyEmail(uid, email).then(result=> {
// console.log("发送验证邮件result", result);
res.send(result);
});
};
... ...
... ... @@ -21,7 +21,7 @@ const _setDefault = (id, uid) => {
* 收货地址页面加载
*/
const index = (req, res, next) => {
let uid = req.user.uid || '20000190';
let uid = req.user.uid;
addressModel.getAddressDataAsync(uid, 20).then(result => {
let resultData = result.data ? result.data : result;
... ...
... ... @@ -93,6 +93,7 @@ const favorite = {
},
// 品牌收藏页
brand(req, res, next) {
let q = req.query;
let page = parseInt(q.page || 1, 10);
... ... @@ -154,6 +155,7 @@ const favorite = {
}).catch(next);
},
// 资讯收藏页
editorial(req, res, next) {
let q = req.query;
let page = parseInt(q.page || 1, 10);
... ... @@ -203,6 +205,7 @@ const favorite = {
}).catch(next);
},
// 取消商品、店铺收藏
cancel(req, res, next) {
let type = req.body.type;
let ids = req.body.ids;
... ... @@ -217,6 +220,7 @@ const favorite = {
}).catch(next);
},
// 取消资讯收藏
editorialCancel(req, res, next) {
let ids = req.body.ids;
let uid = cookie.getUid(req);
... ...
... ... @@ -75,8 +75,6 @@ const _getTitle = (type)=> {
const index = (req, res, next) => {
let uid = req.user.uid;
// let uid = req.user.uid || "20000190";
settingModel.getUserInfo(uid).then(result=> {
result.info.gender ? result.genders[result.info.gender - 1].checked = true :
result.genders[2].checked = true;
... ... @@ -107,8 +105,6 @@ const index = (req, res, next) => {
*/
const editUserInfo = (req, res)=> {
let uid = req.user.uid;
// let uid = req.user.uid || "20000190";
let query = req.body;
settingModel.editUserInfo(uid, query).then(result=> {
... ... @@ -122,8 +118,6 @@ const editUserInfo = (req, res)=> {
* */
const bindMobile = (req, res, next) => {
let uid = req.user.uid;
// let uid = req.user.uid || "20000190";
let type = req.params.type;
settingModel.getUserInfo(uid).then(result=> {
... ... @@ -133,7 +127,6 @@ const bindMobile = (req, res, next) => {
info.ellipsisMobile = info.verify_mobile.substring(0, 3) + '****' + info.verify_mobile.substring(7, 11);
info.checkCode = settingModel.cipheriv(info.uid + '.completeverify');
// info.checkCode = settingModel.cipheriv("20000190" + ".completeverify");
res.display('index', {
module: 'me',
page: 'setting',
... ... @@ -159,8 +152,6 @@ const bindMobile = (req, res, next) => {
const bindEmail = (req, res, next) => {
let uid = req.user.uid;
// let uid = req.user.uid || "20000190";
let type = req.params.type;
settingModel.getUserInfo(uid).then(result=> {
... ... @@ -169,8 +160,6 @@ const bindEmail = (req, res, next) => {
info.ellipsisEmail = info.verify_email.substring(0, 3) + '****' + info.verify_email.substring(7, 11);
info.checkCode = settingModel.cipheriv(info.uid + '.completeverify');
// info.checkCode = settingModel.cipheriv("20000190" + ".completeverify");
res.display('index', {
module: 'me',
page: 'setting',
... ... @@ -194,10 +183,8 @@ const bindEmail = (req, res, next) => {
const modifyPassword = (req, res) => {
let type = req.params.type;
let checkCode = settingModel.cipheriv(req.user.uid + '.completeverify');
// let checkCode = settingModel.cipheriv("20000190" + ".completeverify");
res.display('index', {
module: 'me',
page: 'setting',
... ... @@ -225,7 +212,6 @@ const edit = (req, res)=> {
let codes = code.split('.');
if (parseInt(codes[0], 10) === req.user.uid && codes[1] === 'completeverify') {
// if (codes[0] === "20000190" && codes[1] === "completeverify") {
let result = {
title: _getTitle(type).typeName,
proTitle: _getTitle(type).proName,
... ... @@ -233,10 +219,8 @@ const edit = (req, res)=> {
isShowEmail: _getTitle(type).isModifyEmail || _getTitle(type).isBindEmail,
isShowPassword: _getTitle(type).isShowPassword
};
let checkCode = settingModel.cipheriv(req.user.uid + '.completeoperate');
// let checkCode = settingModel.cipheriv("20000190"+ ".completeoperate");
res.display('index', {
module: 'me',
page: 'setting',
... ... @@ -267,7 +251,6 @@ const success = (req, res)=> {
let codes = code.split('.');
if (parseInt(codes[0], 10) === req.user.uid && codes[1] === 'completeoperate') {
// if (codes[0] === "20000190" && codes[1] === "completeoperate") {
let result = {
title: _getTitle(type).typeName,
proTitle: _getTitle(type).proName,
... ... @@ -302,8 +285,6 @@ const success = (req, res)=> {
const validate1 = (req, res)=> {
co(function *() {
let type = req.params.type;
// let uid = req.user.uid || "20000190";
let uid = req.user.uid;
let body = req.body;
... ... @@ -330,8 +311,6 @@ const validate2 = (req, res)=> {
co(function *() {
let type = req.params.type;
let uid = req.user.uid;
// let uid = req.user.uid || "20000190";
let body = req.body;
if (type === 'password') {
... ...
... ... @@ -28,7 +28,6 @@ const yohoCoinList = (uid, page, queryType, beginTime) => {
queryType: queryType,
beginTime: beginTime
}).then(result => {
// console.log("列表接口",result);
let coinList = [];
let total = false;
let curPage = 1;
... ... @@ -97,16 +96,22 @@ const yohoCoinTotal = (uid)=> {
method: 'app.yoho.yohocoin',
uid: uid
}).then(result => {
// console.log("总数接口",result);
return result;
});
};
/**
* 获取yoho币相关数据
* @param uid
* @param page
* @param queryType
* @param beginTime
* @returns {*}
*/
const getIndexData = (uid, page, queryType, beginTime) => {
let getData = [yohoCoinList(uid, page, queryType, beginTime), yohoCoinTotal(uid)];
return Promise.all(getData).then(result => {
// console.log("合并接口", result);
return {
list: result[0],
num: result[1]
... ...
... ... @@ -11,6 +11,12 @@ const API = global.yoho.API;
const ServiceAPI = global.yoho.ServiceAPI;
const favorite = {
/**
* 查询收藏的商品
* @param param
* @returns {*}
*/
getFavoriteProduct(param) {
let p = {
method: 'web.favorite.product'
... ... @@ -19,6 +25,11 @@ const favorite = {
return API.get('', _.assign(p, param));
},
/**
* 查询收藏的店铺、品牌
* @param param
* @returns {*}
*/
getFavoriteBrand(param) {
let p = {
method: 'app.favorite.brand'
... ... @@ -27,10 +38,23 @@ const favorite = {
return API.get('', _.assign(p, param));
},
/**
* 查询收藏的资讯
* @param param
* @returns {*}
*/
getFavoriteEditoreial(param) {
param.app_type = 1;
return ServiceAPI.get('guang/api/*/favorite/getUserFavArticleList', param);
},
/**
* 取消收藏 商品、店铺
* @param uid
* @param ids
* @param type
* @returns {*|type[]}
*/
cancelFavorite(uid, ids, type) {
let p = {
method: 'web.favorite.cancel',
... ... @@ -42,10 +66,17 @@ const favorite = {
return API.post('', p);
},
/**
* 取消收藏资讯
* @param uid
* @param ids
* @returns {*}
*/
cancelEditorialFavorite(uid, ids) {
return ServiceAPI.get('guang/api/*/favorite/cancelFavorite', {
article_id: ids,
uid: uid
uid: uid,
app_type: 1
});
}
};
... ...
... ... @@ -10,7 +10,7 @@ const api = global.yoho.API;
const crypto = require('crypto');
/**
* 查询个人信息
* 查询个人详细信息
* @param uid
* @returns {*}
*/
... ... @@ -45,6 +45,12 @@ const _getUserInfo = (uid) => {
});
};
/**
* 查询个人联系信息
* @param uid
* @returns {*}
* @private
*/
const _getUserContactInfo = (uid)=> {
return api.get('', {
method: 'web.passport.getUserContacts',
... ... @@ -52,6 +58,11 @@ const _getUserContactInfo = (uid)=> {
}).then(result => result.data);
};
/**
* 合并查询个人信息
* @param uid
* @returns {*}
*/
const getUserInfo = (uid) => {
let getData = [_getUserInfo(uid), _getUserContactInfo(uid)];
... ... @@ -64,14 +75,23 @@ const getUserInfo = (uid) => {
});
};
const getVerifyInfo = (uid)=> {
/* const getVerifyInfo = (uid)=> {
return api.get('', {
method: 'web.passport.getUserVerifyInfo',
uid: uid
}).then(result => result);
};
};*/
/**
* 编辑个人详细信息
* @param uid
* @param nickName
* @param username
* @param gender
* @param birthday
* @returns {*}
* @private
*/
const _editInfo = (uid, nickName, username, gender, birthday)=> {
return api.get('', {
method: 'app.passport.modifyBase',
... ... @@ -83,6 +103,16 @@ const _editInfo = (uid, nickName, username, gender, birthday)=> {
}).then(result => result);
};
/**
* 编辑个人联系信息
* @param uid
* @param areaCode
* @param mobile
* @param fullAddress
* @param zipCode
* @returns {*}
* @private
*/
const _editUserContactInfo = (uid, areaCode, mobile, fullAddress, zipCode)=> {
return api.get('', {
method: 'web.passport.modifyUserContacts',
... ... @@ -94,6 +124,12 @@ const _editUserContactInfo = (uid, areaCode, mobile, fullAddress, zipCode)=> {
}).then(result => result);
};
/**
* 合并编辑个人信息
* @param uid
* @param info
* @returns {*}
*/
const editUserInfo = (uid, info) => {
let getData = [
_editInfo(uid, info.nick_name, info.username, info.gender, info.birthday),
... ... @@ -145,7 +181,6 @@ const decipheriv = (data) => {
module.exports = {
getUserInfo: getUserInfo,
getVerifyInfo: getVerifyInfo,
editUserInfo: editUserInfo,
cipheriv: cipheriv,
decipheriv: decipheriv
... ...
{{!-- 我的收藏 --}}
{{#favorite}}
{{> common/subtitle}}
<div class="order-nav">
... ...
... ... @@ -36,8 +36,10 @@
{{#each this}}
{{#if more}}
<div class="goods-more">
<div class="more-text">MORE</div>
<p>查看更多</p>
<a href="/product/shop/{{../../brandDomain}}/list">
<div class="more-text">MORE</div>
<p>查看更多</p>
</a>
</div>
{{^}}
<div class="goods-info">
... ...
/**
* 商品详情页controller
* 商品、店铺收藏
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/7/17
*/
... ... @@ -8,6 +8,12 @@
const helpers = global.yoho.helpers;
const fav = require('../models/favorite');
/**
* 收藏商品
* @param req
* @param res
* @param next
*/
const product = (req, res, next) => {
let uid = req.user.uid;
let pid = req.body.productId;
... ... @@ -37,6 +43,12 @@ const product = (req, res, next) => {
res.json(resData);
};
/**
* 收藏品牌
* @param req
* @param res
* @param next
*/
const brand = (req, res, next) => {
let uid = req.user.uid;
let pid = req.body.brandId;
... ... @@ -66,6 +78,12 @@ const brand = (req, res, next) => {
res.json(resData);
};
/**
* 收藏店铺
* @param req
* @param res
* @param next
*/
const shop = (req, res, next) => {
let uid = req.user.uid;
let pid = req.body.shopId;
... ...
/**
* 列表页、新品到着列表页
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
*
*/
'use strict';
const _ = require('lodash');
... ... @@ -7,6 +14,7 @@ const DataHelper = require('../models/helpers');
const Resouces = require('../models/resouces');
const list = {
// 列表页
index: (req, res, next) => {
let q = req.query;
... ... @@ -53,6 +61,7 @@ const list = {
},
// 新品到着
newPage: (req, res, next) => {
let q = req.query;
... ...
... ... @@ -18,6 +18,7 @@ const ShopData = require('../models/shop-service');
const Editorial = require('../models/editorial');
const shop = {
// 店铺首页
index(req, res, next) {
let domain = req.params.domain;
let uid = cookie.getUid(req);
... ... @@ -80,6 +81,8 @@ const shop = {
}).catch(next);
},
// 店铺列表页
list(req, res, next) {
let data = {
module: 'product',
... ...
/**
* 获取品牌相关信息
* @author: jiangfeng<jeff.jiang@yoho.cn>
*/
... ... @@ -7,6 +8,12 @@
const api = global.yoho.API;
const BrandApi = {
/**
* 查询品牌信息,是否已收藏
* @param bid 品牌id
* @param uid 用户id
* @returns {*}
*/
getBrandInfo(bid, uid) {
let params = {
method: 'app.brand.getBrandIntro',
... ... @@ -19,6 +26,11 @@ const BrandApi = {
return api.get('', params);
},
/**
* 根据品牌domain查询
* @param domain
* @returns {*}
*/
getDomainInfo(domain) {
return api.get('', {
domain: domain,
... ...
/**
* Created by TaoHuang on 2016/6/14.
* 获取品牌相关信息
* @author: jiangfeng<jeff.jiang@yoho.cn>
*/
'use strict';
... ... @@ -8,6 +9,11 @@ const co = Promise.coroutine;
const api = require('./brand-api');
const camelCase = global.yoho.camelCase;
/**
* 根据品牌domain查询
* @param domain
*/
const getDomainInfo = domain => {
return co(function*() {
let brandInfo = yield api.getDomainInfo(domain);
... ... @@ -19,6 +25,12 @@ const getDomainInfo = domain => {
})();
};
/**
* 查询品牌信息,是否已收藏
* @param bid 品牌id
* @param uid 用户id
* @returns {*}
*/
const getBrandInfo = (bid, uid) => {
return co(function*() {
let brandInfo = yield api.getBrandInfo(bid, uid);
... ...
/**
* 列表页、搜索数据处理工具类
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
*
*/
'use strict';
const _ = require('lodash');
const config = global.yoho.config;
const helpers = {
/**
* 生成 A-Z, 0-9 品牌首字母
* @param numberIndex
* @returns {Array}
*/
brandLetters(numberIndex) {
let letters = [];
... ... @@ -31,6 +44,10 @@ const helpers = {
return letters;
},
/**
* 男女条件
* @returns {*[]}
*/
genders() {
return [
{
... ... @@ -42,6 +59,11 @@ const helpers = {
}];
},
/**
* 颜色条件处理
* @param colors
* @returns {*}
*/
colorConvert(colors) {
if (colors) {
return colors.map((c) => {
... ... @@ -56,6 +78,10 @@ const helpers = {
}
},
/**
* 根据频道获取导航栏
* @returns {{link: string, pathTitle: string, name: string}}
*/
getChannelNav() {
return {
link: '#',
... ... @@ -63,6 +89,13 @@ const helpers = {
name: 'MEN首页'
};
},
/**
* 根据品类生成导航栏
* @param sort
* @param sorts
* @returns {Array}
*/
getSortNav(sort, sorts) {
let nav = [];
... ... @@ -95,6 +128,13 @@ const helpers = {
return nav;
},
/**
* 生成Filter对象
* @param key
* @param value
* @param name
* @returns {{key: *, value: *, name: *}}
*/
newFilter(key, value, name) {
return {
key: key,
... ... @@ -103,6 +143,12 @@ const helpers = {
};
},
/**
* 筛选器数据处理
* @param filter
* @param q
* @returns {*}
*/
filterHandle(filter, q) {
let priceRange = filter.priceRange;
let sizeInfo = filter.size;
... ... @@ -193,6 +239,7 @@ const helpers = {
}).join('、');
if (brandNames) {
brandNames = brandNames.length > 10 ? brandNames.substr(0, 10) + '...' : brandNames;
filters.push(this.newFilter('brand', q.brand, brandNames));
}
}
... ... @@ -229,6 +276,11 @@ const helpers = {
};
},
/**
* 商品列表数据处理
* @param list
* @returns {*}
*/
handleProductList(list) {
if (_.isArray(list)) {
list.forEach(g => {
... ...
/**
* 资源位查询
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
*/
'use strict';
... ...
/**
* 列表、搜索相关api调用
*/
'use strict';
const api = global.yoho.API;
const _ = require('lodash');
/**
* 过滤空参数,不传给api
* @param obj
* @returns {*}
* @private
*/
function _paramHanlde(obj) {
_.keys(obj).forEach(k => {
if (obj[k] === null || obj[k] === '') {
... ... @@ -27,7 +37,8 @@ const Search = {
let finalParams = {
method: 'app.search.li',
limit: 45
limit: 45,
app_type: 1
};
Object.assign(finalParams, _paramHanlde(params));
... ... @@ -37,7 +48,8 @@ const Search = {
queryProductOfBrand(params) {
let finalParams = {
method: 'app.search.brand',
limit: 45
limit: 45,
app_type: 1
};
Object.assign(finalParams, _paramHanlde(params));
... ... @@ -47,7 +59,8 @@ const Search = {
queryNewProduct(params) {
let finalParams = {
method: 'app.search.newProduct',
limit: 45
limit: 45,
app_type: 1
};
Object.assign(finalParams, _paramHanlde(params));
... ... @@ -56,7 +69,8 @@ const Search = {
},
queryAllSort() {
return api.get('', {
method: 'app.sort.get'
method: 'app.sort.get',
app_type: 1
});
}
};
... ...
... ... @@ -48,6 +48,12 @@ function resourceDataHandle(data) {
}
const ShopService = {
/**
* 获取店铺信息
* @param shopId
* @param uid
*/
getShopIntro(shopId, uid) {
return co(function*() {
let shopIntro = yield ShopApi.getShopIntro(shopId, uid);
... ... @@ -59,6 +65,11 @@ const ShopService = {
}
})();
},
/**
* 获取店铺装修
* @param shopId
*/
getShopDecorator(shopId) {
return co(function*() {
let data = yield ShopApi.getShopDecorator(shopId);
... ... @@ -71,6 +82,10 @@ const ShopService = {
})();
},
/**
* 获取店铺二级分类
* @param shopId
*/
getShopSecondSorts(shopId) {
return co(function*() {
let data = yield ShopApi.getShopSorts(shopId);
... ... @@ -87,6 +102,11 @@ const ShopService = {
})();
},
/**
* 获取店铺首页数据(头部、装修)
* @param domain
* @param uid
*/
getShopHeadData(domain, uid) {
return co(function*() {
let domainInfo = yield BrandService.getDomainInfo(domain);
... ...
... ... @@ -6,6 +6,7 @@
'use strict';
const auth = require(`${global.middleware}/auth`);
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
const list = require(cRoot + '/list');
... ... @@ -19,14 +20,14 @@ router.get('/list', list.index); // 列表页面
router.get('/list/new', list.newPage); // 新品列表页
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, item.index); // 商品详情routers
router.post('/item/togglecollect', fav.product); // 商品详情页
router.post('/item/togglecollect', auth, fav.product); // 商品详情页
router.get('/item/getProductInfo', item.getProductInfo); // 商品详情信息
router.get('/shop/query/all', shop.indexQuery);
router.get('/shop/:domain/list', shop.list);
router.get('/shop/:domain', shop.index);
router.post('/shop/togglecollect', fav.shop);
router.post('/brand/togglecollect', fav.brand);
router.post('/shop/togglecollect', auth, fav.shop);
router.post('/brand/togglecollect', auth, fav.brand);
router.get('/query', query.index);
... ...
... ... @@ -25,6 +25,7 @@
{{!-- 分页 --}}
{{{ pagination paginationData }}}
{{^}}
{{!-- 空结果 --}}
{{> list/empty}}
{{/if}}
</div>
... ...
... ... @@ -8,8 +8,11 @@
const orderModel = require('../models/order');
const _ = require('lodash');
const helper = global.yoho.helpers;
// 结算页面
const index = (req, res, next) => {
orderModel.index(req.user.uid).then(result => {
... ... @@ -32,6 +35,13 @@ const index = (req, res, next) => {
// 返回购物车链接
result.data.goCartLink = helper.urlFormat('/shopping/cart');
// 拆单是否显示左右切换
_.forEach(result.data.shopping_cart_data.package_list, i => {
if (i.goods_list.length > 4) {
i.showToggle = true;
}
});
// 是否打印价格radio
result.data.printPriceRadio = [
{
... ...
/**
* 订单支付
* @author: TaoHuang
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 2016/07/18
*/
... ... @@ -8,9 +8,21 @@
const PayData = require('../models/pay');
const OrderData = require('../models/order');
const PayHelpers = require('../helpers/pay');
const PayHelpers = require('../helpers/payment');
const camelCase = global.yoho.camelCase;
const helpers = global.yoho.helpers;
const Payments = {
alipay: 2
};
/**
* 支付页
* @param req
* @param res
* @param next
*/
const online = (req, res, next) => {
let orderCode = req.query.code;
let uid = req.user.uid;
... ... @@ -20,12 +32,19 @@ const online = (req, res, next) => {
defaultHeader: false,
module: 'shopping',
page: 'pay',
title: '支付页面'
title: '支付页面',
username: req.user.username
}, result));
}).catch(next);
};
/**
* 获取第三方支付跳转url
* @param req
* @param res
* @param next
*/
const toPay = (req, res, next) => {
let orderCode = req.body.code;
let method = req.body.method;
... ... @@ -50,23 +69,38 @@ const toPay = (req, res, next) => {
}).catch(next);
};
const callback = () => {
};
/**
* 支付成功回调
* @param req
* @param res
*/
const callback = (req, res) => {
let type = req.params.type;
let payId = Payments[type];
let query = req.query;
const success = (req, res) => {
res.render('pay-success', {
defaultHeader: false,
content: {
cost: '12300.32',
orderNum: '234567890',
onlineCost: '589.00'
PayHelpers.afterPay(query, payId, req.user).then(result => {
if (result.code === 200) {
let data = result.data;
res.render('pay-success', {
defaultHeader: false,
content: {
cost: data.pay,
orderNum: data.orderCode,
onlineCost: data.pay,
orderHref: helpers.urlFormat('/me/order/detail', {code: data.orderCode}),
walkHref: helpers.urlFormat('/')
}
});
}
});
};
module.exports = {
online,
callback,
toPay,
success
toPay
};
... ...
/**
* 各种支付的入口
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 16/7/22
*/
const PayData = require('../models/pay');
const Alipay = require('./pay/alipay');
const Payment = {
pay(user, order, method) {
return PayData.getPaymentInfo(method).then(result => {
if (result && result.id === method) {
if (method === 2) {
return Alipay.pay(user, order, result);
}
} else {
return {
code: 400,
message: '获取支付方式信息失败'
};
}
});
}
};
module.exports = Payment;
... ... @@ -11,14 +11,13 @@ const helpers = global.yoho.helpers;
const common = require('./common');
const sign = require('./sign');
const md5 = require('md5');
const logger = global.yoho.logger;
const ALIPAY_URL = 'https://mapi.alipay.com/gateway.do';
const Alipay = {
pay(user, order, param) {
console.log(order, param);
let payParams = JSON.parse(param.payParams);
let params = {
... ... @@ -39,8 +38,6 @@ const Alipay = {
// TODO 防钓鱼配置,参考php
console.log(sign.raw(params) + payParams.merchant_key);
let signStr = md5(sign.raw(params) + payParams.merchant_key);
let body = sign.rawUncode(params) + '&sign=' + signStr + '&sign_type=MD5';
... ... @@ -50,6 +47,39 @@ const Alipay = {
href: ALIPAY_URL + '?' + body
}
};
},
notify(data, param) {
let payParams = JSON.parse(param.payParams);
logger.info(`Alipay notify, params = ${JSON.stringify(data)}`);
if (!this.checkNotify(data, payParams)) {
return {payResult: -1};
} else {
return {
bankName: '',
orderCode: data.out_trade_no,
payResult: data.trade_status === 'TRADE_SUCCESS' ? 200 : 400,
payTime: data.gmt_payment || '',
totalFee: data.total_fee,
resultMsg: data.notify_type,
payOrderCode: data.out_trade_no,
tradeNo: data.trade_no,
bankBillNo: ''
};
}
},
checkNotify(data, payParams) {
let signValue = data.sign;
delete data.sign;
delete data.sign_type;
delete data.code;
let signStr = md5(sign.raw(data) + payParams.merchant_key);
return signValue === signStr;
}
};
... ...
/**
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 16/7/22
*/
'use strict';
... ...
/**
* 各种支付的入口
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 16/7/22
*/
'use strict';
const PayData = require('../models/pay');
const OrderData = require('../models/order');
const Alipay = require('./pay/alipay');
const Promise = require('bluebird');
const co = Promise.coroutine;
const logger = global.yoho.logger;
const Payment = {
pay(user, order, method) {
return co(function*() {
let payInfo = yield PayData.getPaymentInfo(method);
let result = {
code: 400,
message: '获取支付方式信息失败'
};
if (payInfo && payInfo.id === method) {
if (method === 2) {
result = Alipay.pay(user, order, payInfo);
}
}
if (result.code === 200) {
let updateInfo = yield Payment.beforePay(user, order, method);
if (updateInfo && updateInfo.code !== 200) {
return updateInfo;
}
}
return result;
})();
},
beforePay(user, order, method) {
return Promise.all([
OrderData.updateOrderPayment(order.orderCode, method, user.uid),
PayData.getBankByOrder(order.orderCode)
]).then(result => {
let paymentRecord = result[0];
let bankRecord = result[1];
let bankCode = ''; // 暂时写成'', 参考php代码 Payment.php:564
if (!paymentRecord || paymentRecord.code !== 200) {
let message = paymentRecord && paymentRecord.message ? paymentRecord.message : '系统繁忙,请稍后再试';
return {code: 400, message: message};
}
if (bankRecord && bankRecord.bankCode) {
return PayData.updateOrderPayBank(order.orderCode, method, bankCode);
} else {
return PayData.setOrderPayBank(order.orderCode, method, bankCode);
}
}).catch(e => {
logger.error('update order pay info error.', e);
return Promise.resolve({
code: 400,
message: '更新订单支付信息失败'
});
});
},
afterPay(query, payId, user) {
return co(function*() {
let payInfo = yield PayData.getPaymentInfo(payId);
let payResult = {};
if (payId === 2) {
payResult = Alipay.notify(query, payInfo);
payResult.bankName = payResult.bankName || payInfo.payName || '';
payResult.bankCode = payResult.bankCode || payInfo.pay_code || '';
}
console.log(payResult);
if (payResult && payResult.payResult === 200) {
if (payResult.orderCode) {
logger.info('pay back confirm');
yield PayData.sendPayConfirm(payResult.orderCode, payId, user.uid);
}
return yield PayData.procOrderData(payResult, user.uid);
} else {
return {
code: 500,
message: '支付失败'
};
}
})();
}
};
module.exports = Payment;
... ...
... ... @@ -12,10 +12,9 @@ const api = global.yoho.API;
const helper = global.yoho.helpers;
/**
* 结算页面展示
* 结算页面api
* @param uid 用户id
*/
const _orderApi = uid => api.get('', {
method: 'app.Shopping.payment',
'cart_type': 'ordinary', // eslint-disable-line
... ... @@ -23,7 +22,10 @@ const _orderApi = uid => api.get('', {
uid: uid
});
/**
* 结算页面
* @param uid [int] user id
*/
const index = uid => {
return _orderApi(uid).then(data => {
if (data.code === 200) {
... ... @@ -33,6 +35,10 @@ const index = uid => {
let goods = theData.goods_list;
let shopping = theData.shopping_cart_data;
let packageList = shopping.package_list;
_.forEach(goods, theGoods => {
let splitName = theGoods.product_name.split(' ');
... ... @@ -55,7 +61,26 @@ const index = uid => {
theData.yoho_coin *= 100; // 有货币稀释
theData.shopping_cart_data.balanceCoin = theData.use_yoho_coin;
shopping.balanceCoin = theData.use_yoho_coin;
// 拆单后的邮费优惠计算
if (packageList) {
let shippingOrigin = 0;
let shippingCut = 0;
_.forEach(packageList, i => {
shippingOrigin += (i.shopping_orig_cost >>> 0);
shippingCut += (i.shopping_cut_cost >>> 0);
});
// 对运费的数据进行扩展
shippingCut === 0 || Object.assign(
_.filter(shopping.promotion_formula_list, i => i.promotion === '运费'), {
shippingCut: shippingCut,
shippingOrigin: shippingOrigin
}
);
}
return data;
}
... ... @@ -64,7 +89,7 @@ const index = uid => {
};
/**
* 结算
* 结算api调用
* @param number uid user id
* @param number $deliveryWay 配送方式,1表示普通快递,2表示顺丰速运
* @param int $paymentType 支付方式,1表示在线支付,2表示货到付款
... ... @@ -78,6 +103,11 @@ const _computeApi = (uid, deliveryWay, paymentType, yohoCoin) => api.get('', {
use_yoho_coin: yohoCoin
});
/**
* 结算
* @param uid [int] user id
* @param yohoCoin [int] 使用的有货币
*/
const compute = (uid, yohoCoin) => {
// 目前仅支持普通快递和在线支付
let deliveryWay = 1;
... ... @@ -94,40 +124,7 @@ const compute = (uid, yohoCoin) => {
};
/**
* 提交订单(电子发票)
* @param number uid user id
* @param number address_id 地址id
* @param number yohoCoin 使用的有货币
* @param number invoices_type 发票类型(1-纸质发票,2-电子发票)
* @param string invoices_title 发票抬头
* @param int invoices_content 发票内容
* @param string receiverMobile 收票人手机
* @param string remark 备注
* @param boolean isPrintPrice 是否打印价格
* @param number delivery_time 送货时间
* @param number delivery_way 送货方式(1-普通,2-顺丰)
* @param number payment_id 支付id
* @param number payment_type 支付类型
*/
// const _submitElInvoice = (uid, other) => api.get('', {
// method: 'app.Shopping.submit',
// uid: uid,
// address_id: other.address_id,
// yohoCoin: other.yohoCoin,
// invoices_type: other.invoices_type,
// invoices_title: other.invoices_title,
// invoices_content: other.invoices_content,
// recevierMobile: other.recevierMobile,
// remark: other.remark,
// isPrintPrice: other.isPrintPrice,
// delivery_time: other.delivery_time,
// delivery_way: other.delivery_way,
// payment_id: other.payment_id,
// payment_type: other.payment_type
// });
/**
* 提交订单
* 提交订单api调用
* @param number uid user id
* @param number address_id 地址id
* @param number yohoCoin 使用的有货币
... ... @@ -164,6 +161,11 @@ const _submit = (uid, other) => {
return api.get('', apiParms);
};
/**
* 订单提交
* @param uid [int] userid
* @param other [object] contains some param
*/
const submit = (uid, other) => {
let theOther = {};
let coin = other.coin;
... ... @@ -183,6 +185,12 @@ const submit = (uid, other) => {
return _submit(uid, theOther).then(result => result);
};
/**
* 查询订单信息接口
* @param uid
* @param code
* @returns {*}
*/
const orderDetail = (uid, code) => {
return api.get('', {
method: 'app.SpaceOrders.detail',
... ... @@ -191,9 +199,26 @@ const orderDetail = (uid, code) => {
}, {code: 200});
};
/**
* 更新订单支付方式
* @param code
* @param payment
* @param uid
* @returns {*}
*/
const updateOrderPayment = (code, payment, uid) => {
return api.get('', {
method: 'app.SpaceOrders.updateOrdersPaymentByCode',
order_code: code,
payment: payment,
uid: uid
});
};
module.exports = {
index,
compute,
submit,
orderDetail
orderDetail,
updateOrderPayment
};
... ...
/**
* Created by TaoHuang on 2016/7/18.
* 支付相关api调用
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 2016/07/18
*/
'use strict';
... ... @@ -19,7 +21,55 @@ const getPaymentInfo = (id) => {
});
};
const getBankByOrder = (code) => {
return api.get('', {
method: 'web.SpaceOrders.getOrderPayBank',
orderCode: code
});
};
const setOrderPayBank = (code, payment, bankCode) => {
return api.get('', {
method: 'web.SpaceOrders.addOrderPayBank',
orderCode: code,
payment: payment,
bankCode: bankCode
});
};
const updateOrderPayBank = (code, payment, bankCode) => {
return api.get('', {
method: 'web.SpaceOrders.modifyOrderPayBank',
orderCode: code,
payment: payment,
bankCode: bankCode
});
};
const sendPayConfirm = (code, payment, uid) => {
return api.get('', {
method: 'app.SpaceOrders.payConfirm',
orderCode: code,
payment_id: payment,
uid: uid
});
};
const sendMessage = (mobile, template, codes) => {
return api.get('', {
method: 'app.message.sendMsg',
mobile: mobile,
template: template,
codes: codes
});
};
module.exports = {
getPayProvider,
getPaymentInfo
getPaymentInfo,
getBankByOrder,
setOrderPayBank,
updateOrderPayBank,
sendPayConfirm,
sendMessage
};
... ...
/**
* 订单支付
* @author: TaoHuang
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 2016/07/18
*/
... ... @@ -8,13 +8,19 @@
const api = require('./pay-api');
const order = require('./order');
const Promise = require('bluebird');
const co = Promise.coroutine;
const camelCase = global.yoho.camelCase;
const OrderData = require('./order');
const logger = global.yoho.logger;
const _ = require('lodash');
/**
* 获取在线支付方式
* @returns {*|Promise.<TResult>}
*/
const getOnlinePayProvider = () => {
return api.getPayProvider().then(result => {
if (!(result.code && result.code === 200)) {
... ... @@ -22,7 +28,7 @@ const getOnlinePayProvider = () => {
}
let online = _(result.data)
.filter(i => _.includes(['Alipay', 'Wechatqrcode'], i.payCode))
.filter(i => _.includes(['Alipay'], i.payCode))
.map(i => {
return {
id: i.id,
... ... @@ -48,9 +54,14 @@ const getOnlinePayProvider = () => {
});
};
/**
* 获取订单详情
* @param uid
* @param code
*/
const getOrderInfo = (uid, code) => {
return co(function * () {
let orderData = yield order.orderDetail(uid, code);
return co(function *() {
let orderData = yield OrderData.orderDetail(uid, code);
if (orderData && orderData.data) {
return camelCase(orderData.data);
... ... @@ -60,8 +71,13 @@ const getOrderInfo = (uid, code) => {
})();
};
/**
* 获取支付页数据
* @param uid
* @param code
*/
const getPayInfo = (uid, code) => {
return co(function * () {
return co(function *() {
let payment = yield Promise.all([getOnlinePayProvider(), getOrderInfo(uid, code)]);
return {
... ... @@ -72,11 +88,11 @@ const getPayInfo = (uid, code) => {
};
/**
*
* 获取支付方式的相关参数, (密钥等信息)
* @param id
*/
const getPaymentInfo = (id) => {
return co(function * () {
return co(function *() {
let data = yield api.getPaymentInfo(id);
if (data && data.code === 200 && data.data) {
... ... @@ -86,9 +102,127 @@ const getPaymentInfo = (id) => {
})();
};
/**
* 获取订单支付银行信息
* @param id
*/
const getBankByOrder = (id) => {
return co(function *() {
let data = yield api.getBankByOrder(id);
if (data && data.code === 200 && data.data) {
return camelCase(data.data);
}
return {};
})();
};
/**
* 设置订单支付银行
* @param code
* @param payment
* @param bankCode
*/
const setOrderPayBank = (code, payment, bankCode) => {
return co(function *() {
let data = yield api.setOrderPayBank(code, payment, bankCode);
return data;
})();
};
/**
* 更新订单支付银行
* @param code
* @param payment
* @param bankCode
*/
const updateOrderPayBank = (code, payment, bankCode) => {
return co(function *() {
let data = yield api.updateOrderPayBank(code, payment, bankCode);
return data;
})();
};
/**
* 支付确认
* @param code
* @param payment
* @param uid
*/
const sendPayConfirm = (code, payment, uid) => {
return co(function *() {
let data = yield api.sendPayConfirm(code, payment, uid);
return data;
})();
};
/**
* 支付成功,前端回调时,处理订单信息
* @param payResult
* @param uid
*/
const procOrderData = (payResult, uid) => {
return co(function *() {
let orderCode = payResult.orderCode;
let result = {code: 400, message: ''};
if (!orderCode) {
result.message = '未查到订单信息,订单状态更新失败!';
return result;
} else {
let orderInfo = yield OrderData.orderDetail(uid, orderCode);
if (orderInfo && orderInfo.data) {
let order = camelCase(orderInfo.data);
let amount = order.paymentAmount;
if (order.is_cancel === 'Y') {
logger.warn('front pay success but order is cancel.', {payResult: payResult, order: order});
api.sendMessage(order.mobile, 'error_sms', '支付成功,但订单已取消,订单号为' + orderCode);
return {code: 417, message: '支付成功,但订单已取消,需联系客服!'};
}
if (order.payment_status === 'N') {
logger.warn('front pay success but may be notify fail');
}
if (_.round(parseFloat(amount), 2) !== _.round(parseFloat(payResult.totalFee), 2)) {
logger.warn('front pay success but the amount is not same.', {payResult: payResult, order: order});
return {
code: 415,
message: '支付金额与订单金额不一致,订单状态更新失败!'
};
}
return {
code: 200,
message: '支付成功,请等待发货',
data: {
pay: amount,
orderCode: orderCode
}
};
} else {
result.message = '未查到订单信息,订单状态更新失败!';
}
}
return result;
})();
};
module.exports = {
getPayInfo,
getPaymentInfo
getPaymentInfo,
getBankByOrder,
setOrderPayBank,
updateOrderPayBank,
sendPayConfirm,
procOrderData
};
... ...
... ... @@ -31,14 +31,11 @@ router.get('/order/compute', auth, order.compute);
router.post('/order/submit', auth, order.orderSub);
// 支付
router.get('/pay/online', pay.online);
router.get('/pay/online', auth, pay.online);
router.post('/pay/online/go', pay.toPay);
// 在线支持完成
router.get('/pay/online/success', pay.success);
router.post('/pay/online/go', auth, pay.toPay);
// 支付回调
router.get('/pay/callback/:type', pay.callback);
router.get('/pay/callback/:type', auth, pay.callback);
module.exports = router;
... ...
... ... @@ -231,16 +231,16 @@
<div class="pro-list">
\{{#each invalidPros}}
<ul>
<li class="chk">
<li class="chk" data-product_info='{"goods_type": "invalid", "buy_number": \{{buy_number}}, "selected": "\{{selected}}", "product_sku": "\{{product_sku}}", "promotion_id": 0}'>
<span class="iconfont warning">&#xe625;</span>
</li>
<li>
<a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">
<a href="javascript:void(0)">
<img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
</a>
</li>
<li class="pro-info">
<div class="pro-name"><a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">\{{product_name}}</a></div>
<div class="pro-name"><a href="javascript:void(0)">\{{product_name}}</a></div>
<div>
\{{#if color_name}}
<span class="mr20">颜色: \{{color_name}}</span>
... ... @@ -251,7 +251,7 @@
</div>
</li>
<li class="price-num">
<span class="price sale-price">¥ \{{round salesPrice 2}}</span>
<span class="price sale-price">¥ \{{round sales_price 2}}</span>
<div class="stepper" data-productType=\{{goods_type}}>
<div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
<span class="iconfont">&#xe621;</span>
... ...
... ... @@ -56,13 +56,19 @@
{{#each ../package_list}}
<div class="package-item">
<p class="package-title bold">包裹{{math @index '+' 1}}:{{#if @first}}总仓发货{{^}}异地调拨{{/if}}</p>
<ul class="package-goods clearfix">
{{#each goods_list}}
<li class="left">
<img class="lazy package-goods-img" data-original="{{image goods_images 100 134}}">
</li>
{{/each}}
</ul>
{{#if showToggle}}
<span class="iconfont toggle-icon left-icon">&#xe607;</span>
<span class="iconfont toggle-icon right-icon">&#xe61e;</span>
{{/if}}
<div class="package-goods-wrap">
<ul class="package-goods clearfix">
{{#each goods_list}}
<li class="left">
<img class="lazy package-goods-img" data-original="{{image goods_images 100 134}}">
</li>
{{/each}}
</ul>
</div>
<p class="package-shipping">运费:¥{{shopping_cost}}元(原价{{shopping_orig_cost}}元,优惠{{shopping_cut_cost}}元)</p>
</div>
{{/each}}
... ... @@ -174,23 +180,18 @@
支付方式:<em id="balance-pay-type">在线支付</em>
</p>
</div>
<ul class="balance-list right">
<li>
<span class="balance-title">商品金额:</span>
<span class="balance-cost">{{str_order_amount}}</span>
</li>
<li>
<span class="balance-title">有货币:</span>
<span class="balance-cost"><em id="balance-coin" class="balance-coin">{{round balanceCoin 2}}</em></span>
</li>
<li>
<span class="balance-title">运费:
{{#isY is_multi_package}}
<em class="package-shipping-tip">(原价{{../shippingOrigin}}元,优惠{{../shippingDiscount}}元)</em>
{{/isY}}
</span>
<span class="balance-cost">¥{{round shipping_cost 2}}</span>
</li>
<ul id="balance-list" class="balance-list right">
{{#each promotion_formula_list}}
<li>
<span class="balance-title">
{{promotion}}
{{#if shippingCut}}
<em>(原价:{{shippingOrigin}}元,优惠:{{shippingCut}}元)</em>
{{/if}}
</span>
<span class="balance-cost">{{promotion_amount}}</span>
</li>
{{/each}}
<li class="need-pay">
<span class="balance-title">应付金额{{#if shipping_cost}}(含运费){{/if}}</span>
<span id="balance-cost" class="balance-cost" data-cost="{{last_order_amount}}">¥<em>{{round last_order_amount 2}}</em></span>
... ... @@ -202,6 +203,22 @@
{{/ shopping_cart_data}}
</div>
<script id="balance-tpl" type="text/html">
\{{#each promotion_formula_list}}
<li>
<span class="balance-title">\{{promotion}}</span>
<span class="balance-cost">\{{promotion_amount}}</span>
</li>
\{{/each}}
<li class="need-pay">
<span class="balance-title">应付金额\{{#if shipping_cost}}(含运费)\{{/if}}:</span>
<span id="balance-cost" class="balance-cost" data-cost="{{last_order_amount}}">¥<em>\{{last_order_amount}}</em></span>
</li>
<li>
<span id="submit-order" class="btn submit-order">提交订单</span>
</li>
</script>
<script id="address-list-tpl" type="text/html">
\{{#each address}}
<li class="address\{{#isY is_default}} default\{{/isY}}\{{#if focus}} focus\{{/if}}"
... ...
... ... @@ -7,7 +7,7 @@
<span class="cash right">应付金额:{{paymentAmount}}</span>
</div>
<div class="footer">
<span class="desc pay-notice left">{{userName}}如果<span class="blue">2小时</span>内您无法完成付款,系统会将您的订单取消</span>
<span class="desc pay-notice left">{{../username}}如果<span class="blue">2小时</span>内您无法完成付款,系统会将您的订单取消</span>
<span id="order-detail-ctrl" class="right order-detail-ctrl shrink">
<em>展开详情</em>
<i class="iconfont down">&#xe616;</i>
... ...
... ... @@ -111,16 +111,16 @@
<div class="pro-list">
{{#each invalidPros}}
<ul>
<li class="chk">
<li class="chk" data-product_info='{"goods_type": "invalid", "buy_number": {{buy_number}}, "selected": "{{selected}}", "product_sku": "{{product_sku}}", "promotion_id": 0}'>
<span class="iconfont warning">&#xe625;</span>
</li>
<li>
<a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
<a href="javascript:void(0)">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}">
</a>
</li>
<li class="pro-info">
<div class="pro-name"><a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">{{product_name}}</a></div>
<div class="pro-name"><a href="javascript:void(0)">{{product_name}}</a></div>
<div>
{{#if color_name}}
<span class="mr20">颜色: {{color_name}}</span>
... ... @@ -131,7 +131,7 @@
</div>
</li>
<li class="price-num">
<span class="price sale-price">¥ {{round salesPrice 2}}</span>
<span class="price sale-price">¥ {{round sales_price 2}}</span>
{{> cart/stepper }}
</li>
<li class="total-price-action">
... ...
... ... @@ -26,9 +26,9 @@ module.exports = {
useOneapm: false,
useCache: false,
memcache: {
master: ['192.168.102.168:11211'],
slave: ['192.168.102.168:11211'],
session: ['192.168.102.168:11211'],
master: ['127.0.0.1:11211'],
slave: ['127.0.0.1:11211'],
session: ['127.0.0.1:11211'],
timeout: 1000,
retries: 0
},
... ...
... ... @@ -14,7 +14,15 @@ module.exports = (req, res, next) => {
return req.protocol + '://' + req.get('host') + req.originalUrl;
};
let loginUrl = helpers.urlFormat('/passport/login', {refer: req.getUrl()});
let refer = '';
if (req.method === 'GET') {
refer = req.getUrl();
} else {
refer = req.get('Referer');
}
let loginUrl = helpers.urlFormat('/passport/login', {refer: refer});
if (_.isEmpty(req.user) || !req.user.uid) {
if (req.xhr) {
... ...
... ... @@ -85,34 +85,41 @@ $('#collect-btn').click(function() {
id: articleId
}
}).then(function(data) {
if (data.code === 200) {
new _alert('收藏成功').show();
$this.toggleClass('collected');
} else {
new _alert(data.message).show();
}
switch (data.code) {
// case 401:
// // 防止从已有col的页面再次进行跳转后出错的情况
// if (/\?col=(1|0)/.test(location.href)) {
// hrefUrl = location.href.replace(/\?col=(1|0)/, '?col=' + col);
// } else {
// hrefUrl = location.href + '?col=' + col;
// }
// location.href = '//www.yohobuy.com/signin.html?refer=' + encodeURI(hrefUrl);
// break;
case 400:
new _alert(data.message).show();
break;
case 200:
if (/\?col=(1|0)/.test(location.href)) {
// 如果页面url中含有col,为了防止页面刷新时收藏或者取消收藏会根据col来的问题,进行页面跳转拿掉参数
location.href = location.href.replace(/\?col=(1|0)/, '');
} else {
$this.toggleClass('collected');
}
break;
default:
break;
}
// switch (data.code) {
// // case 401:
// // // 防止从已有col的页面再次进行跳转后出错的情况
// // if (/\?col=(1|0)/.test(location.href)) {
// // hrefUrl = location.href.replace(/\?col=(1|0)/, '?col=' + col);
// // } else {
// // hrefUrl = location.href + '?col=' + col;
// // }
// // location.href = '//www.yohobuy.com/signin.html?refer=' + encodeURI(hrefUrl);
// // break;
// case 400:
// new _alert(data.message).show();
// break;
// case 200:
// if (/\?col=(1|0)/.test(location.href)) {
// // 如果页面url中含有col,为了防止页面刷新时收藏或者取消收藏会根据col来的问题,进行页面跳转拿掉参数
// location.href = location.href.replace(/\?col=(1|0)/, '');
// } else {
// $this.toggleClass('collected');
// }
// break;
// default:
// break;
// }
collecting = false;
});
}).bind('mouseenter mouseleave', function() {
... ... @@ -148,28 +155,17 @@ function comment() {
},
type: 'post',
success: function(data) {
switch (data.code) {
// case 401:
// locating = true;
// location.href = '//www.yohobuy.com/signin.html?refer=' +
// window.escape(location.href + '#comment-info');
// break;
case 400:
new _alert(data.message).show();
break;
case 200:
if (data.data) {
$commentList.html(data.data.content);
$commentNum.html(data.data.count);
showComment();
// clear comment-text
$('#comment-info').val('').keyup();
}
break;
default:
break;
if (data.code === 200) {
$commentList.html(data.data.content);
$commentNum.html(data.data.count);
showComment();
window.location.reload();
// clear comment-text
$('#comment-info').val('').keyup();
} else {
new _alert(data.message).show();
}
commenting = false;
}
... ... @@ -212,3 +208,7 @@ $('#comment-info').keyup(function() {
// init
$('#comment-info').trigger('keyup');
if (($('#tags').find('li').length) === 0) {
$('.article-tag').hide();
}
... ...
... ... @@ -19,12 +19,13 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
var $this = $(this),
// prising = false,
msgId = $this.closest('.msg-content').data('id'),
msgId = $this.parents('.content-msg').data('id'),
url;
// if (prising === msgId) {
// return;
// }
console.log(msgId);
// prising = msgId;
... ... @@ -48,15 +49,6 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
new _alert(data.message).show();
}
// if (data.code === 200) {
// if (data.data * 1 === 0) {
// $this.next('b').addClass('num-0').children('.num').html('0'); // 隐藏数字显示
// } else {
// console.log(data.data)
// $this.next('b').removeClass('num-0').children('.num').html(data.data);
// }
// }
// prising = false;
});
}).on('mouseenter mouseleave', '.like-icon', function() {
$(this).closest('.like').toggleClass('hover');
... ...
... ... @@ -12,7 +12,7 @@ lazyLoad($('.content-msg img.lazy'));
$('.editorial-list-page').on('click', '.like-icon', function() {
var $this = $(this),
msgId = $this.closest('.msg-content').data('id'),
msgId = $this.parents('.content-msg').data('id'),
url;
if ($this.hasClass('liked')) {
... ... @@ -31,9 +31,7 @@ $('.editorial-list-page').on('click', '.like-icon', function() {
if (data.code === 200) {
$this.toggleClass('liked');
$this.next('b').removeClass('num-0').children('.num').html(data.data);
}
if (data.code === 500) {
} else {
new _alert(data.message).show();
}
... ...
... ... @@ -4,6 +4,8 @@
* @date: 2016/07/11
*/
const moment = require('moment');
// 时间格式化
const convertUnitTime = (src) => {
return moment.unix(src).format('YYYY-MM-DD');
... ... @@ -13,6 +15,7 @@ var beginTime = convertUnitTime(new Date() / 1000 - 3600 * 24 * 90);
var type = 0;
var page = 1;
var Bll = {
// 获取路由中的请求参数
getQueryString: function() {
let queryArr = location.search.substr(1).split('&');
let query = {};
... ... @@ -54,6 +57,8 @@ $('.tabs li').on('click', function() {
}
});
// 时间控件切换
$('#begin-time').on('change', function() {
let months = parseInt($(this).val(), 10);
... ...
... ... @@ -167,5 +167,3 @@ $(function() {
}
});
});
... ...
... ... @@ -7,7 +7,7 @@ var $imgCaptchaInput = $('#captcha');
var dialog = require('../../plugins/dialog');
var _alert = dialog.Alert;
var types = location.pathname.split('/');
var type = types[types.length - 1];
var type = types[types.length - 1];// 界面操作类型
/**
... ... @@ -58,6 +58,7 @@ $sms.click(function() {
});
});
// 手机验证第一步提交
$('#mobile-step1').click(function() {
var code = $('#msg-code').val().trim();
var mobile = $('#real-mobile').val();
... ...
... ... @@ -7,7 +7,7 @@ var dialog = require('../../plugins/dialog');
var _alert = dialog.Alert;
var regValidate = require('../../passport/common/mail-phone-regx');
var types = location.pathname.split('/');
var type = types[types.length - 1];
var type = types[types.length - 1];// 界面操作类型
var $imgCaptchaInput = $('#captcha');
var second = 60;
var $sms = $('#send-code2');// 发送短信验证码按钮
... ... @@ -42,7 +42,7 @@ var validatePhoneNumLocal = function(phoneNum) {
};
/**
* 绑定手机号码
* 绑定手机号码部分
*/
$('#region').on('change', function() {
$('#country-code').text($(this).val());
... ... @@ -106,6 +106,7 @@ $sms.click(function() {
});
});
// 绑定手机第二步提交
$('#mobile-step2').click(function() {
var code = $('#msg-code').val();
var mobile = $('#real-mobile').val();
... ... @@ -136,7 +137,7 @@ $('#mobile-step2').click(function() {
/**
* 修改密码
* 修改密码部分
*/
// 输入确认密码
$('#checkPwd').blur(function() {
... ... @@ -188,7 +189,6 @@ $('#step2-pwd').click(function() {
if (data.code === 200) {
location.href = '/me/setting/step3/' + type + '?checkCode=' + $('#checkCode').val();
} else {
// location.href = '/me/setting/step3/' + type + "?checkCode=" + $("#checkCode").val();
new _alert(data.message).show();
}
}
... ...
... ... @@ -7,6 +7,8 @@
function _favBack(data) {
if (data && data.code === 200) {
$('#brand-fav').toggleClass('coled');
} else if (data && data.data && data.data.refer) {
location.href = data.data.refer;
}
}
... ...
... ... @@ -195,22 +195,28 @@ var Cart = {
* @params { Array } products 商品列表
*/
removePro: function(products) {
var dialog = new _confirm({
content: '您确定要从购物车中删除该商品吗?',
cb: function() {
dialog.close();
Util.ajax({
url: '/shopping/cart/product/remove',
data: {skuList: JSON.stringify(products)},
type: 'DELETE',
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
});
}
});
}
}).show();
var dialog;
if (products.length) {
dialog = new _confirm({
content: '您确定要从购物车中删除该商品吗?',
cb: function() {
dialog.close();
Util.ajax({
url: '/shopping/cart/product/remove',
data: {skuList: JSON.stringify(products)},
type: 'DELETE',
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
});
}
});
}
}).show();
} else {
new _alert('请至少选中一件商品!').show();
}
},
/*
... ... @@ -222,26 +228,30 @@ var Cart = {
var msg = '确定要将该商品从购物车中移入收藏吗?<br/>移入收藏后该商品将不在购物车中显示';
var dialog;
if (products.length > 1) {
msg = '确定要将已选中的商品从购物车中移入收藏吗?<br/>移入收藏后已选中的商品将不在购物车中显示';
}
dialog = new _confirm({
content: msg,
cb: function() {
dialog.close();
Util.ajax({
url: '/shopping/cart/product/send_to_favorite',
type: 'POST',
data: {skuList: JSON.stringify(products)},
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
});
}
});
if (!products.length) {
new _alert('请至少选中一件商品!').show();
} else {
if (products.length > 1) {
msg = '确定要将已选中的商品从购物车中移入收藏吗?<br/>移入收藏后已选中的商品将不在购物车中显示';
}
}).show();
dialog = new _confirm({
content: msg,
cb: function() {
dialog.close();
Util.ajax({
url: '/shopping/cart/product/send_to_favorite',
type: 'POST',
data: {skuList: JSON.stringify(products)},
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
});
}
});
}
}).show();
}
},
// 编辑商品的颜色和尺寸
... ...
... ... @@ -77,7 +77,7 @@ var Stepper = {
currNum = $input.val();
plus = $input.parent().next();
if (!$target.hasClass('disable')) {
if (!$target.hasClass('disable') && !$target.parents('.cart-pro-list').hasClass('invalid-pros')) {
sku = $.parseJSON($target.parents('ul').children().first().attr('data-product_info')).product_sku;
goodType = $target.parent().attr('data-producttype');
_this.decrease(goodType, sku, currNum, function(num, changed) {
... ... @@ -103,7 +103,7 @@ var Stepper = {
currNum = $input.val();
minus = $input.parent().prev();
if (!$target.hasClass('disable')) {
if (!$target.hasClass('disable') && !$target.parents('.cart-pro-list').hasClass('invalid-pros')) {
sku = $.parseJSON($target.parents('ul').children().first().attr('data-product_info')).product_sku;
goodType = $target.parent().attr('data-producttype');
_this.increase(goodType, sku, currNum, function(num, changed, overflow) {
... ...
... ... @@ -5,6 +5,7 @@
*/
var $ = require('yoho-jquery'),
Hbs = require('yoho-handlebars'),
lazyLoad = require('yoho-jquery-lazyload');
var Alert = require('../plugins/dialog').Alert;
... ... @@ -27,13 +28,18 @@ var $coin = $('#input-coin'),
maxUse: '您最多使用',
muPostfix: '个有货币'
};
var $balanceCost = $('#balance-cost'),
$balanceCoin = $('#balance-coin');
var $balanceCost = $('#balance-cost');
var $printPrice = $('#print-price');
var $invoice = $('#invoice-content');
var balanceTpl = Hbs.compile($('#balance-tpl').html());
var pkgCache = {};
var $pkgList;
require('yoho-jquery-dotdotdot');
require('../plugins/check'); // before 地址和发票
... ... @@ -48,10 +54,67 @@ $('.brand-and-name .name').dotdotdot({
wrap: 'letter'
});
function pkgPageControl($el, flag) {
var id = $el.index(),
$ul = $el.find('.package-goods'),
theCache = pkgCache[id],
curPage = theCache.cur ? theCache.cur : 1,
page = Math.ceil(theCache.total / 5);
curPage += flag;
// 第一页或最后一页
if (curPage < 1 || curPage > page) {
return;
}
$ul.animate({
marginLeft: -(curPage - 1) * $ul.parent('.package-goods-wrap').width()
}, 200);
theCache.cur = curPage;
}
// JIT拆单
$('.show-package').click(function() {
$('.package-list').toggleClass('hide');
});
if ($('.multi-package-row').length > 0) {
$pkgList = $('.package-list');
// 显示拆单详情面板
$('.show-package').click(function(e) {
$pkgList.toggleClass('hide');
e.stopPropagation();
});
// 绑定document事件,去触发面板关闭
$(document).on('click', function(e) {
if ($pkgList.hasClass('hide') || $(e.target).closest('.package-list').length > 0) {
return;
}
$pkgList.addClass('hide');
});
// 设置左右切换
$('.package-goods').each(function() {
$(this).width($(this).children('li').length * 120);
});
// 初始化cache
$('.package-item').each(function() {
pkgCache[$(this).index()] = {
total: $(this).find('li').length
};
});
$('.package-list').on('click', '.toggle-icon', function() {
var $this = $(this);
var flag = $this.hasClass('left-icon') ? -1 : 1;
pkgPageControl($this.closest('.package-item'), flag);
});
}
// 有货币、备注切换显示
$('.coin-ctrl, .remark-ctrl').click(function() {
... ... @@ -127,15 +190,14 @@ function compute(coin) {
coin: coin
}
}).then(function(data) {
var usedCoin,
cost;
var cost;
if (data.code === 200) {
usedCoin = data.data.use_yoho_coin;
cost = data.data.last_order_amount;
$balanceCost.children('em').text(cost);
$balanceCoin.text(usedCoin);
cost = cost.toFixed(2);
$('#balance-list').html(balanceTpl(data.data));
}
});
}
... ...
... ... @@ -6,6 +6,24 @@ var $ = require('yoho-jquery');
var $orderDetail = $('.order-detail');
var Dialog = require('../plugins/dialog').Dialog;
var tpl = '<div class="pay-page-tips">' +
'<h3>请您在新打开的页面完成付款</h3>' +
'<p>付款完成前请不要关闭此窗口</p>' +
'<p>完成付款后请根据您的情况点击下面的按钮</p>' +
'<div><a href="/me/order"><span class="btn">已完成付款</span></a>' +
'<span class="btn white close-btn">更换支付方式</span>' +
'</div>' +
'</div>';
var infoDaialog = new Dialog({
className: 'pay-info-dialog',
content: tpl,
keep: true
});
// 展开详情/收起详情
$('#order-detail-ctrl').click(function() {
var $this = $(this);
... ... @@ -40,6 +58,14 @@ $('.pay-type-icon').click(function() {
$('#pay-type-name').text($this.data('name'));
});
function showDialog() {
infoDaialog.show();
$('.pay-page-tips .btn.close-btn').off().on('click', function() {
infoDaialog.close();
});
}
// 去支付
$('#go-pay-btn').click(function() {
var payType = $('.pay-type-icon.active').data('id');
... ... @@ -48,13 +74,16 @@ $('#go-pay-btn').click(function() {
$.ajax({
type: 'POST',
url: '/shopping/pay/online/go',
async: false,
data: {
code: order,
method: payType
}
}).then(function(data) {
if (data.code === 200) {
location.href = data.data.href;
window.open(data.data.href);
showDialog();
}
});
});
... ...
... ... @@ -3,6 +3,7 @@
height: 50px;
line-height: 50px;
color: #666;
overflow: hidden;
a {
text-decoration: none;
... ...
... ... @@ -218,9 +218,6 @@
i {
opacity: 1;
}
span {
display: none;
}
.cancel-collect {
display: inline;
}
... ...
.blk-cart-page {
.blk-cart-page,
.shopping-order-page {
.cart-bc {
width: 100%;
position: relative;
... ...
... ... @@ -223,6 +223,20 @@ $hoverColor: #379ed6;
border-top: 1px solid #eee;
color: #999;
input {
color: #999 !important;
}
a {
color: #999 !important;
}
.stepper {
.warning {
display: none;
}
}
.warning {
font-size: 18px !important;
color: #666;
... ...
... ... @@ -336,6 +336,30 @@
}
}
.package-item {
position: relative;
.toggle-icon {
position: absolute;
font-size: 34px;
top: 106px;
cursor: pointer;
}
.left-icon {
left: -24px;
}
.right-icon {
right: -24px;
}
}
.package-goods-wrap {
height: 134px;
overflow: hidden;
}
.package-list {
position: absolute;
background: #fff;
... ...
... ... @@ -156,3 +156,25 @@ $fontColor: #616161;
}
}
.pay-info-dialog {
.pay-page-tips {
text-align: center;
h3 {
font-size: 18px;
font-weight: 700;
margin: 30px 0;
}
p {
font-size: 14px;
color: #999;
margin: 10px 0;
}
.btn {
margin-top: 20px;
}
}
}
... ...
... ... @@ -46,7 +46,7 @@
text-align: center;
width: 100%;
margin-top: 5px;
color: #e8044f;
color: #379ed6;
font-size: 13px;
font-weight: bold;
}
... ...