...
|
...
|
@@ -2,7 +2,8 @@ require('../common'); |
|
|
var tip = require('../plugin/tip'),
|
|
|
IScroll = require('yoho-iscroll'),
|
|
|
diaLog = require('../plugin/dialog'),
|
|
|
Swiper = require('yoho-swiper');
|
|
|
Swiper = require('yoho-swiper'),
|
|
|
moment = require('moment');
|
|
|
|
|
|
var $num = $('.num'),
|
|
|
$navUl = $('.nav-ul');
|
...
|
...
|
@@ -95,10 +96,13 @@ $( |
|
|
$('.swiper-slide img').each(
|
|
|
function() {
|
|
|
if ($(this).height() > w_height) {
|
|
|
$(this).css('max-height', '100%');
|
|
|
$(this).css('top', '0');
|
|
|
$(this).css('height', '90%');
|
|
|
$(this).css('width', 'auto');
|
|
|
var newTop = (w_height - $(this).height()) / 2;
|
|
|
$(this).css('margin-top', newTop + 'px');
|
|
|
} else {
|
|
|
$(this).css('margin-top', '-' + $(this).height()/2 + 'px');
|
|
|
var newTop = (w_height - $(this).height()) / 2;
|
|
|
$(this).css('margin-top', newTop + 'px');
|
|
|
}
|
|
|
}
|
|
|
);
|
...
|
...
|
@@ -113,6 +117,7 @@ $( |
|
|
var boxWidth = box.eq(0).width();
|
|
|
var num = 2;
|
|
|
var boxArr = [];
|
|
|
var maxHeight = 0;
|
|
|
box.each(function(index, value) {
|
|
|
var boxHeight = box.eq(index).height();
|
|
|
if (index < num) {
|
...
|
...
|
@@ -126,8 +131,11 @@ $( |
|
|
'left': box.eq(minBoxIndex).position().left
|
|
|
});
|
|
|
boxArr[minBoxIndex] += box.eq(index).height();
|
|
|
var pullHeight = minBoxHeight + box.eq(index).height();
|
|
|
$('.pull-pic-list').css('height', pullHeight + 'px');
|
|
|
var newHeight = $(this).position().top + box.eq(index).height();
|
|
|
if (newHeight > maxHeight) {
|
|
|
maxHeight = newHeight;
|
|
|
}
|
|
|
$('.pull-pic-list').css('height', maxHeight + 'px');
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -284,6 +292,9 @@ $( |
|
|
$('.chosen-cutter').val(window.cookie('chosenCutter'));
|
|
|
$('.chosen-adviser').val(window.cookie('chosenAdviser'));
|
|
|
$('.chosen-class').val(window.cookie('chosenClass'));
|
|
|
if (window.cookie('chosenClass')) {
|
|
|
getAbleTime();
|
|
|
}
|
|
|
if (!window.cookie('chosenCutter') && window.cookie('chosenPackage')) {
|
|
|
$('.chosen-cutter').val('不预约发型师');
|
|
|
}
|
...
|
...
|
@@ -325,7 +336,7 @@ $( |
|
|
|
|
|
$('.textarea textarea').on('focus', function() {
|
|
|
if ($(this).val() === '添加备注(选填)') {
|
|
|
$(this).val('');
|
|
|
$(this).val('').removeClass('disabled');
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -343,6 +354,8 @@ $( |
|
|
}
|
|
|
if ($('.package-detail').length > 0) {
|
|
|
window.setCookie('chosenPackage', $('.package-detail').find('.name').text());
|
|
|
window.setCookie('packageLimit', $('.package-detail').find('.limit').val());
|
|
|
window.setCookie('packageStyle', $('.package-detail').find('.styleid').val());
|
|
|
}
|
|
|
|
|
|
// 立即预约按钮
|
...
|
...
|
@@ -565,7 +578,7 @@ function autoScroll (thisPo) { |
|
|
$navUl.find('.nav-item:eq(' + thisPo + ')').addClass('active').siblings('li').removeClass('active');
|
|
|
if (thisPo >= 2) {
|
|
|
// 倒数三个不触发效果
|
|
|
if ((sNum - thisPo) > 3) {
|
|
|
if ((sNum - thisPo) >= 3) {
|
|
|
myScroll.scrollTo((0 - (thisPo - 2) * sWidth), 0, 400);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -782,6 +795,33 @@ function limitInp (obj, limit, show) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
function getAbleTime() {
|
|
|
$.ajax({
|
|
|
url: '/activity/trend/getAbleTime',
|
|
|
data: {
|
|
|
activityType: window.queryString.typeStatus,
|
|
|
activityId: window.cookie('packageId')
|
|
|
},
|
|
|
success: function(result) {
|
|
|
if (result.code === 200) {
|
|
|
if (result.data) {
|
|
|
$('.chosen-time').val(_formatDay(new Date(result.data * 1000))).addClass('disabled');
|
|
|
$('.chosen-time').parents('a').attr('href', 'javascript:void(0)');
|
|
|
}
|
|
|
} else {
|
|
|
tip.show('网络断开了~~~');
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
tip.show('网络断开了~~~');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function _formatDay(day) {
|
|
|
return moment(day).format('MM月DD日 HH:mm');
|
|
|
};
|
|
|
|
|
|
// 清除cookie
|
|
|
function clearCookieArr (type) {
|
|
|
switch (type) {
|
...
|
...
|
@@ -812,6 +852,7 @@ function clearCookieArr (type) { |
|
|
window.setCookie('limitPerson', '');
|
|
|
window.setCookie('packageLimit', '');
|
|
|
window.setCookie('packageStyle', '');
|
|
|
window.setCookie('chosenClass', '');
|
|
|
break;
|
|
|
}
|
|
|
} |
...
|
...
|
|