...
|
...
|
@@ -336,14 +336,27 @@ const classActDetail = (params) => { |
|
|
|
|
|
// 潮流之旅详情
|
|
|
const travelDetail = (params) => {
|
|
|
return service.get('MenuConfigController/getFrontMenuById', {
|
|
|
id: params.id,
|
|
|
return service.get('MenuConfigController/getFrontMainTour', {
|
|
|
storeId: params.storeId,
|
|
|
isFront: params.isFront
|
|
|
}, {
|
|
|
cache: true,
|
|
|
code: 200
|
|
|
}).then(result => {
|
|
|
return result;
|
|
|
|
|
|
let resu = '';
|
|
|
Object.assign(params, {hairStylistId: result.data.id});
|
|
|
params.res.cookie('travelId', result.data.id, {
|
|
|
domain: 'yohobuy.com'
|
|
|
});
|
|
|
return Promise.all([
|
|
|
adviserList(params),
|
|
|
getDate2(params)
|
|
|
]).then(newResult => {
|
|
|
resu = Object.assign(result.data, {advisersList: newResult[0].data});
|
|
|
resu = Object.assign(result.data, {dateList: newResult[1].data});
|
|
|
return resu;
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -353,6 +366,7 @@ const adviserList = (params) => { |
|
|
storeId: params.storeId,
|
|
|
activityType: params.activityType,
|
|
|
id: params.id || '',
|
|
|
hairStylistId: params.hairStylistId || '',
|
|
|
isFront: params.isFront
|
|
|
}, {
|
|
|
cache: true,
|
...
|
...
|
@@ -365,9 +379,7 @@ const adviserList = (params) => { |
|
|
// 潮流之旅
|
|
|
const travel = (params) => {
|
|
|
return Promise.all([
|
|
|
travelDetail(params),
|
|
|
adviserList(params),
|
|
|
getDate2(params)
|
|
|
travelDetail(params)
|
|
|
]).then(result => {
|
|
|
|
|
|
let resu = {
|
...
|
...
|
@@ -377,47 +389,36 @@ const travel = (params) => { |
|
|
storeId: params.storeId
|
|
|
};
|
|
|
|
|
|
if (result) {
|
|
|
if (result[0] && result[0].data) {
|
|
|
resu.content = result[0].data.detail;
|
|
|
}
|
|
|
|
|
|
if (result[1] && result[1].data) {
|
|
|
if (result && result[0]) {
|
|
|
|
|
|
resu.content = result[0].tourDetail;
|
|
|
|
|
|
let build = [];
|
|
|
let build = [];
|
|
|
|
|
|
result[1].data.forEach(val => {
|
|
|
build.push({
|
|
|
name: val.activityName,
|
|
|
summary: val.summary,
|
|
|
image: val.image,
|
|
|
id: val.id,
|
|
|
typeStatus: params.activityType,
|
|
|
storeId: params.storeId
|
|
|
});
|
|
|
result[0].advisersList.forEach(val => {
|
|
|
build.push({
|
|
|
name: val.activityName,
|
|
|
summary: val.summary,
|
|
|
image: val.image,
|
|
|
id: val.id,
|
|
|
typeStatus: params.activityType,
|
|
|
storeId: params.storeId
|
|
|
});
|
|
|
});
|
|
|
|
|
|
resu.adviser = build;
|
|
|
}
|
|
|
resu.adviser = build;
|
|
|
|
|
|
if (result[2] && result[2].data) {
|
|
|
|
|
|
let build = [];
|
|
|
|
|
|
if (result && result[2] && result[2].data) {
|
|
|
|
|
|
for(let item in result[2].data){
|
|
|
build.push({
|
|
|
date: _MD(item),
|
|
|
week: result[2].data[item],
|
|
|
dateOrigin: item,
|
|
|
dateParse: Date.parse(item) / 1000
|
|
|
});
|
|
|
}
|
|
|
let build2 = [];
|
|
|
|
|
|
resu.dateList = build;
|
|
|
}
|
|
|
for(let item in result[0].dateList){
|
|
|
build2.push({
|
|
|
date: _MD(item),
|
|
|
week: result[0].dateList[item],
|
|
|
dateOrigin: item,
|
|
|
dateParse: Date.parse(item) / 1000
|
|
|
});
|
|
|
}
|
|
|
resu.dateList = build2;
|
|
|
}
|
|
|
|
|
|
return resu;
|
...
|
...
|
@@ -509,6 +510,10 @@ const getStyle = (params) => { |
|
|
|
|
|
// 获取日期,星期
|
|
|
const getDate = (params) => {
|
|
|
if (!params.activityId) {
|
|
|
params.activityId = params.travelId;
|
|
|
params.activityType = 6;
|
|
|
}
|
|
|
return service.get('ActivityConfigController/getAppointInfoById', {
|
|
|
activityId: params.activityId,
|
|
|
activityType: params.activityType,
|
...
|
...
|
@@ -552,13 +557,15 @@ const getStylePush = (params) => { |
|
|
|
|
|
// 获取时间列表
|
|
|
const getTimeList = (params) => {
|
|
|
if (!params.activityId) {
|
|
|
params.activityId = params.travelId;
|
|
|
params.appointType = 6;
|
|
|
}
|
|
|
|
|
|
let ajaxUrl = '';
|
|
|
if (params.userId) {
|
|
|
|
|
|
ajaxUrl = 'ActivityConfigController/getAppointTimeForTour';
|
|
|
} else {
|
|
|
|
|
|
ajaxUrl = 'AppointmentController/getAppointTime';
|
|
|
}
|
|
|
|
...
|
...
|
@@ -588,7 +595,8 @@ const getTimeList = (params) => { |
|
|
time: _HM(new Date(item * 1000)),
|
|
|
originTime: item,
|
|
|
use: result.data.timeMap[item],
|
|
|
date: _MDHm(new Date(item * 1000)),
|
|
|
date2: _MDHm(new Date(item * 1000)),
|
|
|
date: _MYDHm(new Date(item * 1000)),
|
|
|
});
|
|
|
}
|
|
|
resu.appointNum = result.data.appointNum;
|
...
|
...
|
@@ -757,6 +765,7 @@ const appointment = (params) => { |
|
|
babyName: params.activityType === '4' || params.activityType === '5',
|
|
|
classChosen: params.activityType === '1',
|
|
|
actChosen: params.activityType === '2',
|
|
|
hideChosen: params.activityType === '3' ? false : true,
|
|
|
};
|
|
|
|
|
|
if (result && result[0] && result[0].data) {
|
...
|
...
|
@@ -1055,7 +1064,38 @@ const orderDetail = (params) => { |
|
|
}
|
|
|
}
|
|
|
|
|
|
return resu;
|
|
|
let newNarams = '';
|
|
|
if (result[0] && result[0].data) {
|
|
|
newNarams = {
|
|
|
id: result[0].data[0].activityId,
|
|
|
isFront: params.isFront
|
|
|
};
|
|
|
}
|
|
|
return adviserDetail(newNarams).then(newResult => {
|
|
|
|
|
|
let adviserDetail= '';
|
|
|
if (newResult && newResult.data) {
|
|
|
adviserDetail = {
|
|
|
name: newResult.data.activityName,
|
|
|
summary: newResult.data.summary,
|
|
|
free: newResult.data.isFree === 1,
|
|
|
price: newResult.data.price,
|
|
|
id: newResult.data.id,
|
|
|
package: newResult.data.activityType === 4 || newResult.data.activityType === 5,
|
|
|
adviser: newResult.data.activityType === 3,
|
|
|
act: newResult.data.activityType === 2,
|
|
|
class: newResult.data.activityType === 1,
|
|
|
activityType: newResult.data.activityType,
|
|
|
storeId: params.storeId,
|
|
|
startDate: newResult.data.activityStartDate,
|
|
|
endDate: newResult.data.activityEndDate,
|
|
|
startTime: newResult.data.activityDayStartTime,
|
|
|
endTime: newResult.data.activityDayEndTime
|
|
|
};
|
|
|
}
|
|
|
resu = Object.assign(resu, {adviserDetail: adviserDetail});
|
|
|
return resu;
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
|