Commit 7f0cfa25 authored by zhengke's avatar zhengke

修改跟团游

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