Commit 5c8d02f7 authored by 18224442217's avatar 18224442217

机票订单列表,详情

parent c1835bc9
...@@ -39,6 +39,12 @@ ...@@ -39,6 +39,12 @@
justify-content: space-between; justify-content: space-between;
flex-wrap: nowrap; flex-wrap: nowrap;
} }
.row-sbs-n{
display: flex;
align-items: center;
justify-content: space-around;
flex-wrap: nowrap;
}
.row-sbas-n{ .row-sbas-n{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -245,6 +251,9 @@ ...@@ -245,6 +251,9 @@
.MR20{ .MR20{
margin-right: 20rpx; margin-right: 20rpx;
} }
.MR25{
margin-right: 25rpx;
}
.MR30{ .MR30{
margin-right: 30rpx; margin-right: 30rpx;
} }
...@@ -347,6 +356,9 @@ ...@@ -347,6 +356,9 @@
.PT123{ .PT123{
padding-top: 123rpx; padding-top: 123rpx;
} }
.PB20{
padding-bottom: 20rpx;
}
.PB200{ .PB200{
padding-bottom: 200rpx; padding-bottom: 200rpx;
} }
...@@ -362,6 +374,9 @@ ...@@ -362,6 +374,9 @@
.PX4{ .PX4{
padding: 0 4rpx; padding: 0 4rpx;
} }
.PX20{
padding: 0 20rpx;
}
.PX50{ .PX50{
padding: 0 50rpx; padding: 0 50rpx;
} }
......
...@@ -147,12 +147,10 @@ ...@@ -147,12 +147,10 @@
} }
if(this.GuestList.length>0){ if(this.GuestList.length>0){
uni.setStorageSync("GuestList",this.GuestList) uni.setStorageSync("GuestList",this.GuestList)
}
setTimeout(()=>{
uni.navigateBack({ uni.navigateBack({
delta: -1 delta: -1
}) })
},200) }
}, },
setBirthday(){ setBirthday(){
if(this.addMsg.GuestType==1){ if(this.addMsg.GuestType==1){
......
...@@ -7,23 +7,25 @@ ...@@ -7,23 +7,25 @@
> >
<NavigationHeader :title="title" :titleStyle="titleStyle"></NavigationHeader> <NavigationHeader :title="title" :titleStyle="titleStyle"></NavigationHeader>
<!-- :style="{top:topheight+'px'}" --> <!-- :style="{top:topheight+'px'}" -->
<view class="TicketOrderDetailsC overflow PT123 PB260"> <view class="TicketOrderDetailsC overflow PT123 PB260" v-if="orderData&&orderData.model">
<view class="PY53"> <view class="PY53">
<view class="row-sb-n MT20"> <view class="row-sb-n MT20">
<view class="flexS row-aic-n"> <view class="flexS row-aic-n">
<img class="inlineblock MR20" mode="widthFix" style="width: 44rpx;height: 44rpx;" <img class="inlineblock MR20" mode="widthFix" style="width: 44rpx;height: 44rpx;"
:src="statusImg[0]"/> :src="orderStatus.icon"/>
<!-- 已付款 待付款 已取消colorC6C1BC --> <!-- 已付款 待付款 已取消 -->
<text class="fz36 fontBold">已付款</text> <text class="fz36 fontBold"
:class="[orderStatus.code==-1?'colorC6C1BC':'']">{{orderStatus.text}}</text>
</view> </view>
<view @click="getDetail"> <view @click="getDetail">
<text class="fz26 colorC09D4F">¥</text> <text class="fz26 colorC09D4F">¥</text>
<text class="fz36 colorC09D4F fontBold ML15"> 759.9</text> <text class="fz36 colorC09D4F fontBold ML15"> {{dataModel.PreferPrice}}</text>
<img class="inlineblock ML10" mode="widthFix" style="width: 18rpx;height: 12rpx;" <img class="inlineblock ML10 relative" mode="widthFix" style="width: 18rpx;height: 12rpx;top:-8rpx"
:src="statusImg[3]"/> :src="statusImg[3]"/>
</view> </view>
</view> </view>
<view class="TicketOrderDetailsCard MT45 bgFFF hidden"> <view class="TicketOrderDetailsCard MT45 bgFFF hidden">
<!--
<view class="row-sb-n"> <view class="row-sb-n">
<view class="row-aic-n"> <view class="row-aic-n">
<view class="fz28 color111 ML20"> <view class="fz28 color111 ML20">
...@@ -36,7 +38,6 @@ ...@@ -36,7 +38,6 @@
<view class="fz28 colorE1C278 row-aic-n" @click="TicketDetails(items)"> <view class="fz28 colorE1C278 row-aic-n" @click="TicketDetails(items)">
<text>详情</text> <text>详情</text>
<uni-icons class="ML10" color="#DEBF7B" :type="items.show?'arrowdown':'arrowright'" size="14"></uni-icons> <uni-icons class="ML10" color="#DEBF7B" :type="items.show?'arrowdown':'arrowright'" size="14"></uni-icons>
<!-- <uni-icons class="ML10" color="#DEBF7B" type="arrowright" size="14"></uni-icons> -->
</view> </view>
</view> </view>
<view class="MT60 PX50" style="display: none;"> <view class="MT60 PX50" style="display: none;">
...@@ -125,49 +126,68 @@ ...@@ -125,49 +126,68 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
<view class="height-dashed1 DashedECF1F4 relative MT30"> <TicketOrderDetails :DetailsList="NewDetailsList"></TicketOrderDetails>
<view class="TicketOrderDetailsBor-LR TicketOrderDetailsBor-L absolute z-index2 bgF2EEE5"></view> <view class="PX50">
<view class="TicketOrderDetailsBor-LR TicketOrderDetailsBor-R absolute z-index2 bgF2EEE5"></view> <view class="height-dashed1 DashedECF1F4 relative MT30" v-if="GuestList&&GuestList.length>0">
<!-- <view class="TicketOrderDetailsBor-LR TicketOrderDetailsBor-L absolute z-index2 bgF2EEE5"></view>
<view class="TicketOrderDetailsBor-LR TicketOrderDetailsBor-R absolute z-index2 bgF2EEE5"></view> -->
</view> </view>
<view class="MT38"> <view class="MT38">
<view class="TicketOrderDetailsN-box" v-for="(item,index) in 3"> <view class="TicketOrderDetailsN-box" v-for="(item,index) in GuestList">
<view class="row-sb-n "> <view class="row-sb-n ">
<view class="TicketOrderDetails-Name MR40 fz26 color9999A5 textRight flexS"> <view class="TicketOrderDetails-Name MR40 fz26 color9999A5 textRight flexS">
<text>01</text> <text>{{index+1>=10?index:'0'+(index+1)}}</text>
<text class="ML15">乘机人</text> <text class="ML15">乘机人</text>
</view> </view>
<view class="fz26 fontBold color1D1D20 flexG"> <view class="fz26 fontBold color1D1D20 flexG">
<text class="width100One ellipsis1">李润豪</text> <text class="width100One ellipsis1">{{item.SurName}}</text>
</view> </view>
<view class="fz22 color9999A5 flexS"> <view class="fz22 color9999A5 flexS">
¥258.5 <!-- ¥{{item.Unit_Price}} -->
</view> </view>
</view> </view>
<view class="row-sb-n MT25"> <view class="row-sb-n MT25">
<view class="TicketOrderDetails-Name MR40 fz26 color9999A5 textRight flexS"> <view class="TicketOrderDetails-Name MR40 fz26 color9999A5 textRight flexS">
<text></text> <text></text>
<text class="ML15">身份证</text> <text class="ML15">证件号</text>
</view> </view>
<view class="fz26 fontBold color1D1D20 flexG"> <view class="fz26 fontBold color1D1D20 flexG">
514474455121454521 {{item.IdCard?item.IdCard:item.PassportNo}}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="airTicketDetailsFooter fixedFooter bgFFF fixed row-ajc-n z-index2"> <view class="airTicketDetailsFooter fixedFooter bgFFF fixed z-index2">
<view class="TicketOrderDetailsFooter"> <view class="TicketOrderDetailsFooter row-sbs-n"
<view class="airTicketDetailsFooter-order bgDEBF7B row-ajc-w fontBold"> v-if="dataModel.OrderState==1||dataModel.OrderState==2||dataModel.OrderState==3">
<!-- 取消订单 立即支付 重新下单 --> <view v-if="dataModel.OrderState==1||dataModel.OrderState==2||dataModel.OrderState==3"
class="airTicketDetailsFooter-order row-ajc-w fontBold ML50"
:class="[loading?'bgF5':'bgF5 colorDEBF7B']"
@click="cancelOrder(dataModel)">
<text class="fz32">取消订单</text> <text class="fz32">取消订单</text>
</view> </view>
<view v-if="dataModel.OrderState==1||dataModel.OrderState==2"
class="airTicketDetailsFooter-order row-ajc-w fontBold MR50"
:class="[loading?'bgF5':'bgDEBF7B']"
@click="queren(orderMsg.ID)">
<text class="fz32">立即支付</text>
</view>
</view>
<view class="TicketOrderDetailsFooter row-ajc-n" v-if="dataModel.OrderState==5||dataModel.OrderState==4">
<view
class="airTicketDetailsFooter-order row-ajc-w fontBold"
:class="[loading?'bgF5 colorDEBF7B':'bgDEBF7B']"
@click="goUndOrder(dataModel.TCID)">
<text class="fz32">重新下单</text>
</view>
</view> </view>
</view> </view>
<u-popup <u-popup
...@@ -181,53 +201,51 @@ ...@@ -181,53 +201,51 @@
@click="showDetailPreviwe=false"></uni-icons> @click="showDetailPreviwe=false"></uni-icons>
<view class="fz30 fontBold textCenter">金额明细</view> <view class="fz30 fontBold textCenter">金额明细</view>
<view class="MT75 TicketOrderDetailsGetC"> <view class="MT75 TicketOrderDetailsGetC">
<view class="TicketOrderDetailsGet-Num MB52"> <view class="TicketOrderDetailsGet-Num MB52" v-for="(item,index ) in NewGuestList">
<view class="row-sb-n"> <view class="row-sb-n">
<text class="flexS">人数</text> <text class="flexS">{{item.text}}</text>
<view class="TicketOrderDetailsGet-NumA flexS ML30"> <view class="TicketOrderDetailsGet-NumA flexS ML30">
<view class="height-line1 lineC8C8CF"></view> <view class="height-line1 lineC8C8CF"></view>
</view> </view>
<view class="TicketOrderDetailsGet-NumR row-aic-n"> <view class="TicketOrderDetailsGet-NumR row-aic-n">
<view class="fz30 fontBold ML60 MR60 textRight"> <view class="fz30 fontBold ML60 MR60 textRight">
¥654 ¥{{item.Unit_Price}}
</view> </view>
<view class="fz30 fontBold textRight"> <view class="fz30 fontBold textRight">
×1 ×{{item.Nums}}
</view> </view>
</view> </view>
</view> </view>
<view class="fz24 color9999A5 MT25">(2岁及2岁以上的顾客)</view> <view class="fz24 color9999A5 MT25" v-if="index!=2">
</view> <template v-if="index==0">(14岁及以上的顾客)</template>
<view class="TicketOrderDetailsGet-Num MB52"> <template v-if="index==1">(2岁及14岁以下的顾客)</template>
<view class="row-sb-n"> <template v-if="index==2">(2岁以下的顾客)</template>
<text class="flexS">婴儿</text>
<view class="TicketOrderDetailsGet-NumA flexS ML30">
<view class="height-line1 lineC8C8CF"></view>
</view>
<view class="TicketOrderDetailsGet-NumR row-aic-n">
<view class="fz30 fontBold ML60 MR60 textRight">
¥654
</view>
<view class="fz30 fontBold textRight">
×1人
</view>
</view>
</view> </view>
<view class="fz24 color9999A5 MT25">(2岁以下的顾客)</view>
</view> </view>
</view> </view>
<view class="absolute TicketOrderDetailsGet-Footer bgFFF row-sb-n"> <view class="absolute TicketOrderDetailsGet-Footer bgFFF row-sb-n">
<view> <view>
<view class="fontBold"> <view class="fontBold">
<text class="fz32 color111">¥ </text> <text class="fz32 color111">¥ </text>
<text class="fz52">3,200</text> <text class="fz52">{{dataModel.PreferPrice}}</text>
</view> </view>
<view class="fz26 color9999A5 MT5">2</view> <view class="fz26 color9999A5 MT5">{{dataModel.GuestNum}}</view>
</view> </view>
<view> <view class="row-aic-n">
<view class="airTicketDetailsFooter-order PXY2463 bgDEBF7B row-ajc-w fontBold"> <view v-if="dataModel.OrderState==1||dataModel.OrderState==2||dataModel.OrderState==3"
<!-- 取消订单 立即支付 重新下单 --> class="fz32 relative TicketOrderListCard-PrQx MR20"
<text class="fz32">去支付</text> :class="[loading?'color9999A5':'colorDEBF7B']"
@click="cancelOrder(dataModel)">取 消</view>
<view v-if="dataModel.OrderState==1||dataModel.OrderState==2"
class="airTicketDetailsFooter-order PXY2463 row-ajc-w fontBold"
:class="[loading?'bgF5':'bgDEBF7B']"
@click="queren(orderMsg.ID)">
<text class="fz32">立即支付</text>
</view>
<view v-if="dataModel.OrderState==5||dataModel.OrderState==4"
class="airTicketDetailsFooter-order PXY2463 row-ajc-w fontBold bgDEBF7B borderDEBF7B"
@click="goUndOrder(dataModel.TCID)">
<text class="fz32">重新下单</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -237,12 +255,29 @@ ...@@ -237,12 +255,29 @@
</template> </template>
<script> <script>
import NavigationHeader from "./components/NavigationHeader.vue"; import NavigationHeader from "./components/NavigationHeader.vue";
import TicketOrderDetails from "./components/TicketOrderDetails.vue";
import { getDateWeek } from "./dates.js";
export default { export default {
components: { components: {
NavigationHeader NavigationHeader,
TicketOrderDetails
}, },
data() { data() {
return { return {
orderInfo: {},
loading: false,
dataModel:{},
NewGuestList: [],
GuestList: [],
NewDetailsList: [],
DetailsList: [],
orderStatus: {},
showPayBtn: '',
orderData:{},
orderMsg:{
ID: 0,
IsGetGuest: 1
},
showDetailPreviwe: false, showDetailPreviwe: false,
topheight:0, topheight:0,
titleStyle:{}, titleStyle:{},
...@@ -257,6 +292,8 @@ ...@@ -257,6 +292,8 @@
} }
}, },
onLoad(options){ onLoad(options){
this.orderMsg.ID = options.orderId
this.getOrderDetails()
let that = this; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
...@@ -274,19 +311,329 @@ ...@@ -274,19 +311,329 @@
}, },
methods: { methods: {
goUndOrder(TCID){
uni.navigateTo({
url: `/pages/airTicket/airTicketDetails?TCID=${TCID}&Price=${this.dataModel.Unit_Price}`
});
},
TicketDetails(){
},
getDetail(){ getDetail(){
this.showDetailPreviwe = true this.showDetailPreviwe = true
}, },
getOrderDetails(){ getOrderDetails(){
uni.showLoading()
this.apipost(
"sellorder_post_GetOrderEntity",
this.orderMsg,
(res) => {
if(res.resultCode==1){
this.GuestList = []
this.NewGuestList = []
console.log(res.data,'=======')
this.orderData = res.data;
// IsChargeLossOrders 1是收损单 2否
// IsApplyForCancel 1是小程序端发起取消 2否
this.dataModel = res.data.model
this.orderData.model.GuestList.forEach(x=>{
let obj = {
SurName:x.SurName+x.Name,
PassportNo:x.PassportNo,
IdCard:x.IdCard,
MobilePhone:x.MobilePhone,
ageType: '',
Unit_Price: 0,
NewUnit_Pric: 0,
}
this.GuestList.push(obj)
})
let num = 0
let Unit_Price = 0
let Nums = 0
if(this.dataModel.ManNum>0) {
num = 1;
Unit_Price = this.dataModel.Unit_Price*this.dataModel.ManNum;
Nums = this.dataModel.ManNum
}
if(this.dataModel.BabyNum>0) {
num += 1;
Unit_Price = (this.dataModel.Unit_Price*this.dataModel.BabyNum)*(this.dataModel.BabyPrecent/100);
Nums = this.dataModel.BabyNum
}
if(this.dataModel.ChirdNum>0) {
num += 1;
Unit_Price = (this.dataModel.Unit_Price*this.dataModel.ChirdNum)*(50/100);
Nums = this.ChirdNum
}
for(let i=0;i<num;i++){
let text = '成人'
if(i==1) text = '儿童'
if(i==2) text = '婴儿'
let obj = {
text: text,
Unit_Price: Unit_Price,
Nums: Nums
}
this.NewGuestList.push(obj)
}
this.formatStatus(
this.orderData.model.OrderState,
this.orderData.model.IsChargeLossOrders,
this.orderData.model.IsApplyForCancel
);
if(this.NewDetailsList&&this.NewDetailsList.length==0){
this.getAirDetails(this.orderData.model.TCID)
}
}else{
uni.hideLoading()
}
})
},
getAirDetails(TCID){
this.apipost("AirTicket_get_GetTicketDetails",{ this.apipost("AirTicket_get_GetTicketDetails",{
OrderId: this.orderMsg.OrderId TCID: TCID
}, },
(res) => { (res) => {
if(res.resultCode==1){ if(res.resultCode==1){
console.log(res,'=====') // this.B2BSellNum = res.data.B2BSellNum //
// this.BabyPrecent = Number(res.data.BabyPrecent) //婴儿 %费用
// let that = this;
// this.title = that.orderMsg.Unit_Price>0&&that.B2BSellNum>0?'填写下单信息':'机票信息'
let arr = function(list){
list.forEach(x => {
x.time = ''
x.week = ''
x.duration = ''
x.frequency = 0
x.show = true
});
}
arr(res.data.FlightList)
this.DetailsList = res.data.FlightList
this.DetailsList.forEach(y=>{
let date = y.FlightDate.split('-')
y.time = `${date[1]}-${date[2]}`
y.week = getDateWeek(y.FlightDate)
y.duration = `${y.DepartureTime.Days>0?y.DepartureTime.Days+'d ':''}${y.DepartureTime.Hours>0?y.DepartureTime.Hours+'h ':''}${y.DepartureTime.Minutes>0?y.DepartureTime.Minutes+'m ':''}`
y.frequency = this.DetailsList.length-2>1?this.DetailsList.length-2:0
})
let FlightList = []
let NewFlightList = []
let FlightList2 = []
let NewFlightList2 = []
for(let i=0;i<this.DetailsList.length;i++){
if(this.DetailsList.length-1!=i){
this.DetailsList[i].show = false
FlightList.push(this.DetailsList[i])
if(this.DetailsList.length-2==i||i==0){
NewFlightList.push(this.DetailsList[i])
}
}else{
FlightList2.push(this.DetailsList[i])
NewFlightList2.push(this.DetailsList[i])
}
}
if(FlightList.length==this.DetailsList.length-1){
let obj = {
FlightList: FlightList,
NewFlightList: NewFlightList,
...this.DetailsList[0]
}
this.NewDetailsList.push(obj)
}
if(FlightList2.length==1){
let obj = {
FlightList: FlightList2,
NewFlightList: NewFlightList2,
...this.DetailsList[this.DetailsList.length-1]
}
this.NewDetailsList.push(obj)
}
} }
uni.hideLoading()
}) })
}, },
formatStatus(status, loss, isCancel) {
loss = loss ? loss : -1;
//1、已申请;!=1未申请
if (loss == 1 || status == 4) {
this.orderStatus.code = -1;
this.orderStatus.text = "已取消";
this.orderStatus.icon = this.statusImg[2];
this.showPayBtn = false;
} else if (status == 2 && isCancel != 1) {
this.orderStatus.code = 0;
this.orderStatus.text = "待付款";
this.orderStatus.icon = this.statusImg[1];
this.showPayBtn = true;
} else if (status == 2 && isCancel == 1) {
this.orderStatus.code = -2;
this.orderStatus.text = "审核中";
this.orderStatus.icon = this.statusImg[1];
this.showPayBtn = false;
} else if (status == 1) {
this.orderStatus.code = 1;
this.orderStatus.text = "待付款";
this.orderStatus.icon = this.statusImg[1];
this.showPayBtn = false;
} else if (status == 3) {
this.orderStatus.code = 3;
this.orderStatus.text = "已付款";
this.orderStatus.icon = this.statusImg[0];
this.showPayBtn = false;
}
},
cancelOrder(item){
let that = this
if(this.loading){
return
}
//未付款-调用后台取消
uni.showLoading()
this.loading = true
if (
(item.PaymentTime == null || item.PaymentTime == "") &&
(item.OrderState == 1||item.OrderState == 2)
) {
this.apipost(
"sellorder_post_B2BRemoveOrder",
{
ID: item.OrderId,
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.getOrderDetails()
}
uni.hideLoading()
this.loading = false
},
(err) => {
uni.hideLoading()
this.loading = false
}
);
} else {
let msg = {
OrderId: item.OrderId,
UserId: uni.getStorageSync("mall_UserInfo").UserId,
};
//已付款取消申请
this.apipost(
"sellorder_post_AppletUserCancelOrder",
msg,
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.getOrderDetails()
} else {
}
uni.hideLoading()
this.loading = false
},
(err)=>{
uni.hideLoading()
this.loading = false
}
);
}
},
//微信支付
queren(OrderId) {
if(this.loading){
return
}
uni.showLoading()
this.loading = true
let url = "/api/WeChatPay/GetTravlePayInfo";
let DepartureName = this.NewDetailsList[0].DepartureName
let ArrivalCityName = this.NewDetailsList[0].FlightList[this.NewDetailsList[0].FlightList.length-1].ArrivalCityName
let FlightDate = this.NewDetailsList[0].FlightDate+'/'+this.NewDetailsList[0].Departure_time
let GoodsName = `${DepartureName}-${ArrivalCityName}-${FlightDate}`;
this.request2(
{
url: url,
data: {
OrderId: OrderId,
GoodsName: GoodsName,
OrderPayType: 1,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
},
},
(res) => {
try{
this.orderInfo = JSON.parse(res.data);
this.subscribeMsg(OrderId);
}catch(e){
uni.showToast({
title:'无法正常拉取微信支付,你可以稍后重试或联系销售人员线下转款',
icon:'none'
})
}
},
(err) => {
this.loading = false
uni.hideLoading()
console.log(err)
});
},
subscribeMsg(OrderId) {
const that = this;
let tempObj = uni.getStorageSync("basedata")?.mall?.wechatmessage ?? [];
let tmplIds = [];
if (tempObj && tempObj.length > 0) {
tempObj.forEach((x) => {
if (x.Name == "下单成功提醒" || x.Name == "订单取消提醒") {
tmplIds.push(x.MessageId);
}
});
}
uni.requestSubscribeMessage({
tmplIds: tmplIds,
complete(res) {
that.Pay(OrderId);
},
});
},
Pay(OrderId) {
let that = this;
uni.requestPayment({
provider: "wxpay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function (res) {
that.loading = false
uni.hideLoading()
console.log("success", res);
uni.showToast({
title: "支付成功",
});
that.getOrderDetails()
},
fail: function (err) {
that.loading = false
uni.hideLoading()
console.log("fail:", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
},
});
},
scroll(e) { scroll(e) {
this.boxOption = Math.floor((e.detail.scrollTop - 50) / 1.5); this.boxOption = Math.floor((e.detail.scrollTop - 50) / 1.5);
this.titleStyle.opacity = this.titleStyle.opacity =
...@@ -308,7 +655,7 @@ ...@@ -308,7 +655,7 @@
} }
.TicketOrderDetailsCard{ .TicketOrderDetailsCard{
border-radius: 50rpx; border-radius: 50rpx;
padding: 30rpx 50rpx 37rpx 42rpx; padding: 30rpx 0 37rpx 0;
margin-bottom: 90rpx; margin-bottom: 90rpx;
} }
.TicketOrderDetailsCard-Time{ .TicketOrderDetailsCard-Time{
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<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" <view v-for="(item,index) in TicketOrderTyle"
class="border1 hidden fz24 bgF5 textCenter" class="border1 hidden fz24 bgF5 textCenter"
:class="[OrderTyle==item.Id?'borderDEBF7B':'borderF5']" :class="[msg.orderState==item.Id?'borderDEBF7B':'borderF5']"
@click="research(item)"> @click="research(item.Id)">
{{item.Name}} {{item.Name}}
</view> </view>
</view> </view>
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
@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">
<template v-for="(item,index) in dataList"> <TicketOrderList :dataList="dataList" :msg="msg" @research="research"></TicketOrderList>
<TicketOrderList></TicketOrderList>
</template>
</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"
...@@ -30,6 +28,7 @@ ...@@ -30,6 +28,7 @@
</template> </template>
<script> <script>
import TicketOrderList from "./components/TicketOrderList.vue"; import TicketOrderList from "./components/TicketOrderList.vue";
import { getDateWeek } from "./dates.js";
export default { export default {
components: { components: {
TicketOrderList TicketOrderList
...@@ -39,23 +38,21 @@ ...@@ -39,23 +38,21 @@
scrollTop: 0, scrollTop: 0,
status: 'loadmore', status: 'loadmore',
msg:{ msg:{
ageIndex:1, pageIndex: 1,
pageSize:5, pageSize: 15,
OrderStaus:0, //MiniAppUserId: 0,
TeacherId:0, orderType:-1,
CourseId:0, orderState: 0,
ID:0, GroupType:5,//线路订单
StartTime:'', queryDays:0,
EndTime:'' OutBranchId:-1
}, },
pageCount: 0, pageCount: 0,
OrderTyle: 1,
dataList: [], dataList: [],
loading: false,
TicketOrderTyle:[ TicketOrderTyle:[
{Name:'全部订单',Id:1}, {Name:'全部订单',Id:0},
{Name:'已付款',Id:2}, {Name:'已付款',Id:3},
{Name:'待付款',Id:3}, {Name:'待付款',Id:1},
{Name:'已取消',Id:4}, {Name:'已取消',Id:4},
], ],
loadText: { loadText: {
...@@ -63,20 +60,25 @@ ...@@ -63,20 +60,25 @@
loading: "努力加载中", loading: "努力加载中",
nomore: "没有更多了", nomore: "没有更多了",
}, },
scrollHeight: 0, scrollHeight: '30px',
} }
}, },
onLoad(options){ onLoad(options){
this.msg.orderState = options.orderState?options.orderState:0
}, },
created() {}, created() {},
onShow() {
},
mounted() { mounted() {
this.getList()
setTimeout(() => { setTimeout(() => {
this.getHeadHeight(); this.getHeadHeight();
}, 1000); }, 1000);
}, },
methods: { methods: {
getHeadHeight() { getHeadHeight() {
return
let that = this; let that = this;
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(this);
query query
...@@ -87,7 +89,7 @@ ...@@ -87,7 +89,7 @@
.exec(); .exec();
}, },
research(item) { research(item) {
this.OrderTyle = item.Id this.msg.orderState = item
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.getList(1); this.getList(1);
}, },
...@@ -96,14 +98,46 @@ ...@@ -96,14 +98,46 @@
if (type == 1) { if (type == 1) {
this.dataList = []; this.dataList = [];
} }
return
uni.showLoading() uni.showLoading()
this.request2({ this.apipost(
url: "/api/Hotel/AppGetHotelPage", "sellorder_post_GetTravelOrderAppletList",
data: this.msg, this.msg,
},
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
let arr = function(list){
list.forEach(x=>{
x.time = ''
x.week = ''
x.duration = ''
x.frequency = 0
x.different = 0 //是否异地
x.NewFlightList = []
x.loading = false
})
}
arr(res.data.pageData)
res.data.pageData.forEach(x=>{
arr(x.flightList)
})
res.data.pageData.forEach(x=>{
if(x.flightList.length>2){
x.different = 1
}
x.flightList.forEach((y,index)=>{
let date = y.flightDate.split('-')
y.time = `${date[1]}-${date[2]}`
y.week = getDateWeek(y.flightDate)
y.frequency = x.flightList.length-2>1?x.flightList.length-2:0
if(index==0){
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 ':''}`
x.NewFlightList.push(y)
}
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 ':''}`
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 {
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1697021959000_719.png"/> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1697021959000_719.png"/>
<view class="fz26 color1D1D20 ML31"> <view class="fz26 color1D1D20 ML31">
<text>已选:{{orderMsg.GuestNum}} 人数 </text> <text>已选:{{orderMsg.GuestNum}} 人数 </text>
<text class="ML30">{{orderMsg.ManNum}} 成人</text>
<text class="ML30">{{orderMsg.BabyNum}} 婴儿</text> <text class="ML30">{{orderMsg.BabyNum}} 婴儿</text>
<text class="ML30" v-if="orderMsg.ChirdNum>0">{{orderMsg.ChirdNum}} 儿童</text>
</view> </view>
</view> </view>
<view class="PX50"> <view class="PX50">
...@@ -54,7 +56,7 @@ ...@@ -54,7 +56,7 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="B2BSellNum>=orderMsg.YSeatNum" class="airTicketDetailsAdd bgDEBF7B fz32 fontBold textCenter" <view v-if="B2BSellNum>=orderMsg.YSeatNum||!orderMsg.GuestNum" class="airTicketDetailsAdd bgDEBF7B fz32 fontBold textCenter"
@click="AddPassengers"> @click="AddPassengers">
添加乘机人 添加乘机人
</view> </view>
...@@ -76,16 +78,18 @@ ...@@ -76,16 +78,18 @@
<!-- {{orderMsg.Unit_Price}} --> <!-- {{orderMsg.Unit_Price}} -->
{{orderMsg.PreferPrice}} {{orderMsg.PreferPrice}}
</text> </text>
<!-- <text class="airTicketDetailsFooter-text fz26 ML10 relative"> <text class="airTicketDetailsFooter-text fz26 ML10 relative" v-if="orderMsg.GuestNum>0">
/ 共 {{orderMsg.GuestNum}}
</text> --> </text>
</view> </view>
<view class="row-acje"> <view class="row-acje">
<view class="airTicketDetailsFooter-order row-ajc-w bgDEBF7B fontBold" <view class="airTicketDetailsFooter-order row-ajc-w fontBold" @click="SubmitOrder"
v-if="!loading&&orderMsg.ManNum>0&&orderMsg.ContactMobile" @click="SubmitOrder"> :class="[
<text class="fz32">立即下单</text> loading
</view> ||!orderMsg.ManNum
<view v-else class="airTicketDetailsFooter-order row-ajc-w bgF5 fontBold"> ||!orderMsg.ContactMobile
||orderMsg.ContactMobile.length>11
||11>orderMsg.ContactMobile.length?'bgF5':'bgDEBF7B']">
<text class="fz32">立即下单</text> <text class="fz32">立即下单</text>
</view> </view>
</view> </view>
...@@ -110,8 +114,9 @@ ...@@ -110,8 +114,9 @@
OrderId: 0, OrderId: 0,
TCID: 0, TCID: 0,
CustomerId: 0,//同行Id CustomerId: 0,//同行Id
ManNum: 0, ManNum: 0,//成人
BabyNum: 0, ChirdNum: 0,//儿童
BabyNum: 0,//婴儿
GuestNum: 0,//总人数 GuestNum: 0,//总人数
YSeatNum: 0,//经济舱 YSeatNum: 0,//经济舱
FSeatNum: 0,//头等舱 FSeatNum: 0,//头等舱
...@@ -191,6 +196,7 @@ ...@@ -191,6 +196,7 @@
watch: { watch: {
GuestList:{ GuestList:{
handler(newVal, oldval) { handler(newVal, oldval) {
this.orderMsg.GuestList = []
newVal.forEach(x=>{ newVal.forEach(x=>{
let obj = { let obj = {
SurName: x.SurName, SurName: x.SurName,
...@@ -211,9 +217,7 @@ ...@@ -211,9 +217,7 @@
}, },
"orderMsg.GuestNum":{ "orderMsg.GuestNum":{
handler(newVal, oldval) { handler(newVal, oldval) {
if(this.BabyPrecent>0){
this.getPrice()
}
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -244,24 +248,31 @@ ...@@ -244,24 +248,31 @@
return x.GuestNum==2 return x.GuestNum==2
}) })
this.orderMsg.ManNum = resultMan.length this.orderMsg.ManNum = resultMan.length
this.orderMsg.BabyNum = resultBab.length let BabyNum = resultBab.length
this.orderMsg.GuestNum = this.orderMsg.ManNum+this.orderMsg.BabyNum this.orderMsg.GuestNum = this.orderMsg.ManNum+BabyNum
let ChirdNum = this.orderMsg.ManNum-BabyNum
if(ChirdNum<0){
this.orderMsg.ChirdNum = ChirdNum*-1
}else{
this.orderMsg.ChirdNum = 0
}
this.orderMsg.BabyNum = BabyNum>0?(BabyNum-this.orderMsg.ChirdNum):0
if(this.BabyPrecent>0){
this.getPrice()
}
}, },
// 计算金额及座位 // 计算金额及座位
getPrice(){ getPrice(){
this.orderMsg.PreferPrice = 0 this.orderMsg.PreferPrice = 0
this.orderMsg.YSeatNum = 0 this.orderMsg.YSeatNum = 0
let YSeatNum = this.orderMsg.ManNum let YSeatNum = this.orderMsg.ManNum
let computeBabyNum = this.orderMsg.ManNum - this.orderMsg.BabyNum
let money = this.orderMsg.Unit_Price * this.orderMsg.ManNum; let money = this.orderMsg.Unit_Price * this.orderMsg.ManNum;
if((computeBabyNum==0||computeBabyNum<0||computeBabyNum>0)&&this.orderMsg.BabyNum>0){ if(this.orderMsg.BabyNum>0||this.orderMsg.ChirdNum>0){
if(computeBabyNum==0) money += (this.orderMsg.Unit_Price * this.orderMsg.BabyNum)*(this.BabyPrecent/100) if(this.orderMsg.BabyNum>0) money += (this.orderMsg.Unit_Price * this.orderMsg.BabyNum)*(this.BabyPrecent/100)
if(computeBabyNum<0) { if(this.orderMsg.ChirdNum>0) {
money += (this.orderMsg.Unit_Price * this.orderMsg.ManNum)*(this.BabyPrecent/100) money += (this.orderMsg.Unit_Price*this.orderMsg.ChirdNum)*(50/100)
money += (this.orderMsg.Unit_Price*(computeBabyNum*-1))*(50/100) YSeatNum += this.orderMsg.ChirdNum
YSeatNum += (computeBabyNum*-1)
} }
if(computeBabyNum>0) money += (this.orderMsg.Unit_Price * this.orderMsg.BabyNum)*(this.BabyPrecent/100)
} }
this.orderMsg.PreferPrice = money this.orderMsg.PreferPrice = money
this.orderMsg.YSeatNum = YSeatNum this.orderMsg.YSeatNum = YSeatNum
...@@ -288,12 +299,7 @@ ...@@ -288,12 +299,7 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
SubmitOrder(){ SubmitOrder(){
if(this.orderMsg.GuestList.length==0){ if(this.loading){
uni.showToast({
title: '添加乘机人',
icon: 'none',
mask: true
});
return return
} }
if(this.orderMsg.GuestList.length==0){ if(this.orderMsg.GuestList.length==0){
...@@ -319,6 +325,7 @@ ...@@ -319,6 +325,7 @@
if(res.resultCode==1){ if(res.resultCode==1){
this.queren(res.data) this.queren(res.data)
} }
},(err)=>{
this.loading = false this.loading = false
uni.hideLoading() uni.hideLoading()
}) })
...@@ -354,6 +361,8 @@ ...@@ -354,6 +361,8 @@
} }
}, },
(err) => { (err) => {
this.loading = false
uni.hideLoading()
console.log(err) console.log(err)
}); });
}, },
...@@ -385,28 +394,34 @@ ...@@ -385,28 +394,34 @@
signType: this.orderInfo.signType, signType: this.orderInfo.signType,
paySign: this.orderInfo.sign, paySign: this.orderInfo.sign,
success: function (res) { success: function (res) {
that.loading = false
uni.hideLoading()
console.log("success", res); console.log("success", res);
uni.showToast({ uni.showToast({
title: "支付成功", title: "支付成功",
}); });
uni.removeStorageSync("GuestList")
setTimeout(() => { setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: url:
"/pages/jiuzhai/paysuccess?PreferPrice=" + "/pages/jiuzhai/paysuccess?PreferPrice=" +
this.orderMsg.PreferPrice + that.orderMsg.PreferPrice +
"&isFrom=3", "&isFrom=3",
}); });
}, 100); }, 100);
}, },
fail: function (err) { fail: function (err) {
that.loading = false
uni.hideLoading()
console.log("fail:", err); console.log("fail:", err);
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
}); });
uni.removeStorageSync("GuestList")
setTimeout(() => { setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/airTicket/TicketOrderList?orderId=" + OrderId, url: "/pages/airTicket/TicketOrderList?orderState=1",
}); });
}, 100); }, 100);
}, },
...@@ -448,6 +463,7 @@ ...@@ -448,6 +463,7 @@
for(let i=0;i<this.DetailsList.length;i++){ for(let i=0;i<this.DetailsList.length;i++){
if(this.DetailsList.length-1!=i){ if(this.DetailsList.length-1!=i){
this.DetailsList[i].show = false
FlightList.push(this.DetailsList[i]) FlightList.push(this.DetailsList[i])
if(this.DetailsList.length-2==i||i==0){ if(this.DetailsList.length-2==i||i==0){
NewFlightList.push(this.DetailsList[i]) NewFlightList.push(this.DetailsList[i])
...@@ -475,7 +491,6 @@ ...@@ -475,7 +491,6 @@
this.NewDetailsList.push(obj) this.NewDetailsList.push(obj)
} }
} }
this.loading = false
uni.hideLoading() uni.hideLoading()
}) })
}, },
......
...@@ -47,16 +47,15 @@ ...@@ -47,16 +47,15 @@
{{StartDateObj.math}}{{StartDateObj.date}}日(周{{StartDateObj.week}}) {{StartDateObj.math}}{{StartDateObj.date}}日(周{{StartDateObj.week}})
</template> </template>
<template v-else> <template v-else>
选择出发日期 可选以下出发日期进行筛查
</template> </template>
</text> </text>
<view class="height-line1"></view> <view class="height-line1"></view>
<view class="DepartureTimeList row-sb-n"> <view class="DepartureTimeList row-sb-n">
<view style="width: 590rpx;overflow: hidden;"> <view style="width: 590rpx;overflow: hidden;">
<scroll-view scroll-x style="width:100%;white-space: nowrap;"> <scroll-view scroll-x style="width:100%;white-space: nowrap;">
<view <view class="row-aic-n" v-if="NewDateList&&NewDateList.length>0">
:class="[NewDateList&&NewDateList.length>0?'row-aic-n':'row-w']"> <template v-for="(item,index) in NewDateList">
<template v-if="NewDateList&&NewDateList.length>0" v-for="(item,index) in NewDateList">
<view class="DepartureTimeListC flexS column-ajc fz20" <view class="DepartureTimeListC flexS column-ajc fz20"
:class="[StartDateObj.times==item.times?'bgE1C278':'active']" :class="[StartDateObj.times==item.times?'bgE1C278':'active']"
@click="clickSearch(item,1)"> @click="clickSearch(item,1)">
...@@ -68,7 +67,9 @@ ...@@ -68,7 +67,9 @@
</text> </text>
</view> </view>
</template> </template>
<view v-if="NewDateList.length==0" class="DepartureTimeListC flexS column-ajc fz20" style="width: 100%;"> </view>
<view class="row-w" v-else>
<view class="DepartureTimeListC flexS column-ajc fz20" style="width: 100%;">
<text></text> <text></text>
<text class="MT10 MB10"></text> <text class="MT10 MB10"></text>
<text class="fz26 color9999A5"> <text class="fz26 color9999A5">
...@@ -88,18 +89,19 @@ ...@@ -88,18 +89,19 @@
</view> </view>
</view> </view>
<view class="ScreeningCondition row-sb-n bgFFF"> <!-- <view class="ScreeningCondition row-sb-n bgFFF">
<view class="ScreeningConditionC bgF5" <view class="ScreeningConditionC bgF5"
:class="[item.Id==activeId?'active':'']" v-for="(item,index) in ConditionList" :class="[item.Id==activeId?'active':'']" v-for="(item,index) in ConditionList"
@click="clickSearch(item.Id,2)"> @click="clickSearch(item.Id,2)">
<text class="fz24">{{item.Name}}</text> <text class="fz24">{{item.Name}}</text>
</view> </view>
</view> </view> -->
<view class="MT20"></view>
<scroll-view :scroll-y="true" style="background-color: #f0f4f7;" <u-empty v-if="NewDataList.length==0" text="暂无数据" mode="data" padding-top="0"></u-empty>
<scroll-view v-else :scroll-y="true" style="background-color: #f0f4f7;"
:enable-back-to-top="true" :enable-flex="true" :enable-back-to-top="true" :enable-flex="true"
@scrolltolower="lower" :style="{ 'height': `calc(100% - ${scrollHeight})`}"> @scrolltolower="lower" :style="{ 'height': `calc(100% - ${scrollHeight})`}">
<AirTicketList v-if="NewDataList.length>0" :dataList="NewDataList"></AirTicketList> <AirTicketList :dataList="NewDataList"></AirTicketList>
<!-- <view class="MT10 MB10"> <!-- <view class="MT10 MB10">
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="0" :margin-bottom="0" bg-color="#f0f4f7" /> <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="0" :margin-bottom="0" bg-color="#f0f4f7" />
</view> --> </view> -->
...@@ -123,7 +125,7 @@ ...@@ -123,7 +125,7 @@
:StartDate="msg.StartDate" :StartDate="msg.StartDate"
:EndDate="msg.EndDate" :EndDate="msg.EndDate"
@finish="chosenDateResult" @finish="chosenDateResult"
title="筛选日期"> title="起止出发日期">
</canlendar> </canlendar>
</u-popup> </u-popup>
<u-popup <u-popup
...@@ -223,9 +225,9 @@ ...@@ -223,9 +225,9 @@
created() {}, created() {},
mounted() { mounted() {
this.getDataAddressList() this.getDataAddressList()
this.msg.StartDate = getBeforeDate(0, new Date()), this.msg.StartDate = getBeforeDate(1, new Date()),
this.msg.EndDate = getBeforeDate(-30, new Date()), this.msg.EndDate = getBeforeDate(-60, new Date()),
this.getDateList(31) this.getDateList(60)
}, },
methods: { methods: {
AddressSelection(AddressType){ AddressSelection(AddressType){
...@@ -295,7 +297,7 @@ ...@@ -295,7 +297,7 @@
}else if(y.FlightList.length>2){ }else if(y.FlightList.length>2){
let obj = { let obj = {
duration:`${y.DepartureTime.Days>0?y.DepartureTime.Days+'d ':''}${y.DepartureTime.Hours>0?y.DepartureTime.Hours+'h ':''}${y.DepartureTime.Minutes>0?y.DepartureTime.Minutes+'m ':''}`, duration:`${y.DepartureTime.Days>0?y.DepartureTime.Days+'d ':''}${y.DepartureTime.Hours>0?y.DepartureTime.Hours+'h ':''}${y.DepartureTime.Minutes>0?y.DepartureTime.Minutes+'m ':''}`,
frequency: y.FlightList.length-2>1?y.FlightList.length-2:1, frequency: y.FlightList.length-2>1?y.FlightList.length-2:0,
FlightType: y.FlightList[1].FlightType, FlightType: y.FlightList[1].FlightType,
...y.FlightList[0] ...y.FlightList[0]
} }
......
<template>
<view class="airTicketDetailsList column">
<view v-for="(items,i) in dataList">
<view class="airTicketDetailsCard bgFFF"
:class="[dataList.length-1>i?'MB40':'']">
<view class="row-sb-n"
:class="[items.FlightList.length>1?'MR50':'']">
<view class="row-aic-n">
<view>
<view class="airTicketDetailsCard-qfc bgE1C278 fz30 color111 fontBold">
<template v-if="items.FlightSubType==1">去程</template>
<template v-if="items.FlightSubType==3">返程</template>
</view>
</view>
<view class="fz28 color111 ML20">
<text>{{items.time}}</text> <text class="ML10">周{{items.week}}</text>
</view>
<view class="fz28 color111 ML31">
总时长 {{items.duration}}
</view>
</view>
<view v-if="items.FlightList.length>1" class="fz28 colorE1C278 row-aic-n" @click="TicketDetails(items)">
<!-- <text>详情</text> -->
<uni-icons class="ML10" color="#DEBF7B" :type="items.show?'arrowdown':'arrowright'" size="14"></uni-icons>
<!-- <uni-icons class="ML10" color="#DEBF7B" type="arrowright" size="14"></uni-icons> -->
</view>
</view>
<view class="MT60 PX50" v-if="!items.show">
<view class="row relative" v-for="(item,index) in items.NewFlightList"
:class="[index==0?'MB50':'']">
<text v-if="index==1" class="fz18 fontWeight400 colorFF5858 absolute airTicketDetailsCard-timeT">
{{item.time}} 周{{item.week}}
</text>
<view class="airTicketDetailsCard-timeL column flexS MR20 textRight">
<view v-if="index==0" class="fz28 fontBold relative relativeFT10">{{item.Departure_time}} </view>
<view v-if="items.NewFlightList.length-1==index" class="MT25 fz28 fontBold">
{{item.Arrival_time}}
</view>
</view>
<view class="flexS MR30">
<view class="width-lineH49 bgE1C278 relative">
<view class="bgE1C278 absolute WH12R50 airTicketDetailsCard-LinT"></view>
<template v-if="index">
<view class="bgE1C278 absolute WH6R50 airTicketDetailsCard-LinT2"></view>
<view class="bgE1C278 absolute WH6R50 airTicketDetailsCard-LinT3"></view>
<view class="bgE1C278 absolute WH6R50 airTicketDetailsCard-LinT4"></view>
</template>
<view class="bgE1C278 absolute WH12R50 airTicketDetailsCard-LinB"></view>
<template v-if="index!=1">
<view class="bgE1C278 absolute WH6R50 airTicketDetailsCard-LinB2"></view>
</template>
</view>
</view>
<view class="column flexG relative">
<view v-if="index!=0" class="airTicketDetailsCard-ZhuanNum bgE1C278 fz18 colorFFF absolute">
<template v-if="items.FlightList.length-1>1">+{{items.FlightList.length-1}}</template>
</view>
<view class="airTicketDetailsCard-title row-aic-n absolute" v-if="index==0">
<img class="inlineblock flexS" mode="widthFix" style="width: 20rpx;height: 17rpx;"
:src="item.AlImage"/>
<view class="flexG">
<text class="block width100One overflow fz20 ML5 color9999A5 fontWeight400">{{item.AlName}} {{item.Flight_number}} </text>
</view>
</view>
<view class="fz28 fontBold relative relativeFT8" v-if="index==0">
<text class="block width100One hidden">{{item.DepartureName?item.DepartureName:''}} {{item.dName}}</text>
</view>
<view class="fz28 fontBold MT25" v-if="index==1">
<text class="block width100One hidden">{{item.ArrivalCityName?item.ArrivalCityName:''}} {{item.aName}}</text>
</view>
</view>
</view>
</view>
<template v-if="items.show">
<view class="MT60 PX50" v-for="(item,index) in items.FlightList"
:class="[items.FlightList.length-1!=index?'MB50':'']">
<view class="row-aic-n relative"
:class="[items.FlightList.length-1!=index?'MB70':'']">
<text v-if="items.FlightList.length-1==index" class="fz18 fontWeight400 colorFF5858 absolute airTicketDetailsCard-timeT">
{{item.time}}{{item.week}}
</text>
<view class="airTicketDetailsCard-timeL column flexS MR20 textRight">
<view :class="[index?'fz24':'fz28 fontBold']">{{item.Departure_time}} </view>
<view class="MT35" :class="[items.FlightList.length-1!=index?'fz24':'fz28 fontBold']">
{{item.Arrival_time}}
</view>
</view>
<view class="flexS MR30">
<view class="width-lineH83 bgE1C278 relative">
<view class="bgE1C278 absolute WH12R50 airTicketDetailsCard-LinT"></view>
<template v-if="index">
<view class="bgE1C278 absolute WH6R50 airTicketDetailsCard-LinT2"></view>
<view class="bgE1C278 absolute WH6R50 airTicketDetailsCard-LinT3"></view>
</template>
<view class="bgE1C278 absolute WH12R50 airTicketDetailsCard-LinB"></view>
<template v-if="items.FlightList.length-1>index">
<view class="bgE1C278 absolute WH6R50 airTicketDetailsCard-LinB2"></view>
<view class="bgE1C278 fz18 colorFFF absolute airTicketDetailsCard-LinText">
中转
</view>
</template>
</view>
</view>
<view class="column flexG relative">
<view class="airTicketDetailsCard-title row-aic-n absolute">
<img class="inlineblock flexS" mode="widthFix" style="width: 20rpx;height: 17rpx;"
:src="item.AlImage"/>
<view class="flexG">
<text class="block width100One overflow fz20 ML5 color9999A5 fontWeight400">{{item.AlName}} {{item.Flight_number}}</text>
</view>
</view>
<view class="fz28 fontBold relative relativeFT8">
<text class="block width100One hidden">{{item.DepartureName?item.DepartureName:''}} {{item.dName}} </text>
</view>
<view class="fz28 fontBold MT25">
<text class="block width100One hidden">{{item.ArrivalCityName?item.ArrivalCityName:''}} {{item.aName}} </text>
</view>
</view>
</view>
</view>
</template>
</view>
</view>
</view>
</template>
<script>
export default {
props:['DetailsList'],
components: {
},
data() {
return {
dataList:[
{
show:true
},
{
show:false
},
],
}
},
onLoad(options){
},
watch: {
DetailsList:{
handler(newVal, oldval) {
this.dataList = JSON.parse(JSON.stringify(this.DetailsList))
},
deep: true,
immediate: true
}
},
created() {},
methods: {
TicketDetails(items){
items.show=!items.show
this.$forceUpdate();
},
}
}
</script>
<style scoped>
@import url("@/asset/css/flex.css");
@import url("../style.css");
.airTicketDetailsList{
/* margin: 0 54rpx; */
}
.airTicketDetailsCard{
/* border-radius: 50rpx;
padding: 45rpx 0; */
}
</style>
\ No newline at end of file
<template> <template>
<view class="TicketOrderListCard bgFFF relative"> <view>
<view class="TicketOrderListCard-wf absolute bg111 colorFFF fz24 z-index2">异地</view> <view class="TicketOrderListCard bgFFF relative" v-for="(item,i) in DataLists"
@click="getDetail(item.orderId)">
<view v-if="item.different" class="TicketOrderListCard-wf absolute bg111 colorFFF fz24 z-index2">异地</view>
<template v-for="(childs,index) in item.NewFlightList">
<view class="row-sb-n"> <view class="row-sb-n">
<view class="flexG"></view> <view class="flexG"></view>
<view class="fz24 color111 flexS"> <view class="fz24 color111 flexS">
<text>09-28</text> <text>{{childs.time}}</text>
<text class="ML5 MR10"></text> <text class="ML5 MR10"> {{childs.week}}</text>
<text>10:39</text> <text>{{childs.departure_time}}</text>
</view> </view>
</view> </view>
<view class="MB55" v-for="(item,index) in 2"> <view
:class="[index?'':'MB10']">
<view class="row-sb-n MT10"> <view class="row-sb-n MT10">
<view class="flexS MR20"> <view class="flexS MR20">
<view class="TicketOrderListCard-qc bgE1C278 fz24 color111 overflow textCenter relative relativeFT8"> <view class="TicketOrderListCard-qc bgE1C278 fz24 color111 overflow textCenter relative relativeFT8">
...@@ -18,20 +22,23 @@ ...@@ -18,20 +22,23 @@
</view> </view>
</view> </view>
<view class="column flexS"> <view class="column flexS">
<text class="fz30 fontBold">09:00 </text> <text class="fz30 fontBold">{{childs.departure_time}} </text>
<text class="fz22 MT5 width100 ellipsis1">天府T2</text> <text class="fz22 MT5 width100 ellipsis1">{{childs.dName}}</text>
</view> </view>
<view class="FlightDirection-box relative"> <view class="FlightDirection-box relative">
<view class="FlightDirection-Title column"> <view class="FlightDirection-Title column">
<!-- :style="{'height':'90rpx'}" --> <!-- :style="{'height':'90rpx'}" -->
<view class="row-ajc-n"> <view class="row-ajc-n">
<view class="FlightDirection-zhuan z-index2 MB10"> <view class="FlightDirection-zhuan z-index2 MB10">
<text class="block bgECF1F4 fz21 nowrap">转+2</text> <text v-if="!childs.frequency" class="fz20 color9999A5">{{childs.duration}}</text>
<text v-else class="block bgECF1F4 fz21 nowrap">
<template v-if="childs.frequency>1">+{{childs.frequency}}</template>
</text>
</view> </view>
</view> </view>
<view> <view>
<text class="fz19 textCenter width100 ellipsis1 relative relativeFT8"> <text class="fz19 textCenter width100 ellipsis1 relative relativeFT8">
武汉 北京 {{childs.departureName}} {{childs.arrivalCityName}}
</text> </text>
</view> </view>
</view> </view>
...@@ -44,52 +51,75 @@ ...@@ -44,52 +51,75 @@
</view> </view>
</view> </view>
<view class="column"> <view class="column">
<text class="fz36 fontBold">11:30 </text> <text class="fz36 fontBold">{{childs.arrival_time}} </text>
<text class="fz22 MT5 width100 ellipsis1">许家坪</text> <text class="fz22 MT5 width100 ellipsis1">{{childs.aName}}</text>
</view> </view>
<view class="ML20 TicketOrderListCard-Pr textRight"> <view class="ML20 TicketOrderListCard-Pr textRight">
<text v-if="index==1" class="color9999A5 fz32 relative TicketOrderListCard-PrQx">取消</text> <view v-if="!index" class=" fz34 fontBold">¥ {{item.preferPrice}}</view>
<text v-else class="fz34 fontBold">¥ 5,800</text> <view v-if="index==1&&(item.orderState==1||item.orderState==2||item.orderState==3)"
class="fz32 relative TicketOrderListCard-PrQx"
:class="[item.loading?'color9999A5':'colorDEBF7B']"
@click.stop="cancelOrder(item,i)">取 消</view>
</view> </view>
</view> </view>
<view class="row-w"> <view class="row-w">
<view class="aviationTitle row-aic-n"> <view class="aviationTitle row-aic-n hidden">
<img class="inlineblock flexS" mode="widthFix" style="width: 36rpx;height: 30rpx;" <img class="inlineblock flexS" mode="widthFix" style="width: 36rpx;height: 30rpx;"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696749257000_469.png"/> :src="childs.alImage"/>
<view class="flexG"> <view class="flexG">
<text class="fz22 ML5 color9999A5 width100One ellipsis1">东航CA1852...</text> <text class="fz22 ML5 color9999A5 width100One ellipsis1">{{childs.alName}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template>
<view class="row-sb-n MT30"> <view class="row-sb-n MT30">
<view class="fz324 color9999A5 MR30 flexG"> <view class="fz324 color9999A5 MR30 flexG">
<txet class="block TicketOrderListCard-title width100One ellipsis1">陈伟霆、郑中基等4人</txet> <txet class="block TicketOrderListCard-title width100One ellipsis1" v-if="item.guestList&&item.guestList.length>0">
<template v-for="(n,is) in item.guestList"
v-if="2>is">
{{n.userName}}
<template v-if="is!=item.guestList.length-1"></template>
</template>
等 {{item.guestList.length}} 人</txet>
</view> </view>
<view class="flexS"> <view class="flexS">
<!-- colorDEBF7B --> <view v-if="(item.orderState==1||item.orderState==2)"
<view class="TicketOrderListCard-buttom overflow fz32 fontBold textCenter border1 bgDEBF7B borderDEBF7B" class="TicketOrderListCard-buttom overflow fz32 fontBold textCenter border1"
@click="getDetail"> :class="[item.loading?'bgF5 borderF5 colorDEBF7B':'bgDEBF7B borderDEBF7B']"
@click.stop="queren(item.orderId,i)">
待付款 待付款
</view> </view>
<!-- <view class="TicketOrderListCard-buttom overflow fz32 fontBold textCenter border1 bgF5 borderF5 color9999A5"> <!-- <view v-if="(item.orderState==1||item.orderState==2)&&item.loading"
已取消 class="TicketOrderListCard-buttom overflow fz32 fontBold textCenter border1 bgF5 borderF5 colorDEBF7B"
</view> @click.stop="queren(item.orderId,i)">
<view class="TicketOrderListCard-buttom overflow fz32 fontBold textCenter border1 bgFFF borderDEBF7B colorDEBF7B"> 待付款
已支付
</view> --> </view> -->
<view v-if="item.orderState==3||item.orderState==4"
class="TicketOrderListCard-buttom overflow fz32 fontBold textCenter border1"
:class="[item.orderState==3?'bgFFF borderDEBF7B colorDEBF7B':'bgF5 borderF5 color9999A5']">
{{item.orderState==3?'已支付':'已取消'}}
</view>
</view> </view>
</view> </view>
</view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props:['dataList','msg'],
components: { components: {
}, },
data() { data() {
return { return {
DataLists:[],
orderData: null,
orderInfo:{},
submit: false,
submitCancel: false,
loading: false,
i: null
} }
}, },
onLoad(options){ onLoad(options){
...@@ -98,13 +128,182 @@ ...@@ -98,13 +128,182 @@
created() {}, created() {},
mounted() { mounted() {
},
watch: {
dataList: {
handler(newVal, oldval) {
this.DataLists = JSON.parse(JSON.stringify(newVal))
},
deep: true,
immediate: true
},
msg: {
handler(newVal, oldval) {
this.dataMsg = JSON.parse(JSON.stringify(newVal))
},
deep: true,
immediate: true
},
}, },
methods: { methods: {
getDetail(item){ cancelOrder(item,i){
let that = this
this.i = i
if(this.DataLists[this.i].loading){
return
}
//未付款-调用后台取消
uni.showLoading()
this.DataLists[this.i].loading = true
if (
(item.paymentTime == null || item.paymentTime == "") &&
(item.orderState == 1||item.orderState == 2)
) {
this.apipost(
"sellorder_post_B2BRemoveOrder",
{
ID: item.orderId,
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.$emit('research',that.dataMsg.orderState)
}
uni.hideLoading()
this.DataLists[this.i].loading = false
},
(err) => {
uni.hideLoading()
this.DataLists[this.i].loading = false
}
);
} else {
let msg = {
OrderId: item.orderId,
UserId: uni.getStorageSync("mall_UserInfo").UserId,
};
//已付款取消申请
this.apipost(
"sellorder_post_AppletUserCancelOrder",
msg,
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.$emit('research',that.dataMsg.orderState)
} else {
}
uni.hideLoading()
this.DataLists[this.i].loading = false
},
(err)=>{
uni.hideLoading()
this.DataLists[this.i].loading = false
}
);
}
},
getDetail(orderId){
uni.navigateTo({ uni.navigateTo({
url: '/pages/airTicket/TicketOrderDetails' url: `/pages/airTicket/TicketOrderDetails?orderId=${orderId}`
}); });
}, },
//微信支付
queren(OrderId,i) {
this.i = i
if(this.DataLists[this.i].loading){
return
}
this.DataLists[this.i].loading = true
let url = "/api/WeChatPay/GetTravlePayInfo";
let DepartureName = this.DataLists[0].departureName
let ArrivalCityName = this.DataLists[0].flightList[this.DataLists[0].flightList.length-1].arrivalCityName
let FlightDate = this.DataLists[0].flightDate+'/'+this.DataLists[0].departure_time
let GoodsName = `${DepartureName}-${ArrivalCityName}-${FlightDate}`;
// GoodsName = GoodsName.slice(0, 10);
uni.showLoading()
this.DataLists[this.i].loading = true
this.request2(
{
url: url,
data: {
OrderId: OrderId,
GoodsName: GoodsName,
OrderPayType: 1,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
},
},
(res) => {
try{
this.orderInfo = JSON.parse(res.data);
this.subscribeMsg(OrderId);
}catch(e){
uni.showToast({
title:'无法正常拉取微信支付,你可以稍后重试或联系销售人员线下转款',
icon:'none'
})
}
},
(err) => {
console.log(err)
});
},
subscribeMsg(OrderId) {
const that = this;
let tempObj = uni.getStorageSync("basedata")?.mall?.wechatmessage ?? [];
let tmplIds = [];
if (tempObj && tempObj.length > 0) {
tempObj.forEach((x) => {
if (x.Name == "下单成功提醒" || x.Name == "订单取消提醒") {
tmplIds.push(x.MessageId);
}
});
}
uni.requestSubscribeMessage({
tmplIds: tmplIds,
complete(res) {
that.Pay(OrderId);
},
});
},
Pay(OrderId) {
let that = this;
uni.requestPayment({
provider: "wxpay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function (res) {
uni.hideLoading()
that.DataLists[that.i].loading = false
console.log("success", res);
uni.showToast({
title: "支付成功",
});
that.$emit('research',that.dataMsg.orderState)
},
fail: function (err) {
uni.hideLoading()
that.DataLists[that.i].loading = false
console.log("fail:", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
},
});
},
} }
} }
</script> </script>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
</view> </view>
<view v-if="items.FlightList.length>1" class="fz28 colorE1C278 row-aic-n" @click="TicketDetails(items)"> <view v-if="items.FlightList.length>1" class="fz28 colorE1C278 row-aic-n" @click="TicketDetails(items)">
<text>详情</text> <!-- <text>详情</text> -->
<uni-icons class="ML10" color="#DEBF7B" :type="items.show?'arrowdown':'arrowright'" size="14"></uni-icons> <uni-icons class="ML10" color="#DEBF7B" :type="items.show?'arrowdown':'arrowright'" size="14"></uni-icons>
<!-- <uni-icons class="ML10" color="#DEBF7B" type="arrowright" size="14"></uni-icons> --> <!-- <uni-icons class="ML10" color="#DEBF7B" type="arrowright" size="14"></uni-icons> -->
</view> </view>
...@@ -62,10 +62,10 @@ ...@@ -62,10 +62,10 @@
</view> </view>
</view> </view>
<view class="fz28 fontBold relative relativeFT8" v-if="index==0"> <view class="fz28 fontBold relative relativeFT8" v-if="index==0">
<text class="block width100One hidden">{{item.DepartureName}} {{item.dName}}</text> <text class="block width100One hidden">{{item.DepartureName?item.DepartureName:''}} {{item.dName}}</text>
</view> </view>
<view class="fz28 fontBold MT25" v-if="index==1"> <view class="fz28 fontBold MT25" v-if="index==1">
<text class="block width100One hidden">{{item.ArrivalCityName}} {{item.aName}}</text> <text class="block width100One hidden">{{item.ArrivalCityName?item.ArrivalCityName:''}} {{item.aName}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -109,10 +109,10 @@ ...@@ -109,10 +109,10 @@
</view> </view>
</view> </view>
<view class="fz28 fontBold relative relativeFT8"> <view class="fz28 fontBold relative relativeFT8">
<text class="block width100One hidden">{{item.DepartureName}} {{item.dName}} </text> <text class="block width100One hidden">{{item.DepartureName?item.DepartureName:''}} {{item.dName}} </text>
</view> </view>
<view class="fz28 fontBold MT25"> <view class="fz28 fontBold MT25">
<text class="block width100One hidden">{{item.ArrivalCityName}} {{item.aName}} </text> <text class="block width100One hidden">{{item.ArrivalCityName?item.ArrivalCityName:''}} {{item.aName}} </text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -27,12 +27,7 @@ ...@@ -27,12 +27,7 @@
<view class="FlightDirection-zhuan z-index2 ML10" v-if="childs.frequency"> <view class="FlightDirection-zhuan z-index2 ML10" v-if="childs.frequency">
<!-- childs.FlightType==2 --> <!-- childs.FlightType==2 -->
<text class="block bgECF1F4 fz21 nowrap"> <text class="block bgECF1F4 fz21 nowrap">
<template v-if="childs.frequency&&childs.frequency>1"> <template v-if="childs.frequency>1">+{{childs.frequency}}</template>
转+{{childs.frequency}}
</template>
<template v-if="childs.frequency&&childs.frequency==1">
经停
</template>
</text> </text>
</view> </view>
</view> </view>
......
...@@ -153,6 +153,10 @@ ...@@ -153,6 +153,10 @@
lastNot: [0, 10] //前置的无房操作 lastNot: [0, 10] //前置的无房操作
}; };
}, },
onShow(){
this.start = this.setDefaultDate(this.StartDate);
this.end = this.setDefaultDate(this.EndDate);
},
mounted () { mounted () {
console.log("进入了....") console.log("进入了....")
uni.getSystemInfo({ uni.getSystemInfo({
...@@ -473,17 +477,6 @@ ...@@ -473,17 +477,6 @@
submit() { submit() {
var obj = { var obj = {
/* startYMD: this.date[this.start[0]].year + this.type + this.date[this.start[0]].month + this.type + this.isFestival(
this.start[0], this.start[1]),
startMD: this.date[this.start[0]].month + this.type + this.isFestival(this.start[0], this.start[1]),
startDay: this.startDay,
startWeek: this.startWeek,
endYMD: this.date[this.end[0]].year + this.type + this.date[this.end[0]].month + this.type + this.isFestival(this
.end[0], this.end[1]),
emdMD: this.date[this.end[0]].month + this.type + this.type + this.isFestival(this.end[0], this.end[1]),
endDay: this.endDay,
endWeek: this.endWeek,
day: this.day */
startWeek: this.startWeek, startWeek: this.startWeek,
endWeek: this.endWeek, endWeek: this.endWeek,
start: this.date[this.start[0]].year + this.type + this.date[this.start[0]].month + this.type + start: this.date[this.start[0]].year + this.type + this.date[this.start[0]].month + this.type +
...@@ -505,72 +498,6 @@ ...@@ -505,72 +498,6 @@
}) })
this.$emit("finish",obj) this.$emit("finish",obj)
//价格清单,应该存入vuex获取缓存中
// if (this.priceStauts.length > 0) {
// var price = []
// if (this.end[0] - this.start[0] == 0) {
// for (var i = this.start[1]; i < this.end[1]; i++) {
// var day = this.date[this.start[0]].year + this.type + this.setPull(this.date[this.start[0]]
// .month) + this.type + this.isFestival(
// this.start[0], i)
// price.push({
// day_str: day,
// price: this.priceStauts[this.start[0]][i]
// })
// }
// } else {
// for (var i = this.start[0]; i <= this.end[0]; i++) {
// console.log(i)
// if (i == this.start[0]) {
// for (var j = this.start[1]; j < this.date[i].day.length; j++) {
// var day = this.date[i].year + this.type + this.setPull(this.date[i].month) + this
// .type + this.isFestival(
// i, j)
// price.push({
// day_str: day,
// price: this.priceStauts[i][j]
// })
// }
// } else if (i == this.end[0]) {
// for (var j = 0; j < this.end[1]; j++) {
// var day = this.date[i].year + this.type + this.setPull(this.date[i].month) + this
// .type + this.isFestival(
// i, j)
// price.push({
// day_str: day,
// price: this.priceStauts[i][j]
// })
// }
// } else {
// for (var j = 0; j < this.date[i].day.length; j++) {
// var day = this.date[i].year + this.type + this.setPull(this.date[i].month) + this
// .type + this.isFestival(
// i, j)
// price.push({
// day_str: day,
// price: this.priceStauts[i][j]
// })
// }
// }
// }
// }
// //加入缓存
// uni.setStorage({
// key: 'Price',
// data: JSON.stringify(price)
// })
// }
//跳转到上一页
// uni.navigateBack({
// delta: 1
// })
}, },
} }
}; };
......
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