Authored by biao

Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-blk into release/1.0

Showing 57 changed files with 1011 additions and 421 deletions
... ... @@ -21,8 +21,9 @@ const brand = require('../models/brand');
const index = (req, res, next) => {
let channel = req.query.brand || 1;
let contentCode = 'd0149783b8dd2adaf083fd10556c39a9';
let appType = 1;
brand.getListData(contentCode, channel).then((result) => {
brand.getListData(contentCode, channel, appType).then((result) => {
res.display('index', {
module: 'brand',
page: 'index',
... ...
... ... @@ -42,6 +42,7 @@ const _processListData = (list) => {
}
);
});
console.log(listData)
return listData;
};
... ... @@ -96,9 +97,10 @@ const _getResources = (contentCode) => {
* @param channel
* @returns {*}
*/
const _getBreakingSort = (channel) => {
const _getBreakingSort = (channel, appType) => {
return api.get('', {
yo_channel: channel,
yh_channel: channel,
app_type: appType,
method: 'app.brand.newBrandList'
}).then((result) => {
if (result && result.code === 200) {
... ... @@ -114,8 +116,8 @@ const _getBreakingSort = (channel) => {
* 获取品牌一览相关数据
* @returns {*}
*/
const getListData = (contentCode, channel) => {
return Promise.all([_getResources(contentCode), _getBreakingSort(channel)])
const getListData = (contentCode, channel, appType) => {
return Promise.all([_getResources(contentCode), _getBreakingSort(channel, appType)])
.then((result) => {
return {
... ...
... ... @@ -13,6 +13,6 @@ const cRoot = './controllers';
const index = require(`${cRoot}`).index;
router.get('/', index);
router.get(['/', '/men', '/women', '/lifestyle'], index);
module.exports = router;
... ...
... ... @@ -7,7 +7,7 @@
'use strict';
const editorialModel = require('../models/editorial');
const md5 = require('md5');
/**
* 资讯首页数据
* @param req
... ... @@ -117,6 +117,7 @@ const list = (req, res) => {
*/
const detail = (req, res, next) => {
let id = req.params.id;
let clientType = 'pc';
editorialModel.getDetailData(id).then((result) => {
res.display('detail', {
... ... @@ -207,8 +208,8 @@ let cancelCollect = (req, res, next) => {
* @param next
*/
let setPraise = (req, res, next) => {
let udid = req.user.udid;
let id = req.query.id;
let udid = md5(req.ip);
let id = req.body.id;
let appType = 1;
editorialModel.setPraise(id, udid, appType).then((result) => {
... ... @@ -223,8 +224,8 @@ let setPraise = (req, res, next) => {
* @param next
*/
let cancelPraise = (req, res, next) => {
let udid = req.user.udid;
let id = req.query.id;
let udid = md5(req.ip);
let id = req.body.id;
let appType = 1;
editorialModel.cancelPraise(id, udid, appType).then((result) => {
... ...
... ... @@ -5,7 +5,6 @@
*/
'use strict';
const serviceAPI = global.yoho.ServiceAPI;
const api = global.yoho.API;
const camelCase = global.yoho.camelCase;
const _ = require('lodash');
... ... @@ -57,8 +56,11 @@ const _processListData = (list) => {
total: list.total
});
_.forEach(list.list.artList, (data, index) => {
if (index === 0) {
// console.log(list)
_.forEach(list.list.artList, (data) => {
if (data.author) {
listData = _.assign(listData, {
authorName: data.author.name
});
... ... @@ -71,6 +73,7 @@ const _processListData = (list) => {
});
listData.tabs = list.list.artList;
// console.log(listData)
return listData;
};
... ... @@ -258,10 +261,11 @@ const _processHeadData = (list) => {
// 推荐商品
const _getRelatedData = () => {
const _getRelatedData = (sknList) => {
// console.log(id);
return api.get('', {
query: '51152761,51178582,51146105,51149561,51149414,51082157,51079256',
// query: '51152761,51178582,51146105,51149561,51149414,51082157,51079256,',
qurey: sknList,
method: 'app.search.li'
}).then((result) => {
let productList = [];
... ... @@ -317,6 +321,7 @@ const _processContentData = (list) => {
contentData.contents = list;
// let idList = '';
let sknList = '';
let formatData = [];
_.forEach(contentData.contents, function(value) {
... ... @@ -330,45 +335,37 @@ const _processContentData = (list) => {
formatData.push(data);
});
}
});
// console.log(formatData)
if (value.goodsGroup) {
// _.forEach(value.goodsGroup.data, function(data) {
// // console.log(data)
// // _.forEach(data.list, function(value) {
// // sknList += value.id + ',';
_getRelatedData().then((result) => {
// formatData.push(result);
// console.log(formatData);
// // formatData.push(value);
// // });
// });
}
});
_getRelatedData(sknList).then((result) => {
_.forEach(formatData, function(data, index) {
// console.log(formatData)
data[index] = _.assign(result[index]);
});
// console.log(formatData);
// console.log(formatData)
return formatData;
}).then(() => {
});
// if (value.goodsGroup) {
// _.forEach(value.goodsGroup.data, function(data) {
// // console.log(data)
// _.forEach(data.list, function(value) {
// // console.log(value)
// _getRelatedData(51152761).then((result) => {
// // console.log(result)
// value = _.assign(value, result);
// value = _.assign(value, {
// link: `${config.siteUrl}/product/pro_${result.id}_${value.productSkc}/${result.cnAlphabet}`
// });
// // console.log(value)
// });
// });
// });
// }
return contentData;
};
... ... @@ -517,7 +514,7 @@ const cancelCollect = (id, uid, appType) => {
*/
const setPraise = (id, udid, appType) => {
return serviceAPI.get('/guang/api/*/praise/setPraise', {
return serviceAPI.get('/guang/api/v2/praise/setPraise', {
article_id: id,
udid: udid,
app_type: appType
... ... @@ -532,7 +529,7 @@ const setPraise = (id, udid, appType) => {
*/
const cancelPraise = (id, udid, appType) => {
return serviceAPI.get('/guang/api/*/praise/cancel', {
return serviceAPI.get('/guang/api/v2/praise/cancel', {
article_id: id,
udid: udid,
app_type: appType
... ...
... ... @@ -17,8 +17,8 @@ router.get('/(:id).html', editorial.detail);// 资讯详情页
router.post('/info/collect', editorial.setCollect);// 资讯收藏
router.post('/info/cancelcollect', editorial.cancelCollect);// 资讯取消收藏
router.get('/info/praise', editorial.setPraise);// 点赞
router.get('/info/cancelPraise', editorial.cancelPraise);// 取消点赞
router.post('/info/praise', editorial.setPraise);// 点赞
router.post('/info/cancelPraise', editorial.cancelPraise);// 取消点赞
router.post('/info/comment', editorial.addComment);// 添加评论
module.exports = router;
... ...
... ... @@ -42,7 +42,7 @@
</div>
{{/ text}}
{{# goods}}
{{!-- {{# goods}}
<div class="related-reco">
<div class="article-title">
<div class="title-line"></div>
... ... @@ -80,7 +80,7 @@
{{/ data}}
</div>
</div>
{{/ goodsGroup}}
{{/ goodsGroup}} --}}
{{/ content}}
{{#if brands}}
... ...
... ... @@ -6,6 +6,7 @@
'use strict';
const helpModel = require('../models/help');
const contentData = require('../models/content-data');
/**
* 根据id获取文章数据
... ... @@ -13,8 +14,6 @@ const helpModel = require('../models/help');
* @returns {*}
*/
const getData = (id)=> {
let contentData = helpModel.contentData().content;
for (let i = 0; i < contentData.length; i++) {
if (contentData[i].id === id) {
return contentData[i];
... ...
/**
* 帮助中心数据
*/
'use strict';
const content = [
{
id: '1',
content: [
{
stepTitle: '第一步:注册&登录',
steps: [
{
id: '1',
stepData: '您可通过Yoho!Family账号进行登录'
},
{
id: '1',
stepData: '只需要一个手机号即可完成新账号注册'
}
]
},
{
stepTitle: '第二步:挑选心仪商品',
steps: [
{
id: '1',
stepData: '搜索关键字或者品牌名称,能找到您心仪的商品'
},
{
id: '1',
stepData: '根据商品分类和偏好进行筛选,能更快遇见您心仪的商品'
},
{
id: '1',
stepData: '将喜欢的商品放进购物车,以免错过'
}
]
},
{
stepTitle: '第三步:支付货款',
steps: [
{
id: '1',
stepData: '在购物车中点击“去结算”,商品在购物车中不保留库存'
},
{
id: '1',
stepData: '确认您的收货信息、发票以及货款,确认无误后提交订单进行结算'
},
{
id: '1',
stepData: '可以在“我的订单”查看订单物流进度'
}
]
},
{
stepTitle: '第四步:收货&退款',
steps: [
{
id: '1',
stepData: '收到商品,点击“确认收货”'
},
{
id: '1',
stepData: '如您对商品满意我们深感荣幸,不满意您可以选择退货退款'
}
]
},
{
endData: '若以上内容未解决您的问题,请联系在线客服为您解答。'
}
]
},
{
id: '2',
content: [
{
stepTitle: '支付说明',
steps: [
{stepData: '1、Yoho!BLK为您提供支付宝进行在线支付,APP另可通过微信支付进行在线支付;'},
{stepData: '2、如果您的Yoho!Family账户内有有货币,您可以在结算时选择使用;'},
{
stepData: '3、网上支付均是支付成功即刻到账。若由于网络故障导致您已支付成功的订单未改变订单' +
'状态,请您联系我们的客服专员为您解决。'
}
],
warningTip: {
tipName: '温馨提示:',
tipData: '在线支付付款等待期限为2小时。请您在订购成功后2小时内完成支付,否则我们将不会保留' +
'您的订单。'
}
},
{
stepTitle: '发票说明',
steps: [
{stepData: '1、如果您需要发票,请您在结算商品时勾选发票,商品将连同发票一并寄出;'},
{stepData: '2、发票金额根据您的订单实付金额开具;'},
{stepData: '3、若您收到包裹后确认未收到发,请您及时与客服联系处理。'}
]
},
{
stepTitle: 'Yoho!BLK是否提供增值专用税发票?',
steps: [
{stepData: '目前,Yoho!BLK可以提供增值税专用发票。'},
{
stepData: '注明:开具增值税专用发票需要提供:名称、纳税人识别号、地址、电话、' +
'开户行、帐号以及发票类型。'
}
]
},
{
stepTitle: '增值税普通发票与增值税专业发票有什么区别?',
normal: [
{normalData: '重点区别在于“能否抵扣增值税销项税”方面:'}
],
steps: [
{
stepData: '1、企业采购货货物收到供应方的“增值税普通发票”,其支付款中所含的“进项税”' +
'记入货物成本,不能抵扣企业因销售等业务活动产生的增值税销项税,实现不了增值税的流转;'
},
{
stepData: '2、企业采购货货物收到供应方的“增值税专用发票”其进项税,可以在规定范围内' +
'抵扣企业销售等业务活动产生的销项税,从而实现增值税的流转。'
}
]
},
{
stepTitle: '购买商品的时候忘记勾选发票了,可以补寄吗?',
steps: [
{stepData: '1) 发票可以补100天之内订购的订单。'},
{stepData: '2) 补开发票需提供“Yoho!BLK发货单”或详细的订购信息。'},
{stepData: '3) 补开发票所产成的运费由Yoho!BLK承担。'}
]
},
{
stepTitle: '如何更换发票?',
normal: [
{
normalData: '您在收到发票后如果发现因商家原因所致票据抬头、内容或金额错误,请联系客服专' +
'员为您安排办理换发票事宜,往返快递费用由责任方承担。'
}
]
},
{
endData: '若以上内容未解决您的问题,请联系在线客服为您解答。'
}
]
},
{
id: '31',
content: [
{
steps: [
{stepData: '1、Yoho!BLK全部采用顺丰速运,保证货物快速、安全地送达您的手中。'},
{stepData: '2、如您所在地区超出顺丰配送范围,我们将给您安排EMS进行配送。'},
{stepData: '3、在核对您订购的商品、邮寄地址、款项支付等信息无误后,Yoho!BLK会将货物及时发出'}
]
},
{
stepTitle: '订单已提交成功,什么时候可以发货?',
normal: [
{
normalData: '订单提交成功后我们会尽快发货,订单当天16点前付款成功当天发货,其余订单次日发货。' +
'另外我们在北京、成都、广州设有中转仓,如果您是北京、天津、河北、四川、重庆、广东客户,您的商' +
'品将发往中转仓,订单当天15点前付款成功当天发往中转仓,其余订单次日发往中转仓,请您耐心等待。' +
'详细进度您可以进入“个人中心-我的订单”查看订单状态。商品发货后您也将收到短信通知,告知您快' +
'递公司以及快递单号。'
}
]
},
{
stepTitle: '你们从哪里发货?多长时间可以到货?',
normal: [
{
normalData: '我们的仓库在江苏南京,根据地域的不同,发货后江苏省内一般1-3天可以收到,江苏省外' +
'一般3-5天可以收到。如果在您订购完成后7天内商品仍没有送达,您可以直接与客服中心联系。需要说明' +
'的是:化妆品等液体商品,走的是陆运,会比普通商品晚2-3天左右,敬请谅解。'
}
]
},
{
stepTitle: '如何查看物流进度?',
normal: [
{normalData: '您可通过“个人中心-我的订单”查看物流进度,您也可以通过快递单号在各快递官网查询。'}
],
warningTip: {
tipName: '温馨提示:',
tipData: '快递派件过程中,如果我们联络您的时间超过7天未得到回复,此订单将被默认为您已经放弃订购。' +
'如果您对收货时间有特殊要求, 请您下单时在备注栏中详细注明。'
}
},
{
endData: '若以上内容未解决您的问题,请联系在线客服为您解答。'
}
]
},
{
id: '32',
content: [
{
stepTitle: '商品到达以后可以当场验收商品吗?',
normal: [
{
normalData: '商品支持当面验收,如配送人员不配合您可以选择拒收商品。商品送达后您可当场确认商品' +
'与您订购的是否一致。您在验收商品时如发现商品短缺、配送错误、包装破损、商品存在质量问题等,' +
'请您向配送人员指出,并当场拒收全部商品,并在送货单上注明原因。相应的赠品和优惠商品应同时拒收' +
',并请您在24小时内与客服联系进一步处理。'
}
]
},
{
stepTitle: '可以由他人代为签收吗?',
normal: [
{normalData: '可以,非订货人本人签收的商品等同于订购人进行签收验货。'}
]
},
{
stepTitle: '如签收后发现商品存在质量问题可以退货吗?',
normal: [
{normalData: '如您感觉商品存在质量问题您可以联系在线客服帮您做进一步处理。'}
]
},
{
stepTitle: '物流信息显示已签收,但我并未收到商品?',
normal: [
{normalData: '您可先确认商品是否放在门卫或者代收点,如没有您可以联系在线客服为您处理。'}
]
},
{
stepTitle: '商品送到后我不想要了可以拒收吗?',
normal: [
{normalData: '可以。温馨提醒:无理由拒收需要您自行承担运费。'}
]
},
{
endData: '若以上内容未解决您的问题,请联系在线客服为您解答。'
}
]
},
{
id: '41',
content: [
{
stepTitle: '服务承诺',
normal: [
{
normalData: '如果您在购物过程中有任何建议或者意见,您可以通过在线客服与我们联系沟通,我们承诺' +
'在24小时内与您联系。'
},
{
normalData: '为了退货流程更方便,Yoho!BLK已推出自助退换货流程,请您登录后在个人中心中依提示进' +
'行在线退换货操作。如自助退换货有困难,可联系我们,客服专员会协助您完成退换货,我们将以最快的' +
'速度妥善为您解决。'
}
]
},
{
stepTitle: '服务时间',
normal: [
{normalData: '在线人工客服:8:00-24:00'},
{normalData: '400客服热线:8:00-22:30'}
]
}]
},
{
id: '42',
content: [
{
steps: [
{
stepData: '1、为节省您的宝贵时间及保证账户安全,现Yoho!BLK官网已开通《自助退换货》功能,您可' +
'在签收商品的7天内进入官网“我的订单”页面操作退货申请。'
},
{
stepData: '2、在退换货申请得到初步审核确认通过后,请在7日内将商品寄回,并填写寄回快递信息,逾' +
'期则视为撤销退换货,不予办理。'
},
{
stepData: '3、商品寄回时请您将商品连同发货单一并寄回(如无发货单,您可找张纸上注明订单编号,' +
'收货人姓名及手机号码),如您购买时索要发票,一经退货请将发票随商品一同寄回,如发票丢失将无' +
'法办理退货。'
},
{
stepData: '4、退换货地址:南京市江宁区江宁经济技术开发区苏源大道87号Yoho!Buy有货物流中心东' +
'一楼,Yoho!BLK仓库(收),邮编:211106。'
},
{
stepData: '5、退货中心收到寄回商品,检测后符合条件的,我们将在3个工作日内为您安排退款事宜' +
'。退款时间非退款到账时间,具体到账时间以各平台、银行具体情况为准。'
}
]
},
{
normal: [
{normalData: '具体操作流程如下:'}
],
steps: [
{stepData: '第一步:进入“我的订单”—找到需要退换货的订单—点击”确认收货”'},
{stepData: '第二步:阅读退换货政策,根据您的实际情况选择退换货的原因,点击“提交退换货申请”'},
{
stepData: '第三步:提交退换货申请成功后,会在24小时内确认您的申请,您可通过“我的退换货”' +
'查看退换货进度'
}
]
},
{
warningTip: {
tipName: '温馨提醒:'
}
},
{
steps: [
{
stepData: '1、因商品质量问题或平台原因导致而发生的退换货,Yoho!BLK将承担由此产生的配送费用;' +
'如因您个人原因退换货,请自行承担相关费用。'
},
{
stepData: '2、图片信息仅供参照,商品以实物为准。因拍摄灯光及不同显示器色差等问题可能造成商' +
'品图片与实物有一定色差,此情况不作为质量问题原因的退换货申请条件。'
},
{
stepData: '3、退换货商品须保持原样(原品牌包装完整,商品吊牌未剪,未穿洗),并有确保商品不会' +
'被二次损坏的包裹包装(包括包裹填充物及外包装箱或外包装袋),以确保商品在返回仓库的运输过程' +
'中不被损坏,使您的利益被充分保护。'
},
{stepData: '4、已开具发票的订单,若发票未与商品一起寄回,则无法办理退货,换货无需寄回发票'}
]
},
{
endData: '若以上内容未解决您的问题,请联系在线客服为您解答。'
}
]
},
{
id: '43',
content: [
{
bigTitle: '7天无理由退货条例总则'
},
{
stepTitle: '订单退换货时效是多久?',
normal: [
{
normalData: '自订单签收次日起7日内可以退货,15日内可以换货(以快递公司的送货单上的签收日期' +
'为准)。'
}
]
},
{
stepTitle: '出现哪些情形时,消费者可在签收7天内无理由退货',
steps: [
{stepData: '1.商品客观问题'},
{stepData: '2.商品及商品本身包装保持Yoho!BLK出售时原装且配件赠品齐全,不影响二次销售的。'}
]
},
{
stepTitle: '哪些商品不支持7天无理由退货',
normal: [
{
normalData: '考虑到个人卫生,内衣,内裤、袜子、泳衣泳裤、贴身塑身衣类商品(具体以网站内商品' +
'分类为准),不支持7天无理由退换货,同时,手表、香水、香薰、化妆品等特殊商品,无质量问题不支' +
'持7天无理由退换货。'
}
]
},
{
stepTitle: '出现哪些情形时不予退货',
steps: [
{stepData: '1.任何非Yoho!BLK出售的商品(商品编码不符);'},
{stepData: '2.已经超过三包期限的商品;'},
{
stepData: '3.未经授权的维修、误用、碰撞、疏忽、滥用、进液、事故、改动、不正确的安装所造成的' +
'商品质量问题,或撕毁、涂改标贴、机器序号、防伪标记;'
},
{
stepData: '4.无法提供商品的发票(如已索要发票)、保修卡等三包凭证或者三包凭证信息与商品不符' +
'及被涂改的;'
},
{stepData: '5.其他依法不应办理退换货的(详见各类商品退货细则)。'}
]
},
{
stepTitle: '退货运费由谁承担',
steps: [
{
stepData: '1.因商品质量问题产生的退货,退货运费由Yoho!BLK承担,需要您先行垫付,退款后联系' +
'客服退运费;'
},
{stepData: '2.因您个人原因产生的退货,购买时产生的运费及退货运费由您个人承担。'}
]
},
{
bigTitle: '服饰箱包及鞋类商品退货细则'
},
{
stepTitle: '退换货原因',
steps: [
{stepData: '1.商品质量问题'},
{
stepData: '2.商品完好的(即商品及包装保持出售时原状且配件赠品资料齐全的)可以在签收次日起' +
'7日内退货,15日内换货'
}
]
},
{
stepTitle: '注意事项',
steps: [
{
stepData: '1.出于安全和卫生考虑,贴身用品如内衣裤、袜子、文胸类及泳衣类等商品,除质量问题外,' +
'概不退货;'
},
{
stepData: '2.任何因非正常使用、保管或个人原因造成的商品损坏(如自行修改尺寸,洗涤,皮具表面' +
'刮花、打油,刺绣,水洗、碰酸、碱、油或者触硬物,包装盒破损(包括鞋类、礼品类包装盒外直接' +
'缠绕胶带或贴快递面单等)雨天穿着,长时间穿着,气味污染等),不予退换。'
},
{
stepData: '3.商品吊牌、发货单、商品配件(如配饰挂坠、肩带、小卡包等)、说明书、保修单、标签' +
'等丢失,不予退货;如您购买时索要发票,一经退货请将发票随商品一同寄回,如发票丢失将无法办' +
'理退货;'
},
{
stepData: '4.商品及商品本身包装保持Yoho!BLK出售时原状且配件齐全,吊牌包装完整,不影响二次' +
'销售,在退换货期限内可以办理退换货;'
},
{stepData: '5.遇过敏问题产生退换货需要提供医院的相关证明;'},
{stepData: '6.礼包或套装中的商品不可以部分退货,如有发票、赠品等需同商品一起退回。'}
]
},
{
bigTitle: '美容化妆类商品退货细则'
},
{
stepTitle: '退货原因',
normal: [
{normalData: '商品质量问题。'}
]
},
{
stepTitle: '注意事项',
steps: [
{
stepData: '1.出于安全和卫生考虑,已使用的美容化妆品不予退货,经权威部门检测商品存在内在质量' +
'问题者除外。'
},
{stepData: '2.如商品包装破损,商品过期可以申请质量问题退换货;'},
{
stepData: '3.商品销售页面明确标示商品保质期将到期、外包装有损坏或产品有瑕疵的,不得再以此为' +
'由要求退换货。'
},
{stepData: '4.遇过敏问题产生退货需要提供医院的相关证明。'},
{
stepData: '5.Yoho!BLK保证商品的进货渠道和质量,如果您在使用时对商品质量表示质疑,请出具书面' +
'鉴定,有货会按照国家法律规定予以处理。'
}
],
warningTip: {
tipName: '温馨提示:',
tipData: '化妆品的使用效果会因肤质、年龄、季节、气候、使用方法以及配套产品等的不同而效果不一,' +
'因此,介绍的功能及使用效果仅供参考,如果您对商品细节有任何疑问,请在订购前与客服联系并详细确认。'
}
},
{
bigTitle: '家居家纺类商品退货细则'
},
{
stepTitle: '退货原因',
steps: [
{stepData: '1.商品质量问题;'},
{
stepData: '2.商品及商品本身包装保持Yoho!BLK出售时原装且配件齐全,不影响二次销售的,在订单签' +
'收次日起7日内可退货,15日内可换货。'
}
]
},
{
stepTitle: '注意事项',
steps: [
{stepData: '1.因个人原因造成商品损坏(如自行修改尺寸、洗涤)的,不予退货;'},
{stepData: '2.商品吊牌、发货单、商品配件、说明书、保修单及标签等丢失的或包装破损,不予退货。'}
]
},
{
bigTitle: '手表类商品退换货细则'
},
{
stepTitle: '注意事项',
steps: [
{stepData: '1.请您务必将商品的外包装、内带附件、保修卡、说明书等随同商品一起寄回。'},
{
stepData: '2.如超过退换货时间,购买的商品出现质量问题,请您与Yoho!BLK客服中心联系,我们会帮您' +
'联系维修点或者返厂维修,若二次维修仍然存在问题,我们会帮您办理退换。'
}
]
},
{
bigTitle: '珠宝类商品退换货细则'
}, {
normal: [
{normalData: '珠宝类商品不支持7天无理由退换货,感谢您的理解与支持!'}
]
}
]
}
];
module.exports = content;
... ...
... ... @@ -62,47 +62,6 @@ const menuData = ()=> {
};
};
/**
* 文章数据
* @returns {{content: *[]}}
*/
const contentData = ()=> {
return {
content: [
{
id: '1',
content: '<h1>购物指南</h1>'
},
{
id: '2',
content: '<h1>支付方式</p>'
},
{
id: '31',
content: '<h1>配送方式-配送时间与范围</p>'
},
{
id: '32',
content: '<h1>配送方式-商品验收与签收</p>'
},
{
id: '41',
content: '<h1>售后服务-投诉与建议</p>'
},
{
id: '42',
content: '<h1>售后服务-退换货流程</p>'
},
{
id: '43',
content: '<h1>售后服务-退换货政策</p>'
}
]
};
};
module.exports = {
menuData,
contentData
menuData
};
... ...
... ... @@ -7,7 +7,7 @@
{{!-- 左侧菜单导航 --}}
<div class="help-navigation left">
<p class="title bold">帮助中心</p>
{{>help/menu}}
{{>menu}}
</div>
{{!-- 右侧页面内容 --}}
... ...
<div class="help-page blk-page">
<div class="center-content clearfix">
{{# content}}
{{!-- 头部面包屑 --}}
{{> path-nav}}
<div class="help-index">
{{>help}}
</div>
{{/ content}}
</div>
</div>
<div>
{{{content}}}
{{#each content}}
<p class="big-title">{{bigTitle}}</p>
<p class="step-title">{{stepTitle}}</p>
{{#each normal}}
<p class="normal-data">{{normalData}}</p>
{{/each}}
<ul>
{{#each steps}}
<li class="step-data {{#if id}}step{{/if}}">{{stepData}}</li>
{{/each}}
</ul>
{{#warningTip}}
<p><span style="color: red">{{tipName}}</span>{{tipData}}</p>
{{/warningTip}}
<br>
{{endData}}
<br>
{{/each}}
</div>
... ...
<div class="search-part">
<h1 class="title">YOHO!BLK 帮助中心</h1>
</div>
<div class="splider">
<span class="draw"></span>
<span class="part-head">新手指南</span>
<span class="draw"></span>
</div>
<div class="guide">
<ul>
<li>
<a href="">
<div class="login-icon"></div>
<span>登录注册</span>
</a>
</li>
<li>
<a href="">
<div class="search-icon"></div>
<span>搜索商品</span>
</a>
</li>
<li>
<a href="">
<div class="order-icon"></div>
<span>选购下单</span>
</a>
</li>
<li>
<a href="">
<div class="pay-icon"></div>
<span>订单支付</span>
</a>
</li>
<li>
<a href="">
<div class="return-icon"></div>
<span>收货退货</span>
</a>
</li>
</ul>
</div>
<div class="splider">
<span class="draw"></span>
<span class="part-head">自助服务</span>
<span class="draw"></span>
</div>
<div class="self-help">
<ul>
<li>
<a href="">
<div class="order-icon"></div>
<span>订单查询</span>
</a>
</li>
<li>
<a href="">
<div class="refund-icon"></div>
<span>退换货</span>
</a>
</li>
<li>
<a href="">
<div class="online-icon"></div>
<span>在线客服</span>
</a>
</li>
<li>
<a href="">
<div class="me-icon"></div>
<span>个人信息</span>
</a>
</li>
<li>
<a href="">
<div class="self-icon"></div>
<span>账号安全</span>
</a>
</li>
<li>
<a href="">
<div class="address-icon"></div>
<span>地址管理</span>
</a>
</li>
</ul>
</div>
<div class="splider">
<span class="draw"></span>
<span class="part-head">常见问题</span>
<span class="draw"></span>
</div>
<div class="common-problem">
<div>
<ul>
<li></li>
</ul>
</div>
<div class="table-info">
<ul>
<li>
<div class="part-info">
<p class="head">会员中心</p>
<div class="part-body">
<p>账户管理</p>
<p>密码管理</p>
</div>
</div>
</li>
<li>
<div class="part-info">
<p class="head">购物指南</p>
<div class="part-body">
<p>尺码选择</p>
<p>发票</p>
<p>商品咨询</p>
</div>
</div>
</li>
<li>
<div class="part-info">
<p class="head">支付方式</p>
<div class="part-body">
<p>在线支付</p>
<p>货到付款</p>
</div>
</div>
</li>
</ul>
<ul>
<li>
<div class="part-info">
<p class="head">配送方式</p>
<div class="part-body">
<p>配送时间</p>
<p>配送方式</p>
<p>顺丰速运</p>
<p>商品签收验收</p>
</div>
</div>
</li>
<li>
<div class="part-info">
<p class="head">售后服务</p>
<div class="part-body">
<p>退换货政策</p>
<p>退换货流程</p>
<p>退款方式时效</p>
<p>投诉与建议</p>
</div>
</div>
</li>
<li>
<div class="part-info">
<p class="head">APP常见问题</p>
<div class="part-body">
<p>iPhone版</p>
<p>Android版</p>
<p>Wap版</p>
</div>
</div>
</li>
</ul>
</div>
</div>
<ul class="nav">
{{#each menuData}}
{{#if subsets}}
<li class="big-category cateId-{{id}} subsets">
<div class="plus inline-block"></div>{{text}}</li>
... ...
... ... @@ -29,11 +29,11 @@ const index = (req, res, next) => {
let reg = /(\d{3})\d{4}(\d{4})/;
for (let i = 0; i < length; i++) {
resultData[i].default = resultData[i].is_default === 'Y';
resultData[i].mobile = resultData[i].mobile.replace(reg, '$1****$2');
}
resultData.leftLength = 7 - length;
resultData.length = length;
res.display('index', {
module: 'me',
page: 'address',
... ...
... ... @@ -23,6 +23,19 @@ const getTime = (time, a)=> {
};
/**
* 取时间的秒数
* @param time
* @returns {number}
*/
const getDate = (time)=> {
if (typeof (time) === 'string') {
return new Date(time).getTime() / 1000;
} else {
return new Date(time.getFullYear() + '-' + time.getMonth() + '-' + time.getDate()).getTime() / 1000;
}
};
/**
* yoho币页面加载
*/
const index = (req, res, next) => {
... ... @@ -30,9 +43,9 @@ const index = (req, res, next) => {
let page = parseInt(req.query.page, 10) || 1;
let queryType = parseInt(req.query.queryType, 10) || 0;
let beginTime = req.query.beginTime || getTime(new Date(), 3);
let date1 = new Date().getTime();
let date2 = new Date(beginTime).getTime();
let selectIndex = parseInt((date1 - date2) / (1000 * 3600 * 24 * 90), 10);
let date1 = getDate(new Date());
let date2 = getDate(beginTime);
let selectIndex = parseInt((date1 - date2) / (90 * 3600 * 24), 10);
currencyModel.getIndexData(uid, page, queryType, beginTime).then(result=> {
result.list.tabs[queryType].isActive = true;
... ...
... ... @@ -34,7 +34,7 @@ const index = (req, res) => {
};
const detail = (req, res) => {
const code = req.query.code;
const code = req.query.orderCode;
const uid = req.user.uid;
Promise.all([orderModel.getOrderDetail(uid, code), mcHandler.getMeThumb()]).then(result => {
... ...
... ... @@ -34,7 +34,7 @@ const index = (req, res, next) => {
*/
const refund = (req, res, next) => {
let uid = req.user.uid;
let code = parseInt(req.params.orderCode, 10);
let code = parseInt(req.query.orderCode, 10);
if (!uid || !code) {
return next();
... ... @@ -75,7 +75,7 @@ const refundApply = (req, res, next) => {
* 退货详情页
*/
const refundDetail = (req, res, next) => {
let applyId = parseInt(req.params.applyId, 10),
let applyId = parseInt(req.query.orderCode, 10),
uid = req.user.uid;
if (!uid || !applyId) {
... ... @@ -94,7 +94,7 @@ const refundDetail = (req, res, next) => {
* 换货申请页
*/
const exchange = (req, res, next) => {
const code = req.params.orderCode;
const code = parseInt(req.query.orderCode, 10);
const uid = req.user.uid;
returns.getChangeGoodsList(code, uid).then(result => {
... ... @@ -130,7 +130,7 @@ const getProductInfo = (req, res, next) => {
* 换货详情页
*/
const exchangeDeatail = (req, res) => {
let id = parseInt(req.params.applyId, 10),
let id = parseInt(req.query.orderCode, 10),
uid = req.user.uid;
returns.getExchangeDetailData(id, uid).then(result => {
... ...
... ... @@ -16,6 +16,7 @@ var fs = require('fs');
var path = require('path');
const uuid = require('uuid');
const os = require('os');
const _ = require('lodash');
const regMobile = /(\d{3})\d{4}(\d{4})/;// 正则匹配替换手机号码中间4位
const regEmail = /(\d{3})\d{4}/;// 正则匹配替换邮箱中间4位
... ... @@ -84,6 +85,25 @@ const index = (req, res, next) => {
result.info.head_ico = result.info.head_ico ? helpers.image(result.info.head_ico, 400, 300, 2) : '';
result.info.mobile = result.info.mobile ? result.info.mobile.replace(regMobile, '$1****$2') : '';
result.stepUrl = '/me/setting/step1';
if (result.info.birthday) {
let a = result.info.birthday.split('-');
_.forEach(result.date.selectYear, function(x) {
if (x.value === a[0]) {
x.isSelected = 'selected';
}
});
_.forEach(result.date.selectMonth, function(x) {
if (x.value === a[1]) {
x.isSelected = 'selected';
}
});
_.forEach(result.date.selectDay, function(x) {
if (x.value === a[2]) {
x.isSelected = 'selected';
}
});
}
res.display('index', {
module: 'me',
... ... @@ -305,6 +325,7 @@ const validate1 = (req, res)=> {
} else if (type === 'mobile') {
let a = yield accountModel.checkVerifyMsg(body.code, body.mobile, body.area);
res.send(a);
} else if (type === 'email') {
let a = yield accountModel.sendVerifyEmail(uid, body.email);
... ...
... ... @@ -320,10 +320,14 @@ const _getUserOrder = (uid, type, page) => {
code: item.orderCode
});
item.refundUrl = helpers.urlFormat('/me/return/refund/' + item.orderCode);
item.exchangeUrl = helpers.urlFormat('/me/return/exchange/' + item.orderCode);
item.refundUrl = helpers.urlFormat('/me/return/refund/', {
orderCode: item.orderCode
});
item.exchangeUrl = helpers.urlFormat('/me/return/exchange/', {
orderCode: item.orderCode
});
item.detailUrl = helpers.urlFormat('/me/order/detail/', {
code: item.orderCode
orderCode: item.orderCode
});
});
... ...
... ... @@ -80,7 +80,9 @@ const getUserReturn = (uid, page) => {
item.hidePrice = true;
item.showStatus = true;
item.refundStr = refundStr[item.refundType];
item.detailUrl = helpers.urlFormat(urlIndex[item.refundType] + item.id);
item.detailUrl = helpers.urlFormat(urlIndex[item.refundType], {
orderCode: item.id
});
item.type = typeIndex[item.refundType];
item.orderGoods.forEach(good => {
... ... @@ -485,7 +487,7 @@ const saveRefund = (orderCode, uid, goods, payment) => {
return {
code: 200,
data: {
refer: `/me/return/refund/detail/${subRes.data.apply_id}`
refer: `/me/return/refund/detail?orderCode=${subRes.data.apply_id}`
}
};
}
... ... @@ -589,7 +591,6 @@ const getChangeGoodsList = (orderCode, uid) => {
*/
const _setExchangeDetailData = (data) => {
data = camelCase(data);
let list = {};
switch (data.status) {
... ... @@ -606,7 +607,9 @@ const _setExchangeDetailData = (data) => {
} else {
Object.assign(list, {
audit: true,
reminder: true
reminder: true,
inDoor: true,
cancel: true
});
}
... ... @@ -614,7 +617,8 @@ const _setExchangeDetailData = (data) => {
case 10:
Object.assign(list, {
through: true,
reminder: true
reminder: true,
location: true
});
if (data.deliveryTpyeName === '寄回换货') {
... ... @@ -631,11 +635,16 @@ const _setExchangeDetailData = (data) => {
break;
case 20:
if (data.deliveryTpyeName === '寄回换货') {
Object.assign(list, {
logistics: true
});
} else {
list.send = true;
list.reminder = true;
list.inDoor = true;
list.auditSuccess = true;
list.view = `//www.yohobuy.com/me/order/detail?code=${data.orderCode}`;
}
break;
... ... @@ -644,6 +653,8 @@ const _setExchangeDetailData = (data) => {
list.takeGoods = true;
list.auditSuccess = true;
list.view = `//www.yohobuy.com/me/order/detail?code=${data.orderCode}`;
} else {
list.takeGoods = true;
}
break;
case 50:
... ... @@ -667,7 +678,7 @@ const _setExchangeDetailData = (data) => {
default:
break;
}
console.log(list);
return list;
};
... ... @@ -683,7 +694,6 @@ const getExchangeDetailData = (id, uid) => {
returnsAPI.getExchangeDetail(id, uid),
returnsAPI.getExpressCompanyAsync()
]).then(result => {
let exchangeData = {};
Object.assign(exchangeData, _setSideMenu('我的退/换货'));
... ...
... ... @@ -11,6 +11,43 @@ const crypto = require('crypto');
const fs = require('fs');
/**
* 日期数据
* @returns {{selectYear: Array, selectMonth: Array, selectDay: Array}}
*/
const getSelect = ()=> {
let date = new Date();
let year = date.getFullYear();
let selectYear = [];
let selectMonth = [];
let selectDay = [];
for (let i = 1950; i < year + 1; i++) {
selectYear.push({
id: i,
value: i + ''
});
}
for (let j = 1; j < 13; j++) {
selectMonth.push({
id: j,
value: j + ''
});
}
for (let k = 1; k < 32; k++) {
selectDay.push({
id: k,
value: k + ''
});
}
return {
selectYear,
selectMonth,
selectDay
};
};
/**
* 查询个人详细信息
* @param uid
* @returns {*}
... ... @@ -67,21 +104,17 @@ const _getUserContactInfo = (uid)=> {
const getUserInfo = (uid) => {
let getData = [_getUserInfo(uid), _getUserContactInfo(uid)];
return Promise.all(getData).then(result => {
return {
info: result[0].info,
genders: result[0].genders,
concat: result[1]
concat: result[1],
date: getSelect()
};
});
};
/* const getVerifyInfo = (uid)=> {
return api.get('', {
method: 'web.passport.getUserVerifyInfo',
uid: uid
}).then(result => result);
};*/
/**
* 编辑个人详细信息
... ...
... ... @@ -35,10 +35,10 @@ router.get('/confirmReceive', order.confirmReceive);
// 退换货
router.get('/return', returns.index);
router.get('/return/refund/:orderCode', returns.refund);
router.get('/return/exchange/:orderCode', returns.exchange);
router.get('/return/refund/detail/:applyId', returns.refundDetail);
router.get('/return/exchange/detail/:applyId', returns.exchangeDeatail);
router.get('/return/refund', returns.refund);
router.get('/return/exchange', returns.exchange);
router.get('/return/refund/detail', returns.refundDetail);
router.get('/return/exchange/detail', returns.exchangeDeatail);
router.post('/return/refund/apply', returns.refundApply);
router.post('/return/cancel', returns.cancelApply);
router.post('/return/setEepress', returns.setEepress);
... ...
... ... @@ -10,7 +10,7 @@
<th class="width-opearte">操作</th>
</tr>
{{#each data}}
<tr class="table-body">
<tr class="table-body ">
<input type="hidden" id="tr_{{address_id}}" value="{{address_id}}">
<input type="hidden" id="tr_{{area_code}}" value="{{area_code}}">
<td class="width-name">{{consignee}}</td>
... ... @@ -22,11 +22,11 @@
<span class="blue opreation update-address" data-id="{{address_id}}">修改</span>
<em class="op-sep">|</em>
<span class="blue opreation del-address" data-id="{{address_id}}">删除</span>
{{#isY is_default}}
{{#if default}}
<span class="btn set-default opreation current-default ">默认地址</span>
{{^}}
<span class="btn set-default opreation " data-id="{{address_id}}">设为默认</span>
{{/isY}}
{{else}}
<span class="btn set-default opreation " data-id={{address_id}}>设为默认</span>
{{/if}}
</div>
</td>
</tr>
... ...
... ... @@ -2,6 +2,7 @@
{{> returns/returns-status}}
<div class="exchange-detail-page" data-id="{{id}}">
<a href="/help?id=43" class="notice" target="_blank">换货须知</a>
<div class="exchange-detail">
{{#if audit}}
<p class="state"><span class="iconfont">&#xe618;</span>换货申请审核中</p>
... ... @@ -28,9 +29,8 @@
{{/if}}
<div class="way">
{{#if takeGoods}}
<p class="contact">我们会尽快将您的商品发出,请耐心等待,如有疑问,请联系<a href="http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=703953&configID=149819&jid=1099911094"><span class="iconfont">&#xe61c;</span></a>在线客服</p>
<p class="contact">我们会尽快将您的商品发出,请耐心等待,如有疑问,请联系<a href="http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409" target="_blank"><span class="iconfont">&#xe61c;</span></a>在线客服</p>
{{/if}}
{{#if reminder}}
... ... @@ -50,7 +50,7 @@
{{/if}}
{{#if doubt}}
<p class="contact">如有疑问,请联系<a href="http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409"><span class="iconfont">&#xe61c;</span></a>在线客服</p>
<p class="contact">如有疑问,请联系<a href="http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409" target="_blank"><span class="iconfont">&#xe61c;</span>在线客服</p></a>
{{/if}}
{{#if auditSuccess}}
... ... @@ -111,17 +111,13 @@
{{#if location}}
<div class="address">
<p class="address-title">收货地址<span class="modify-btn">修改</span></p>
<p class="address-title">收货地址</p>
<div class="address-detail">
<p>所在区域:{{city}}{{county}}</p>
<p>&nbsp货 &nbsp人:{{consigneeName}}</p>
<p>详细地址:{{address}}</p>
<p>联系电话:{{mobile}}</p>
</div>
<div class="address-modify">
</div>
</div>
{{/if}}
</div>
... ... @@ -156,10 +152,10 @@
</div>
</div>
<div class="reason-info">
<span>问题描述:{{reasonName}}</span>
<span>问题描述:{{remark}}</span>
<div class="reason-img">照片凭证:
<div class="evidence">
<img src="{{image img 70 90}}">
<img src="{{evidenceImages}}">
</div>
</div>
</div>
... ... @@ -167,4 +163,5 @@
</div>
</div>
</div>
{{/ exchange}}
\ No newline at end of file
{{/ exchange}}
... ...
... ... @@ -53,7 +53,39 @@
</div>
<div class="form-group">
<label class="label-name">出生日期:</label>
<input id="birthday" class="input" type="text" value="{{info.birthday}}">
{{#date}}
<select id="year" >
{{#each selectYear}}
{{#if isSelected}}
<option value="{{id}}" selected={{isSelected}}>{{value}}</option>
{{else}}
<option value="{{id}}" >{{value}}</option>
{{/if}}
{{/each}}
</select>
<select id="month" >
{{#each selectMonth}}
{{#if isSelected}}
<option value="{{id}}" selected={{isSelected}}>{{value}}</option>
{{else}}
<option value="{{id}}" >{{value}}</option>
{{/if}}
{{/each}}
</select>
<select id="day" >
{{#each selectDay}}
{{#if isSelected}}
<option value="{{id}}" selected={{isSelected}}>{{value}}</option>
{{else}}
<option value="{{id}}" >{{value}}</option>
{{/if}}
{{/each}}
</select>
{{/date}}
<span class="blue error-tips">{{> icon/error-round}}出生日期格式不对</span>
</div>
<div class="form-group-address">
... ...
... ... @@ -73,7 +73,7 @@ const getProductItemData = (params, url, uid) => {
}
result.uid = uid;
result.mainPath = url;
result.mainPath = `/product${url}`;
// 商品基本信息
data.goodInfo = itemFun.setProductData(result);
... ...
... ... @@ -18,7 +18,7 @@ const logger = global.yoho.logger;
const _ = require('lodash');
const payments = {
alipay: 2
alipay: 33
};
/**
... ...
... ... @@ -13,14 +13,14 @@ module.exports = {
app: 'web',
appVersion: '4.6.0', // 调用api接口版本
port: 6003,
siteUrl: '//www.yohobuy.com',
siteUrl: '//www.yohoblk.com',
signExtend: {
app_type: 1
},
subDomains: {
default: '//www.yohobuy.com'
default: '//www.yohoblk.com'
},
cookieDomain: 'yohobuy.com',
cookieDomain: 'yohoblk.com',
domains: {
api: 'http://devapi.yoho.cn:58078/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service: 'http://devservice.yoho.cn:58077/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
... ... @@ -94,8 +94,8 @@ if (isProduction) {
Object.assign(module.exports, {
appName: 'www.yohoblk.com for test',
domains: {
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/',
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/',
search: 'http://192.168.102.216:8080/yohosearch/'
},
useOneapm: true,
... ...
... ... @@ -41,7 +41,7 @@ module.exports = () => {
let password = data.password;
let area = data.area;
return LoginService.signin(area, account, password);
return LoginService.signinAsync(area, account, password);
}).then(result => {
if (result.code !== 200) {
return Promise.reject(new Error(result.message));
... ...
{{# pageHeader}}
<div class="yoho-header">
<div class="blk-header">
<div class="center-content">
<div class="yoho-group-map">
<span class="iconfont">&#xe600;</span>
... ...
{{# navMenu}}
<div class="yoho-nav">
<div class="blk-nav">
<div class="main-nav">
<div class="center-content">
<ul class="main-nav-list">
... ...
<div class="yoho-sign-header">
<div class="blk-sign-header">
<div class="center-content">
<div class="main-logo"></div>
<div class="main-logo">
<a href="{{siteUrl}}"></a>
</div>
<ul class="header-tools right clearfix">
<li>
{{#if userName}}
... ...
... ... @@ -3,8 +3,10 @@
{
"name": "yohoblk-node",
"script": "app.js",
"instances": "0",
"instances": "max",
"exec_mode": "cluster",
"merge_logs": true,
"log_data_format": "YYYY-MM-DD HH:mm Z",
"env": {
"PORT": 6003
}
... ...

8.8 KB | W: | H:

1.78 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -76,6 +76,39 @@ $('.yoho-group a').hover(function() {
$(this).text(data.en);
});
$bagGoodsList.on('click', '.del-good-btn', function() {
var $this = $(this),
data = $this.data();
var list = [];
if (!data) {
return;
}
list.push({
goods_type: data.type,
buy_number: data.num,
selected: 'Y',
product_sku: data.sku,
promotion_id: data.pid
});
$.ajax({
type: 'DELETE',
url: '/shopping/cart/product/remove',
data: {skuList: JSON.stringify(list)},
success: function(result) {
var num = parseInt($bagNum.text(), 10) || 0;
if (result.code === 200) {
num = num - data.num;
$bagNum.text(num);
$this.closest('.goods-item').remove();
}
}
});
});
$('.contain-third').on({
mouseenter: function() {
var $thirdWrapper = $(this).children('.third-nav-wrapper');
... ... @@ -144,6 +177,4 @@ $(document).click(function(e) {
}
});
module.exports = {
refreshBag
};
exports.refreshBag = refreshBag;
... ...
... ... @@ -39,7 +39,7 @@ $('#prise-btn').click(function() {
}
prising = true;
$.ajax({
type: 'GET',
type: 'post',
url: url,
data: {
id: articleId
... ... @@ -86,6 +86,8 @@ $('#collect-btn').click(function() {
if (data.code === 200) {
new _alert(data.message).show();
$this.toggleClass('collected');
} else if (data.code === 400) {
window.location.href = 'http://www.yohobuy.com/passport/login';
} else {
new _alert(data.message).show();
}
... ... @@ -134,6 +136,8 @@ function comment() {
// clear comment-text
$('#comment-info').val('').keyup();
} else if (data.code === 400) {
window.location.href = 'http://www.yohobuy.com/passport/login';
} else {
new _alert(data.message).show();
}
... ...
... ... @@ -23,7 +23,7 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
url = '/editorial/info/praise';
}
$.ajax({
type: 'GET',
type: 'POST',
url: url,
data: {
id: msgId,
... ... @@ -31,8 +31,8 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
}
}).then(function(data) {
if (data.code === 200) {
$this.toggleClass('liked');
$this.next('b').html(data.data);
$this.toggleClass('liked');
} else {
new _alert(data.message).show();
}
... ... @@ -41,3 +41,12 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
}).on('mouseenter mouseleave', '.like-icon', function() {
$(this).closest('.like').toggleClass('hover');
});
$('.msg-title').each(function() {
var $this = $(this),
$text = $this.text();
if ($text.length > 68) {
$this.html($text.substring(0, 64) + '...');
}
});
... ...
... ... @@ -26,7 +26,7 @@ $('.editorial-list-page').on('click', '.like-icon', function() {
url = '/editorial/info/praise';
}
$.ajax({
type: 'GET',
type: 'POST',
url: url,
data: {
id: msgId,
... ...
... ... @@ -59,16 +59,28 @@ $(function() {
info.consignee === '' ? $consignee.next().show() : $consignee.next().hide();
info.address === '' ? $address.next().show() : $address.next().hide();
info.mobile === '' ? $mobile.next().show() :
(!reg.test(info.mobile) ? $mobile.next().html('手机号码格式不对').show() : $mobile.next().hide());
typeof (info.area_code) === 'undefined' ?
addressForm.css('margin-bottom', '20px').find('.error-tips').show() :
addressForm.css('margin-bottom', '70px').find('.error-tips').hide();
if (info.consignee === '' || info.address === '' || info.mobile === '' || !reg.test(info.mobile) ||
typeof (info.area_code) === 'undefined') {
flag = false;
if (info.id) {
info.mobile === '' ? $mobile.next().show() : $mobile.next().hide();
if (info.consignee === '' || info.address === '' || info.mobile === '' ||
typeof (info.area_code) === 'undefined') {
flag = false;
}
return flag;
} else {
info.mobile === '' ? $mobile.next().show() :
(!reg.test(info.mobile) ? $mobile.next().html('手机号码格式不对').show() : $mobile.next().hide());
if (info.consignee === '' || info.address === '' || info.mobile === '' || !reg.test(info.mobile) ||
typeof (info.area_code) === 'undefined') {
flag = false;
}
return flag;
}
return flag;
},
// 拼接一条数据的html
... ... @@ -84,7 +96,8 @@ $(function() {
'<td class=\'width-opearte\'><div><span class=\'blue opreation update-address\' data-id=\'' +
info.address_id + '\'>修改</span>\n<em class="op-sep">|</em>\n' +
'<span class=\'blue opreation del-address\' data-id=\'' + info.address_id + '\'>删除</span>\n' +
'<span class=\'btn set-default opreation \' data-id=\'' + info.address_id + '\'>设为默认</span></div></td>';
'<span class=\'btn set-default opreation \' data-id=\'' + info.address_id + '\'>设为默认</span>' +
'</div></td>';
html += '</tr>';
return html;
},
... ... @@ -118,6 +131,7 @@ $(function() {
info.area_code = area.split(',')[2];
info.area = areaInfo.split(',').join(' ');
if (Bll.check(info) === true) {
// 新增
... ... @@ -149,23 +163,46 @@ $(function() {
});
}
} else { // 修改
$.ajax({
type: 'POST',
url: '/me/address/update',
dataType: 'json',
data: info,
success: function(data) {
if (data.code === 200) {
info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
info.address_id = info.id;
$('#tr_' + info.id).parent().before(Bll.getHtml(info)).remove();
Bll.clearInput();
$('.tip em').html('新增地址');
} else {
new _alert(data.message).show();
if (new RegExp(/^\d{3}[*]{4}\d{4}/).test(info.mobile)) {
$.ajax({
type: 'POST',
url: '/me/address/update',
dataType: 'json',
data: info,
success: function(data) {
if (data.code === 200) {
info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
info.address_id = info.id;
$('#tr_' + info.id).parent().before(Bll.getHtml(info)).remove();
Bll.clearInput();
$('.tip em').html('新增地址');
} else {
new _alert(data.message).show();
}
}
}
});
});
} else if (reg.test(info.mobile)) {
$mobile.next().hide();
$.ajax({
type: 'POST',
url: '/me/address/update',
dataType: 'json',
data: info,
success: function(data) {
if (data.code === 200) {
info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
info.address_id = info.id;
$('#tr_' + info.id).parent().before(Bll.getHtml(info)).remove();
Bll.clearInput();
$('.tip em').html('新增地址');
} else {
new _alert(data.message).show();
}
}
});
} else {
$mobile.next().html('手机号码格式不对').show();
}
}
}
});
... ... @@ -227,12 +264,29 @@ $(function() {
data: {
id: id
},
success: function() {
$('.current-default').removeClass('current-default').text('设为默认');
$(self).addClass('current-default').text('默认地址');
tbody.find('.table-body').eq(0).before('<tr class=\'table-body\'>' + tr.html() + '</tr>');
tr.remove();
success: function(data) {
if (data.code === 200) {
$('.current-default').removeClass('current-default').text('设为默认');
$(self).addClass('current-default').text('默认地址');
tbody.find('.table-body').eq(0).before('<tr class=\'table-body select-row\'>' + tr.html() +
'</tr>');
tr.remove();
} else {
new _alert(data.message).show();
}
}
});
});
// 选中某一行
$(document).on('click', '.table-body', function() {
$('.table-body').removeClass('select-row');
$(this).addClass('select-row');
$('.set-default').hide();
$(this).find('.set-default').css('display', 'inline-block');
});
});
... ...
... ... @@ -3,7 +3,6 @@ var $ = require('yoho-jquery'),
var id = $('.exchange-detail-page').data('id');
var $mainWrap = $('.exchange-detail-page'),
$submitExpress = $mainWrap.find('.submit-express'),
$showExpress = $mainWrap.find('.show-content'),
... ... @@ -12,7 +11,8 @@ var $mainWrap = $('.exchange-detail-page'),
var $expressCompany = $('.express-company'),
$expressCode = $('.express-code');
var expressList = $editExpress.data();
var expressList = $editExpress.data(),
remark = $('.reason-info').find('span').text().length;
function cancelExchangeApply() {
$.ajax({
... ... @@ -77,3 +77,9 @@ $showExpress.on('click', '.reset-express', function() {
$showExpress.addClass('hide');
$editExpress.removeClass('hide');
});
console.log($('.reason-info').find('span').text().length);
if (remark <= 5) {
$('.reason-info').hide();
}
... ...
... ... @@ -9,6 +9,14 @@ var _dialog = dialog.Dialog;
var _alert = dialog.Alert;
var modifyHead = require('./setting/modifyHead');// flash操作
var tip;// 头像编辑弹框
var $year = $('#year');
var $month = $('#month');
var $day = $('#day');
var birthday = {
year: $year.val() || '',
month: $month.val() || '',
day: $day.val() || ''
};
var headHtml = modifyHead.swfobject('head', '600px', '400px', '../../img/me/head.swf?code=' + Math.random() +
'&upload_url=' + encodeURIComponent(location.protocol + '//' +
... ... @@ -40,8 +48,8 @@ var Bll = {
typeof (info.area_code) === 'undefined' ?
addressForm.css('margin-bottom', '20px').find('.error-tips').show() :
addressForm.css('margin-bottom', '70px').find('.error-tips').hide();
if (!regBirth.test(info.birthday) || !regName.test(info.nick_name) ||
!regRealName.test(info.username) || typeof (info.area_code) === 'undefined') {
if (!regBirth.test(info.birthday) || !regName.test(info.nick_name) || !regRealName.test(info.username) ||
typeof (info.area_code) === 'undefined') {
flag = false;
}
return flag;
... ... @@ -109,6 +117,18 @@ window.receive_image_bytes = function(obj) {
}
};
// 时间控件切换
$year.on('change', function() {
birthday.year = $(this).val();
});
$month.on('change', function() {
birthday.month = $(this).val();
});
$day.on('change', function() {
birthday.day = $(this).val();
});
$(function() {
var address = cascadingAddress({el: '#address'});
var areaCode = $('#area_code').val();
... ... @@ -139,7 +159,7 @@ $(function() {
nick_name: $('#nick_name').val(),
username: $('#username').val(),
gender: $('#gender').val(),
birthday: $('#birthday').val(),
birthday: birthday.year + '-' + birthday.month + '-' + birthday.day,
area_code: area.split(',')[2],
// todo 手机号码老接口必填
... ...
... ... @@ -51,8 +51,8 @@ function uploadImage() {
module.exports = {
swfobject,
uploadImage
swfobject: swfobject,
uploadImage: uploadImage
};
... ...
... ... @@ -11,7 +11,7 @@ var type = types[types.length - 1];// 界面操作类型
var $imgCaptchaInput = $('#captcha');
var second = 60;
var $sms = $('#send-code2');// 发送短信验证码按钮
var area = $('#country-code').text().substring(0);// 地区码
var area = $('#country-code').text().substring(0) || '86';// 地区码
// 发送短信后倒计时显示
var disableSMSBtn = function() {
second -= 1;
... ...
... ... @@ -8,7 +8,7 @@ var dialog = require('../../plugins/dialog');
var _alert = dialog.Alert;
var types = location.pathname.split('/');
var type = types[types.length - 1];// 界面操作类型
var area = $('#country-code').text() || '86';
/**
* 手机号码验证
... ... @@ -35,7 +35,7 @@ $('[placeholder]').placeholder();
// 发送手机验证码
$sms.click(function() {
var mobile = $('#real-mobile').val();
var area = $('#country-code').text();
if ($(this).hasClass('disable')) {
return;
... ... @@ -64,7 +64,6 @@ $sms.click(function() {
$('#mobile-step1').click(function() {
var code = $('#msg-code').val().trim();
var mobile = $('#real-mobile').val();
var area = '+86';
$.ajax({
type: 'POST',
... ...
.yoho-header {
.blk-header {
height: 50px;
line-height: 50px;
font-size: 12px;
... ... @@ -231,7 +231,7 @@
}
}
.yoho-nav {
.blk-nav {
.main-nav {
height: 80px;
... ... @@ -285,7 +285,11 @@
li {
float: left;
margin-right: 66px;
margin-left: 66px;
}
li:first-child {
margin-left: 0;
}
li > a {
... ...
div.blk-pagination {
width: 500px;
padding: 0;
a {
... ...
.yoho-sign-header {
.blk-sign-header {
.center-content {
height: 80px;
border-bottom: 2px solid #eee;
... ... @@ -9,6 +9,12 @@
height: 80px;
background: resolve('layout/sign-logo.png') no-repeat center center;
display: inline-block;
> a {
display: inline-block;
width: 100%;
height: 100%;
}
}
.header-tools {
... ...
... ... @@ -430,4 +430,8 @@
}
}
.blk-pagination {
width: 400px;
}
}
... ...
... ... @@ -26,12 +26,7 @@
color: #333;
line-height: 30px;
max-height: 64px;
word-wrap: break-word;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.msg-title:hover {
... ...
... ... @@ -47,6 +47,23 @@
width: 990px;
padding: 35px 30px;
background-color: #fff;
.normal-data,
.step-data {
padding: 2px;
line-height: 25px;
}
.big-title {
font-size: 20px;
}
.step-title {
font-weight: bolder;
padding-bottom: 5px;
}
.step {
list-style: disc;
}
}
}
... ...
... ... @@ -119,6 +119,10 @@
padding: 8px 0 8px 10px;
}
.select-row {
border: solid 2px black;
}
.width-name {
width: 60px;
word-break: break-all;
... ... @@ -148,8 +152,7 @@
.current-default,
.set-default {
display: inline-block;
display: none;
margin-left: 20px;
}
}
... ...
.exchange-detail-page {
position: relative;
.state {
font-size: 16px;
color: #5cb0de;
... ... @@ -18,7 +20,6 @@
font-size: 16px;
color: #5cb0de;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
span {
font-size: 20px;
... ... @@ -29,6 +30,7 @@
.way {
font-size: 14px;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
.way-title {
margin-top: 10px;
... ... @@ -111,16 +113,8 @@
line-height: 40px;
}
.modify-btn {
font-size: 12px;
float: right;
display: block;
height: 20px;
width: 40px;
line-height: 20px;
text-align: center;
margin-top: 10px;
border: 1px solid #eee;
label {
margin-right: 5px;
}
.address-detail {
... ... @@ -374,4 +368,38 @@
}
}
.input-group {
height: 35px;
}
.change-area {
display: block;
float: left;
height: 35px;
line-height: 35px;
}
.dist-item {
padding: 5px;
}
.notice {
width: 70px;
height: 24px;
line-height: 26px;
text-align: center;
font-size: 12px;
border: 1px solid #eee;
display: block;
cursor: pointer;
position: absolute;
top: -184px;
right: 0;
}
.error-tip {
position: relative;
top: -29px;
left: 150px;
}
}
... ...
... ... @@ -258,6 +258,7 @@
.btn {
display: inline-block;
width: 100px !important;
}
}
}
... ...
... ... @@ -6,6 +6,9 @@
clear: both;
margin-bottom: 20px;
}
select {
width: 60px;
}
.form-group-address {
clear: both;
... ...
... ... @@ -11,7 +11,7 @@
</div>
<div class="price">
<p>¥{{round sales_price 2}} X{{buy_number}}</p>
<span class="del-good-btn">删除</span>
<span class="del-good-btn" data-type="{{goods_type}}" data-num="{{buy_number}}" data-num="{{buy_number}}" data-sku="{{product_sku}}" data-pid="{{promotion_id}}">删除</span>
</div>
</dd>
{{/ goods}}
\ No newline at end of file
... ...