Authored by 周少峰

Merge branch 'release/4.9.1.0'

@@ -23,7 +23,7 @@ exports.index = (req, res, next) => { @@ -23,7 +23,7 @@ exports.index = (req, res, next) => {
23 23
24 studentsModel.getStudentsData(channel, req).then(result => { 24 studentsModel.getStudentsData(channel, req).then(result => {
25 25
26 - if ('isStudent' in req.user && req.user.isStudent === 1) { 26 + if ('isStudent' in req.user && parseInt(req.user.isStudent, 10) === 1) {
27 result.realData.verifyRusult = {isStudent: true}; 27 result.realData.verifyRusult = {isStudent: true};
28 } 28 }
29 29
@@ -587,7 +587,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { @@ -587,7 +587,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
587 587
588 if (origin.productPriceBo.studentPrice) { 588 if (origin.productPriceBo.studentPrice) {
589 // 学生价 589 // 学生价
590 - result.studentsPrice = '¥' + origin.productPriceBo.studentPrice; 590 + result.studentsPrice = '¥' + origin.productPriceBo.studentPrice.toFixed(2);
591 } else { 591 } else {
592 // VIP学生数据 592 // VIP学生数据
593 result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid); 593 result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid);
@@ -9,7 +9,8 @@ var $ = require('yoho-jquery'), @@ -9,7 +9,8 @@ var $ = require('yoho-jquery'),
9 9
10 var defaultOptions = { 10 var defaultOptions = {
11 mask: true, 11 mask: true,
12 - closeIcon: true 12 + closeIcon: true,
  13 + refreshOnClose: false
13 }; 14 };
14 15
15 var tpl = 16 var tpl =
@@ -53,6 +54,15 @@ function createDialog(data) { @@ -53,6 +54,15 @@ function createDialog(data) {
53 return $('.yoho-dialog'); 54 return $('.yoho-dialog');
54 } 55 }
55 56
  57 +function cerateSubContent(text) {
  58 + var $yohoDialog = $('.yoho-dialog'),
  59 + subContent = '<p class="sub-content">' + text + '</p>';
  60 +
  61 + if ($yohoDialog && $yohoDialog.length > 0) {
  62 + $yohoDialog.find('.content').after(subContent);
  63 + }
  64 +}
  65 +
56 function Dialog(options) { 66 function Dialog(options) {
57 var opt = $.extend({}, defaultOptions, options); 67 var opt = $.extend({}, defaultOptions, options);
58 var that = this, 68 var that = this,
@@ -66,11 +76,31 @@ function Dialog(options) { @@ -66,11 +76,31 @@ function Dialog(options) {
66 if (opt.mask) { 76 if (opt.mask) {
67 that.$mask = createMask(); 77 that.$mask = createMask();
68 } 78 }
  79 +
69 that.$el = createDialog(opt); 80 that.$el = createDialog(opt);
70 81
  82 +
  83 + if (opt.subContent) {
  84 + cerateSubContent(opt.subContent);
  85 + }
  86 +
  87 + if (opt.subContents) {
  88 + for (i = opt.subContents.length - 1; i >= 0; i--) {
  89 + cerateSubContent(opt.subContents[i]);
  90 + }
  91 + }
  92 +
71 // 绑定x关闭事件 93 // 绑定x关闭事件
72 that.$el.find('.close').click(function() { 94 that.$el.find('.close').click(function() {
73 that.close(); 95 that.close();
  96 + if (options.refreshOnClose) {
  97 + window.location.reload();
  98 + }
  99 + });
  100 +
  101 + // 绑定btn关闭事件
  102 + that.$el.find('.btn-close').click(function() {
  103 + that.close();
74 }); 104 });
75 105
76 function bindBtnEvt(index) { 106 function bindBtnEvt(index) {
@@ -530,7 +530,8 @@ @@ -530,7 +530,8 @@
530 } 530 }
531 531
532 .stu-alert .close-icon, 532 .stu-alert .close-icon,
533 -.stu-dialog .close-icon { 533 +.stu-dialog .close-icon,
  534 +.subcontent-dialog .close-icon {
534 display: inline-block; 535 display: inline-block;
535 top: -20px; 536 top: -20px;
536 right: -20px; 537 right: -20px;