Authored by 周少峰

Merge branch 'release/4.9.1.0'

... ... @@ -23,7 +23,7 @@ exports.index = (req, res, next) => {
studentsModel.getStudentsData(channel, req).then(result => {
if ('isStudent' in req.user && req.user.isStudent === 1) {
if ('isStudent' in req.user && parseInt(req.user.isStudent, 10) === 1) {
result.realData.verifyRusult = {isStudent: true};
}
... ...
... ... @@ -587,7 +587,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => {
if (origin.productPriceBo.studentPrice) {
// 学生价
result.studentsPrice = '¥' + origin.productPriceBo.studentPrice;
result.studentsPrice = '¥' + origin.productPriceBo.studentPrice.toFixed(2);
} else {
// VIP学生数据
result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid);
... ...
... ... @@ -9,7 +9,8 @@ var $ = require('yoho-jquery'),
var defaultOptions = {
mask: true,
closeIcon: true
closeIcon: true,
refreshOnClose: false
};
var tpl =
... ... @@ -53,6 +54,15 @@ function createDialog(data) {
return $('.yoho-dialog');
}
function cerateSubContent(text) {
var $yohoDialog = $('.yoho-dialog'),
subContent = '<p class="sub-content">' + text + '</p>';
if ($yohoDialog && $yohoDialog.length > 0) {
$yohoDialog.find('.content').after(subContent);
}
}
function Dialog(options) {
var opt = $.extend({}, defaultOptions, options);
var that = this,
... ... @@ -66,11 +76,31 @@ function Dialog(options) {
if (opt.mask) {
that.$mask = createMask();
}
that.$el = createDialog(opt);
if (opt.subContent) {
cerateSubContent(opt.subContent);
}
if (opt.subContents) {
for (i = opt.subContents.length - 1; i >= 0; i--) {
cerateSubContent(opt.subContents[i]);
}
}
// 绑定x关闭事件
that.$el.find('.close').click(function() {
that.close();
if (options.refreshOnClose) {
window.location.reload();
}
});
// 绑定btn关闭事件
that.$el.find('.btn-close').click(function() {
that.close();
});
function bindBtnEvt(index) {
... ...
... ... @@ -530,7 +530,8 @@
}
.stu-alert .close-icon,
.stu-dialog .close-icon {
.stu-dialog .close-icon,
.subcontent-dialog .close-icon {
display: inline-block;
top: -20px;
right: -20px;
... ...