Commit 7f0cfa25 authored by zhengke's avatar zhengke

修改跟团游

parent 5307dc3e
......@@ -6,14 +6,14 @@ Page({
* 页面的初始数据
*/
data: {
StopResh:false,
dates:[],
startCityList:[],
datecount:[],
StopResh: false,
dates: [],
startCityList: [],
datecount: [],
//显示默认天数
showDays:-1,
ckedStartCity:0,
listmsg:{
showDays: -1,
ckedStartCity: 0,
listmsg: {
cityId: "262",
companyId: 0,
endDate: "",
......@@ -33,43 +33,43 @@ Page({
startCityId: 0,
startDate: ""
},
ScreenStatus:false,
dataList:[],
ScreenStatus: false,
dataList: [],
site: {
companyId: app.state.companyId,
cityId: app.state.cityId
},
isLogin:app.isLogin,
orderType:0,
isLogin: app.isLogin,
orderType: 0,
orderindex: 1
},
// 最近3个月
loadDates() {
let dates=[];
let dates = [];
let d = new Date().getMonth();
for (let i = 0; i < 3; i++) {
d++;
d = d > 12 ? d - 12 : d;
let obj={
id:d,
let obj = {
id: d,
name: d + "月"
}
dates.push(obj);
}
this.setData({
dates:dates
dates: dates
})
},
PXClick() {
this.setData({
StopResh:true,
StopResh: true,
})
},
ClosePXView(e) {
if (e.target.dataset.target == "self") {
this.setData({
StopResh: false,
})
}
},
......@@ -91,23 +91,23 @@ Page({
app.$api('b2b_get_GetGroupSearchItem', tagmsg).then(res => {
console.log(res);
res.startCity.unshift({
id:0,
startCityName:'不限'
id: 0,
startCityName: '不限'
})
this.setData({
startCityList:res.startCity,
datecount:res.tripDay
startCityList: res.startCity,
datecount: res.tripDay
})
}).catch(err => { })
},
//价格区间输入框改变
bindKeyInput: function (e) {
if(e.target.dataset.type==1){
if (e.target.dataset.type == 1) {
this.data.listmsg.minPrice = e.detail.value;
this.setData({
listmsg: this.data.listmsg
})
}else{
} else {
this.data.listmsg.maxPrice = e.detail.value;
this.setData({
listmsg: this.data.listmsg
......@@ -115,15 +115,15 @@ Page({
}
},
//点击行程天数
getTripDay(e){
getTripDay(e) {
this.data.listmsg.maxTripDay = e.target.dataset.id;
this.setData({
listmsg: this.data.listmsg,
showDays : e.target.dataset.id
showDays: e.target.dataset.id
})
},
//点击月份的到出发结束日期
getStartMonth(e){
getStartMonth(e) {
console.log(e);
let year = new Date().getFullYear();
let month = e.target.dataset.type;
......@@ -134,14 +134,14 @@ Page({
this.data.listmsg.startDate = firstdate;
this.data.listmsg.endDate = lastdate;
this.setData({
listmsg:this.data.listmsg
listmsg: this.data.listmsg
})
},
//给日期赋值
bindDateChange(e){
if(e.target.dataset.type==1){
bindDateChange(e) {
if (e.target.dataset.type == 1) {
this.data.listmsg.startDate = e.detail.value;
}else{
} else {
this.data.listmsg.endDate = e.detail.value;
}
this.setData({
......@@ -159,18 +159,18 @@ Page({
this.data.ordertype = 0
}
this.setData({
orderindex:this.data.orderindex,
ordertype:this.data.ordertype
orderindex: this.data.orderindex,
ordertype: this.data.ordertype
})
console.log(this.data.orderindex,'orderindex');
console.log(this.data.orderindex, 'orderindex');
console.log(this.data.ordertype, 'ordertype');
this.onLoad();
},
//点击确定查询数据
getList(){
let that=this;
getList() {
let that = this;
that.data.listmsg.companyId = that.data.site.companyId;
that.data.listmsg.cityId = that.data.site.cityId;
if (this.data.isLogin == 1) {
......@@ -186,19 +186,19 @@ Page({
})
console.log("listmsg", that.data.listmsg)
app.$api('b2b_get_GetB2BTravelPageList', that.data.listmsg).then(res => {
res.pageData.forEach(x=>{
res.pageData.forEach(x => {
x.newImgCover = JSON.parse(x.imgCover);
})
console.log(res.pageData,'ssss');
console.log(res.pageData, 'ssss');
this.setData({
dataList: res.pageData,
ScreenStatus : false
ScreenStatus: false
})
}).catch(err => { })
},
//点击重置
resetMsg(){
resetMsg() {
this.data.listmsg.startDate = '';
this.data.listmsg.endDate = '';
this.data.listmsg.maxTripDay = -1;
......@@ -206,32 +206,32 @@ Page({
this.data.listmsg.minPrice = -1;
this.data.listmsg.maxPrice = -1;
this.setData({
listmsg:this.data.listmsg,
showDays:this.data.showDays
listmsg: this.data.listmsg,
showDays: this.data.showDays
})
this.onLoad();
},
//点击出发城市
getStartCity(e){
getStartCity(e) {
console.log(e);
this.data.listmsg.startCityId = e.target.dataset.id;
this.data.ckedStartCity = e.target.dataset.index;
this.setData({
listmsg:this.data.listmsg,
listmsg: this.data.listmsg,
ckedStartCity: this.data.ckedStartCity
})
this.onLoad();
},
ScreenOpen(){
ScreenOpen() {
this.setData({
ScreenStatus:true,
ScreenStatus: true,
})
},
CloseScreen(e) {
if (e.target.dataset.target == "self") {
this.setData({
ScreenStatus: false,
})
}
},
......@@ -295,4 +295,4 @@ Page({
onShareAppMessage: function () {
}
})
\ No newline at end of file
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment