Commit c67c904a authored by 华国豪's avatar 华国豪 🙄

1

parent 4e933d89
...@@ -205,6 +205,9 @@ image{ ...@@ -205,6 +205,9 @@ image{
.commonF .flex1{ .commonF .flex1{
flex: 1; flex: 1;
} }
.commonF .tct{
text-align: center;
}
.num_wrap{ .num_wrap{
width: 220rpx; width: 220rpx;
vertical-align: middle; vertical-align: middle;
...@@ -239,3 +242,4 @@ image{ ...@@ -239,3 +242,4 @@ image{
border: none; border: none;
margin: 0 2rpx; margin: 0 2rpx;
} }
.clearfix:after {content: "\0020";display: block;height: 0;clear: both;}
\ No newline at end of file
// pages/Ticket/TicketList/TicketList.js let app = getApp();
var util = require('../../../utils/util.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
screenList:[
{
name: '航空公司',
id: 1,
},
{
name: '舱位',
id: 2,
}
],
cangweiList: [
{ title: "头等舱", id: 1 },
{ title: "商务舱", id: 2 },
{ title: "经济舱", id: 3 }
],
msg: {
pageIndex: 1,
pageSize: 10,
id: 0,
qFlightDateStart: util.YYMMDD(new Date()),
qFlightDateEnd: "",
flight_number: "",
airLineID: 0,
ticketType: 2,
lineId: 0,
isPayOrder: 0,
departure_city: 0,
departure_cityname: "",
arrival_city: 0,
arrival_cityname: "",
freightSpace: 0,
airTicketScatterNum: 0,
flithtMonthDate: '',
timeSort: 0,
priceSort: 0,
},
airlineList: [],
bottomActive: 1,
screenBoxShow: true,
screenID: 1,
getMonthMsg:{
id: 0,
flithtMonthDate: '',
flight_number: '',
airLineID: 0,
ticketType: 2,
lineId: 0,
isPayOrder: 0,
departure_city: 0,
freightSpace: 0,
airTicketScatterNum: 0,
}
}, },
getMonthMinPrice: function () {
},
//舱位筛选
changeCangwei: function (e) {
let id = Number(e.currentTarget.dataset.id)
this.setData({
'msg.freightSpace': id
})
},
// 筛选项切换
changeScreenList: function (e) {
let id = Number(e.currentTarget.dataset.id)
this.setData({
screenID: id
})
},
// 航空公司筛选
changeAirline: function (e) {
let id = Number(e.currentTarget.dataset.id)
this.setData({
'msg.airLineID': id
})
},
closeScreenBox: function (){
this.setData({
screenBoxShow: false
})
},
// 航空公司下拉框
initAirlines: function () {
app.$api('airline_get_GetB2BAirLineList', {}).then(res => {
console.log(res)
this.setData({
airlineList: res
})
}).catch(err => { });
},
//底部按钮监听
cahngeBtnActive: function (e) {
let index = e.currentTarget.dataset.index;
let timeSort = index == 2 ? 1 : 0
let priceSort = index == 3 ? 1 : 0
this.setData({
bottomActive: Number(index),
'msg.timeSort': timeSort,
'msg.priceSort': priceSort
})
if (index == 4) {
this.setData({
screenBoxShow: true
})
} else {
this.getList()
}
},
// 获取数据
getList: function () {
app.$apiJavaData("api/dmc/airticket/getB2BAirticketForMinPrice", this.data.msg).then(res => {
console.log(res)
this.setData({
orderAdd: res.data
})
}).catch(err => { })
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// this.getList()
console.log(new Date().Format("yyyy-MM-dd"))
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
this.initAirlines()
}, },
/** /**
......
<!--pages/Ticket/TicketList/TicketList.wxml--> <view class='TicketList commonF'>
<text>pages/Ticket/TicketList/TicketList.wxml</text> <view class='top-date-box clearfix'>
<scroll-view scroll-x style='white-space: nowrap;' class='date'>
<view class='date-item f22 c11'>
<view>
<view>07-11</view>
<view>今天</view>
<view>¥3516</view>
</view>
</view>
<view class='date-item f22 c11'>
<view>
<view>07-11</view>
<view>今天</view>
<view>¥3516</view>
</view>
</view>
<view class='date-item f22 c11 '>
<view class='active'>
<view>07-11</view>
<view>今天</view>
<view>¥3516</view>
</view>
</view>
<view class='date-item f22 c11'>
<view>
<view>07-11</view>
<view>今天</view>
<view>¥3516</view>
</view>
</view>
<view class='date-item f22 c11'>
<view>
<view>07-11</view>
<view>今天</view>
<view>¥3516</view>
</view>
</view>
</scroll-view>
<view class='more-date'>
<view class='date-img'>
<image src='../../../images/product/ico_date.png'></image>
</view>
<view class='arr-img'>
<image src='../../../images/product/arr_bottom.png'></image>
</view>
</view>
</view>
<view class='tips-box f22 c66'>
航班起降均为当地时间
</view>
<scroll-view scroll-y class='content-box'>
<view class='list-item'>
<text class='item-tag cee f20'>当日最低</text>
<view class='list-item-content clearfix'>
<view class='list-item-left'>
<view class='list-item-left-time'>
<view>
<view class='f40 c11 bold'>03:20</view>
<view class='c99 f24'>双流机场</view>
</view>
<view class='margin-lr20'>
<image src='../../../images/ticket/big_arr2.png'></image>
<view class='c55 f22 tct zhuan'>
<view>转</view>
<view>2次</view>
</view>
</view>
<view>
<view class='f40 c11 bold'>03:20</view>
<view class='c99 f24'>双流机场</view>
</view>
<view class='f20 c11'>
+1天
</view>
</view>
<view class='name-time c88 f24'>
<view>
<image src='../../../images/ticket/paixu2_1.png'></image>
<text>四川航空</text>
</view>
<view>
<image src='../../../images/ticket/shijian.png'></image>
<text>33h20m</text>
</view>
</view>
</view>
<view class='list-item-right'>
<view class='f22 cee'>
¥ <text class='f40 blod'>2092</text>
</view>
<view class='c99 f20'>
<view>含税总价</view>
<view>含税总价</view>
</view>
<view class='cee f20 shengyu'>
<text>剩3张</text>
</view>
</view>
</view>
</view>
</scroll-view>
<view class='bottom-btn f24 c11'>
<view class='btn-item {{bottomActive === 1 ? "cee" : ""}}' data-index="1" bindtap='cahngeBtnActive'>
<view>
<image wx:if="{{bottomActive!==1}}" src='../../../images/ticket/paixu1.png'></image>
<image wx:if="{{bottomActive===1}}" src='../../../images/ticket/paixu1_1.png'></image>
</view>
<view>
推荐排序
</view>
</view>
<view class='btn-item {{bottomActive === 2 ? "cee" : ""}}' data-index="2" bindtap='cahngeBtnActive'>
<view>
<image wx:if="{{bottomActive!==2}}" src='../../../images/ticket/paixu2.png'></image>
<image wx:if="{{bottomActive===2}}" src='../../../images/ticket/paixu2_1.png'></image>
</view>
<view>
低价优先
</view>
</view>
<view class='btn-item {{bottomActive === 3 ? "cee" : ""}}' data-index="3" bindtap='cahngeBtnActive'>
<view>
<image wx:if="{{bottomActive!==3}}" src='../../../images/ticket/paixu3.png'></image>
<image wx:if="{{bottomActive===3}}" src='../../../images/ticket/paixu3_1.png'></image>
</view>
<view>
时间排序
</view>
</view>
<view class='btn-item {{bottomActive === 4 ? "cee" : ""}}' data-index="4" bindtap='cahngeBtnActive'>
<view>
<image wx:if="{{bottomActive!==4}}" src='../../../images/ticket/paixu4.png'></image>
<image wx:if="{{bottomActive===4}}" src='../../../images/ticket/paixu4_1.png'></image>
</view>
<view>
筛选
</view>
</view>
</view>
<!-- 筛选弹窗 -->
<view wx:if="{{screenBoxShow}}" class='screen-box' bindtap='closeScreenBox'>
<view class='screen-box-content' catchtap>
<image class='close-img' src='../../../images/ticket/close-img.png' catchtap="closeScreenBox"></image>
<view class='screen-box-top tct c11 f30'>
筛选
</view>
<view class='screen-list'>
<view class='left-type'>
<view class='c11 f28 {{item.id === screenID ? "active" : ""}}' wx:for="{{screenList}}" wx:for-index="index" wx:for-item="item" wx:key="index" bindtap='changeScreenList' data-id="{{item.id}}">{{item.name}}</view>
</view>
<scroll-view class='right-list' scroll-y>
<view class='airline-list' hidden='{{screenID!==1}}'>
<view class='airline-list-item' catchtap='changeAirline' data-id="0">
<text class='f28 {{msg.airLineID === 0 ? "cee" : ""}}'>不限</text>
<view>
<image wx:if="{{msg.airLineID === 0}}" class='xuanzhong' src='/images/visa/xunazhong.png'></image>
<view wx:else class='raduis'></view>
</view>
</view>
<view class='airline-list-item' wx:for="{{airlineList}}" wx:for-index="index" wx:for-item="item" wx:key="index" catchtap='changeAirline' data-id="{{item.AirLineId}}">
<text class='f28 {{msg.airLineID === item.AirLineId ? "cee" : ""}}'>{{item.AlName}}</text>
<view>
<image wx:if="{{msg.airLineID === item.AirLineId}}" class='xuanzhong' src='/images/visa/xunazhong.png'></image>
<view wx:else class='raduis'></view>
</view>
</view>
</view>
<view class='airline-list' hidden='{{screenID!==2}}'>
<view class='airline-list-item' catchtap='changeCangwei' data-id="0">
<text class='f28 {{msg.freightSpace === 0 ? "cee" : ""}}'>不限</text>
<view>
<image wx:if="{{msg.freightSpace === 0}}" class='xuanzhong' src='/images/visa/xunazhong.png'></image>
<view wx:else class='raduis'></view>
</view>
</view>
<view class='airline-list-item' wx:for="{{cangweiList}}" wx:for-index="index" wx:for-item="item" wx:key="index" catchtap='changeCangwei' data-id="{{item.id}}">
<text class='f28 {{msg.freightSpace === item.id ? "cee" : ""}}'>{{item.title}}</text>
<view>
<image wx:if="{{msg.freightSpace === item.id}}" class='xuanzhong' src='/images/visa/xunazhong.png'></image>
<view wx:else class='raduis'></view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class='screen-btn '>
<text class='f28' catchtap='getList'>查看结果</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* pages/Ticket/TicketList/TicketList.wxss */ .top-date-box{
\ No newline at end of file padding: 17rpx 0;
background-color: #fff;
display: flex;
}
.top-date-box .date{
float: left;
width: 90%;
display: flex;
}
.top-date-box .more-date{
float: left;
width: 10%;
text-align: center;
padding-top: 20rpx;
border-left: 2rpx solid #f5f5f5;
}
.top-date-box .date .date-item{
width: 160rpx;
text-align: center;
padding: 14rpx 16rpx;
border-radius: 4rpx;
display: inline-block;
}
.top-date-box .date .date-item .active{
color: #fff;
background-color: #EE4454;
}
.date-img,.arr-img{
height: 30rpx;
}
.date-img image,.btn-item image{
width: 30rpx;
height: 30rpx;
}
.arr-img image{
width: 20rpx;
height: 10rpx;
}
.tips-box{
height: 60rpx;
line-height: 60rpx;
text-align: center;
background-color: #f5f5f5;
}
.content-box{
height:calc(100vh - 322rpx);
background-color: #f5f5f5;
padding: 0 30rpx;
}
.list-item-content{
display: flex;
align-items: center;
}
.list-item{
padding: 30rpx;
background-color: white;
border-radius:12rpx;
position: relative;
}
.item-tag{
width:90rpx;
height:28rpx;
background:rgba(250,199,203,1);
border-radius:0px 0px 4rpx 4rpx;
display: inline-block;
text-align: center;
line-height: 28rpx;
position: absolute;
left: 30rpx;
top: 0;
}
.list-item-left{
width: 70%;
}
.list-item-right{
width: 30%;
}
.list-item-left-time{
display: flex;
align-items: center;
}
.list-item-left-time image{
height: 10rpx;
width: 118rpx;
}
.zhuan{
margin-top: -40rpx;
}
.list-item-right{
text-align: right;
}
.shengyu text{
display: inline-block;
width: 70rpx;
height: 30rpx;
line-height: 30rpx;
background: rgba(255,255,255,1);
border: 1px solid rgba(238, 68, 84, 1);
border-radius: 3rpx;
text-align: center;
}
.name-time{
margin-top: 15rpx;
display: flex;
align-items: center;
}
.name-time image{
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.name-time view{
margin-right: 30rpx;
}
.margin-lr20{
margin: 0 30rpx;
}
.bottom-btn{
height:100rpx;
border-top: 1px solid #f5f5f5;
display: flex;
align-items: center;
justify-content: space-around;
}
.bottom-btn .btn-item{
text-align: center;
}
.screen-box{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
background:rgba(17,17,17, .5);
z-index: 2;
}
.screen-box-top{
padding: 30rpx;
}
.screen-box-content{
height: 90%;
width: 100%;
position: absolute;
bottom: 0;
left: 0;
background-color: white;
border-radius:12rpx 12rpx 0px 0px;
}
.close-img{
width: 30rpx;
height: 30rpx;
position: absolute;
right: 30rpx;
top: 30rpx;
}
.screen-list{
height: 900rpx;
display: flex;
border-top: 1px solid rgba(233,233,233,1);
}
.screen-list .left-type{
width: 20%;
background-color: rgba(246,247,250,1);
}
.screen-list .left-type>view{
border-bottom: 1px solid rgba(233,233,233,1);
border-right: 1px solid rgba(233,233,233,1);
background-color: rgba(246,247,250,1);
}
.screen-list .left-type view.active{
border-right: 0;
background-color: #fff;
}
.screen-list .right-list{
width: 80%;
padding: 0 20rpx;
}
.left-type>view{
height: 87rpx;
text-align: center;
line-height: 87rpx;
}
.airline-list-item{
display: flex;
align-items: center;
height: 87rpx;
line-height: 87rpx;
justify-content: space-between;
border-bottom: 1px solid rgba(233,233,233,1);
}
.raduis{
width:34rpx;
height:34rpx;
border-radius: 50%;
border:1px solid rgba(153, 153, 153, 1);
}
.xuanzhong{
width: 34rpx;
height: 34rpx;
}
.screen-btn{
height: 110rpx;
text-align: right;
padding-right: 30rpx;
}
.screen-btn text{
display: inline-block;
width: 400rpx;
height: 70rpx;
background:rgba(238,68,84,1);
border-radius: 35rpx;
text-align: center;
color: white;
line-height: 70rpx;
margin-top: 10rpx;
}
\ No newline at end of file
...@@ -83,10 +83,9 @@ Page({ ...@@ -83,10 +83,9 @@ Page({
const scene = decodeURIComponent(options.scene) const scene = decodeURIComponent(options.scene)
if (scene) { if (scene) {
let tcId = scene.split('=')[1] ? scene.split('=')[1] : options.tcid; let tcId = scene.split('=')[1] ? scene.split('=')[1] : options.tcid;
// let tcId = 4006 this.setData({
// this.setData({ tcId: tcId
// tcId: tcId })
// })
}else{ }else{
// this.setData({ // this.setData({
// tcId: 3278 // tcId: 3278
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 14, "current": 15,
"list": [ "list": [
{ {
"id": 2, "id": 2,
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
"id": 12, "id": 12,
"name": "签证详情", "name": "签证详情",
"pathName": "pages/visa/visaDetails/visaDetails", "pathName": "pages/visa/visaDetails/visaDetails",
"query": "id=dRvFC7rQ4Lg%3D%0A", "query": "",
"scene": null "scene": null
}, },
{ {
...@@ -145,6 +145,13 @@ ...@@ -145,6 +145,13 @@
"pathName": "pages/visa/visaOrder/visaOrder", "pathName": "pages/visa/visaOrder/visaOrder",
"query": "id=dRvFC7rQ4Lg%3D%0A&selectDate=2019-07-11", "query": "id=dRvFC7rQ4Lg%3D%0A&selectDate=2019-07-11",
"scene": null "scene": null
},
{
"id": 15,
"name": "机票列表",
"pathName": "pages/Ticket/TicketList/TicketList",
"query": "",
"scene": null
} }
] ]
} }
......
...@@ -53,7 +53,23 @@ const getDays = (year, month)=>{ ...@@ -53,7 +53,23 @@ const getDays = (year, month)=>{
var d = new Date(year, month, 0); var d = new Date(year, month, 0);
return d.getDate(); return d.getDate();
} }
// 时间格式化
Date.prototype.Format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds() //秒
};
if (/(y+)/.test(fmt)) { //根据y的长度来截取年
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
return fmt;
}
module.exports = { module.exports = {
formatTime: formatTime, formatTime: formatTime,
CompareDate: CompareDate, CompareDate: CompareDate,
......
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