Commit 0c6242aa authored by 黄奎's avatar 黄奎

新增参数

parent 24124116
<template> <template>
<view class="bgF5" <view class="bgF5" :class="[dataList.length==0||3>dataList.length?'height100vh':'height100']">
:class="[dataList.length==0||3>dataList.length?'height100vh':'height100']"> <view class="TicketOrderList-header bgFFF fixed row-sb-n z-index3">
<view class="TicketOrderList-header bgFFF fixed row-sb-n z-index3"> <view v-for="(item,index) in TicketOrderTyle" class="border1 hidden fz24 bgF5 textCenter" :class="[msg.orderState==item.Id?'borderDEBF7B':'borderF5']"
<view v-for="(item,index) in TicketOrderTyle" @click="research(item.Id)">
class="border1 hidden fz24 bgF5 textCenter" {{item.Name}}
:class="[msg.orderState==item.Id?'borderDEBF7B':'borderF5']" </view>
@click="research(item.Id)"> </view>
{{item.Name}} <u-empty v-if="dataList.length==0" text="暂无数据" mode="data"></u-empty>
</view> <scroll-view v-else :scroll-y="true" style="background-color: #f0f4f7;" :enable-back-to-top="true" :enable-flex="true"
</view>
<u-empty v-if="dataList.length==0" text="暂无数据" mode="data"></u-empty>
<scroll-view v-else :scroll-y="true" style="background-color: #f0f4f7;"
:enable-back-to-top="true" :enable-flex="true"
@scrolltolower="lower" :style="{ 'height': `calc(100% - ${scrollHeight})`}"> @scrolltolower="lower" :style="{ 'height': `calc(100% - ${scrollHeight})`}">
<view class="TicketOrderListC"> <view class="TicketOrderListC">
<view class="TicketOrderList-box"> <view class="TicketOrderList-box">
<TicketOrderList :dataList="dataList" :msg="msg" @research="research"></TicketOrderList> <TicketOrderList :dataList="dataList" :msg="msg" @research="research"></TicketOrderList>
</view> </view>
<view style="padding:10px 0;"> <view style="padding:10px 0;">
<u-loadmore :status="status" :load-text="loadText" <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="0" :margin-bottom="0" bg-color="#f0f4f7" />
:font-size="24" :margin-top="0" </view>
:margin-bottom="0" bg-color="#f0f4f7" /> </view>
</view> </scroll-view>
</view> </view>
</scroll-view>
</view>
</template> </template>
<script> <script>
import TicketOrderList from "./components/TicketOrderList.vue"; import TicketOrderList from "./components/TicketOrderList.vue";
import { getDateWeek } from "./dates.js"; import {
export default { getDateWeek
components: { } from "./dates.js";
TicketOrderList export default {
}, components: {
data() { TicketOrderList
return { },
scrollTop: 0, data() {
status: 'loadmore', return {
msg:{ scrollTop: 0,
pageIndex: 1, status: 'loadmore',
pageSize: 15, msg: {
//MiniAppUserId: 0, pageIndex: 1,
orderType:-1, pageSize: 15,
orderState: 0, CustomerId: 0, //客户ID
GroupType:5,//线路订单 orderType: -1,
queryDays:0, orderState: 0,
OutBranchId:-1 GroupType: 5, //机票订单
}, queryDays: 0,
pageCount: 0, OutBranchId: -1
dataList: [], },
TicketOrderTyle:[ pageCount: 0,
{Name:'全部订单',Id:0}, dataList: [],
{Name:'已付款',Id:3}, TicketOrderTyle: [{
{Name:'待付款',Id:1}, Name: '全部订单',
{Name:'已取消',Id:4}, Id: 0
], },
loadText: { {
Name: '已付款',
Id: 3
},
{
Name: '待付款',
Id: 1
},
{
Name: '已取消',
Id: 4
},
],
loadText: {
loadmore: "轻轻上拉,加载更多", loadmore: "轻轻上拉,加载更多",
loading: "努力加载中", loading: "努力加载中",
nomore: "没有更多了", nomore: "没有更多了",
}, },
scrollHeight: '30px', scrollHeight: '30px',
} b2b_user_info: {},
}, }
onLoad(options){ },
this.msg.orderState = options.orderState?options.orderState:0 onLoad(options) {
}, this.msg.orderState = options.orderState ? options.orderState : 0;
created() {}, this.b2b_user_info = uni.getStorageSync('b2b_user');
onShow() { this.msg.CustomerId = this.b2b_user_info.customerId;
},
}, created() {},
mounted() { onShow() {
this.getList()
setTimeout(() => { },
mounted() {
this.getList()
setTimeout(() => {
this.getHeadHeight(); this.getHeadHeight();
}, 1000); }, 1000);
}, },
methods: { methods: {
getHeadHeight() { getHeadHeight() {
return return
let that = this; let that = this;
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(this);
query query
...@@ -88,109 +98,115 @@ ...@@ -88,109 +98,115 @@
}) })
.exec(); .exec();
}, },
research(item) { research(item) {
this.msg.orderState = item this.msg.orderState = item
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.getList(1); this.getList(1);
}, },
//获取列表数据 //获取列表数据
getList(type) { getList(type) {
if (type == 1) { if (type == 1) {
this.dataList = []; this.dataList = [];
} }
uni.showLoading() uni.showLoading()
this.apipost( this.apipost(
"sellorder_post_GetTravelOrderAppletList", "sellorder_post_GetTravelOrderAppletList",
this.msg, this.msg,
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
let arr = function(list){ let arr = function(list) {
list.forEach(x=>{ list.forEach(x => {
x.time = '' x.time = ''
x.week = '' x.week = ''
x.duration = '' x.duration = ''
x.frequency = 0 x.frequency = 0
x.different = 0 //是否异地 x.different = 0 //是否异地
x.NewFlightList = [] x.NewFlightList = []
x.loading = false x.loading = false
}) })
} }
arr(res.data.pageData) arr(res.data.pageData)
res.data.pageData.forEach(x=>{ res.data.pageData.forEach(x => {
arr(x.flightList) arr(x.flightList)
}) })
res.data.pageData.forEach(x=>{ res.data.pageData.forEach(x => {
if(x.flightList.length>2){ if (x.flightList.length > 2) {
x.different = 1 x.different = 1
} }
let FlightList = x.flightList.filter(z=>{ let FlightList = x.flightList.filter(z => {
return z.flightSubType!=3 return z.flightSubType != 3
}) })
let FlightList2 = x.flightList.filter(z=>{ let FlightList2 = x.flightList.filter(z => {
return z.flightSubType==3 return z.flightSubType == 3
}) })
x.flightList.forEach((y,index)=>{ x.flightList.forEach((y, index) => {
let date = y.flightDate.split('-') let date = y.flightDate.split('-')
y.time = `${date[1]}-${date[2]}` y.time = `${date[1]}-${date[2]}`
y.week = getDateWeek(y.flightDate) y.week = getDateWeek(y.flightDate)
if(index==0){ if (index == 0) {
y.frequency = FlightList.length-1 y.frequency = FlightList.length - 1
y.duration = `${x.departureTime.days>0?x.departureTime.days+'d ':''}${x.departureTime.hours>0?x.departureTime.hours+'h ':''}${x.departureTime.minutes>0?x.departureTime.minutes+'m ':''}` y.duration =
x.NewFlightList.push(y) `${x.departureTime.days>0?x.departureTime.days+'d ':''}${x.departureTime.hours>0?x.departureTime.hours+'h ':''}${x.departureTime.minutes>0?x.departureTime.minutes+'m ':''}`
} x.NewFlightList.push(y)
if(x.flightList.length-1==index){ }
y.frequency = FlightList2.length-1 if (x.flightList.length - 1 == index) {
y.duration = `${x.arrivalTime.days>0?x.arrivalTime.days+'d ':''}${x.arrivalTime.hours>0?x.arrivalTime.hours+'h ':''}${x.arrivalTime.minutes>0?x.arrivalTime.minutes+'m ':''}` y.frequency = FlightList2.length - 1
x.NewFlightList.push(y) y.duration =
} `${x.arrivalTime.days>0?x.arrivalTime.days+'d ':''}${x.arrivalTime.hours>0?x.arrivalTime.hours+'h ':''}${x.arrivalTime.minutes>0?x.arrivalTime.minutes+'m ':''}`
}) x.NewFlightList.push(y)
}) }
})
})
if (this.msg.pageIndex === 1) { if (this.msg.pageIndex === 1) {
this.dataList = res.data.pageData; this.dataList = res.data.pageData;
} else { } else {
this.dataList = this.dataList.concat(res.data.pageData); this.dataList = this.dataList.concat(res.data.pageData);
} }
this.pageCount = res.data.pageCount; this.pageCount = res.data.pageCount;
if(this.pageCount==1) this.status = "nomore"; if (this.pageCount == 1) this.status = "nomore";
} }
uni.hideLoading() uni.hideLoading()
} }
); );
}, },
//滚动加载 //滚动加载
lower(e) { lower(e) {
if (this.msg.pageIndex < this.pageCount) { if (this.msg.pageIndex < this.pageCount) {
this.msg.pageIndex++; this.msg.pageIndex++;
this.status = "loading"; this.status = "loading";
this.getList(); this.getList();
} else { } else {
this.status = "nomore"; this.status = "nomore";
} }
}, },
} }
} }
</script> </script>
<style scoped> <style scoped>
@import url("@/asset/css/flex.css"); @import url("@/asset/css/flex.css");
@import url("./style.css"); @import url("./style.css");
.TicketOrderList-header{
left: 0; .TicketOrderList-header {
right: 0; left: 0;
top: 0; right: 0;
padding: 27rpx 54rpx; top: 0;
} padding: 27rpx 54rpx;
.TicketOrderList-header>view{ }
width: 135rpx;
padding: 15rpx 0; .TicketOrderList-header>view {
border-radius: 20rpx; width: 135rpx;
} padding: 15rpx 0;
.TicketOrderListC{ border-radius: 20rpx;
padding-top: 145rpx; }
}
.TicketOrderList-box{ .TicketOrderListC {
padding: 0 54rpx; padding-top: 145rpx;
padding-bottom: 49rpx; }
}
</style> .TicketOrderList-box {
\ No newline at end of file padding: 0 54rpx;
padding-bottom: 49rpx;
}
</style>
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