Authored by yyq

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

  1 +/**
  2 + * 意见反馈 controller
  3 + * @return jsonp
  4 + * @author: gxh<xuhui.ge@yoho.cn>
  5 + * @date: 2017/04/06
  6 + */
  7 +
  8 +'use strict';
  9 +
  10 +const suggestFeedBackModel = require('../models/suggestFeedBack');
  11 +const _ = require('lodash');
  12 +
  13 +const getFeedBack = (req, res, next) => {
  14 +
  15 + let feedbackId = req.query.feedback_id || 0;
  16 + let questionId = req.query.question_id || 0;
  17 + let answer = _.trim(req.query.answer) || '';
  18 + let solution = req.query.solution || 0;
  19 +
  20 + if (!feedbackId || !questionId || !answer || !solution) {
  21 +
  22 + suggestFeedBackModel.feedBackApi(feedbackId, questionId, answer, solution).then((result) => {
  23 +
  24 + return res.jsonp({
  25 + code: 200,
  26 + data: result.data,
  27 + message: 'success'
  28 + });
  29 +
  30 + }).catch(next);
  31 +
  32 + } else {
  33 + return res.status(403).send({
  34 + message: '意见反馈失败'
  35 + });
  36 + }
  37 +
  38 +};
  39 +
  40 +module.exports = {
  41 + getFeedBack
  42 +};
  43 +
  44 +
  1 +/**
  2 + * suggestFeedBack model
  3 + * @author: gxh<xuhui.ge@yoho.cn>
  4 + * @date: 2017/04/06
  5 + */
  6 +
  7 +'use strict';
  8 +
  9 +const api = global.yoho.API;
  10 +const config = global.yoho.config;
  11 +
  12 +/**
  13 + * 获取用户信息
  14 + * @param uid
  15 + * @return string
  16 + */
  17 +const feedBackApi = (feedbackId, questionId, answer, solution) => {
  18 + let params = {
  19 + method: 'open.feedback.submit',
  20 + feedback_id: feedbackId,
  21 + question_id: questionId,
  22 + answer: answer,
  23 + solution: solution
  24 + };
  25 +
  26 + return api.get('', params, config.apiCache);
  27 +};
  28 +
  29 +module.exports = {
  30 + feedBackApi
  31 +};
@@ -17,6 +17,7 @@ const uploadCtrl = require(`${cRoot}/upload`); @@ -17,6 +17,7 @@ const uploadCtrl = require(`${cRoot}/upload`);
17 const erp2goods = require(`${cRoot}/erp2goods`); 17 const erp2goods = require(`${cRoot}/erp2goods`);
18 const getBanner = require(`${cRoot}/getBanner`); 18 const getBanner = require(`${cRoot}/getBanner`);
19 const passport = require(`${cRoot}/passport`); 19 const passport = require(`${cRoot}/passport`);
  20 +const suggestFeedBack = require(`${cRoot}/suggestFeedBack`);
20 21
21 router.get('/recentReview', rvCtrl.index); // 最近浏览 22 router.get('/recentReview', rvCtrl.index); // 最近浏览
22 router.post('/getRecommend', rvCtrl.getRecommend); // 为你优选 23 router.post('/getRecommend', rvCtrl.getRecommend); // 为你优选
@@ -29,6 +30,8 @@ router.get('/getbanner', getBanner.index); @@ -29,6 +30,8 @@ router.get('/getbanner', getBanner.index);
29 30
30 router.get('/passport', passport.index); 31 router.get('/passport', passport.index);
31 32
  33 +router.get('/suggestfeedback', suggestFeedBack.getFeedBack);
  34 +
32 module.exports = router; 35 module.exports = router;
33 36
34 37
@@ -6,6 +6,10 @@ @@ -6,6 +6,10 @@
6 <div class="me-main"> 6 <div class="me-main">
7 <div class="order-detail block" data-id="{{orderNum}}"> 7 <div class="order-detail block" data-id="{{orderNum}}">
8 <h2 class="title"></h2> 8 <h2 class="title"></h2>
  9 +
  10 + {{!--防诈骗提示--}}
  11 + {{> swindle-info}}
  12 +
9 <div class="detail-info{{#if virtualGoods}} virtual-detail{{/if}} {{#if offlineBySelf}}offline-self{{/if}}"> 13 <div class="detail-info{{#if virtualGoods}} virtual-detail{{/if}} {{#if offlineBySelf}}offline-self{{/if}}">
10 <div class="status"> 14 <div class="status">
11 <p> 15 <p>
@@ -9,6 +9,9 @@ @@ -9,6 +9,9 @@
9 VIP金额累计需要订单成功且无退换货 9 VIP金额累计需要订单成功且无退换货
10 </h2> 10 </h2>
11 11
  12 + {{!--防诈骗提示--}}
  13 + {{> swindle-info}}
  14 +
12 {{> tabs}} 15 {{> tabs}}
13 16
14 {{#if orders}} 17 {{#if orders}}
@@ -29,6 +29,10 @@ @@ -29,6 +29,10 @@
29 更多订单 29 更多订单
30 </a> 30 </a>
31 </h2> 31 </h2>
  32 +
  33 + {{!--防诈骗提示--}}
  34 + {{> swindle-info}}
  35 +
32 {{> home/orders/order-block}} 36 {{> home/orders/order-block}}
33 </div> 37 </div>
34 {{/ latestOrders}} 38 {{/ latestOrders}}
@@ -7,6 +7,9 @@ @@ -7,6 +7,9 @@
7 <div class="returns-apply block{{#if exchange}} exchange{{/if}}"> 7 <div class="returns-apply block{{#if exchange}} exchange{{/if}}">
8 <h2 class="title"></h2> 8 <h2 class="title"></h2>
9 9
  10 + {{!--防诈骗提示--}}
  11 + {{> swindle-info}}
  12 +
10 <div class="apply-container"> 13 <div class="apply-container">
11 {{# exchange}} 14 {{# exchange}}
12 <div class="return-prompt"> 15 <div class="return-prompt">
@@ -6,6 +6,10 @@ @@ -6,6 +6,10 @@
6 <div class="me-main"> 6 <div class="me-main">
7 <div class="returns-detail block{{#if detail.isChange}} exchange-detail{{/if}}"> 7 <div class="returns-detail block{{#if detail.isChange}} exchange-detail{{/if}}">
8 <h2 class="title"></h2> 8 <h2 class="title"></h2>
  9 +
  10 + {{!--防诈骗提示--}}
  11 + {{> swindle-info}}
  12 +
9 {{# detail}} 13 {{# detail}}
10 <div class="order-info"> 14 <div class="order-info">
11 订单编号:{{orderNum}} 15 订单编号:{{orderNum}}
@@ -6,6 +6,10 @@ @@ -6,6 +6,10 @@
6 {{# save}} 6 {{# save}}
7 <div class="returns-save block{{#unless refund}} exchange{{/unless}}"> 7 <div class="returns-save block{{#unless refund}} exchange{{/unless}}">
8 <h2 class="title"></h2> 8 <h2 class="title"></h2>
  9 +
  10 + {{!--防诈骗提示--}}
  11 + {{> swindle-info}}
  12 +
9 <div class="save-container"> 13 <div class="save-container">
10 <h2>{{type}}申请:</h2> 14 <h2>{{type}}申请:</h2>
11 <div class="save-prompt"> 15 <div class="save-prompt">
@@ -3,6 +3,10 @@ @@ -3,6 +3,10 @@
3 <div class="me-main"> 3 <div class="me-main">
4 <div class="returns block"> 4 <div class="returns block">
5 <h2 class="title"></h2> 5 <h2 class="title"></h2>
  6 +
  7 + {{!--防诈骗提示--}}
  8 + {{> swindle-info}}
  9 +
6 <div class="me-orders"> 10 <div class="me-orders">
7 <p class="order-table-header table-header clearfix"> 11 <p class="order-table-header table-header clearfix">
8 <span class="info">商品信息</span> 12 <span class="info">商品信息</span>
  1 +<div class="swindle-info">
  2 + <span>重要提醒:</span>有货不会以任何理由要求您点击任何网址链接办理退货退款,请谨防钓鱼链接及带“+”号的诈骗电话!
  3 +</div>
@@ -92,7 +92,7 @@ const applysave = (req, res, next) => { @@ -92,7 +92,7 @@ const applysave = (req, res, next) => {
92 92
93 try { 93 try {
94 for (let key in req.body) { 94 for (let key in req.body) {
95 - if (req.body.hasOwnProperty(key)) { 95 + if (req.body[key]) {
96 key = key + ''; 96 key = key + '';
97 param[_.camelCase(key)] = req.body[key]; 97 param[_.camelCase(key)] = req.body[key];
98 } 98 }
@@ -11,7 +11,7 @@ const isTest = process.env.NODE_ENV === 'test'; @@ -11,7 +11,7 @@ const isTest = process.env.NODE_ENV === 'test';
11 11
12 module.exports = { 12 module.exports = {
13 app: 'web', 13 app: 'web',
14 - appVersion: '5.5.1', // 调用api的版本 14 + appVersion: '5.6.0', // 调用api的版本
15 port: 6002, 15 port: 6002,
16 siteUrl: 'http://www.yohobuy.com', 16 siteUrl: 'http://www.yohobuy.com',
17 cookieDomain: '.yohobuy.com', 17 cookieDomain: '.yohobuy.com',
@@ -68,5 +68,20 @@ module.exports = [ @@ -68,5 +68,20 @@ module.exports = [
68 'www' 68 'www'
69 ); 69 );
70 } 70 }
  71 + },
  72 +
  73 + // erp2good
  74 + {
  75 + type: TYPE.rewrite,
  76 + origin: (req) => {
  77 + console.log(req.path);
  78 + return req.path === '/erp2goods';
  79 + },
  80 + target: '/common/erp2goods'
  81 + },
  82 + {
  83 + type: TYPE.redirect,
  84 + origin: '/index.html',
  85 + target: helpers.urlFormat('/')
71 } 86 }
72 ]; 87 ];
@@ -15,6 +15,11 @@ @@ -15,6 +15,11 @@
15 </ul> 15 </ul>
16 {{/if}} 16 {{/if}}
17 </div> 17 </div>
  18 + <div class="left swindle-info">
  19 + <a href="//www.yohobuy.com/help/detail?id=103" target="_blank">
  20 + <i class="iconfont">&#xe6ed;</i>关于防诈骗的重要提醒
  21 + </a>
  22 + </div>
18 <div class="left yoho-cert-tip"></div> 23 <div class="left yoho-cert-tip"></div>
19 <div class="yoho-buy-tools right"> 24 <div class="yoho-buy-tools right">
20 <ul> 25 <ul>
1 { 1 {
2 "name": "yohobuy-node", 2 "name": "yohobuy-node",
3 - "version": "5.5.18", 3 + "version": "5.5.23",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
  1 +<div class="content">
  2 + <div class="group">
  3 + <h3 class="dia-title">认证资格说明</h3>
  4 + <p>1、全日制大学本科、研究生、博士;</p>
  5 + <p>2、学校在可选范围之内,可能有部分学校暂未被收录,后期会尽快添加;</p>
  6 + <p>3、每个学号只能认证一个有货账户;</p>
  7 + </div>
  8 + <div class="group">
  9 + <h3 class="dia-title">特权详细说明</h3>
  10 +
  11 + <p><span class="font-bold">权益一:</span>认证立赠100有货币</p>
  12 + <p>认证成功,立即赠送100有货币。</p>
  13 +
  14 + <p><span class="font-bold">权益二:</span>新品立享9折</p>
  15 + <p>学生购买指定原价新品时,可立即享受9折优惠,此折扣与VIP折扣不可同时享受。</p>
  16 +
  17 + <p><span class="font-bold">权益三:</span>每1元返1个有货币</p>
  18 + <p>1、学生购买指定商品时,每1元返1个有货币(以商品的实际成交金额计算);</p>
  19 + <p>2、有货币返还时间:确认收货7日后,系统自动将对应数量的有货币返还至购买账户;</p>
  20 + <p>3、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>
  21 + <p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p>
  22 +
  23 + <p><span class="font-bold">权益四:</span>分期付款</p>
  24 + <p>开通有货分期后,可享受部分商品30天延后付款,最长6个月的分期付款,开启任性购物模式。</p>
  25 + </div>
  26 +</div>
@@ -361,18 +361,13 @@ function parseProductInfo(productInfo, defaultInfo) { @@ -361,18 +361,13 @@ function parseProductInfo(productInfo, defaultInfo) {
361 }; 361 };
362 } 362 }
363 363
364 -function updateCartItem(newSku, oldSku) { 364 +function updateCartItem(swapData) {
365 365
366 return $.ajax({ 366 return $.ajax({
367 type: 'POST', 367 type: 'POST',
368 url: '/cart/cart/updateProduct', 368 url: '/cart/cart/updateProduct',
369 data: { 369 data: {
370 - swapData: JSON.stringify([{  
371 - buy_number: '1',  
372 - selected: 'Y',  
373 - new_product_sku: newSku,  
374 - old_product_sku: oldSku  
375 - }]) 370 + swapData: JSON.stringify([swapData])
376 } 371 }
377 }).then(function(d) { 372 }).then(function(d) {
378 if (d.code === 200) { 373 if (d.code === 200) {
@@ -75,11 +75,14 @@ ColorPanelAction = { @@ -75,11 +75,14 @@ ColorPanelAction = {
75 var $item = $this.closest('li[data-role="pitem"]'); 75 var $item = $this.closest('li[data-role="pitem"]');
76 76
77 // var pid = $item.data('pid'); 77 // var pid = $item.data('pid');
  78 + var swapData = {};
78 var oldSku = $item.data('id'); 79 var oldSku = $item.data('id');
79 var $size = $this.closest('.goods-choose-box').find('.choose-size .dt.active'); 80 var $size = $this.closest('.goods-choose-box').find('.choose-size .dt.active');
80 var newSku = $size.data('sku'); 81 var newSku = $size.data('sku');
81 var newSkn = $this.closest('.goods-info').data('skn'); 82 var newSkn = $this.closest('.goods-info').data('skn');
82 var promotionId = $item.data('promotionid'); 83 var promotionId = $item.data('promotionid');
  84 + var poolId = $item.data('pool-id');
  85 + var batchNo = $item.data('batch-no');
83 86
84 // 没有重新选择颜色-尺码,则不用重新请求显示 87 // 没有重新选择颜色-尺码,则不用重新请求显示
85 if (!oldSku || !newSku || oldSku === newSku) { 88 if (!oldSku || !newSku || oldSku === newSku) {
@@ -91,7 +94,23 @@ ColorPanelAction = { @@ -91,7 +94,23 @@ ColorPanelAction = {
91 if ($item.data('isgift') || $item.data('ispricegift')) { 94 if ($item.data('isgift') || $item.data('ispricegift')) {
92 return capi.updateCartGiftItem(promotionId, newSkn, newSku); 95 return capi.updateCartGiftItem(promotionId, newSkn, newSku);
93 } 96 }
94 - capi.updateCartItem(newSku, oldSku); 97 +
  98 + swapData = {
  99 + buy_number: '1',
  100 + selected: 'Y',
  101 + new_product_sku: newSku,
  102 + old_product_sku: oldSku
  103 + }
  104 +
  105 + // 套餐编辑尺码
  106 + if (poolId) {
  107 + $.extend(swapData, {
  108 + activity_id: poolId,
  109 + batch_no: batchNo
  110 + });
  111 + }
  112 +
  113 + capi.updateCartItem(swapData);
95 }, 114 },
96 _hideColorSizePanel: function($item) { 115 _hideColorSizePanel: function($item) {
97 $item.find('.goods-choose-box').hide(); 116 $item.find('.goods-choose-box').hide();
@@ -9,6 +9,8 @@ var $ = require('yoho-jquery'), @@ -9,6 +9,8 @@ var $ = require('yoho-jquery'),
9 9
10 var Dialog = require('../common/dialog').Dialog; 10 var Dialog = require('../common/dialog').Dialog;
11 11
  12 +var authProtocolTpl = require('hbs/product/students/auth-protocol.hbs');
  13 +
12 var $sortItem = $('.sort-item'), 14 var $sortItem = $('.sort-item'),
13 $agreenShow = $('#agreen-show'), 15 $agreenShow = $('#agreen-show'),
14 $stuProv = $('#stu-province-show'), 16 $stuProv = $('#stu-province-show'),
@@ -438,12 +440,7 @@ $('.ident-select-wrap > .arrow-down').click(function() { @@ -438,12 +440,7 @@ $('.ident-select-wrap > .arrow-down').click(function() {
438 }); 440 });
439 441
440 $couponDia.on('click', function() { 442 $couponDia.on('click', function() {
441 - var cont = '<h3 class="dia-title">认证协议</h3>' +  
442 - '<p>(1) 全日制大学生及硕士博士研究生;</p>' +  
443 - '<p>(2) 学校在可选的范围内,有部分学校可能暂未收录,后期尽快增加;</p>' +  
444 - '<p>(3) 每个学号只能认证一个账户;</p>';  
445 -  
446 - createStuDialog('stu-agree-dialog', cont); 443 + createStuDialog('stu-agree-dialog', authProtocolTpl({}));
447 }); 444 });
448 445
449 $rightsItem.each(function(index, ele) { 446 $rightsItem.each(function(index, ele) {
@@ -451,7 +448,7 @@ $rightsItem.each(function(index, ele) { @@ -451,7 +448,7 @@ $rightsItem.each(function(index, ele) {
451 detail = $(ele).find('.item-detail').html(), 448 detail = $(ele).find('.item-detail').html(),
452 i = Number(index) + 1; 449 i = Number(index) + 1;
453 450
454 - rightsText += '<p>权益' + i + ':' + title + '</p><p>' + detail + '</p>'; 451 + rightsText += '<p><span class="font-bold">权益' + i + ':</span>' + title + '</p><p>' + detail + '</p>';
455 i !== $rightsItem.length ? rightsText += '<br>' : ''; 452 i !== $rightsItem.length ? rightsText += '<br>' : '';
456 }); 453 });
457 454
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 width: 171px; 7 width: 171px;
8 height: 40px; 8 height: 40px;
9 display: inline-block; 9 display: inline-block;
10 - background-image: url(../img/sprite.3party.png); 10 + background-image: resolve(header/logo.png);
11 background-position: 0 0; 11 background-position: 0 0;
12 vertical-align: middle; 12 vertical-align: middle;
13 margin-right: 10px; 13 margin-right: 10px;
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 width: 171px; 7 width: 171px;
8 height: 40px; 8 height: 40px;
9 display: inline-block; 9 display: inline-block;
10 - background-image: url(../img/sprite0.3party.png); 10 + background-image: resolve(header/logo.png);
11 background-position: 0 0; 11 background-position: 0 0;
12 vertical-align: middle; 12 vertical-align: middle;
13 margin-right: 10px; 13 margin-right: 10px;
@@ -989,6 +989,18 @@ @@ -989,6 +989,18 @@
989 } 989 }
990 } 990 }
991 } 991 }
  992 +
  993 + .swindle-info {
  994 + color: #444;
  995 + font-size: 12px;
  996 + margin-left: 20px;
  997 +
  998 + i {
  999 + color: #cd0c25;
  1000 + font-size: 12px;
  1001 + margin-right: 5px;
  1002 + }
  1003 + }
992 } 1004 }
993 1005
994 .yoho-header.boys { 1006 .yoho-header.boys {
@@ -289,6 +289,17 @@ @@ -289,6 +289,17 @@
289 .presall-tag { 289 .presall-tag {
290 background: #333; 290 background: #333;
291 } 291 }
  292 +
  293 + .swindle-info {
  294 + margin: 10px;
  295 + padding: 10px;
  296 + font-size: 13px;
  297 + background-color: #faf6da;
  298 +
  299 + span {
  300 + color: #cd0c25;
  301 + }
  302 + }
292 } 303 }
293 304
294 @import "default"; 305 @import "default";
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 } 6 }
7 7
8 .status { 8 .status {
9 - margin: 10px 0; 9 + margin: 0 0 10px;
10 padding: 10px; 10 padding: 10px;
11 background: #efefef; 11 background: #efefef;
12 border-bottom: 1px solid #e6e6e6; 12 border-bottom: 1px solid #e6e6e6;
@@ -156,7 +156,6 @@ @@ -156,7 +156,6 @@
156 } 156 }
157 } 157 }
158 158
159 -  
160 .outter-progress { 159 .outter-progress {
161 width: 554px; 160 width: 554px;
162 height: 12px; 161 height: 12px;
@@ -543,6 +543,10 @@ @@ -543,6 +543,10 @@
543 .content { 543 .content {
544 text-align: left; 544 text-align: left;
545 margin: 10px; 545 margin: 10px;
  546 + width: inherit;
  547 + height: 400px;
  548 + overflow: hidden;
  549 + overflow-y: scroll;
546 } 550 }
547 551
548 .dia-title { 552 .dia-title {
@@ -557,16 +561,19 @@ @@ -557,16 +561,19 @@
557 p { 561 p {
558 line-height: 35px; 562 line-height: 35px;
559 font-size: 14px; 563 font-size: 14px;
  564 + }
  565 +
  566 + .font-bold {
560 font-weight: bold; 567 font-weight: bold;
561 } 568 }
562 } 569 }
563 570
564 .stu-rights-dialog { 571 .stu-rights-dialog {
565 - width: 600px; 572 + width: 570px;
566 } 573 }
567 574
568 .stu-agree-dialog { 575 .stu-agree-dialog {
569 - width: 500px; 576 + width: 600px;
570 } 577 }
571 578
572 .stu-alert .content p { 579 .stu-alert .content p {