Authored by lijing

潮流之旅bug

... ... @@ -982,7 +982,7 @@ const orderList = (params) => {
if (result) {
if (result[0] && result[0].data) {
console.log(result[0].data);
let build = [];
result[0].data.forEach(val => {
build.push({
... ... @@ -991,7 +991,9 @@ const orderList = (params) => {
createTime: _MYDHm(new Date(val.appointTime * 1000)),
originTime: val.appointTime,
id: val.id,
storeId: params.storeId
storeId: params.storeId,
typeStatus: val.activityType,
activityId: val.activityId
});
});
resu.list1 = build;
... ... @@ -1041,11 +1043,18 @@ const orderDetail = (params) => {
resu.storeInfo = {
name: result[1].data.storeName,
adr: result[1].data.address,
telephone: result[1].data.telephone
telephone: result[1].data.telephone,
storeId: result[1].data.storeId,
longitude: result[1].data.longitude,
latitude: result[1].data.latitude,
storeName: result[1].data.storeName,
address: result[1].data.address,
telephone: result[1].data.telephone,
introduction: result[1].data.introduction,
pictureUrl: result[1].data.pictureUrl
};
}
if (result[0] && result[0].data) {
console.log(result[0].data);
let appointContent = JSON.parse(result[0].data[0].appointContent);
resu.userInfo = {
babyName: appointContent.name,
... ... @@ -1204,7 +1213,6 @@ const kids = (params) => {
if (result && result[0] && result[0].data) {
let build = [];
console.log(result[0].data);
result[0].data.forEach(val => {
build.push({
img: val.thumbnailUrl,
... ...
... ... @@ -5,10 +5,12 @@
<div class="box">
<div class="content content-padding">{{{content}}}</div>
</div>
{{#if dateList}}
<div class="big-title">
可预约时间
</div>
{{> trend/date-list}}
{{/if}}
<div class="s-tip">
<p>小贴士:</p>
<p>1、活动当天记得提前10-15分钟到店,以保证您能够准时参加活动;</p>
... ...
... ... @@ -106,12 +106,12 @@
<span class="label">人数</span>
<div class="num">
<a class="minus-btn"></a>
<input type="text" id="num" value="1" class="cookie" max="1" />
<input type="text" id="num" value="1" max="1" readonly="readonly" />
<a class="plus-btn"></a>
</div>
</div>
<div class="textarea">
<textarea class="cookie disabled" id="note">添加备注(选填)</textarea>
<textarea class="cookie" id="note">添加备注(选填)</textarea>
</div>
</div>
<div class="need-know">
... ...
<div class="trend-c">
<div class="trend-c chosen-time">
<p class="date-tip {{#if hide}}hide{{/if}}"><span class="icon-pic tip"></span>如更换{{#if needAdv}}顾问{{else}}套餐{{/ if}}请重新选择</p>
<div class="side-main">
<div class="time-nav wrapper clearfix">
... ...
... ... @@ -4,16 +4,18 @@
{{/ userInfo}}
<div class="detail-list">
{{#storeInfo}}
<div class="list-item">
<a class="list-item" href="//m.yohobuy.com/activity/trend/store?storeId={{storeId}}">
<span class="icon-pic shop"></span>
门店:{{name}}
<span class="iconfont icon-arr">&#xe604;</span>
</div>
<div class="list-item">
</a>
<a class="list-item"{{#if longitude}} href="//m.yohobuy.com/activity/trend/map?jd={{longitude}}&wd={{latitude}}&name={{storeName}}&intro={{introduction}}&tel={{telephone}}&adr={{address}}&pic={{image pictureUrl}}"{{/if}}>
<span class="icon-pic adr"></span>
门店地址:{{adr}}
{{#if longitude}}
<span class="iconfont icon-arr">&#xe604;</span>
</div>
{{/if}}
</a>
<a class="list-item" href="tel:{{telephone}}">
<span class="icon-pic tel"></span>
门店电话:{{telephone}}
... ...
... ... @@ -7,7 +7,7 @@
{{/if}}
<div class="order-list clearfix">
{{# list1}}
<a class="order-item clearfix" href="//m.yohobuy.com/activity/trend/order-detail?id={{id}}&storeId={{storeId}}&showBtn=true">
<a class="order-item clearfix" href="//m.yohobuy.com/activity/trend/order-detail?id={{id}}&storeId={{storeId}}&showBtn=true&typeStatus={{typeStatus}}&activityId={{activityId}}">
<div class="info">
<div class="name">{{name}}
<span class="iconfont icon-arr">&#xe604;</span>
... ...
... ... @@ -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);
}
if ($('.textarea textarea').val() === '添加备注(选填)') {
$('.textarea textarea').addClass('disabled');
$('.textarea textarea').on('focus', function() {
if ($(this).val() === '添加备注(选填)') {
$(this).val('').removeClass('disabled');
}
});
};
// 默认选中菜单
if ($('.class-detail').length > 0) {
... ... @@ -465,6 +474,9 @@ $(
// 加减人数按钮
$num.find('.plus-btn').on('click', function() {
if (!$('.chosen-time').val()) {
tip.show('请先选择预约时间');
} else {
var limitNum = parseInt($num.find('input').attr('max'));
if (parseInt($num.find('input').val()) < limitNum) {
num = parseInt($num.find('input').val()) + 1;
... ... @@ -472,6 +484,7 @@ $(
} else {
tip.show('可预约人数已达上限');
}
}
});
$num.find('.minus-btn').on('click', function() {
if (parseInt($num.find('input').val()) > 1) {
... ... @@ -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) {
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) {
... ...
... ... @@ -12,6 +12,10 @@
background-color: #ebebeb;
padding-bottom: 88px;
.opacity {
opacity: 0.6;
}
input.disabled {
color: #aaa;
}
... ... @@ -297,7 +301,6 @@
.list-item {
padding: 0 30px;
display: block;
height: 88px;
line-height: 88px;
border-top: solid 1px #e0e0e0;
position: relative;
... ... @@ -534,7 +537,8 @@
display: inline-block;
width: 500px;
border: 0;
line-height: 88px;
line-height: 44px;
padding: 22px 0;
height: 88px;
font-size: 28px;
}
... ... @@ -1369,6 +1373,7 @@
}
.chan-btn {
display: none;
padding: 10px 25px;
border: solid 2px #444;
border-radius: 5px;
... ... @@ -1450,7 +1455,6 @@
.detail-info {
div {
height: 50px;
line-height: 50px;
}
}
... ...