Authored by 王水玲

星潮教室

... ... @@ -115,3 +115,5 @@ var CalendarHandler = {
$(document).ready(function() {
CalendarHandler.initialize();
});
exports.calculateMonthDays = CalendarHandler.calculateMonthDays;
... ...
... ... @@ -51,7 +51,7 @@ function scrollHandler() {
// function successShare() {
// $.ajax({
// type: 'POST',
// url: '',
// url: '/guang/starclass/forward',
// success: function(data) {
// var code = data.code;
... ... @@ -105,7 +105,10 @@ $(document).on('click', '.collection', function() {
}
$that.find('.collected-num').html(data.num);
}
if (code === 201) {
window.location = data.data;
}
},
error: function() {
... ...
... ... @@ -6,12 +6,11 @@
var $ = require('jquery'),
Swiper = require('yoho.iswiper'),
calendar = require('../guang/calendar'),
tip = require('../plugin/tip');
var bannerSwiper, collocationSwiper;
var nowDaysNub = 0;
// 日历弹出框显示及粉丝排行榜数据组装
function intimacyData(data) {
var $ul = $('.fan-charts-cont'),
... ... @@ -19,7 +18,11 @@ function intimacyData(data) {
$increased = $('.increased'),
signDay = data.signDay,
html = '',
style = '';
style = '',
nowDate = new Date(),
nowYear = nowDate.getFullYear(),
nowMonth = nowDate.getMonth(),
nowDaysNub = calendar.calculateMonthDays(nowMonth, nowYear);
var i;
... ... @@ -49,11 +52,19 @@ function intimacyData(data) {
$ul.html(html);
$myIntimacy.find('span').html(data.intimacyNum);
$increased.find('span').html(data.intimacyNum);
$myIntimacy.find('span').html(data.todayIntimacy);
$increased.find('span').html(data.todayIntimacy);
if (data.intimacyNum === 0) {
$('.my-intimacy').hide();
$('.increased').show();
} else {
$('.my-intimacy').show();
$('.increased').hide();
}
$('.pop-intimacy').show();
$('.mask').show();
$('.classroom-mask').show();
$('body').css({
overflow: 'hidden'
});
... ... @@ -185,12 +196,11 @@ $('.add-intimacy').on('click', function() {
var code = data.code;
if (code === 200) {
if (data.intimacyNum === 0) {
$('.my-intimacy').hide();
$('.increased').show();
} else {
intimacyData(data.data);
}
intimacyData(data.data);
}
if (code === 201) {
window.location = data.data;
}
},
error: function() {
... ... @@ -200,9 +210,9 @@ $('.add-intimacy').on('click', function() {
});
// 关闭日历弹出窗事件
$('.pop-intimacy .pop-close, .mask').on('click', function() {
$('.pop-intimacy .pop-close, .classroom-mask').on('click', function() {
$('.pop-intimacy').hide();
$('.mask').hide();
$('.classroom-mask').hide();
$('body').css({
overflow: 'visible'
... ...
... ... @@ -308,7 +308,7 @@ body {
.pop-intimacy {
width: 580rem / $pxConvertRem;
height: 910rem / $pxConvertRem;
height: 920rem / $pxConvertRem;
background: #fff;
border-radius: 10rem / $pxConvertRem;
position: fixed;
... ... @@ -501,6 +501,7 @@ body {
}
.fans-intimacy {
width: 150rem / $pxConvertRem;
float: right;
font-size: 20rem / $pxConvertRem;
color: #444;
... ...
... ... @@ -4,7 +4,7 @@
<h1 class="cur-year"></h1>
<h4 class="cur-month"></h4>
<div class="my-intimacy">亲密度 <span></span></div>
<div class="increased">今日已增加<span></span>,明日再来哦!</div>
<div class="increased">今日已增加<span></span>明日再来哦!</div>
</div>
<div class="calendar">
<input type="hidden" value="{{signDay}}" class="sign-day" />
... ...