Authored by 周少峰

Merge branch 'hotfix/stuAndNginx'

  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
@@ -68,5 +68,19 @@ module.exports = [ @@ -68,5 +68,19 @@ module.exports = [
68 'www' 68 'www'
69 ); 69 );
70 } 70 }
  71 + },
  72 + // erp2good
  73 + {
  74 + type: TYPE.rewrite,
  75 + origin: (req) => {
  76 + console.log(req.path);
  77 + return req.path === '/erp2goods'
  78 + },
  79 + target: '/common/erp2goods'
  80 + },
  81 + {
  82 + type: TYPE.redirect,
  83 + origin: '/index.html',
  84 + target: helpers.urlFormat('/')
71 } 85 }
72 ]; 86 ];
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>
@@ -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,8 +7,8 @@ @@ -7,8 +7,8 @@
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);  
11 - background-position: 0 0; 10 + background-image: resolve(header/logo.png);
  11 + background-position: 0px 0px;
12 vertical-align: middle; 12 vertical-align: middle;
13 margin-right: 10px; 13 margin-right: 10px;
14 } 14 }
@@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
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);  
11 - background-position: 0 0; 10 + background-image: resolve(header/logo.png);
  11 + background-position: 0px 0px;
12 vertical-align: middle; 12 vertical-align: middle;
13 margin-right: 10px; 13 margin-right: 10px;
14 } 14 }
@@ -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 {