Authored by yyq

Merge branch 'release/5.6' of git.yoho.cn:fe/yohobuy-node into release/5.6

/**
* 意见反馈 controller
* @return jsonp
* @author: gxh<xuhui.ge@yoho.cn>
* @date: 2017/04/06
*/
'use strict';
const suggestFeedBackModel = require('../models/suggestFeedBack');
const _ = require('lodash');
const getFeedBack = (req, res, next) => {
let feedbackId = req.query.feedback_id || 0;
let questionId = req.query.question_id || 0;
let answer = _.trim(req.query.answer) || '';
let solution = req.query.solution || 0;
if (!feedbackId || !questionId || !answer || !solution) {
suggestFeedBackModel.feedBackApi(feedbackId, questionId, answer, solution).then((result) => {
return res.jsonp({
code: 200,
data: result.data,
message: 'success'
});
}).catch(next);
} else {
return res.status(403).send({
message: '意见反馈失败'
});
}
};
module.exports = {
getFeedBack
};
... ...
/**
* suggestFeedBack model
* @author: gxh<xuhui.ge@yoho.cn>
* @date: 2017/04/06
*/
'use strict';
const api = global.yoho.API;
const config = global.yoho.config;
/**
* 获取用户信息
* @param uid
* @return string
*/
const feedBackApi = (feedbackId, questionId, answer, solution) => {
let params = {
method: 'open.feedback.submit',
feedback_id: feedbackId,
question_id: questionId,
answer: answer,
solution: solution
};
return api.get('', params, config.apiCache);
};
module.exports = {
feedBackApi
};
... ...
... ... @@ -17,6 +17,7 @@ const uploadCtrl = require(`${cRoot}/upload`);
const erp2goods = require(`${cRoot}/erp2goods`);
const getBanner = require(`${cRoot}/getBanner`);
const passport = require(`${cRoot}/passport`);
const suggestFeedBack = require(`${cRoot}/suggestFeedBack`);
router.get('/recentReview', rvCtrl.index); // 最近浏览
router.post('/getRecommend', rvCtrl.getRecommend); // 为你优选
... ... @@ -29,6 +30,8 @@ router.get('/getbanner', getBanner.index);
router.get('/passport', passport.index);
router.get('/suggestfeedback', suggestFeedBack.getFeedBack);
module.exports = router;
... ...
... ... @@ -6,6 +6,10 @@
<div class="me-main">
<div class="order-detail block" data-id="{{orderNum}}">
<h2 class="title"></h2>
{{!--防诈骗提示--}}
{{> swindle-info}}
<div class="detail-info{{#if virtualGoods}} virtual-detail{{/if}} {{#if offlineBySelf}}offline-self{{/if}}">
<div class="status">
<p>
... ...
... ... @@ -9,6 +9,9 @@
VIP金额累计需要订单成功且无退换货
</h2>
{{!--防诈骗提示--}}
{{> swindle-info}}
{{> tabs}}
{{#if orders}}
... ...
... ... @@ -29,6 +29,10 @@
更多订单
</a>
</h2>
{{!--防诈骗提示--}}
{{> swindle-info}}
{{> home/orders/order-block}}
</div>
{{/ latestOrders}}
... ...
... ... @@ -7,6 +7,9 @@
<div class="returns-apply block{{#if exchange}} exchange{{/if}}">
<h2 class="title"></h2>
{{!--防诈骗提示--}}
{{> swindle-info}}
<div class="apply-container">
{{# exchange}}
<div class="return-prompt">
... ...
... ... @@ -6,6 +6,10 @@
<div class="me-main">
<div class="returns-detail block{{#if detail.isChange}} exchange-detail{{/if}}">
<h2 class="title"></h2>
{{!--防诈骗提示--}}
{{> swindle-info}}
{{# detail}}
<div class="order-info">
订单编号:{{orderNum}}
... ...
... ... @@ -6,6 +6,10 @@
{{# save}}
<div class="returns-save block{{#unless refund}} exchange{{/unless}}">
<h2 class="title"></h2>
{{!--防诈骗提示--}}
{{> swindle-info}}
<div class="save-container">
<h2>{{type}}申请:</h2>
<div class="save-prompt">
... ...
... ... @@ -3,6 +3,10 @@
<div class="me-main">
<div class="returns block">
<h2 class="title"></h2>
{{!--防诈骗提示--}}
{{> swindle-info}}
<div class="me-orders">
<p class="order-table-header table-header clearfix">
<span class="info">商品信息</span>
... ...
<div class="swindle-info">
<span>重要提醒:</span>有货不会以任何理由要求您点击任何网址链接办理退货退款,请谨防钓鱼链接及带“+”号的诈骗电话!
</div>
... ...
... ... @@ -92,7 +92,7 @@ const applysave = (req, res, next) => {
try {
for (let key in req.body) {
if (req.body.hasOwnProperty(key)) {
if (req.body[key]) {
key = key + '';
param[_.camelCase(key)] = req.body[key];
}
... ...
... ... @@ -11,7 +11,7 @@ const isTest = process.env.NODE_ENV === 'test';
module.exports = {
app: 'web',
appVersion: '5.5.1', // 调用api的版本
appVersion: '5.6.0', // 调用api的版本
port: 6002,
siteUrl: 'http://www.yohobuy.com',
cookieDomain: '.yohobuy.com',
... ...
... ... @@ -68,5 +68,20 @@ module.exports = [
'www'
);
}
},
// erp2good
{
type: TYPE.rewrite,
origin: (req) => {
console.log(req.path);
return req.path === '/erp2goods';
},
target: '/common/erp2goods'
},
{
type: TYPE.redirect,
origin: '/index.html',
target: helpers.urlFormat('/')
}
];
... ...
... ... @@ -15,6 +15,11 @@
</ul>
{{/if}}
</div>
<div class="left swindle-info">
<a href="//www.yohobuy.com/help/detail?id=103" target="_blank">
<i class="iconfont">&#xe6ed;</i>关于防诈骗的重要提醒
</a>
</div>
<div class="left yoho-cert-tip"></div>
<div class="yoho-buy-tools right">
<ul>
... ...
{
"name": "yohobuy-node",
"version": "5.5.18",
"version": "5.5.23",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
<div class="content">
<div class="group">
<h3 class="dia-title">认证资格说明</h3>
<p>1、全日制大学本科、研究生、博士;</p>
<p>2、学校在可选范围之内,可能有部分学校暂未被收录,后期会尽快添加;</p>
<p>3、每个学号只能认证一个有货账户;</p>
</div>
<div class="group">
<h3 class="dia-title">特权详细说明</h3>
<p><span class="font-bold">权益一:</span>认证立赠100有货币</p>
<p>认证成功,立即赠送100有货币。</p>
<p><span class="font-bold">权益二:</span>新品立享9折</p>
<p>学生购买指定原价新品时,可立即享受9折优惠,此折扣与VIP折扣不可同时享受。</p>
<p><span class="font-bold">权益三:</span>每1元返1个有货币</p>
<p>1、学生购买指定商品时,每1元返1个有货币(以商品的实际成交金额计算);</p>
<p>2、有货币返还时间:确认收货7日后,系统自动将对应数量的有货币返还至购买账户;</p>
<p>3、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>
<p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p>
<p><span class="font-bold">权益四:</span>分期付款</p>
<p>开通有货分期后,可享受部分商品30天延后付款,最长6个月的分期付款,开启任性购物模式。</p>
</div>
</div>
... ...
... ... @@ -361,18 +361,13 @@ function parseProductInfo(productInfo, defaultInfo) {
};
}
function updateCartItem(newSku, oldSku) {
function updateCartItem(swapData) {
return $.ajax({
type: 'POST',
url: '/cart/cart/updateProduct',
data: {
swapData: JSON.stringify([{
buy_number: '1',
selected: 'Y',
new_product_sku: newSku,
old_product_sku: oldSku
}])
swapData: JSON.stringify([swapData])
}
}).then(function(d) {
if (d.code === 200) {
... ...
... ... @@ -75,11 +75,14 @@ ColorPanelAction = {
var $item = $this.closest('li[data-role="pitem"]');
// var pid = $item.data('pid');
var swapData = {};
var oldSku = $item.data('id');
var $size = $this.closest('.goods-choose-box').find('.choose-size .dt.active');
var newSku = $size.data('sku');
var newSkn = $this.closest('.goods-info').data('skn');
var promotionId = $item.data('promotionid');
var poolId = $item.data('pool-id');
var batchNo = $item.data('batch-no');
// 没有重新选择颜色-尺码,则不用重新请求显示
if (!oldSku || !newSku || oldSku === newSku) {
... ... @@ -91,7 +94,23 @@ ColorPanelAction = {
if ($item.data('isgift') || $item.data('ispricegift')) {
return capi.updateCartGiftItem(promotionId, newSkn, newSku);
}
capi.updateCartItem(newSku, oldSku);
swapData = {
buy_number: '1',
selected: 'Y',
new_product_sku: newSku,
old_product_sku: oldSku
}
// 套餐编辑尺码
if (poolId) {
$.extend(swapData, {
activity_id: poolId,
batch_no: batchNo
});
}
capi.updateCartItem(swapData);
},
_hideColorSizePanel: function($item) {
$item.find('.goods-choose-box').hide();
... ...
... ... @@ -9,6 +9,8 @@ var $ = require('yoho-jquery'),
var Dialog = require('../common/dialog').Dialog;
var authProtocolTpl = require('hbs/product/students/auth-protocol.hbs');
var $sortItem = $('.sort-item'),
$agreenShow = $('#agreen-show'),
$stuProv = $('#stu-province-show'),
... ... @@ -438,12 +440,7 @@ $('.ident-select-wrap > .arrow-down').click(function() {
});
$couponDia.on('click', function() {
var cont = '<h3 class="dia-title">认证协议</h3>' +
'<p>(1) 全日制大学生及硕士博士研究生;</p>' +
'<p>(2) 学校在可选的范围内,有部分学校可能暂未收录,后期尽快增加;</p>' +
'<p>(3) 每个学号只能认证一个账户;</p>';
createStuDialog('stu-agree-dialog', cont);
createStuDialog('stu-agree-dialog', authProtocolTpl({}));
});
$rightsItem.each(function(index, ele) {
... ... @@ -451,7 +448,7 @@ $rightsItem.each(function(index, ele) {
detail = $(ele).find('.item-detail').html(),
i = Number(index) + 1;
rightsText += '<p>权益' + i + ':' + title + '</p><p>' + detail + '</p>';
rightsText += '<p><span class="font-bold">权益' + i + ':</span>' + title + '</p><p>' + detail + '</p>';
i !== $rightsItem.length ? rightsText += '<br>' : '';
});
... ...
... ... @@ -7,7 +7,7 @@
width: 171px;
height: 40px;
display: inline-block;
background-image: url(../img/sprite.3party.png);
background-image: resolve(header/logo.png);
background-position: 0 0;
vertical-align: middle;
margin-right: 10px;
... ...
... ... @@ -7,7 +7,7 @@
width: 171px;
height: 40px;
display: inline-block;
background-image: url(../img/sprite0.3party.png);
background-image: resolve(header/logo.png);
background-position: 0 0;
vertical-align: middle;
margin-right: 10px;
... ...
... ... @@ -989,6 +989,18 @@
}
}
}
.swindle-info {
color: #444;
font-size: 12px;
margin-left: 20px;
i {
color: #cd0c25;
font-size: 12px;
margin-right: 5px;
}
}
}
.yoho-header.boys {
... ...
... ... @@ -289,6 +289,17 @@
.presall-tag {
background: #333;
}
.swindle-info {
margin: 10px;
padding: 10px;
font-size: 13px;
background-color: #faf6da;
span {
color: #cd0c25;
}
}
}
@import "default";
... ...
... ... @@ -6,7 +6,7 @@
}
.status {
margin: 10px 0;
margin: 0 0 10px;
padding: 10px;
background: #efefef;
border-bottom: 1px solid #e6e6e6;
... ... @@ -156,7 +156,6 @@
}
}
.outter-progress {
width: 554px;
height: 12px;
... ...
... ... @@ -543,6 +543,10 @@
.content {
text-align: left;
margin: 10px;
width: inherit;
height: 400px;
overflow: hidden;
overflow-y: scroll;
}
.dia-title {
... ... @@ -557,16 +561,19 @@
p {
line-height: 35px;
font-size: 14px;
}
.font-bold {
font-weight: bold;
}
}
.stu-rights-dialog {
width: 600px;
width: 570px;
}
.stu-agree-dialog {
width: 500px;
width: 600px;
}
.stu-alert .content p {
... ...