...
|
...
|
@@ -148,6 +148,9 @@ $( |
|
|
if (window.cookie('limitPerson')) {
|
|
|
$('#num').attr('max', window.cookie('limitPerson'));
|
|
|
}
|
|
|
if ($('#num').attr('max') === '1') {
|
|
|
$('#num').next('.plus-btn').addClass('opacity');
|
|
|
}
|
|
|
// 选择套餐优先级最高,改变套餐,其他选项要重新选择
|
|
|
$('.chosen-select .need').on('click', function() {
|
|
|
var $depend = $('.chosen-select').find('.depend');
|
...
|
...
|
@@ -299,7 +302,12 @@ $( |
|
|
$('.chosen-adviser').val(window.cookie('chosenAdviser'));
|
|
|
$('.chosen-class').val(window.cookie('chosenClass'));
|
|
|
if (window.cookie('chosenClass')) {
|
|
|
getAbleTime();
|
|
|
var timeResult = getAbleTime();
|
|
|
if (timeResult.data) {
|
|
|
$('.chosen-time').val(_formatDay(new Date(timeResult.data * 1000))).addClass('disabled');
|
|
|
$('.chosen-time').parents('a').attr('href', 'javascript:void(0)');
|
|
|
window.setCookie('timeStr', timeResult.data);
|
|
|
}
|
|
|
}
|
|
|
if (!window.cookie('chosenCutter') && window.cookie('chosenPackage')) {
|
|
|
$('.chosen-cutter').val('不预约发型师');
|
...
|
...
|
@@ -357,11 +365,12 @@ $( |
|
|
clearCookieArr(3);
|
|
|
}
|
|
|
|
|
|
$('.textarea textarea').on('focus', function() {
|
|
|
if ($(this).val() === '添加备注(选填)') {
|
|
|
if ($('.textarea textarea').val() === '添加备注(选填)') {
|
|
|
$('.textarea textarea').addClass('disabled');
|
|
|
$('.textarea textarea').on('focus', function() {
|
|
|
$(this).val('').removeClass('disabled');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 默认选中菜单
|
|
|
if ($('.class-detail').length > 0) {
|
...
|
...
|
@@ -465,12 +474,16 @@ $( |
|
|
|
|
|
// 加减人数按钮
|
|
|
$num.find('.plus-btn').on('click', function() {
|
|
|
var limitNum = parseInt($num.find('input').attr('max'));
|
|
|
if (parseInt($num.find('input').val()) < limitNum) {
|
|
|
num = parseInt($num.find('input').val()) + 1;
|
|
|
$num.find('input').val(num);
|
|
|
if (!$('.chosen-time').val()) {
|
|
|
tip.show('请先选择预约时间');
|
|
|
} else {
|
|
|
tip.show('可预约人数已达上限');
|
|
|
var limitNum = parseInt($num.find('input').attr('max'));
|
|
|
if (parseInt($num.find('input').val()) < limitNum) {
|
|
|
num = parseInt($num.find('input').val()) + 1;
|
|
|
$num.find('input').val(num);
|
|
|
} else {
|
|
|
tip.show('可预约人数已达上限');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
$num.find('.minus-btn').on('click', function() {
|
...
|
...
|
@@ -610,6 +623,10 @@ $( |
|
|
var time = $('#detail-time').attr('date') * 1000;
|
|
|
var weekTime = formatDate(time);
|
|
|
$('#detail-time').html(weekTime);
|
|
|
var timeResult = getAbleTime();
|
|
|
if (timeResult.data === '') {
|
|
|
$('.chan-btn').show();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
);
|
...
|
...
|
@@ -682,7 +699,9 @@ function getTimeList() { |
|
|
userId: window.queryString.id
|
|
|
},
|
|
|
success: function(result) {
|
|
|
window.setCookie('limitPerson', result.appointNum);
|
|
|
if ($('.chosen-time').length > 0) {
|
|
|
window.setCookie('limitPerson', result.appointNum);
|
|
|
}
|
|
|
let timeList = '';
|
|
|
for (var i = 0;i < result.getTimeList.length; i ++) {
|
|
|
var useClass = 'use';
|
...
|
...
|
@@ -725,6 +744,9 @@ function orderSubmit() { |
|
|
var uid = parseInt($('#uid').val());
|
|
|
var activityId = window.cookie('packageId') || window.cookie('adviserId') || window.cookie('classId');
|
|
|
var userNote = $('#note').val();
|
|
|
if (userNote === '添加备注(选填)') {
|
|
|
userNote = '';
|
|
|
}
|
|
|
var appointPersonNum = parseInt($('#num').val());
|
|
|
var age = parseInt($('#age').val());
|
|
|
var ageType = $('#age').parents('.chose-item').find('input:checked').next('label').text();
|
...
|
...
|
@@ -864,18 +886,17 @@ function limitInp (obj, limit, show) { |
|
|
}
|
|
|
|
|
|
function getAbleTime() {
|
|
|
var timeResult = '';
|
|
|
$.ajax({
|
|
|
url: '/activity/trend/getAbleTime',
|
|
|
data: {
|
|
|
activityType: window.queryString.typeStatus,
|
|
|
activityId: window.cookie('packageId')
|
|
|
activityId: window.queryString.activityId || window.cookie('packageId')
|
|
|
},
|
|
|
async: false,
|
|
|
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)');
|
|
|
}
|
|
|
timeResult = result;
|
|
|
} else {
|
|
|
tip.show(result.message);
|
|
|
}
|
...
|
...
|
@@ -884,6 +905,7 @@ function getAbleTime() { |
|
|
tip.show('网络断开了~~~');
|
|
|
}
|
|
|
});
|
|
|
return timeResult;
|
|
|
}
|
|
|
|
|
|
function _formatDay(day) {
|
...
|
...
|
|