Authored by 陈峰

Merge branch 'feature/trend' into 'release/5.5.1'

Feature/trend



See merge request !418
... ... @@ -208,7 +208,7 @@ exports.appointment = function(req, res, next) {
exports.travel = function(req, res, next) {
Object.assign(responseData, {
let resData = Object.assign({}, responseData, {
pageHeader: headerModel.setNav({
navTitle: '潮流之旅'
}),
... ... @@ -227,7 +227,7 @@ exports.travel = function(req, res, next) {
domain: 'yohobuy.com',
path: '/'
});
res.render('trend/travel', Object.assign(responseData, result));
res.render('trend/travel', Object.assign(resData, result));
}).catch(next);
};
... ... @@ -286,7 +286,8 @@ exports.photography = function(req, res, next) {
storeId: req.query.storeId,
id: req.query.id,
activityType: 4,
isFront: req.query.isFront || req.cookies.isFront
isFront: req.query.isFront || req.cookies.isFront,
// filter: 2
};
trendModel.photography(params).then((result) => {
... ... @@ -296,7 +297,7 @@ exports.photography = function(req, res, next) {
exports.kidStyle = function(req, res, next) {
Object.assign(responseData, {
let resData = Object.assign({}, responseData, {
pageHeader: headerModel.setNav({
navTitle: '儿童造型'
}),
... ... @@ -311,7 +312,7 @@ exports.kidStyle = function(req, res, next) {
};
trendModel.kidStyle(params).then((result) => {
res.render('trend/kidStyle', Object.assign(responseData, result));
res.render('trend/kidStyle', Object.assign(resData, result));
}).catch(next);
};
... ... @@ -368,6 +369,7 @@ exports.cutter = function(req, res, next) {
activityType: 5,
id: req.query.id,
activityId: req.query.id,
hairStylistId: req.query.id,
isFront: req.query.isFront || req.cookies.isFront
};
... ... @@ -420,7 +422,7 @@ exports.orderDetail = function(req, res, next) {
// 选择页面
exports.chosenPackage = function(req, res, next) {
Object.assign(responseData, {
let resData = Object.assign({}, responseData, {
pageHeader: headerModel.setNav({
navTitle: '选择套餐'
}),
... ... @@ -430,11 +432,13 @@ exports.chosenPackage = function(req, res, next) {
let params = {
storeId: req.query.storeId,
activityType: req.query.typeStatus,
isFront: req.query.isFront || req.cookies.isFront
isFront: req.query.isFront || req.cookies.isFront,
hairStylistId: req.cookies.cutterId,
filter: 2
};
trendModel.chosenPackage(params).then((result) => {
res.render('trend/chosen-package', Object.assign(responseData, result));
res.render('trend/chosen-package', Object.assign(resData, result));
}).catch(next);
};
... ... @@ -468,6 +472,7 @@ exports.chosenTime = function(req, res, next) {
activityType: req.query.typeStatus,
activityId: req.cookies.packageId || req.query.activityId || req.cookies.adviserId,
travelId: req.cookies.travelId,
storeId: req.query.storeId,
isFront: req.query.isFront || req.cookies.isFront
};
... ... @@ -477,7 +482,7 @@ exports.chosenTime = function(req, res, next) {
};
exports.chosenCutter = function(req, res, next) {
Object.assign(responseData, {
let resData = Object.assign({}, responseData, {
pageHeader: headerModel.setNav({
navTitle: '选择发型师'
}),
... ... @@ -486,11 +491,12 @@ exports.chosenCutter = function(req, res, next) {
let params = {
storeId: req.query.storeId,
isFront: req.query.isFront || req.cookies.isFront
isFront: req.query.isFront || req.cookies.isFront,
filter: 2
};
trendModel.chosenCutter(params).then((result) => {
res.render('trend/chosen-cutter', Object.assign(responseData, result));
res.render('trend/chosen-cutter', Object.assign(resData, result));
}).catch(next);
};
... ... @@ -506,7 +512,8 @@ exports.chosenAdviser = function(req, res, next) {
storeId: req.query.storeId,
activityType: req.query.typeStatus,
isFront: req.query.isFront || req.cookies.isFront,
hairStylistId: req.cookies.travelId
hairStylistId: req.cookies.travelId,
filter: 2
};
trendModel.chosenAdviser(params).then((result) => {
... ... @@ -572,14 +579,14 @@ exports.delOrder = function(req, res, next) {
};
exports.needKnow = function(req, res) {
let type = req.query.type;
Object.assign(responseData, {
pageHeader: headerModel.setNav({
navTitle: req.query.title
}),
title: req.query.title
});
let type = req.query.type;
switch (type) {
case '1':
res.render('trend/need-know1', responseData);
... ... @@ -596,6 +603,8 @@ exports.needKnow = function(req, res) {
case '5':
res.render('trend/need-know5', responseData);
break;
default:
break;
}
};
... ...
... ... @@ -8,7 +8,6 @@
const service = global.yoho.ServiceAPI;
const moment = require('moment');
const helpers = global.yoho.helpers;
// 格式年月日
const _formatDay = (day) => {
... ... @@ -52,7 +51,7 @@ const _HM = (day) => {
// 资讯列表
const info = (params) => {
return service.get('InformationController/getFrontAllList', {
return service.get('InformationController/getFrontMainPushList', {
storeId: params.storeId,
isFront: params.isFront
}, {
... ... @@ -134,7 +133,12 @@ const articleDetail = (params) => {
let resu = {};
if (result && result.data) {
resu = result.data;
resu = {
coverUrl: result.data.coverUrl,
titles: result.data.title,
summary: result.data.summary,
content: result.data.content
};
}
return resu;
});
... ... @@ -189,7 +193,7 @@ const oldList = (params) => {
if (result && result.data) {
resu = result.data;
}
return resu;
});
};
... ... @@ -243,7 +247,7 @@ const classActList = (params) => {
startTime: val.activityDayStartTime,
endTime: val.activityDayEndTime,
free: val.isFree === 1,
price: helpers.round(val.price, 0),
price: val.price,
needApo: val.isAppointment === 1,
apoStatus: val.appointStatus === 1,
id: val.id,
... ... @@ -282,10 +286,13 @@ const classActList = (params) => {
startTime: val.activityDayStartTime,
endTime: val.activityDayEndTime,
end: true,
free: true,
// free: true,
id: val.id,
status: status,
storeId: params.storeId
storeId: params.storeId,
free: val.isFree === 1,
price: val.price,
});
});
... ... @@ -327,6 +334,58 @@ const classActDetail = (params) => {
});
};
// 获取日期,星期(所有潮流顾问, 发型师详情页)
const getDate2 = (params) => {
return service.get('ActivityConfigController/getAppointDateForTour', {
storeId: params.storeId,
activityType: params.activityType,
hairStylistId: params.id || '',
isFront: params.isFront
}, {
code: 200
}).then(result => {
return result;
});
};
// 获取日期,星期
const getDate = (params) => {
let apiUrl = 'ActivityConfigController/getAppointInfoById';
if (!params.activityId && (params.activityType === '3')) {
params.activityId = params.travelId;
params.activityType = 6;
} else if (!params.activityId && (params.activityType !== '3')) {
apiUrl = 'ActivityConfigController/getAllAppointDate';
}
return service.get(apiUrl, {
storeId: params.storeId,
activityId: params.activityId,
activityType: params.activityType,
isFront: params.isFront
}, {
code: 200
}).then(result => {
return result;
});
};
// 潮流顾问,发型师套餐列表
const adviserList = (params) => {
return service.get('ActivityConfigController/getActivityList', {
storeId: params.storeId,
activityType: params.activityType,
id: params.id || '',
hairStylistId: params.hairStylistId || '',
isFront: params.isFront,
filter: params.filter || '',
}, {
code: 200
}).then(result => {
return result;
});
};
// 潮流之旅详情
const travelDetail = (params) => {
return service.get('MenuConfigController/getFrontMainTour', {
... ... @@ -354,21 +413,6 @@ const travelDetail = (params) => {
});
};
// 潮流顾问,发型师套餐列表
const adviserList = (params) => {
return service.get('ActivityConfigController/getActivityList', {
storeId: params.storeId,
activityType: params.activityType,
id: params.id || '',
hairStylistId: params.hairStylistId || '',
isFront: params.isFront
}, {
code: 200
}).then(result => {
return result;
});
};
// 潮流之旅
const travel = (params) => {
return Promise.all([
... ... @@ -449,6 +493,8 @@ const adviser = (params) => {
name: result[0].data.activityName,
summary: result[0].data.summary,
image: result[0].data.image,
isCanAppoint: result[0].data.isCanAppoint === 1,
storeId: params.storeId
};
resu.content = result[0].data.detail;
... ... @@ -499,37 +545,6 @@ 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,
isFront: params.isFront
}, {
code: 200
}).then(result => {
return result;
});
};
// 获取日期,星期(所有潮流顾问, 发型师详情页)
const getDate2 = (params) => {
return service.get('ActivityConfigController/getAppointDateForTour', {
storeId: params.storeId,
activityType: params.activityType,
hairStylistId: params.id || '',
isFront: params.isFront
}, {
code: 200
}).then(result => {
return result;
});
};
// 获取风格热推
const getStylePush = (params) => {
return service.get('MenuConfigController/getFrontMenuPhotoStyle', {
... ... @@ -545,17 +560,20 @@ const getStylePush = (params) => {
// 获取时间列表
const getTimeList = (params) => {
if (!params.activityId) {
params.activityId = params.travelId;
params.appointType = 6;
}
let ajaxUrl = '';
if (params.userId) {
ajaxUrl = 'ActivityConfigController/getAppointTimeForTour';
if (!params.activityId && (params.appointType !== '3')) {
ajaxUrl = 'ActivityConfigController/getAllAppointTime';
} else {
ajaxUrl = 'AppointmentController/getAppointTime';
if (!params.activityId) {
params.activityId = params.travelId;
params.appointType = 6;
}
if (params.userId) {
ajaxUrl = 'ActivityConfigController/getAppointTimeForTour';
} else {
ajaxUrl = 'AppointmentController/getAppointTime';
}
}
return service.get(ajaxUrl, {
... ... @@ -616,7 +634,7 @@ const photography = (params) => {
if (result) {
if (result[0] && result[0].data) {
resu.detail = {
bigPic: result[0].data.mainPushUrl
bigPic: result[0].data.pictureUrl.split(',')[0]
};
resu.content = result[0].data.detail;
}
... ... @@ -697,7 +715,7 @@ const packageDetail = (params) => {
limit: result[0].data.styleNumber,
styleId: result[0].data.styleList
};
resu.isAppointment = result[0].data.isAppointment === 1;
resu.isAppointment = result[0].data.isCanAppoint === 1;
resu.content = result[0].data.detail;
}
... ... @@ -720,6 +738,7 @@ const styleDetail = (params) => {
if (result && result[0] && result[0].data && result[0].data[0]) {
resu.introduction = result[0].data[0].introduction;
resu.sharePic = result[0].data[0].styleImage;
resu.picList = result[0].data[0].styleDemo.split(',');
resu.picList.forEach(val => {
bulid.push({
... ... @@ -753,7 +772,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,
// hideChosen: params.activityType === '3' ? false : true,
};
if (result && result[0] && result[0].data) {
... ... @@ -861,10 +880,21 @@ const chosenTime = (params) => {
});
};
// 不选发型师价格
const cutterPrice = (params) => {
return service.get('ActivityConfigController/getMinTimeStylistPrice', {
storeId: params.storeId,
isFront: params.isFront
}).then(result => {
return result;
});
};
// 选择发型师
const chosenCutter = (params) => {
return Promise.all([
cutterList(params),
cutterPrice(params),
]).then(result => {
let resu = {};
... ... @@ -882,11 +912,15 @@ const chosenCutter = (params) => {
radio: true,
arr: false,
free: val.minPrice === -1,
noPackage: val.minPrice === null
noPackage: val.minPrice === null,
id: val.id
});
});
resu.cutterList = build;
}
if (result[1]) {
resu.minPrice = result[1].data;
}
return resu;
});
... ... @@ -963,13 +997,15 @@ const orderList = (params) => {
let params2 = params;
return Promise.all([
orderList1(Object.assign(params1, {statusList: '1,2'})),
orderList1(Object.assign(params2, {statusList: '3,4'}))
orderList1(Object.assign(params1, {statusList: '1'})),
orderList1(Object.assign(params2, {statusList: '2,3,4'})),
storeInfo(params)
]).then(result => {
let resu = {
list1: [],
list2: [],
storeInfo: {},
noOrder: false
};
... ... @@ -1011,6 +1047,14 @@ const orderList = (params) => {
resu.list2 = build;
}
if (result[2] && result[2].data) {
resu.storeInfo = {
name: result[2].data.storeName,
introduction: result[2].data.introduction,
pictureUrl: result[2].data.pictureUrl
};
}
if (!result[0].data && !result[1].data) {
resu.noOrder = true;
}
... ... @@ -1068,13 +1112,14 @@ const orderDetail = (params) => {
activityId: result[0].data[0].activityId,
stylesName: result[0].data[0].stylesName,
typeStatus: result[0].data[0].activityType,
status: result[0].data[0].appointStatusStr,
status: result[0].data[0].detailStatusStr,
id: result[0].data[0].id,
showBtn: params.showBtn === 'true',
originUrl: result[0].data[0].url,
personName: result[0].data[0].personName,
personId: result[0].data[0].personId,
num: result[0].data[0].appointPersonNum
num: result[0].data[0].appointPersonNum,
canChangeTime: result[0].data[0].isCanAppoint === 1
};
}
}
... ... @@ -1088,7 +1133,6 @@ const orderDetail = (params) => {
};
}
return adviserDetail(newNarams).then(newResult => {
let adviserDetail= '';
if (newResult && newResult.data) {
... ... @@ -1127,11 +1171,13 @@ const cutterList = (params) => {
return service.get('MenuConfigController/getFrontMenuStylist', {
storeId: params.storeId,
id: params.id || '',
isFront: params.isFront
isFront: params.isFront,
filter: params.filter || '',
}).then(result => {
return result;
});
};
const cutterList2 = (params) => {
return service.get('MenuConfigController/getFrontMenuStylist', {
storeId: params.storeId,
... ... @@ -1198,7 +1244,7 @@ const kidStyle = (params) => {
if (result[2] && result[2].data) {
resu.detail = {
bigPic: result[2].data.mainPushUrl
bigPic: result[2].data.pictureUrl.split(',')[0]
};
resu.content = result[2].data.detail;
}
... ... @@ -1300,7 +1346,8 @@ const cutter = (params) => {
}
}
}
resu.storeId = params.storeId;
resu.id = params.id;
return resu;
});
};
... ... @@ -1367,4 +1414,4 @@ module.exports = {
changeDate,
kids,
getAbleTime
};
};
\ No newline at end of file
... ...
... ... @@ -17,5 +17,9 @@
<p>2、您可以和2-3名好友一起来参加活动,共同体验潮流之旅;</p>
<p>3、活动时长预估时间,如超出时间请您谅解。</p>
</div>
{{# detail}}
{{#if isCanAppoint}}
<a class="foot-btn ok" href="//m.yohobuy.com/activity/trend/appointment?storeId={{storeId}}&typeStatus=3">立即预约</a>
{{/if}}
{{/ detail}}
</div>
\ No newline at end of file
... ...
... ... @@ -48,7 +48,7 @@
</div>
{{/ packageChosen}}
{{# styleChosen}}
<div class="chose-item select need">
<div class="chose-item select">
<span class="label">选择风格</span>
<a href="http://m.yohobuy.com/activity/trend/chosen-style?storeId={{storeId}}&chosenType=1&typeStatus={{typeStatus}}">
<input class="inp chosen-style eps require" type="text" label="风格" placeholder="未选择" readonly="readonly" />
... ...
... ... @@ -3,8 +3,8 @@
{{#if coverUrl}}
<img src="{{image coverUrl}}">
{{/if}}
<p class="title">{{title}}</p>
<p>{{summary}}</p>
<p class="title">{{titles}}</p>
<p class="tip-s hide">{{summary}}</p>
<div class="content">{{{content}}}</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="trend-c no-pb share-store">
<div class="trend-c no-pb share-map">
{{# infos}}
{{> trend/article}}
{{/ infos}}
... ...
... ... @@ -4,12 +4,15 @@
<label class="top">
<input type="radio" name="cutter" class="diy" data="不预约发型师" />
不预约发型师
{{# minPrice}}
<span class="min-price">¥<span>{{this}}</span></span>
{{/ minPrice}}
</label>
<div class="cutter side">
{{# cutterList}}
<label class="cutter-item clearfix">
{{# radio}}
<input type="radio" name="cutter" class="diy" data={{name}} />
<input type="radio" name="cutter" class="diy" data="{{name}}" id="{{id}}" />
{{/ radio}}
<div class="pic">
<img src="{{image img}}">
... ...
<div class="trend-c">
<div class="side-main grey-bg">
<div class="style-c">
<div class="top"><span class="icon-pic tip"></span>如更换套餐请重新选择</div>
<div class="top"><span class="icon-pic tip"></span><span class="text">如更换套餐请重新选择</span></div>
<p class="style-tip">当前套餐可选风格<span class="total"></span>种,已选<span class="now"></span></p>
<ul class="style-ul clearfix">
{{# styleList}}
... ...
<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="trend-c chosen-time time-tag">
<p class="date-tip {{#if hide}}hide{{/if}}">
<span class="icon-pic tip"></span>
<span class="text">如更换{{#if needAdv}}顾问{{else}}套餐{{/ if}}请重新选择</span>
</p>
<div class="side-main">
<div class="time-nav wrapper clearfix">
<ul class="nav-ul">
... ...
... ... @@ -8,7 +8,6 @@
{{else}}
<span class="price">免费</span>
{{/if}}
</div>
<div class="tip">
<div>
... ...
<div class="trend-c share-cutter">
{{> trend/adviser-info}}
{{#if packageList}}
<div class="big-title">造型套餐</div>
<div class="package-top">
<span></span>
预约后需到店付款
</div>
{{/if}}
{{# packageList}}
{{> trend/cutter-package}}
{{/ packageList}}
... ... @@ -17,7 +19,7 @@
<div class="pull-pic-list clearfix">
{{# stylist}}
<div class="box">
<img src="{{image this}}" />
<img data="{{image this}}" />
</div>
{{/ stylist}}
</div>
... ...
... ... @@ -11,7 +11,7 @@
{{/if}}
</div>
<div class="tip-tittle">
<span class="icon-pic tip"></span>您可以选择<span class="red">预约发型师</span>或者<span class="red">直接预约套餐</span>来理发
<span class="icon-pic tip2"></span>您可以选择<span class="red">预约发型师</span>或者<span class="red">直接预约套餐</span>来理发
</div>
<div class="big-title">发型师</div>
<div class="cutter">
... ...
<div class="trend-c map-c share-store">
<div class="trend-c map-c share-map">
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=55E5CFCa68831302cebe0acdd575c77d"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.js"></script>
<div id="map"></div>
... ...
... ... @@ -21,6 +21,7 @@
门店电话:{{telephone}}
<span class="iconfont icon-arr">&#xe604;</span>
</a>
<input type="hidden" class="share-info" data-name="{{name}}" data-intro="{{introduction}}" data-pic="{{pictureUrl}}" />
{{/ storeInfo}}
</div>
{{# adviserDetail}}
... ... @@ -113,6 +114,7 @@
</div>
{{/if}}
{{#if ../adviserDetail/kidStyle}}
{{#if ../userInfo/personName}}
<div class="chosen chosen-detail">
<a class="chose-item select" href="//m.yohobuy.com/activity/trend/cutter?storeId={{../adviserDetail/storeId}}&id={{../userInfo/personId}}&typeStatus={{../adviserDetail/activityType}}&cutterName={{../userInfo/personName}}">
<span class="label">发型师</span>
... ... @@ -121,6 +123,7 @@
</a>
</div>
{{/if}}
{{/if}}
{{#if stylesName}}
<p class="tip-top">风格</p>
<p class="tip-main">{{stylesName}}</p>
... ... @@ -128,8 +131,10 @@
<p class="tip-top">预约时间</p>
<p class="tip-main"><span id="detail-time" date="{{originTime}}">{{appointTime}}</span>
{{#if showBtn}}
{{#if canChangeTime}}
<a class="chan-btn" id={{id}} href="//m.yohobuy.com/activity/trend/chosen-time?storeId={{storeId}}&activityId={{activityId}}&typeStatus={{typeStatus}}&chosenType=2&order=true">更改</a>
{{/if}}
{{/if}}
</p>
</div>
{{/ userInfo}}
... ...
<div class="trend-c share-order" {{#if noOrder}}style="background-color: #fff;"{{/if}}>
{{# storeInfo}}
<input type="hidden" class="share-info" data-name="{{name}}" data-intro="{{introduction}}" data-pic="{{pictureUrl}}" />
{{/ storeInfo}}
{{#if noOrder}}
<div class="success">
<div class="success-pic fail-pic"></div>
... ...
<div class="trend-c package-detail">
{{# detail}}
{{#if img}}
<img src="{{image img}}">
<img class="share-pic" src="{{image img}}">
{{/if}}
<div class="package-item only">
<div class="top clearfix package-detail">
... ...
<div class="trend-c">
<div class="trend-c share-photography">
<div class="box-padding">
{{# detail}}
{{#if bigPic}}
... ... @@ -16,11 +16,13 @@
<div class="swiper-wrapper">
{{# swiper}}
<div class="swiper-slide">
<a class="pic" href="http://m.yohobuy.com/activity/trend/style-detail?id={{id}}&storeId={{storeId}}&styleName={{name}}">
<img src="{{image pic}}">
</a>
<p class="title eps">{{name}}</p>
<p class="main">{{introduction}}</p>
<a href="http://m.yohobuy.com/activity/trend/style-detail?id={{id}}&storeId={{storeId}}&styleName={{name}}">
<div class="pic limit-pic">
<img src="{{image pic}}">
</div>
<p class="title eps">{{name}}</p>
<p class="main">{{introduction}}</p>
</a>
</div>
{{/ swiper}}
</div>
... ... @@ -33,15 +35,17 @@
<span>套餐</span>
</div>
<div class="tab-item hide">
<ul class="tab-ul clearfix">
{{# styleList}}
<li>
<a href="http://m.yohobuy.com/activity/trend/style-detail?id={{id}}&storeId={{../storeId}}&styleName={{name}}">
<img src="{{image img}}">
</a>
</li>
{{/ styleList}}
</ul>
<div class="tab-ul clearfix">
<div class="pull-pic-list clearfix">
{{# styleList}}
<div class="box">
<a href="http://m.yohobuy.com/activity/trend/style-detail?id={{id}}&storeId={{../storeId}}&styleName={{name}}">
<img data="{{image img}}">
</a>
</div>
{{/ styleList}}
</div>
</div>
</div>
<div class="tab-item hide">
<div class="package-top">
... ...
... ... @@ -4,7 +4,7 @@
{{/ infos}}
{{#if infos}}
{{#detail}}
<a class="more-article" href="//m.yohobuy.com/activity/trend/article-list?storeId={{storeId}}">更多活动咨询
<a class="more-article" href="//m.yohobuy.com/activity/trend/article-list?storeId={{storeId}}&name={{storeName}}&intro={{introduction}}&pic={{image pictureUrl}}">更多活动资讯
<span class="iconfont icon-arr">&#xe604;</span>
</a>
{{/ detail}}
... ... @@ -23,12 +23,13 @@
<a class="list-item">
<span class="icon-pic clock"></span>
营业时间:{{businessTime}}
<span class="iconfont icon-arr">&#xe604;</span>
</a>
<a class="list-item" href="//m.yohobuy.com/activity/trend/map?jd={{longitude}}&wd={{latitude}}&name={{storeName}}&intro={{introduction}}&tel={{telephone}}&adr={{address}}&pic={{image pictureUrl}}">
<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>
门店地址:{{address}}
{{#if longitude}}
<span class="iconfont icon-arr">&#xe604;</span>
{{/if}}
</a>
<a class="list-item" href="tel:{{telephone}}">
<span class="icon-pic tel"></span>
... ... @@ -36,6 +37,7 @@
<span class="iconfont icon-arr">&#xe604;</span>
</a>
</div>
<input class="share-inp" type="hidden" data-name="{{storeName}}" data-tip="{{introduction}}" data-pic="{{pictureUrl}}" />
{{/ detail}}
</div>
</div>
... ...
<div class="trend-c">
<div class="box-padding style-detail">
<div class="content">{{introduction}}</div>
<input class="share-pic" type="hidden" value="{{sharePic}}" />
<div class="pull-pic-list clearfix">
{{# picList}}
<div class="box">
<img src="{{image imgSrc}}" />
<img data="{{image imgSrc}}" />
</div>
{{/ picList}}
</div>
... ...
... ... @@ -10,10 +10,12 @@
{{# adviser}}
{{> trend/adviser}}
{{/ adviser}}
{{#if dateList}}
<div class="big-title">
可预约时间
</div>
{{> trend/date-list}}
{{/if}}
<div class="s-tip">
<p>小贴士:</p>
<p>1、活动当天记得提前10-15分钟到店,以保证您能够准时参加活动;</p>
... ...
<div class="class">
<div class="class-item clearfix">
<a class="pic" href="//m.yohobuy.com/activity/trend/act-detail?activityId={{id}}&name={{name}}&price={{price}}&startDate={{startDate}}&endDate={{endDate}}&startTime={{startTime}}&endTime={{endTime}}&status={{status}}&storeId={{storeId}}">
<a class="pic" href="//m.yohobuy.com/activity/trend/act-detail?activityId={{id}}&name={{name}}&price={{price}}&startDate={{startDate}}&endDate={{endDate}}&startTime={{startTime}}&endTime={{endTime}}&status={{status}}&storeId={{storeId}}&pic={{image image}}">
<img src="{{image image}}">
</a>
<div class="info">
<span class="name">{{name}}</span>
{{#if free}}
<span class="free">免费</span>
{{else}}
<span class="price"><span>¥</span>{{price}}</span>
{{/if}}
</div>
<div class="tip">
<div>
<p>日期:{{startDate}}{{endDate}}</p>
<p>时间:{{startTime}}{{endTime}}</p>
<div class="info">
<span class="name">{{name}}</span>
{{#if free}}
<span class="free">免费</span>
{{else}}
<span class="price"><span>¥</span>{{price}}</span>
{{/if}}
</div>
{{#if end}}
<a class="end">已结束</a>
{{else}}
{{#if needApo}}
{{#if apoStatus}}
<a href="//m.yohobuy.com/activity/trend/act-detail?activityId={{id}}&name={{name}}&price={{price}}&startDate={{startDate}}&endDate={{endDate}}&startTime={{startTime}}&endTime={{endTime}}&status={{status}}&storeId={{storeId}}">立即预约</a>
<div class="tip">
<div>
<p>日期:{{startDate}}{{endDate}}</p>
<p>时间:{{startTime}}{{endTime}}</p>
</div>
{{#if end}}
<div class="end a">已结束</div>
{{else}}
{{#if needApo}}
{{#if apoStatus}}
<div class="a">立即预约</div>
{{else}}
<div class="disable a">已约满</div>
{{/if}}
{{else}}
<a class="disable">已约满</a>
<div class="any-time a">免预约</div>
{{/if}}
{{else}}
<a class="any-time">免预约</a>
{{/if}}
{{/if}}
</div>
</div>
</a>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -8,4 +8,5 @@
<div class="intro">{{summary}}</div>
<div class="info">{{intro}}</div>
</div>
<input class="cutter-id" type="hidden" value="{{id}}" />
</div>
\ No newline at end of file
... ...
... ... @@ -3,10 +3,12 @@
<a class="pic" href="//m.yohobuy.com/activity/trend/article-detail?informationId={{id}}">
<img src="{{image coverUrl}}">
</a>
<p class="title">{{title}}</p>
<a href="//m.yohobuy.com/activity/trend/article-detail?informationId={{id}}">
<p class="title">{{title}}</p>
</a>
<div class="tip">
{{summary}}
<a href="//m.yohobuy.com/activity/trend/article-detail?informationId={{id}}">查看详情</a>
<a href="//m.yohobuy.com/activity/trend/article-detail?informationId={{id}}">{{summary}}</a>
<a class="a" href="//m.yohobuy.com/activity/trend/article-detail?informationId={{id}}">查看详情</a>
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="class">
<div class="class-item clearfix">
<a class="pic" href="//m.yohobuy.com/activity/trend/class-detail?activityId={{id}}&name={{name}}&price={{price}}&startDate={{startDate}}&endDate={{endDate}}&startTime={{startTime}}&endTime={{endTime}}&status={{status}}&storeId={{storeId}}">
<a class="pic" href="//m.yohobuy.com/activity/trend/class-detail?activityId={{id}}&name={{name}}&price={{price}}&startDate={{startDate}}&endDate={{endDate}}&startTime={{startTime}}&endTime={{endTime}}&status={{status}}&storeId={{storeId}}&pic={{image image}}">
<img src="{{image image}}">
</a>
<div class="info">
<span class="name">{{name}}</span>
{{#if free}}
<span class="free">免费</span>
{{else}}
<span class="price"><span>¥</span>{{price}}</span>
{{/if}}
</div>
<div class="tip">
<div>
<p>日期:{{startDate}}{{endDate}}</p>
<p>时间:{{startTime}}{{endTime}}</p>
<div class="info">
<span class="name">{{name}}</span>
{{#if free}}
<span class="free">免费</span>
{{else}}
<span class="price"><span>¥</span>{{price}}</span>
{{/if}}
</div>
{{#if end}}
<a class="end">已结束</a>
{{else}}
{{#if needApo}}
{{#if apoStatus}}
<a href="//m.yohobuy.com/activity/trend/class-detail?activityId={{id}}&name={{name}}&price={{price}}&startDate={{startDate}}&endDate={{endDate}}&startTime={{startTime}}&endTime={{endTime}}&status={{status}}&storeId={{storeId}}">立即预约</a>
<div class="tip">
<div>
<p>日期:{{startDate}}{{endDate}}</p>
<p>时间:{{startTime}}{{endTime}}</p>
</div>
{{#if end}}
<div class="end a">已结束</div>
{{else}}
{{#if needApo}}
{{#if apoStatus}}
<div class="a">立即预约</div>
{{else}}
<div class="disable a">已约满</div>
{{/if}}
{{else}}
<a class="disable">已约满</a>
<div class="any-time a">免预约</div>
{{/if}}
{{else}}
<a class="any-time">免预约</a>
{{/if}}
{{/if}}
</div>
</div>
</a>
</div>
</div>
\ No newline at end of file
... ...
require('../common');
var tip = require('../plugin/tip'),
IScroll = require('yoho-iscroll'),
diaLog = require('../plugin/dialog'),
Swiper = require('yoho-swiper'),
moment = require('moment');
diaLog = require('../plugin/dialog');
var $num = $('.num'),
$navUl = $('.nav-ul');
$navUl = $('.nav-ul'),
idArr = '',
hasId = false,
timeResult = '',
time = 0,
weekTime = '';
var num = 1,
openId = '',
... ... @@ -17,42 +18,22 @@ var num = 1,
$cookie,
$cookie2,
styleTotal = 0,
styleNow = 0;
styleNow = 0,
autoIndex = 0,
i = 0,
getCookie = '',
inpNum = 0,
styleStr = [];
require('../../scss/activity/trend/trend.page.css');
require('../activity/trend/share.js');
var indexAct = require('activity/trend/index');
require('../common');
require('activity/trend/trend.page.css');
require('activity/trend/share');
if ($('#map').length > 0) {
require('../../scss/activity/trend/map.css');
require('activity/trend/map');
}
function formatDate(time) {
var week = new Array('周一', '周二', '周三', '周四', '周五', '周六', '周日');
var time = new Date(time);
var year = time.getYear();
var month = time.getMonth() + 1;
var date = time.getDate();
var day = time.getDay();
var hour = time.getHours();
var minutes = time.getMinutes();
if (year < 1900) {
year = year + 1900;
}
if (month < 10) {
month = '0' + month;
}
if (date < 10) {
date = '0' + date;
}
if (hour < 10) {
hour = '0' + hour;
}
if (minutes < 10) {
minutes = '0' + minutes;
}
return year + '年' + month + '月' + date + '日' + ' ' + week[day-1] + ' ' + hour + ':' + minutes;
}
function autoScroll(thisPo) {
$navUl.find('.nav-item:eq(' + thisPo + ')').addClass('active').siblings('li').removeClass('active');
... ... @@ -65,367 +46,9 @@ function autoScroll(thisPo) {
}
}
var swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
lazyLoading: true,
lazyLoadingInPrevNext: true,
paginationClickable: true,
// loop: true,
autoplay: 3000,
slidesPerView: 'auto',
centeredSlides: true,
observer: true,
observeParents: true,
paginationBulletRender: function(index, className) {
return '<span class="' + className + '">' + (index + 1) + '</span>';
}
});
function getTimeList() {
var $date = $('.nav-ul').find('.active').attr('data');
$.ajax({
url: '/activity/trend/getTimeList',
data: {
dateTime: $date,
storeId: window.queryString.storeId,
appointType: window.queryString.typeStatus || window.cookie('travelType'),
activityId: window.queryString.activityId || window.queryString.id || '',
travelId: window.cookie('travelId'),
userId: window.queryString.id
},
success: function(result) {
var timeList = '';
var timeStr = '';
$('.time-list').empty();
$('.date-list').empty();
if ($('.chosen-time').length > 0) {
window.setCookie('limitPerson', result.appointNum);
}
for (var i = 0; i < result.getTimeList.length; i++) {
var useClass = 'use';
if (result.getTimeList[i].use === 2) {
var useClass = 'disable';
}
timeList = timeList + '<a date2="' + result.getTimeList[i].date2 + '" date="' + result.getTimeList[i].date + '" data="' + result.getTimeList[i].originTime + '" class="time-item ' + useClass + '">' + result.getTimeList[i].time + '</a>';
}
if ($('.time-list').length > 0) {
$('.time-list').append(timeList);
}
if ($('.date-list').length > 0) {
$('.date-list').append(timeList);
}
$('.time-list .time-item').on('click', function() {
if (!$(this).hasClass('disable')) {
$(this).addClass('chosen').siblings('.time-item').removeClass('chosen');
timeStr = $(this).attr('data');
window.setCookie('timeStr', timeStr);
// 如果是从预约订单详情页过来
if (window.queryString.order == 'true') {
var detailtTimeStr = $(this).attr('date');
window.setCookie('detailtTimeStr', detailtTimeStr);
}
}
});
},
error: function() {
tip.show('获取时间列表失败~');
}
});
}
function orderSubmit() {
var type = 1;
var storeId = window.queryString.storeId;
var appointTime = parseInt(window.cookie('timeStr'));
var appointUserName = $('#name').val();
var appointMobile = parseInt($('#tel').val());
var uid = parseInt($('#uid').val());
var activityId = window.cookie('packageId') || window.cookie('adviserId') || window.cookie('travelId');
var userNote = $('#note').val();
var appointPersonNum = parseInt($('#num').val());
var age = parseInt($('#age').val()) || '';
var ageType = $('#age').parents('.chose-item').find('input:checked').next('label').text();
var styles = window.cookie('styleStr');
var sex = $('input[name=sex]:checked').next('label').attr('name') || '';
var appointContent = '{"name":"' + appointUserName + '","age":"' + age + ageType + '","sex":"' + sex + '","mobile":' + appointMobile + ',"num":' + appointPersonNum + ',"remark":"' + userNote + '"}';
if (!window.cookie('packageId') && !window.cookie('adviserId')) {
type = 2;
}
userNote = userNote.replace(/[\r\n]/g, ' ');
if (userNote === '添加备注(选填)') {
userNote = '';
}
$.ajax({
url: '/activity/trend/addOrder',
data: {
storeId: storeId,
appointTime: appointTime,
appointUserName: appointUserName,
appointMobile: appointMobile,
uid: uid,
activityId: activityId,
appointContent: appointContent,
userNote: userNote,
appointPersonNum: appointPersonNum,
styles: styles,
type: type
},
success: function(result) {
if (result.code === 200) {
document.location.href = '//m.yohobuy.com/activity/trend/success?storeId=' + window.queryString.storeId + '&typeStatus=' + window.queryString.typeStatus;
} else {
tip.show(result.message);
}
},
error: function() {
tip.show('网络断开了~~~');
}
});
}
function diaHide() {
$('#dialog-wrapper').hide();
}
function removeByValue(arr, val) {
for (var i=0; i<arr.length; i++) {
if (arr[i] == val) {
arr.splice(i, 1);
break;
}
}
}
function checkSubmit() {
var needNnow = $('.need-know').find('input:checked').length;
if (needNnow > 0) {
var $require = $('.require');
var checkSubmit = false;
$require.each(
function() {
if ($(this).val() === '') {
var errText = $(this).attr('label');
tip.show('请输入' + errText);
checkSubmit = false;
return false;
} else {
var thisId = $(this).attr('id');
switch (thisId) {
case 'name' :
var reg = /^[\u4e00-\u9fa5]{1,10}$/;
var val = $(this).val();
if (!reg.test(val)) {
tip.show('姓名请输入10个以内汉字');
checkSubmit = false;
return false;
} else {
checkSubmit = true;
}
break;
case 'tel' :
var reg = /^1[34578]\d{9}$/;
var val = $(this).val();
if (!reg.test(val)) {
tip.show('手机号请输入11位数字');
checkSubmit = false;
} else {
checkSubmit = true;
}
return false;
break;
default:
checkSubmit = true;
}
}
}
);
if (checkSubmit) {
submitDia();
}
} else {
tip.show('请先接受上述条款');
}
}
function submitDia() {
diaLog.showDialog({
hasHeader: '温馨提示',
dialogText: '1、如需取消预约,可在预约时间前3天取消预约;<br />2、未取消的预约请按时到店。如未及时到店,我们将按爽约进行处理,一年中有3次爽约行为,本年内就无法再参与本店活动了哦。',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
}
}, function() {
diaHide();
orderSubmit();
});
// 修改弹框样式
$('.tap-hightlight').css('color', '#007aff');
$('.dialog-content').css({'text-align': 'left', 'padding': '0 0.75rem 0.5rem'});
}
function setCookieArr() {
var cookieArr = new Array();
$cookie.each(
function() {
cookieArr.push($(this).val());
}
);
window.setCookie('cookieArr', cookieArr);
}
// 限制输入长度
function limitInp(obj, limit, show) {
var textLen = obj.val();
if (textLen.length > limit) {
if (show) {
tip.show('最多输入' + limit + '字');
}
textLen = textLen.substring(0, limit);
obj.val(textLen);
return false;
}
}
function getAbleTime() {
var timeResult = '';
$.ajax({
url: '/activity/trend/getAbleTime',
data: {
activityType: window.queryString.typeStatus,
activityId: window.queryString.activityId || window.cookie('packageId') || window.cookie('travelId')
},
async: false,
success: function(result) {
if (result.code === 200) {
timeResult = result;
} else {
// tip.show(result.message);
}
},
error: function() {
tip.show('网络断开了~~~');
}
});
return timeResult;
}
function _formatDay(day) {
return moment(day).format('MM月DD日 HH:mm');
}
// 清除cookie
function clearCookieArr(type) {
switch (type) {
case 1 :
window.setCookie('chosenStyle', '');
window.setCookie('chosenTime', '');
break;
case 2 :
window.setCookie('chosenPackage', '');
window.setCookie('chosenStyle', '');
window.setCookie('chosenTime', '');
break;
case 3 :
window.setCookie('chosenPackage', '');
window.setCookie('packageId', '');
window.setCookie('chosenStyle', '');
window.setCookie('chosenTime', '');
window.setCookie('chosenAdviser', '');
window.setCookie('adviserId', '');
window.setCookie('chosenCutter', '');
window.setCookie('iscutter', '');
window.setCookie('styleStr', '');
window.setCookie('timeStr', '');
window.setCookie('detailtTimeStr', '');
window.setCookie('radiobirth', '');
window.setCookie('radiosex', '');
window.setCookie('cookieArr', '');
window.setCookie('limitPerson', '');
window.setCookie('packageLimit', '');
window.setCookie('packageStyle', '');
window.setCookie('chosenClass', '');
window.setCookie('styleId', '');
break;
}
}
$(
function() {
// 地图初始化
if ($('#map').length > 0) {
var w_height = $(window).height();
var h_height = $('.yoho-header').height();
$('#map').css('height', (w_height - h_height) + 'px');
var mapPic = decodeURI(window.queryString.pic);
var mapName = decodeURI(window.queryString.name);
var napAdr = decodeURI(window.queryString.adr);
var mapIntro = decodeURI(window.queryString.intro);
var mapTel = decodeURI(window.queryString.tel);
var mapJD = decodeURI(window.queryString.jd);
var mapWD = decodeURI(window.queryString.wd);
var map = new BMap.Map('map');
var point = new BMap.Point(mapJD, mapWD); // 坐标点
var searchInfoWindow = null;
var content = '<div style="margin:0;line-height:20px;padding:2px;font-size:12px;">' +
'<img src="' + mapPic + '" style="float:right;zoom:1;overflow:hidden;width:100px;height:100px;margin-left:3px;"/>' +
'地址:' + napAdr + '<br/>电话:' + mapTel + '<br/>简介:' + mapIntro +
'</div>';
var marker = new BMap.Marker(point); // 创建marker对象
var label = new BMap.Label(mapName, {offset: new BMap.Size(30, -20)});
var top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT});// 左上角,添加比例尺
var ctrl_nav = new BMap.NavigationControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, type: BMAP_NAVIGATION_CONTROL_LARGE});
// 百度地图API功能
map.centerAndZoom(point, 15); // 缩放比例
map.enableScrollWheelZoom();
// 创建检索信息窗口对象
searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, {
title: mapName, // 标题
width: 290, // 宽度
height: 105, // 高度
panel: 'panel', // 检索结果面板
enableAutoPan: true, // 自动平移
searchTypes: [
// BMAPLIB_TAB_SEARCH, // 周边检索
BMAPLIB_TAB_TO_HERE, // 到这里去
// BMAPLIB_TAB_FROM_HERE // 从这里出发
]
});
marker.enableDragging(); // marker可拖拽
marker.addEventListener('click', function(e) {
searchInfoWindow.open(marker);
});
map.addOverlay(marker); // 在地图中添加marker
marker.setLabel(label);
map.addControl(top_left_control);
map.addControl(ctrl_nav);
}
// 批量设置isFront参数
if (window.queryString.isFront) {
window.setCookie('isFront', window.queryString.isFront);
... ... @@ -439,62 +62,12 @@ $(
// 风格详情页图片点击放大
$('.pull-pic-list').on('click', function() {
var w_height = $(window).height();
$('.big-pic').show();
$('.swiper-slide img').each(
function() {
if ($(this).height() > w_height) {
$(this).css('height', '90%');
$(this).css('width', 'auto');
var newTop = (w_height - $(this).height()) / 2;
$(this).css('margin-top', newTop + 'px');
} else {
var newTop = (w_height - $(this).height()) / 2;
$(this).css('margin-top', newTop + 'px');
}
}
);
$('.swiper-slide').on('click', function() {
$('.big-pic').hide();
});
indexAct.pullPicBig();
});
// 瀑布流
if ($('.pull-pic-list').length > 0) {
setTimeout(function() {
var box = $('.pull-pic-list .box');
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) {
boxArr[index] = boxHeight;
} else {
var minBoxHeight = Math.min.apply(null, boxArr);
var minBoxIndex = $.inArray(minBoxHeight, boxArr);
$(value).css({
'position': 'absolute',
'top': minBoxHeight,
'left': box.eq(minBoxIndex).position().left
});
boxArr[minBoxIndex] += box.eq(index).height();
var newHeight = $(this).position().top + box.eq(index).height();
if (newHeight > maxHeight) {
maxHeight = newHeight;
}
$('.pull-pic-list').css('height', maxHeight + 'px');
}
});
}, 500);
indexAct.pullPic();
}
if ($('.adviser-info').length > 0) {
... ... @@ -514,9 +87,10 @@ $(
$depend.each(
function() {
if ($(this).find('input').val() === '') {
var errText = $(this).closest('.depend').find('.label').text();
var errText = '';
if ($(this).find('input').val() === '') {
errText = $(this).closest('.depend').find('.label').text();
tip.show('请先选择' + errText);
chosenAble = false;
return false;
... ... @@ -534,10 +108,10 @@ $(
$('.chosen-select .depend').on('click', function() {
if ($(this).find('.chosen-cutter').length > 0) {
clearCookieArr(2);
indexAct.clearCookieArr(2);
} else {
if (!($('.chosen-style').val() && !$('.chosen-package').val())) {
clearCookieArr(1);
indexAct.clearCookieArr(1);
}
}
});
... ... @@ -546,22 +120,22 @@ $(
$('#note').on('keyup', function() {
var obj = $(this);
limitInp(obj, 200, true);
indexAct.limitInp(obj, 200, true);
});
$('#name').on('keyup', function() {
var obj = $(this);
limitInp(obj, 10, false);
indexAct.limitInp(obj, 10, false);
});
$('#tel').on('keyup', function() {
var obj = $(this);
limitInp(obj, 11, false);
indexAct.limitInp(obj, 11, false);
});
$('#age').on('keyup', function() {
var obj = $(this);
limitInp(obj, 2, false);
indexAct.limitInp(obj, 2, false);
});
// 默认勾选
... ... @@ -588,7 +162,7 @@ $(
function() {
if (window.cookie('chosenStyle').indexOf($(this).text()) > -1) {
$(this).addClass('chosen');
styleNow ++;
styleNow++;
}
}
);
... ... @@ -603,8 +177,6 @@ $(
);
}
if (window.queryString.chosenType === '2') {
var autoIndex = 0;
$('.nav-item').each(
function() {
if ($(this).find('p:first').text()) {
... ... @@ -668,10 +240,10 @@ $(
// 默认已勾选风格,根据后选套餐是否包含该风格,判断时候清空风格
if (window.cookie('packageStyle') && window.cookie('styleId')) {
var idArr = window.cookie('packageStyle').split(',');
var hasId = false;
idArr = window.cookie('packageStyle').split(',');
hasId = false;
for (var i = 0; i < idArr.length; i++) {
for (i = 0; i < idArr.length; i++) {
if (idArr[i] === $('.chosen-style').attr('id')) {
hasId = true;
break;
... ... @@ -679,7 +251,7 @@ $(
}
if (!hasId) {
$('.chosen-style').val('');
clearCookieArr(1);
indexAct.clearCookieArr(1);
}
window.setCookie('styleId', '');
}
... ... @@ -688,10 +260,10 @@ $(
$('.chosen-adviser').val(window.cookie('chosenAdviser'));
$('.chosen-class').val(window.cookie('chosenClass'));
if (window.cookie('chosenClass')) {
var timeResult = getAbleTime();
timeResult = indexAct.getAbleTime();
if (timeResult.data) {
$('.chosen-time').val(_formatDay(new Date(timeResult.data * 1000))).addClass('disabled');
$('.chosen-time').val(indexAct._formatDay(new Date(timeResult.data * 1000))).addClass('disabled');
$('.chosen-time').parents('a').attr('href', 'javascript:void(0)');
window.setCookie('timeStr', timeResult.data);
}
... ... @@ -710,9 +282,9 @@ $(
$('.chosen-select .chose-item:eq(1)').addClass('need');
$('.chosen-select .depend').on('click', function() {
if ($(this).find('.chosen-cutter').length > 0) {
clearCookieArr(2);
indexAct.clearCookieArr(2);
} else {
clearCookieArr(1);
indexAct.clearCookieArr(1);
}
});
}
... ... @@ -722,15 +294,15 @@ $(
// 修改表单存储cookie
$('.chosen').on('click', function() {
setCookieArr();
indexAct.setCookieArr();
});
$('.chosen .cookie').on('keyup', function() {
setCookieArr();
indexAct.setCookieArr();
});
if ($('.chosen-info').find('.cookie').length > 0) {
if (window.cookie('cookieArr') !== undefined && (window.cookie('cookieArr'))) {
var getCookie = window.cookie('cookieArr').split(',');
var inpNum = 0;
getCookie = window.cookie('cookieArr').split(',');
inpNum = 0;
$cookie.each(
function() {
... ... @@ -746,14 +318,15 @@ $(
window.setCookie('radio' + $(this).attr('name'), radioIndex);
});
if ($('.chosen-info').find('.cookie2').length > 0) {
$('.chose-item').find('.cookie2[name=sex]:eq(' + window.cookie('radiosex') + ')').attr('checked', 'checked');
$('.chose-item').find('.cookie2[name=birth]:eq(' + window.cookie('radiobirth') + ')').attr('checked', 'checked');
$('.chose-item').find('.cookie2[name=sex]:eq(' +
window.cookie('radiosex') + ')').attr('checked', 'checked');
$('.chose-item').find('.cookie2[name=birth]:eq(' +
window.cookie('radiobirth') + ')').attr('checked', 'checked');
}
if ($('.clearCookie').length > 0) {
clearCookieArr(3);
indexAct.clearCookieArr(3);
}
if ($('.textarea textarea').val() === '添加备注(选填)') {
$('.textarea textarea').addClass('disabled');
}
... ... @@ -764,24 +337,7 @@ $(
});
// 默认选中菜单
if ($('.class-detail').length > 0) {
window.setCookie('chosenClass', $('.class-detail').find('.name').text());
window.setCookie('packageId', $('.class-detail').find('.name').attr('id'));
}
if ($('.adviser-info').find('.name').length > 0) {
window.setCookie('chosenCutter', $('.adviser-info').find('.name').text());
window.setCookie('chosenAdviser', $('.adviser-info').find('.name').text());
}
if ($('.style-detail').length > 0) {
window.setCookie('styleId', window.queryString.id);
window.setCookie('chosenStyle', ' ' + decodeURI(window.queryString.styleName) + ' ');
}
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());
window.setCookie('packageId', window.queryString.id);
}
indexAct.chosenDefault();
// 立即预约按钮
$('.chosen-btn').on('click', function() {
... ... @@ -791,7 +347,13 @@ $(
var chosenNum = $chosenItem.length;
var chosenType = window.queryString.chosenType;
var tipMsg = '';
var chosenText = '';
var chosenText2 = '';
var packageId = '';
if ($(this).hasClass('full')) {
return false;
}
if ((checkedNum <= 0) && (chosenNum <= 0)) {
switch (chosenType) {
case '1' : tipMsg = '风格';
... ... @@ -804,12 +366,14 @@ $(
break;
case '5' : tipMsg = '发型师';
break;
default:
break;
}
tip.show('请选择' + tipMsg);
} else {
var chosenText = $checkedItem.attr('data') || $chosenItem.text();
var chosenText2 = $chosenItem.attr('date2');
var packageId = $checkedItem.attr('id');
chosenText = $checkedItem.attr('data') || $chosenItem.text();
chosenText2 = $chosenItem.attr('date2');
packageId = $checkedItem.attr('id');
switch (chosenType) {
case '4' :
... ... @@ -830,6 +394,9 @@ $(
break;
case '5' :
window.setCookie('chosenCutter', chosenText);
window.setCookie('cutterId', packageId);
break;
default:
break;
}
document.location.href = document.referrer;
... ... @@ -838,45 +405,19 @@ $(
// 取消订单
$('.order-btn a').on('click', function() {
diaLog.showDialog({
dialogText: '确认取消预约吗?',
hasFooter: {
leftBtnText: '我再想想',
rightBtnText: '确认取消'
}
}, function() {
$.ajax({
url: '/activity/trend/delOrder',
data: {
id: $('.order-btn a').attr('id')
},
success: function(result) {
if (result.code === 200) {
document.location.href = '//m.yohobuy.com/activity/trend/order-list?storeId=' + window.queryString.storeId;
} else {
tip.show(result.message);
}
},
error: function() {
tip.show('网络断开了~~~');
}
});
});
// 修改弹框样式
$('.dialog-left-btn').css('color', '#999');
$('.dialog-right-btn').css('color', '#007aff');
indexAct.cancelOrder();
});
// 加减人数按钮
$num.find('.plus-btn').on('click', function() {
var limitNum = 0;
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;
limitNum = parseInt($num.find('input').attr('max'), 10);
if (parseInt($num.find('input').val(), 10) < limitNum) {
num = parseInt($num.find('input').val(), 10) + 1;
$num.find('input').val(num);
} else {
tip.show('可预约人数已达上限');
... ... @@ -884,8 +425,8 @@ $(
}
});
$num.find('.minus-btn').on('click', function() {
if (parseInt($num.find('input').val()) > 1) {
num = parseInt($num.find('input').val()) - 1;
if (parseInt($num.find('input').val(), 10) > 1) {
num = parseInt($num.find('input').val(), 10) - 1;
$num.find('input').val(num);
} else {
tip.show('人数不能小于1');
... ... @@ -909,23 +450,25 @@ $(
return false;
});
myScroll.on('scrollEnd', function() {
var thisPo = 0;
if ($navUl.hasClass('srolling')) {
$navUl.removeClass('srolling');
var thisPo = Math.ceil((0 - myScroll.x) / sWidth + 1.5);
thisPo = Math.ceil((0 - myScroll.x) / sWidth + 1.5);
autoScroll(thisPo);
getTimeList();
indexAct.getTimeList();
}
});
}
// 通过点击选择时间段
$navUl.find('.nav-item').on('click', function() {
if (!$(this).hasClass('disable')) {
var thisPo = $(this).index();
var thisPo = 0;
if (!$(this).hasClass('disable')) {
thisPo = $(this).index();
autoScroll(thisPo);
getTimeList();
indexAct.getTimeList();
}
});
... ... @@ -936,7 +479,7 @@ $(
});
$('.dia-tip').on('click', function() {
checkSubmit();
indexAct.checkSubmit();
});
$('.tab .tab-top span').on('click', function() {
... ... @@ -958,29 +501,48 @@ $(
var $totalId = $(this).attr('id');
var $packageStyle = window.cookie('packageStyle').split(',');
for (var i = 0; i < $packageStyle.length; i++) {
if ($totalId == $packageStyle[i]) {
for (i = 0; i < $packageStyle.length; i++) {
if ($totalId === $packageStyle[i]) {
$(this).removeClass('disabled');
}
}
}
);
} else if (!window.cookie('chosenPackage')) {
$('.style-ul:eq(0) li').each(
function() {
$('.top').find('.text').text('请先选择套餐');
$(this).removeClass('disabled');
styleTotal = $('.style-ul:eq(0) li').length;
$('.foot-btn').addClass('full').removeClass('ok');
$('.style-tip').hide();
}
);
}
$('.style-tip .total').text(styleTotal);
$('.style-tip .now').text(styleNow);
}
var styleStr = new Array();
// 不选套餐进入时间选择页
if ($('.time-tag').length > 0) {
if (!window.cookie('packageId') && ((window.queryString.typeStatus === '4') ||
(window.queryString.typeStatus === '5'))) {
$('.date-tip').find('.text').text('请先选择套餐');
$('.foot-btn').addClass('full').removeClass('ok');
}
}
$('.style-ul li').on('click', function() {
$(this).parents('.style-ul').siblings('.style-ul').find('li').removeClass('chosen');
var $this = $(this);
var $thisId = $(this).attr('id');
var limitNum = 0;
$(this).parents('.style-ul').siblings('.style-ul').find('li').removeClass('chosen');
if (!$this.hasClass('disabled')) {
if ($this.hasClass('chosen')) {
$this.removeClass('chosen');
if (!$this.hasClass('not')) {
removeByValue(styleStr, $thisId);
indexAct.removeByValue(styleStr, $thisId);
styleNow--;
} else {
styleStr = [];
... ... @@ -988,7 +550,7 @@ $(
}
} else {
if (!$this.hasClass('not')) {
var limitNum = $('.total').text();
limitNum = $('.total').text();
if (styleNow >= limitNum) {
tip.show('超过最大可选风格数');
... ... @@ -1010,14 +572,14 @@ $(
if ($('.time-nav').length > 0) {
$('.time-nav ul').find('.nav-item:eq(2)').addClass('active');
getTimeList();
indexAct.getTimeList();
}
if ($('.order-item').length > 0) {
$('.order-item').each(
function() {
var time = $(this).find('.time').attr('date') * 1000;
var weekTime = formatDate(time);
time = $(this).find('.time').attr('date') * 1000;
weekTime = indexAct.formatDate(time);
$(this).find('.time').html(weekTime);
}
... ... @@ -1025,9 +587,9 @@ $(
}
if ($('#detail-time').length > 0) {
var time = $('#detail-time').attr('date') * 1000;
var weekTime = formatDate(time);
var timeResult = getAbleTime();
time = $('#detail-time').attr('date') * 1000;
weekTime = indexAct.formatDate(time);
timeResult = indexAct.getAbleTime();
$('#detail-time').html(weekTime);
if (timeResult.data === '') {
... ... @@ -1035,4 +597,4 @@ $(
}
}
}
);
\ No newline at end of file
);
... ...
var tip = require('plugin/tip'),
moment = require('moment'),
Swiper = require('yoho-swiper'),
diaLog = require('plugin/dialog');
var $cookie;
new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
lazyLoading: true,
lazyLoadingInPrevNext: true,
paginationClickable: true,
// loop: true,
autoplay: 3000,
slidesPerView: 'auto',
centeredSlides: true,
observer: true,
observeParents: true,
paginationBulletRender: function(index, className) {
return '<span class="' + className + '">' + (index + 1) + '</span>';
}
});
function pullPic() {
var pos = 0;
var topNum = 2;
var heightArr = [];
var $box = $('.pull-pic-list').find('.box');
function rePosition(po) {
var $thisImg = $('.pull-pic-list').find('img:eq(' + po + ')');
var $thisBox = $('.pull-pic-list').find('.box:eq(' + po + ')');
$thisImg.attr('src', $thisImg.attr('data'));
$thisImg.load(
function() {
var minHeight = 0;
var minTop = 0;
var maxHeight = 0;
if (po < topNum) {
heightArr[po] = $thisBox.height();
} else {
minHeight = Math.min.apply(null, heightArr);
minTop = $.inArray(minHeight, heightArr);
heightArr[minTop] = heightArr[minTop] + $thisBox.height();
$thisBox.css({
'position': 'absolute',
'top': minHeight + 'px',
'left': $box.eq(minTop).position().left
});
maxHeight = Math.max.apply(null, heightArr);
$('.pull-pic-list').css('height', maxHeight + 'px');
}
po++;
rePosition(po);
}
);
}
rePosition(pos);
}
function getTimeList() {
var $date = $('.nav-ul').find('.active').attr('data');
var userId = '';
if (window.queryString.id && ($('.travel').length > 0)) {
userId = window.queryString.id;
}
if (window.queryString.id && ($('.share-cutter').length > 0)) {
userId = window.queryString.id;
}
$.ajax({
url: '/activity/trend/getTimeList',
data: {
dateTime: $date,
storeId: window.queryString.storeId,
appointType: window.queryString.typeStatus || window.cookie('travelType'),
activityId: window.queryString.activityId || window.queryString.id || '',
travelId: window.cookie('travelId'),
userId: userId
},
success: function(result) {
var timeList = '';
var timeStr = '';
var i = 0;
var useClass = '';
$('.time-list').empty();
$('.date-list').empty();
if ($('.chosen-time').length > 0) {
window.setCookie('limitPerson', result.appointNum);
}
for (i = 0; i < result.getTimeList.length; i++) {
useClass = 'use';
if (result.getTimeList[i].use === 2) {
useClass = 'disable';
}
timeList = timeList + '<a date2="' + result.getTimeList[i].date2 + '" date="' +
result.getTimeList[i].date + '" data="' + result.getTimeList[i].originTime + '" class="time-item ' +
useClass + '">' + result.getTimeList[i].time + '</a>';
}
if ($('.time-list').length > 0) {
$('.time-list').append(timeList);
}
if ($('.date-list').length > 0) {
$('.date-list').append(timeList);
}
$('.time-list .time-item').on('click', function() {
var detailtTimeStr = '';
if (!$(this).hasClass('disable')) {
$(this).addClass('chosen').siblings('.time-item').removeClass('chosen');
timeStr = $(this).attr('data');
window.setCookie('timeStr', timeStr);
// 如果是从预约订单详情页过来
if (window.queryString.order === 'true') {
detailtTimeStr = $(this).attr('date');
window.setCookie('detailtTimeStr', detailtTimeStr);
}
}
});
},
error: function() {
tip.show('获取时间列表失败~');
}
});
}
// 清除cookie
function clearCookieArr(type) {
switch (type) {
case 1 :
window.setCookie('chosenStyle', '');
window.setCookie('chosenTime', '');
break;
case 2 :
window.setCookie('chosenPackage', '');
window.setCookie('chosenStyle', '');
window.setCookie('chosenTime', '');
break;
case 3 :
window.setCookie('chosenPackage', '');
window.setCookie('packageId', '');
window.setCookie('chosenStyle', '');
window.setCookie('chosenTime', '');
window.setCookie('chosenAdviser', '');
window.setCookie('adviserId', '');
window.setCookie('chosenCutter', '');
window.setCookie('iscutter', '');
window.setCookie('styleStr', '');
window.setCookie('timeStr', '');
window.setCookie('detailtTimeStr', '');
window.setCookie('radiobirth', '');
window.setCookie('radiosex', '');
window.setCookie('cookieArr', '');
window.setCookie('limitPerson', '');
window.setCookie('packageLimit', '');
window.setCookie('packageStyle', '');
window.setCookie('chosenClass', '');
window.setCookie('styleId', '');
window.setCookie('cutterId', '');
break;
default:
break;
}
}
function formatDate(time) {
var week = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
var times = new Date(time);
var year = times.getYear();
var month = times.getMonth() + 1;
var date = times.getDate();
var day = times.getDay();
var hour = times.getHours();
var minutes = times.getMinutes();
var timeText = '';
if (year < 1900) {
year = year + 1900;
}
if (month < 10) {
month = '0' + month;
}
if (date < 10) {
date = '0' + date;
}
if (hour < 10) {
hour = '0' + hour;
}
if (minutes < 10) {
minutes = '0' + minutes;
}
timeText = year + '年' + month + '月' + date + '日&nbsp' + week[day] + '&nbsp' + hour + ':' + minutes;
return timeText;
}
function diaHide() {
$('#dialog-wrapper').hide();
}
function orderSubmit() {
var type = 1;
var storeId = window.queryString.storeId;
var appointTime = parseInt(window.cookie('timeStr'), 10);
var appointUserName = $('#name').val();
var appointMobile = parseInt($('#tel').val(), 10);
var uid = parseInt($('#uid').val(), 10);
var activityId = window.cookie('packageId') || window.cookie('adviserId') || window.cookie('travelId');
var userNote = $('#note').val();
var appointPersonNum = parseInt($('#num').val(), 10);
var age = parseInt($('#age').val(), 10) || '';
var ageType = $('#age').parents('.chose-item').find('input:checked').next('label').text();
var styles = window.cookie('styleStr');
var sex = $('input[name=sex]:checked').next('label').attr('name') || '';
var appointContent = '{"name":"' + appointUserName + '","age":"' + age +
ageType + '","sex":"' + sex + '","mobile":' + appointMobile + ',"num":' +
appointPersonNum + ',"remark":"' + userNote + '"}';
if (!window.cookie('packageId') && !window.cookie('adviserId')) {
type = 2;
}
userNote = userNote.replace(/[\r\n]/g, ' ');
if (userNote === '添加备注(选填)') {
userNote = '';
}
$.ajax({
url: '/activity/trend/addOrder',
data: {
storeId: storeId,
appointTime: appointTime,
appointUserName: appointUserName,
appointMobile: appointMobile,
uid: uid,
activityId: activityId,
appointContent: appointContent,
userNote: userNote,
appointPersonNum: appointPersonNum,
styles: styles,
type: type
},
success: function(result) {
if (result.code === 200) {
document.location.href = '//m.yohobuy.com/activity/trend/success?storeId=' +
window.queryString.storeId + '&typeStatus=' + window.queryString.typeStatus;
} else {
tip.show(result.message);
}
},
error: function() {
tip.show('网络断开了~~~');
}
});
}
function submitDia() {
diaLog.showDialog({
hasHeader: '温馨提示',
dialogText: '1、如需取消预约,可在预约时间前3天取消预约;<br />2、未取消的预约请按时到店。如未及时到店,我们将按爽约进行处理,一年中有3次爽约行为,本年内就无法再参与本店活动了哦。',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
}
}, function() {
diaHide();
orderSubmit();
});
// 修改弹框样式
$('.tap-hightlight').css('color', '#007aff');
$('.dialog-content').css({'text-align': 'left', 'padding': '0 0.75rem 0.5rem'});
}
function checkSubmit() {
var needNnow = $('.need-know').find('input:checked').length;
var $require = $('.require');
var checkSubmits = false;
var errText = '';
var thisId = '';
var reg = '';
var val = '';
if (needNnow > 0) {
$require.each(
function() {
if ($(this).val() === '') {
errText = $(this).attr('label');
tip.show('请输入' + errText);
checkSubmits = false;
return false;
} else {
thisId = $(this).attr('id');
switch (thisId) {
case 'name' :
reg = /^[A-Za-z0-9\u4e00-\u9fa5]+$/;
val = $(this).val();
if (!reg.test(val)) {
tip.show('姓名请输入中文,英文,数字组合');
checkSubmits = false;
return false;
} else {
checkSubmits = true;
}
break;
case 'tel' :
reg = /^1[34578]\d{9}$/;
val = $(this).val();
if (!reg.test(val)) {
tip.show('手机号请输入11位数字');
checkSubmits = false;
return false;
} else {
checkSubmits = true;
}
break;
case 'age' :
reg = /^[1-9]\d{0,1}$/;
val = $(this).val();
if (!reg.test(val)) {
tip.show('年龄请输入两位以内有效数字');
checkSubmits = false;
return false;
} else {
checkSubmits = true;
}
break;
default:
checkSubmits = true;
}
}
}
);
if (checkSubmits) {
submitDia();
}
} else {
tip.show('请先接受上述条款');
}
}
function getAbleTime() {
var timeResult = '';
$.ajax({
url: '/activity/trend/getAbleTime',
data: {
activityType: window.queryString.typeStatus,
activityId: window.queryString.activityId || window.cookie('packageId') || window.cookie('travelId')
},
async: false,
success: function(result) {
if (result.code === 200) {
timeResult = result;
} else {
// tip.show(result.message);
}
},
error: function() {
tip.show('网络断开了~~~');
}
});
return timeResult;
}
function setCookieArr() {
var cookieArr = [];
$cookie = $('.chosen-info').find('.cookie');
$cookie.each(
function() {
cookieArr.push($(this).val());
}
);
window.setCookie('cookieArr', cookieArr);
}
function removeByValue(arr, val) {
var i = 0;
for (i = 0; i < arr.length; i++) {
if (arr[i] === val) {
arr.splice(i, 1);
break;
}
}
}
// 限制输入长度
function limitInp(obj, limit, show) {
var textLen = obj.val();
if (textLen.length > limit) {
if (show) {
tip.show('最多输入' + limit + '字');
}
textLen = textLen.substring(0, limit);
obj.val(textLen);
return false;
}
}
function _formatDay(day) {
return moment(day).format('MM月DD日 HH:mm');
}
function pullPicBig(){
var w_height = $(window).height();
$('.big-pic').show();
$('.swiper-slide img').each(
function() {
var newTop = (w_height - $(this).height()) / 2;
if ($(this).height() > w_height) {
$(this).css('height', '90%');
$(this).css('width', 'auto');
$(this).css('margin-top', newTop + 'px');
} else {
$(this).css('margin-top', newTop + 'px');
}
}
);
$('.swiper-slide').on('click', function() {
$('.big-pic').hide();
});
}
function cancelOrder(){
diaLog.showDialog({
dialogText: '确认取消预约吗?',
hasFooter: {
leftBtnText: '我再想想',
rightBtnText: '确认取消'
}
}, function() {
$.ajax({
url: '/activity/trend/delOrder',
data: {
id: $('.order-btn a').attr('id')
},
success: function(result) {
if (result.code === 200) {
document.location.href = '//m.yohobuy.com/activity/trend/order-list?storeId=' +
window.queryString.storeId;
} else {
tip.show(result.message);
}
},
error: function() {
tip.show('网络断开了~~~');
}
});
});
// 修改弹框样式
$('.dialog-left-btn').css('color', '#999');
$('.dialog-right-btn').css('color', '#007aff');
}
function chosenDefault() {
if ($('.class-detail').length > 0) {
window.setCookie('chosenClass', $('.class-detail').find('.name').text());
window.setCookie('packageId', $('.class-detail').find('.name').attr('id'));
}
if ($('.adviser-info').find('.name').length > 0) {
window.setCookie('chosenCutter', $('.adviser-info').find('.name').text());
window.setCookie('chosenAdviser', $('.adviser-info').find('.name').text());
window.setCookie('cutterId', $('.cutter-id').val());
}
if ($('.style-detail').length > 0) {
window.setCookie('styleId', window.queryString.id);
window.setCookie('chosenStyle', ' ' + decodeURI(window.queryString.styleName) + ' ');
}
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());
window.setCookie('packageId', window.queryString.id);
}
}
module.exports = {
getTimeList: getTimeList,
clearCookieArr: clearCookieArr,
formatDate: formatDate,
checkSubmit: checkSubmit,
submitDia: submitDia,
orderSubmit: orderSubmit,
getAbleTime: getAbleTime,
setCookieArr: setCookieArr,
removeByValue: removeByValue,
limitInp: limitInp,
pullPic: pullPic,
pullPicBig: pullPicBig,
cancelOrder: cancelOrder,
chosenDefault: chosenDefault,
_formatDay: _formatDay
};
... ...
$(
function() {
// 地图初始化
var w_height = $(window).height();
var h_height = $('.yoho-header').height();
var mapPic = decodeURI(window.queryString.pic);
var mapName = decodeURI(window.queryString.name);
var napAdr = decodeURI(window.queryString.adr);
var mapIntro = decodeURI(window.queryString.intro);
var mapTel = decodeURI(window.queryString.tel);
var mapJD = decodeURI(window.queryString.jd);
var mapWD = decodeURI(window.queryString.wd);
var point = new window.BMap.Point(mapJD, mapWD); // 坐标点
var searchInfoWindow = null;
var content = '<div style="margin:0;line-height:20px;padding:2px;font-size:12px;">' +
'<img src="' + mapPic +
'" style="float:right;zoom:1;overflow:hidden;width:100px;height:100px;margin-left:3px;"/>' +
'地址:' + napAdr + '<br/>电话:' + mapTel + '<br/>简介:' + mapIntro +
'</div>';
var marker = new window.BMap.Marker(point); // 创建marker对象
var label = new window.BMap.Label(mapName, {offset: new window.BMap.Size(30, -20)});
var top_left_control = new window.BMap.ScaleControl({anchor: window.BMAP_ANCHOR_BOTTOM_RIGHT});// 左上角,添加比例尺
var ctrl_nav = new window.BMap.NavigationControl({
anchor: window.BMAP_ANCHOR_BOTTOM_RIGHT,
type: window.BMAP_NAVIGATION_CONTROL_LARGE
});
var map = '';
$('#map').css('height', (w_height - h_height) + 'px');
map = new window.BMap.Map('map');
// 百度地图API功能
map.centerAndZoom(point, 15); // 缩放比例
map.enableScrollWheelZoom();
// 创建检索信息窗口对象
searchInfoWindow = new window.BMapLib.SearchInfoWindow(map, content, {
title: mapName, // 标题
width: 290, // 宽度
height: 105, // 高度
panel: 'panel', // 检索结果面板
enableAutoPan: true, // 自动平移
searchTypes: [
// BMAPLIB_TAB_SEARCH, // 周边检索
window.BMAPLIB_TAB_TO_HERE, // 到这里去
// BMAPLIB_TAB_FROM_HERE // 从这里出发
]
});
marker.enableDragging(); // marker可拖拽
marker.addEventListener('click', function() {
searchInfoWindow.open(marker);
});
map.addOverlay(marker); // 在地图中添加marker
marker.setLabel(label);
map.addControl(top_left_control);
map.addControl(ctrl_nav);
}
);
... ...
var share = require('common/share');
var sharePic = '';
var shareTip = '';
function urlHttp(url) {
var http = '';
if (url) {
http = (url.indexOf('http:') >= 0) || (url.indexOf('https:') >= 0);
if (http) {
return url;
} else {
return 'http:' + url;
}
}
}
if ($('.share-class').length > 0 || $('.share-activity').length > 0 || $('.travel').length > 0 ||
$('.share-photography').length > 0 || $('.kid-style').length > 0 || $('.travel').length > 0) {
sharePic = $('.trend-c').find('img:eq(0)').attr('src');
shareTip = $('.trend-c').find('p:eq(0)').text();
window.setCookie('sharePic', sharePic);
window.setCookie('shareTip', shareTip);
}
// 潮流之旅主页,预约页,子页面,预约成功页
if (window.queryString.typeStatus === '3') {
if (window.queryString.typeStatus === '3' || $('.travel').length > 0) {
share({
title: '潮流之旅',
desc: $('.trend-c').find('p:eq(0)').text(),
imgUrl: $('.trend-c').find('img:eq(0)').attr('src')
desc: window.cookie('shareTip'),
imgUrl: urlHttp(window.cookie('sharePic'))
});
}
// 潮流之旅-顾问页
if ((window.queryString.typeStatus === '3') && ($('.adviser-info').length > 0)) {
share({
title: $('.trend-c').find('.name:eq(0)').text(),
title: '潮流顾问介绍-' + $('.trend-c').find('.name:eq(0)').text(),
desc: $('.trend-c').find('.intro:eq(0)').text(),
imgUrl: 'http:' + $('.trend-c').find('.pic:eq(0)').attr('src')
imgUrl: urlHttp($('.trend-c').find('.pic:eq(0)').attr('src'))
});
}
// 介绍页,预约页,子页面,预约成功页
if (window.queryString.typeStatus === '4') {
// 儿童摄影介绍页,预约页,子页面,预约成功页
if (window.queryString.typeStatus === '4' || ($('.share-photography').length > 0)) {
share({
title: '儿童摄影',
desc: $('.trend-c').find('p:eq(0)').text(),
imgUrl: $('.trend-c').find('img:eq(0)').attr('src')
desc: window.cookie('shareTip'),
imgUrl: urlHttp(window.cookie('sharePic'))
});
}
// 儿童造型介绍页,预约页,子页面,预约成功页
if (window.queryString.typeStatus === '5' || ($('.kid-style').length > 0)) {
share({
title: '儿童造型',
desc: window.cookie('shareTip'),
imgUrl: urlHttp(window.cookie('sharePic'))
});
}
// 介绍页,预约页,子页面,预约成功页
if (window.queryString.typeStatus === '2') {
share({
title: '活动',
desc: 'play and learn,来YOHO!玩潮流',
imgUrl: urlHttp(window.cookie('sharePic'))
});
}
// 介绍页,预约页,子页面,预约成功页
if (window.queryString.typeStatus === '1') {
share({
title: '潮流课堂',
desc: 'play and learn,来YOHO!玩潮流',
imgUrl: urlHttp(window.cookie('sharePic'))
});
}
// 风格样片页
if (window.queryString.styleName) {
share({
title: window.queryString.styleName,
desc: $('.trend-c').find('p:eq(0)').text(),
imgUrl: 'http:' + $('.trend-c').find('img:eq(0)').attr('src')
title: decodeURI(window.queryString.styleName),
desc: $('.trend-c').find('.content').text(),
imgUrl: urlHttp($('.trend-c').find('.share-pic').val())
});
}
// 套餐详情页-儿童造型
if (($('.package-detail').length > 0) && ($('.package-item').length > 0) && window.queryString.type) {
share({
title: '儿童造型',
desc: window.cookie('shareTip'),
imgUrl: urlHttp(window.cookie('sharePic'))
});
}
// 套餐详情页
if (($('.package-detail').length > 0) && ($('.package-item').length > 0)) {
// 套餐详情页-儿童摄影
if (($('.package-detail').length > 0) && ($('.package-item').length > 0) && !window.queryString.type) {
share({
title: $('.trend-c').find('.name:eq(0)').text(),
desc: $('.trend-c').find('.main:eq(0) p').text(),
imgUrl: 'http:' + $('.trend-c').find('img:eq(0)').attr('src')
imgUrl: urlHttp($('.trend-c').find('.share-pic').attr('src'))
});
}
... ... @@ -50,34 +109,34 @@ if (($('.kid-style').length > 0) && ($('.package-item').length > 0)) {
share({
title: '儿童造型',
desc: $('.trend-c').find('p').text(),
imgUrl: 'http:' + $('.trend-c').find('img:eq(0)').attr('src')
imgUrl: urlHttp($('.trend-c').find('img:eq(0)').attr('src'))
});
}
// 发型师介绍页
if ($('.share-cutter').length > 0) {
share({
title: $('.trend-c').find('.name:eq(0)').text(),
desc: $('.trend-c').find('.intro:eq(0)').text(),
imgUrl: 'http:' + $('.trend-c').find('.pic').attr('src')
title: '发型师介绍-' + $('.trend-c').find('.name:eq(0)').text(),
desc: $('.trend-c').find('.info:eq(0)').text(),
imgUrl: urlHttp($('.trend-c').find('.pic').attr('src'))
});
}
// 门店信息页,活动咨询列表,地图
// 门店信息页
if ($('.share-store').length > 0) {
share({
title: $('.trend-c').find('.title:eq(0)').text(),
desc: $('.trend-c').find('.tip:eq(0)').text(),
imgUrl: 'http:' + $('.trend-c').find('.pic:eq(0)').attr('src')
title: $('.trend-c').find('.share-inp').attr('data-name'),
desc: $('.trend-c').find('.share-inp').attr('data-tip'),
imgUrl: urlHttp($('.trend-c').find('.share-inp').attr('data-pic'))
});
}
// 门店信息页,活动咨询列表,地图
if ($('.share-store').length > 0) {
// 地图,活动咨询列表
if ($('.share-map').length > 0) {
share({
title: $('.trend-c').find('.title:eq(0)').text(),
desc: $('.trend-c').find('.tip:eq(0)').text(),
imgUrl: 'http:' + $('.trend-c').find('.pic:eq(0)').attr('src')
title: decodeURI(window.queryString.name),
desc: decodeURI(window.queryString.intro),
imgUrl: urlHttp(window.queryString.pic)
});
}
... ... @@ -85,8 +144,8 @@ if ($('.share-store').length > 0) {
if ($('.share-article').length > 0) {
share({
title: $('.trend-c').find('.title:eq(0)').text(),
desc: $('.trend-c').find('p:eq(0)').text(),
imgUrl: 'http:' + $('.trend-c').find('img:eq(0)').attr('src')
desc: $('.trend-c').find('.tip-s:eq(0)').text(),
imgUrl: urlHttp($('.trend-c').find('img:eq(0)').attr('src'))
});
}
... ... @@ -95,7 +154,7 @@ if ($('.share-activity').length > 0) {
share({
title: '活动',
desc: 'play and learn,来YOHO!玩潮流',
imgUrl: 'http:' + $('.trend-c').find('img:eq(0)').attr('src')
imgUrl: urlHttp($('.trend-c').find('img:eq(0)').attr('src'))
});
}
... ... @@ -104,24 +163,24 @@ if ($('.class-detail').length > 0) {
share({
title: $('.trend-c').find('.name:eq(0)').text(),
desc: $('.trend-c').find('.tip p:eq(1)').text(),
imgUrl: 'http:' + $('.trend-c').find('img:eq(0)').attr('src')
imgUrl: urlHttp(window.queryString.pic)
});
}
// 潮流课堂
if ($('.share-class').length > 0) {
share({
title: $('.trend-c').find('.name:eq(0)').text(),
desc: $('.trend-c').find('.tip p:eq(1)').text(),
imgUrl: 'http:' + $('.trend-c').find('img:eq(0)').attr('src')
title: '潮流课堂',
desc: 'play and learn,来YOHO!玩潮流',
imgUrl: urlHttp($('.trend-c').find('img:eq(0)').attr('src'))
});
}
// 订单列表页,订单详情页
if ($('.share-order').length > 0) {
share({
title: $('.trend-c').find('div:eq(0)').text(),
desc: $('.trend-c').find('p').text(),
imgUrl: 'http:' + $('.trend-c').find('img:eq(0)').attr('src')
title: $('.trend-c').find('.share-info').attr('data-name'),
desc: $('.trend-c').find('.share-info').attr('data-intro'),
imgUrl: urlHttp($('.trend-c').find('.share-info').attr('data-pic'))
});
}
... ...
... ... @@ -5,7 +5,6 @@
*/
var $ = require('yoho-jquery');
var dialogHbs = require('plugin/dialog.hbs');
// fullWithBtn是供详情页获取限购码使用的特殊参数
... ... @@ -22,8 +21,6 @@ exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
$dialogBox = $('.dialog-box');
$dialogWrapper = $('.dialog-wrapper');
// 显示
if (data.fast) {
$dialogWrapper.css({
... ...
@charset "utf-8";
@import "layout/swiper";
@import "map";
.trend-c.map-c {
padding: 0;
... ... @@ -137,6 +138,9 @@
}
input.diy {
border: 0;
border-radius: 50%;
overflow: hidden;
-webkit-appearance: none;
width: 30px;
height: 30px;
... ... @@ -150,6 +154,7 @@
}
input.diy-2 {
border: 0;
-webkit-appearance: none;
width: 30px;
height: 30px;
... ... @@ -163,6 +168,8 @@
}
input.diy-3 {
border: 0;
&:checked {
background-image: resolve("activity/trend/diy-checked-3.png");
}
... ... @@ -222,6 +229,7 @@
}
.content {
clear: both;
background-color: #fff;
img {
... ... @@ -271,8 +279,9 @@
.title {
font-size: 38px;
color: #4a4a4a;
padding: 0 30px;
line-height: 95px;
padding: 25px 30px;
line-height: 45px;
font-weight: bold;
}
.tip {
... ... @@ -281,7 +290,7 @@
padding: 0 30px 30px;
line-height: 44px;
a {
.a {
width: 120px;
height: 30px;
display: inline-block;
... ... @@ -347,9 +356,11 @@
padding: 30px;
.title {
line-height: 88px;
line-height: 45px;
padding: 25px 0;
color: #4a4a4a;
font-size: 38px;
font-weight: bold;
}
}
... ... @@ -374,14 +385,16 @@
color: #444;
font-size: 38px;
float: left;
width: 530px;
width: 500px;
line-height: 45px;
padding: 20px 0;
}
.price {
font-size: 50px;
color: #d0021b;
float: right;
width: 160px;
width: 190px;
text-align: right;
span {
... ... @@ -403,14 +416,7 @@
float: left;
width: 100%;
div {
font-size: 28px;
color: #444;
float: left;
line-height: 45px;
}
a {
.a {
display: block;
width: 160px;
height: 70px;
... ... @@ -423,6 +429,13 @@
margin-top: 10px;
}
div {
font-size: 28px;
color: #444;
float: left;
line-height: 45px;
}
.disable {
background-color: #b0b0b0;
color: #fff;
... ... @@ -534,7 +547,7 @@
border: 0;
line-height: 44px;
padding: 22px 0;
height: 88px;
height: 80px;
font-size: 28px;
}
... ... @@ -651,7 +664,7 @@
}
&.disable {
background-size: 100%;
background-size: 212px 96px;
background-image: resolve("activity/trend/time.png");
border: 0;
color: #b0b0b0;
... ... @@ -849,6 +862,16 @@
input {
margin-right: 20px;
}
.min-price {
float: right;
color: #d0021b;
font-size: 30px;
span {
font-size: 40px;
}
}
}
.chosen-list {
... ... @@ -947,9 +970,17 @@
margin: 0 5px;
border: solid 1px #e0e0e0;
img {
.limit-pic {
width: 688px;
height: 432px;
overflow: hidden;
display: block;
}
img {
width: 688px;
min-height: 432px;
height: auto;
}
.title {
... ... @@ -1012,7 +1043,7 @@
right: 0;
left: 0;
background-color: #000;
opacity: 0.7;
opacity: 0.95;
}
}
... ... @@ -1265,6 +1296,7 @@
height: 25px;
width: 100%;
background-size: 100%;
margin-top: 30px;
}
.order-list {
... ... @@ -1408,6 +1440,11 @@
background-size: 100% 100%;
}
.icon-pic.tip2 {
background-image: resolve("activity/trend/tip2.png");
background-size: 100% 100%;
}
.icon-pic.clock {
background-image: resolve("activity/trend/clock.png");
background-size: 100% 100%;
... ...