Commit 25cd54a4 authored by 18224442217's avatar 18224442217

支付已调通

parent 23b75f00
......@@ -3,9 +3,9 @@
<view class="AirplanePassengerAddEditingC">
<view class="column">
<view class="AirplanePassengerAddEditingC-text row-sb-n fz30">
<text class="flexS AirplanePassengerAddEditingC-textL">姓名</text>
<input class="flexG fontBold" type="text" placeholder="文姓名,请于乘机证件相同"
v-model="text"/>
<text class="flexS AirplanePassengerAddEditingC-textL">姓名(英文)</text>
<input class="flexG fontBold" type="text" placeholder="文姓名,请于乘机证件相同"
v-model="addMsg.SurName"/>
</view>
<view class="height-line1"></view>
</view>
......@@ -13,9 +13,9 @@
<view class="AirplanePassengerAddEditingC-text row-sb-n fz30">
<text class="flexS AirplanePassengerAddEditingC-textL">证件</text>
<view class="flexG row-aic-n">
<view v-for="(item,index) in certificateList" class="AirplanePassengerAddEditingC-choose MR30">
<!-- circle -->
<uni-icons color="#DEBF7B" type="checkbox-filled" size="18"></uni-icons>
<view v-for="(item,index) in certificateList" class="AirplanePassengerAddEditingC-choose MR30"
@click="getType(item,1)">
<uni-icons color="#DEBF7B" :type="addMsg.GuestType==item.Id?'checkbox-filled':'circle'" size="18"></uni-icons>
<text class="ML20 fz30 fontBold">{{item.Name}}</text>
</view>
</view>
......@@ -25,16 +25,35 @@
<view class="column">
<view class="AirplanePassengerAddEditingC-text row-sb-n fz30">
<text class="flexS AirplanePassengerAddEditingC-textL">证件号</text>
<input class="flexG fontBold" type="text" placeholder="请输入身份证号码"
v-model="text"/>
<input v-if="addMsg.GuestType==1" class="flexG fontBold" type="text" placeholder="请输入身份证号码"
v-model="addMsg.IdCard" @blur="setBirthday"/>
<input v-if="addMsg.GuestType==2" class="flexG fontBold" type="text" placeholder="请输入护照号码"
v-model="addMsg.PassportNo" @blur="setBirthday"/>
</view>
<view class="height-line1"></view>
</view>
<view class="column">
<view class="AirplanePassengerAddEditingC-text row-sb-n fz30">
<text class="flexS AirplanePassengerAddEditingC-textL">成人/婴儿</text>
<view class="flexG row-aic-n">
<view v-for="(item,index) in GuestTypeList" class="AirplanePassengerAddEditingC-choose MR30"
@click="getType(item,2)">
<uni-icons color="#DEBF7B" :type="addMsg.GuestNum==item.Id?'checkbox-filled':'circle'" size="18"></uni-icons>
<text class="ML20 fz30 fontBold">{{item.Name}}</text>
</view>
</view>
</view>
<view class="height-line1"></view>
</view>
</view>
<view class="AirplanePassengerList-footer fixedFooter bgFFF fixed z-index2">
<view class="AirplanePassengerList-buttom bgDEBF7B fz32 fontBold textCenter"
<view v-if="addMsg.SurName&&(addMsg.PassportNo||addMsg.IdCard)"
class="AirplanePassengerList-buttom bgDEBF7B fz32 fontBold textCenter"
@click="showAddEditingPreviwe=true">
确认添加
确认{{editorIndex||editorIndex==0?'编辑':'添加'}}
</view>
<view v-else class="AirplanePassengerList-buttom bgF5 fz32 fontBold textCenter">
确认{{editorIndex||editorIndex==0?'编辑':'添加'}}
</view>
</view>
<u-popup
......@@ -52,26 +71,28 @@
<view class="showAddEditing-Details bgF5 MT15">
<view class="row-aic-n">
<text class="fz26 flexS">姓名</text>
<text class="fz30 fontBold colorFF5858 flexG">王俊苏</text>
<text class="fz30 fontBold colorFF5858 flexG">{{addMsg.SurName}}</text>
</view>
<view class="row-aic-n">
<text class="fz26 flexS">证件号</text>
<text class="fz30 fontBold colorFF5858 flexG">212114555698544</text>
<text class="fz30 fontBold colorFF5858 flexG">{{addMsg.GuestType==1?addMsg.IdCard:addMsg.PassportNo}}</text>
</view>
<view class="row-aic-n">
<view class="row-aic-n" v-if="addMsg.result">
<text class="fz26 flexS">出生日期</text>
<text class="fz30 fontBold flexG">2017-01-25</text>
<text class="fz30 fontBold flexG">{{addMsg.result.birthday}}</text>
</view>
</view>
<view class="showAddEditing-buttom fz32 fontBold textCenter row-sb-n">
<view class="border1 colorDEBF7B borderDEBF7B" @click="showAddEditingPreviwe=false">返回修改</view>
<view class="border1 borderDEBF7B" @click="submit">确认添加</view>
<view v-if="!loading" class="border1 borderDEBF7B" @click="submit">确认{{editorIndex||editorIndex==0?'编辑':'添加'}}</view>
<view v-else class="border1 bgF5">确认{{editorIndex||editorIndex==0?'编辑':'添加'}}</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import { parseIDCard } from "./dates.js";
export default {
components: {
......@@ -83,23 +104,75 @@
{Name:'身份证',Id:1},
{Name:'护照',Id:2},
],
GuestTypeList:[
{Name:'成人',Id:1},
{Name:'婴儿',Id:2},
],
text:'',
showAddEditingPreviwe: false
showAddEditingPreviwe: false,
addMsg: {
SurName:'',PassportNo:'',IdCard:'',MobilePhone:'',
result:null,show: false,GuestType:1,GuestNum: 1,Id:0
},
GuestList: [],
editorIndex: null
}
},
onLoad(options){
this.editorIndex = options.editorIndex||options.editorIndex==0?options.editorIndex:null
uni.setNavigationBarTitle({
title: options.item?'编辑乘机人':'新增乘机人'
title: options.editorIndex||options.editorIndex==0?'编辑乘机人':'新增乘机人'
})
},
onBackPress(options){
console.log(options,'-----navigateBack')
},
created() {},
mounted() {
let GuestList = uni.getStorageSync("GuestList")
this.GuestList = GuestList?GuestList:[]
if(this.editorIndex||this.editorIndex==0){
this.addMsg = this.GuestList[this.editorIndex]
}
},
watch: {
addMsg:{
handler(newVal, oldval) {
}
}
},
methods: {
submit(){
// uni.showLoading({
// title: "",
// });
// uni.hideLoading();
this.addMsg.Id = Math.floor(Math.random()*(100-1)+1)
if(!this.editorIndex){
this.GuestList.push(this.addMsg)
}
if(this.GuestList.length>0){
uni.setStorageSync("GuestList",this.GuestList)
}
setTimeout(()=>{
uni.navigateBack({
delta: -1
})
},200)
},
setBirthday(){
if(this.addMsg.GuestType==1){
this.addMsg.result = parseIDCard(this.addMsg.IdCard)
}
},
getType(item,type){
if(type==1){
if(this.addMsg.GuestType!=item.Id){
this.addMsg.IdCard = ''
this.addMsg.PassportNo = ''
}
this.addMsg.GuestType = item.Id
}else{
this.addMsg.GuestNum = item.Id
}
}
}
}
</script>
......
......@@ -9,75 +9,83 @@
<NavigationHeader :title="title" :titleStyle="titleStyle"></NavigationHeader>
<view class="PT123 PB260">
<view class="row-ajc-n MT45 MB30 fz40 fontBold">
<view>成都</view>
<view>{{NewDetailsList[0].DepartureName}}</view>
<img class="inlineblock ML50 MR50" mode="widthFix" style="width: 79rpx;height: 38rpx"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696990221000_663.png"/>
<view>北京</view>
<view>{{NewDetailsList[0].FlightList[NewDetailsList[0].FlightList.length-1].ArrivalCityName}}</view>
</view>
<AirTicketDetails></AirTicketDetails>
<AirTicketDetails v-if="NewDetailsList.length>0" :DetailsList="NewDetailsList"></AirTicketDetails>
<template v-if="orderMsg.Unit_Price>0&&B2BSellNum>0">
<view class="PX50 MT20 MB30 row-aic-n">
<img class="inlineblock MR10" mode="widthFix" style="width: 167rpx;height: 31rpx"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1697021959000_719.png"/>
<view class="fz26 color1D1D20 ML31">
<text>已选:1 人数 </text>
<text class="ML30">1 婴儿</text>
<text>已选:{{orderMsg.GuestNum}} 人数 </text>
<text class="ML30">{{orderMsg.BabyNum}} 婴儿</text>
</view>
</view>
<view class="PX50">
<view class="airTicketDetailsAdd-box bgFFF">
<view class="PX4">
<view v-for="(item,index) in riderList"
:class="[index==riderList.length-1?'':'MB50']">
<view class="fz30 fontBold">王俊苏</view>
<view class="fz26 color9999A5 MT25">
<text>证件号</text>
<text class="ML10">2221115454465632535</text>
</view>
</view>
<view class="PX4" v-if="GuestList.length>0">
<template v-for="(item,index) in GuestList">
<u-swipe-action
:index="index" :key="item.Id"
:options="options"
:show="item.show"
:auto-close="false"
@click="bindClick"
@open="open">
<view>
<view class="fz30 fontBold">{{item.SurName}}</view>
<view class="fz26 color9999A5 MT25">
<text>证件号</text>
<text class="ML10">{{item.IdCard?item.IdCard:item.PassportNo}}</text>
</view>
</view>
</u-swipe-action>
<view v-if="GuestList.length-1!=index" class="MB50"></view>
</template>
<view class="height-line1 MT40 MB35"></view>
<view class="row-ajc-n MB70">
<text class="flexS fz30">联系电话</text>
<view class="airTicketDetailsAddMobile flexG ML30">
<input class="fz30" v-model="Mobile" placeholder="用于接收通知" />
<input class="fz30" type="number" v-model="orderMsg.ContactMobile" placeholder="用于接收通知" />
</view>
</view>
</view>
<view class="airTicketDetailsAdd bgDEBF7B fz32 fontBold textCenter"
:class="[riderList.length==0?'MB255':'']"
<view v-if="B2BSellNum>=orderMsg.YSeatNum" class="airTicketDetailsAdd bgDEBF7B fz32 fontBold textCenter"
@click="AddPassengers">
添加乘机人
</view>
<view v-if="GuestList.length==0" class="MB255"></view>
</view>
</view>
<view class="airTicketDetailsInstructionsBox MT15" style="display: none;">
<img class="inlineblock" mode="widthFix" style="width: 125rpx;height: 30rpx;"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696821283000_148.png"/>
<view class="airTicketDetailsInstructions MT15 fz24">
本模块为保险投保页面,由明亚保险经纪股份有限公司管理运
营。请仔细阅读客户通知书、保险代理协议、投保须知及条款
等重要内容。为保障你的权益,我们将会安全记录你的操作。本模
块为保险投保页面,由明亚保险经纪股份有限公司管理运营。请
仔细阅读客户通知书、保险代理协议、投保须知及条款等重要内容
。为保障你的权益,我们将会安全记录你的操作。本模块为保险投
保页面,由明亚保险经纪股份有限公司管理运营。请仔细阅读客户通知
书、保险代理协议、投保须知及条款等重要内容。为保障你的权益,我
们将会安全记录你的操作。本模块为保险投保页面,由明亚保险经纪股份
有限公司管理运营。请仔细阅读客户通知书、保险代理协议、投保须知及
条款等重要内容。为保障你的权益,我们将会安全记录你的操作。
</view>
</view>
</template>
</view>
</scroll-view>
<view class="airTicketDetailsFooter fixedFooter bgFFF fixed row-sb-n z-index2">
<view class="airTicketDetailsFooter fixedFooter bgFFF fixed row-sb-n z-index2"
v-if="orderMsg.Unit_Price>0&&B2BSellNum>0">
<view class="row-aic-n">
<text class="airTicketDetailsFooter-text fz32 relative">价格</text>
<text class="airTicketDetailsFooter-text fz32 relative">
<!-- 价格 -->
合计
</text>
<text class="airTicketDetailsFooter-text fz32 ML10 relative"> ¥ </text>
<text class="ML10 fz52">3,200</text>
<text class="airTicketDetailsFooter-text fz26 ML10 relative">/人</text>
<text class="ML10 fz52">
<!-- {{orderMsg.Unit_Price}} -->
{{orderMsg.PreferPrice}}
</text>
<!-- <text class="airTicketDetailsFooter-text fz26 ML10 relative">
/人 -->
</text>
</view>
<view class="row-acje">
<view class="airTicketDetailsFooter-order bgDEBF7B row-ajc-w fontBold">
<view class="airTicketDetailsFooter-order row-ajc-w bgDEBF7B fontBold"
v-if="!loading&&orderMsg.ManNum>0&&orderMsg.ContactMobile" @click="SubmitOrder">
<text class="fz32">立即下单</text>
</view>
<view v-else class="airTicketDetailsFooter-order row-ajc-w bgF5 fontBold">
<text class="fz32">立即下单</text>
</view>
</view>
......@@ -88,6 +96,7 @@
import AirTicketHeader from "./components/airTicketHeader.vue";
import NavigationHeader from "./components/NavigationHeader.vue";
import AirTicketDetails from "./components/airTicketDetails.vue";
import { gegerateDates,getBeforeDate,getDateWeek } from "./dates.js";
export default {
components: {
AirTicketHeader,
......@@ -96,28 +105,73 @@
},
data() {
return {
orderInfo: {},
orderMsg:{
OrderId: 0,
TCID: 0,
CustomerId: 0,//同行Id
ManNum: 0,
BabyNum: 0,
GuestNum: 0,//总人数
YSeatNum: 0,//经济舱
FSeatNum: 0,//头等舱
ESeatNum: 0,//商务舱
OrderSource: 5,
Unit_Price: 0,
PreferPrice: 0,//应收
GuestList:[
// {SurName:'',PassportNo:'',IdCard:'',MobilePhone:''}
],
ContactMobile: '',
PlaceOrderFrom: 2,
CreateBy: 0,//销售id
},
B2BSellNum: 0,
BabyPrecent: 0,
NewDetailsList:[],
DetailsList:[],
loading: false,
Mobile: '',
riderList: [
{ value: 0, text: "篮球" },
{ value: 1, text: "足球" },
{ value: 2, text: "游泳" },
],
dataList:[
{
show:true
},
{
show:false
},
],
GuestList: [],
topheight:0,
titleStyle:{},
boxOption: 0,
title: '填写下单信息'
title: '填写下单信息',
isToken: false,
U:{},
Ub2b:{},
options: [{
text: '编辑',
style: {
backgroundColor: '#DEBF7B'
}
},
{
text: '删除',
style: {
backgroundColor: '#f5f5f5',
color:'#DEBF7B'
}
}
],
isOpened: 'right',
}
},
onLoad(options){
this.orderMsg.OrderId = options.OrderId?options.OrderId:0
this.orderMsg.TCID = options.TCID
this.orderMsg.Unit_Price = Number(options.Price)
this.U = uni.getStorageSync("mall_UserInfo")
this.Ub2b = uni.getStorageSync("b2b_user")
if(this.U&&this.U.Token){
this.isToken = true
}
if(this.Ub2b&&this.Ub2b.customerId){
this.orderMsg.CreateBy = this.Ub2b.salesBaseInfo.employeeId
this.orderMsg.CustomerId = this.Ub2b.customerId
}
this.getDetails()
let that = this;
uni.getSystemInfo({
success(res) {
......@@ -130,11 +184,303 @@
},
});
},
created() {},
created() {
},
watch: {
GuestList:{
handler(newVal, oldval) {
newVal.forEach(x=>{
let obj = {
SurName: x.SurName,
PassportNo: x.PassportNo,
IdCard: x.IdCard,
MobilePhone: x.MobilePhone
}
this.orderMsg.GuestList.push(obj)
})
}
},
orderMsg:{
handler(newVal, oldval) {
},
deep: true,
immediate: true
},
"orderMsg.GuestNum":{
handler(newVal, oldval) {
if(this.BabyPrecent>0){
this.getPrice()
}
},
deep: true,
immediate: true
},
BabyPrecent:{
handler(newVal, oldval) {
this.getPrice()
},
deep: true,
immediate: true
}
},
onShow() {
this.getGuestList()
},
mounted() {
},
methods: {
// 计算人数
getGuestList(){
let GuestList = uni.getStorageSync("GuestList")
this.GuestList = GuestList?GuestList:[]
let resultMan = this.GuestList.filter(x=>{
return x.GuestNum==1
})
let resultBab = this.GuestList.filter(x=>{
return x.GuestNum==2
})
this.orderMsg.ManNum = resultMan.length
this.orderMsg.BabyNum = resultBab.length
this.orderMsg.GuestNum = this.orderMsg.ManNum+this.orderMsg.BabyNum
},
// 计算金额及座位
getPrice(){
this.orderMsg.PreferPrice = 0
this.orderMsg.YSeatNum = 0
let YSeatNum = this.orderMsg.ManNum
let computeBabyNum = this.orderMsg.ManNum - this.orderMsg.BabyNum
let money = this.orderMsg.Unit_Price * this.orderMsg.ManNum;
if((computeBabyNum==0||computeBabyNum<0||computeBabyNum>0)&&this.orderMsg.BabyNum>0){
if(computeBabyNum==0) money += (this.orderMsg.Unit_Price * this.orderMsg.BabyNum)*(this.BabyPrecent/100)
if(computeBabyNum<0) {
money += (this.orderMsg.Unit_Price * this.orderMsg.ManNum)*(this.BabyPrecent/100)
money += (this.orderMsg.Unit_Price*(computeBabyNum*-1))*(50/100)
YSeatNum += (computeBabyNum*-1)
}
if(computeBabyNum>0) money += (this.orderMsg.Unit_Price * this.orderMsg.BabyNum)*(this.BabyPrecent/100)
}
this.orderMsg.PreferPrice = money
this.orderMsg.YSeatNum = YSeatNum
},
// 编辑删除
bindClick(index,index1) {
if(!index1){
uni.navigateTo({
url: `/pages/airTicket/AirplanePassengerAddEditing?editorIndex=${index}`
});
}else{
this.GuestList.splice(index, 1)
uni.setStorageSync("GuestList",this.GuestList)
this.getGuestList()
}
},
open(index) {
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
// 原本为'false',再次设置为'false'会无效
this.GuestList[index].show = true;
this.GuestList.map((val, idx) => {
if(index != idx) this.GuestList[idx].show = false;
})
this.$forceUpdate();
},
SubmitOrder(){
if(this.orderMsg.GuestList.length==0){
uni.showToast({
title: '添加乘机人',
icon: 'none',
mask: true
});
return
}
if(this.orderMsg.GuestList.length==0){
uni.showToast({
title: '添加乘机人',
icon: 'none',
mask: true
});
return
}
if(!this.orderMsg.ContactMobile||(this.orderMsg.ContactMobile.length>0&&this.orderMsg.ContactMobile.length!=11)){
uni.showToast({
title: '请输入正确联系电话',
icon: 'none',
mask: true
});
return
}
uni.showLoading()
this.loading = true
this.apipost("sellorder_post_SetOrderInfoForAirTicket",this.orderMsg,
(res) => {
if(res.resultCode==1){
this.queren(res.data)
}
this.loading = false
uni.hideLoading()
})
},
//微信支付
queren(OrderId) {
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}`;
// GoodsName = GoodsName.slice(0, 10);
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.Pay(OrderId);
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) {
console.log("success", res);
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url:
"/pages/jiuzhai/paysuccess?PreferPrice=" +
this.orderMsg.PreferPrice +
"&isFrom=3",
});
}, 100);
},
fail: function (err) {
console.log("fail:", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/airTicket/TicketOrderList?orderId=" + OrderId,
});
}, 100);
},
});
},
getDetails(){
uni.showLoading()
this.apipost("AirTicket_get_GetTicketDetails",{
TCID: this.orderMsg.TCID
},
(res) => {
if(res.resultCode==1){
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){
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)
}
}
this.loading = false
uni.hideLoading()
})
},
AddPassengers(){
uni.navigateTo({
url: '/pages/airTicket/AirplanePassengerList'
url: `/pages/airTicket/AirplanePassengerAddEditing`///pages/airTicket/AirplanePassengerList
});
},
scroll(e) {
......
......@@ -29,7 +29,7 @@
<img class="inlineblock MR10" mode="widthFix" style="width: 18rpx;height: 22rpx"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696743247000_254.png"/>
<text class="StartStopAddressText fz30 fontBold"
:class="[!OriginAddress.DepartCityName?'color9999A5':'']">
:class="[!OriginAddress.ArriveCityName?'color9999A5':'']">
{{OriginAddress.ArriveCityName?OriginAddress.ArriveCityName:'选择目的地'}}
</text>
</view>
......@@ -40,7 +40,8 @@
</view>
<view class="DepartureTime column">
<text class="fz24 color9999A6">出发时间</text>
<text class="fz30 fontBold MT31 MB20">
<text class="fz30 fontBold MT31 MB20"
:class="[StartDateObj.math?'':'color9999A5']">
<template v-if="StartDateObj.math">
{{StartDateObj.math}}{{StartDateObj.date}}日(周{{StartDateObj.week}})
</template>
......@@ -52,8 +53,9 @@
<view class="DepartureTimeList row-sb-n">
<view style="width: 590rpx;overflow: hidden;">
<scroll-view scroll-x style="width:100%;white-space: nowrap;">
<view class="row-aic-n">
<template v-for="(item,index) in NewDateList">
<view
:class="[NewDateList&&NewDateList.length>0?'row-aic-n':'row-w']">
<template v-if="NewDateList&&NewDateList.length>0" v-for="(item,index) in NewDateList">
<view class="DepartureTimeListC flexS column-ajc fz20"
:class="[StartDateObj.times==item.times?'bgE1C278':'active']"
@click="clickSearch(item,1)">
......@@ -65,6 +67,13 @@
</text>
</view>
</template>
<view v-if="NewDateList.length==0" class="DepartureTimeListC flexS column-ajc fz20" style="width: 100%;">
<text></text>
<text class="MT10 MB10"></text>
<text class="fz26 color9999A5">
无可选日期
</text>
</view>
</view>
</scroll-view>
</view>
......@@ -200,9 +209,9 @@
onLoad(options){
if(options.data){
let obj = JSON.parse(options.data)
this.OriginAddress.DepartCityName = obj.DepartCityName,
// this.OriginAddress.DepartCityName = obj.DepartCityName,
this.msg.DepartCityId = this.OriginAddress.DepartCityId = obj.DepartCityId,
this.OriginAddress.ArriveCityName = obj.ArriveCityName,
// this.OriginAddress.ArriveCityName = obj.ArriveCityName,
this.msg.ArriveCityId = this.OriginAddress.DepartCityId = obj.ArriveCityId
}
this.U = uni.getStorageSync("mall_UserInfo")
......@@ -234,7 +243,6 @@
this.msg.DepartCityId = this.OriginAddress.DepartCityId
this.msg.ArriveCityId = this.OriginAddress.ArriveCityId
}
},
RenewalAddres(SelectObj,AddressType){
if(AddressType==1){
......@@ -245,6 +253,7 @@
this.msg.ArriveCityId = this.OriginAddress.ArriveCityId = SelectObj.ID
}
this.showAddressPreviwe = false
this.getDataList()
},
//滚动加载
lower(e) {
......@@ -264,8 +273,15 @@
// this.pageCount = res.data.pageCount
this.NewDateList = []
this.dataList = res.data
let arr = function(list){
list.forEach(x=>{
x.Price = 0
})
}
arr(this.dataList)
this.dateList.forEach(x => {
this.dataList.forEach(y=>{
y.Price = this.isToken?y.B2BPrice:y.B2CPrice
y.NewFlightList = []
if(y.FlightList.length>0&&y.FlightList.length<3){
y.FlightList.forEach(z=>{
......@@ -297,10 +313,11 @@
}
})
});
this.StartDateObj = this.NewDateList[0]
this.NewDataList = this.dataList.filter(x=> {
return x.FlightDate==this.NewDateList[0].times
})
this.NewDataList = JSON.parse(JSON.stringify(this.dataList))
// this.StartDateObj = this.NewDateList[0]
// this.NewDataList = this.dataList.filter(x=> {
// return x.FlightDate==this.NewDateList[0].times
// })
}
uni.hideLoading()
});
......@@ -326,16 +343,24 @@
},
clickSearch(item,type){
if(type==1){
uni.showLoading()
if(this.StartDateObj.times==item.times){
this.StartDateObj = {}
this.NewDataList = JSON.parse(JSON.stringify(this.dataList))
setTimeout(()=>{
uni.hideLoading()
},500)
}else{
this.StartDateObj = item
this.msg.StartDate = item.times
this.NewDataList = this.dataList.filter(x=> {
return x.FlightDate==item.times
})
setTimeout(()=>{
uni.hideLoading()
},500)
}
}else{
this.activeId = item
}
......@@ -355,6 +380,18 @@
if(res.resultCode==1){
this.DepartureCityList = res.data.DepartureCityList
this.ArrivalCity = res.data.ArrivalCity
if(this.msg.DepartCityId){
let DepartCityName = this.DepartureCityList.filter(x=>{
return x.ID==this.msg.DepartCityId
})
this.OriginAddress.DepartCityName = DepartCityName[0].Name
}
if(this.msg.ArriveCityId){
let ArriveCityName = this.ArrivalCity.filter(x=>{
return x.ID==this.msg.ArriveCityId
})
this.OriginAddress.ArriveCityName = ArriveCityName[0].Name
}
}
});
},
......
......@@ -71,9 +71,16 @@
},
methods: {
getAddress(item){
this.SelectObj = {
Name: item.Name,
ID: item.ID,
if(item.ID==this.SelectObj.ID){
this.SelectObj = {
Name: '',
ID: 0,
}
}else{
this.SelectObj = {
Name: item.Name,
ID: item.ID,
}
}
this.$emit('RenewalAddres',this.SelectObj ,this.AddressType)
// this.$forceUpdate()
......
......@@ -6,32 +6,33 @@
<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>09-30</text> <text class="ML10">周六</text>
<text>{{items.time}}</text> <text class="ML10">周{{items.week}}</text>
</view>
<view class="fz28 color111 ML31">
总时长 5h
总时长 {{items.duration}}
</view>
</view>
<view 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>
<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 2"
<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">
10-01 周日
{{item.time}} 周{{item.week}}
</text>
<view class="airTicketDetailsCard-timeL column flexS MR20 textRight">
<view v-if="index==0" class="fz28 fontBold relative relativeFT10">09:00 </view>
<view v-if="index==1" class="MT25 fz28 fontBold">
11:30
<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">
......@@ -49,33 +50,38 @@
</view>
</view>
<view class="column flexG relative">
<view v-if="index==1" class="airTicketDetailsCard-ZhuanNum bgE1C278 fz18 colorFFF absolute">转+2</view>
<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="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696749257000_469.png"/>
:src="item.AlImage"/>
<view class="flexG">
<text class="block width100One overflow fz20 ML5 color9999A5 fontWeight400">东航 CA1852 </text>
<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">CTU 双流机场 T2</text>
<text class="block width100One hidden">{{item.DepartureName}} {{item.dName}}</text>
</view>
<view class="fz28 fontBold MT25" v-if="index==1">
<text class="block width100One hidden">PEK 首都机场 T3</text>
<text class="block width100One hidden">{{item.ArrivalCityName}} {{item.aName}}</text>
</view>
</view>
</view>
</view>
<view class="MT60 PX50"
:class="[index!=1?'MB50':'']" v-if="items.show">
<view class="row-aic-n MB70 relative" v-for="(item,index) in 3">
<text v-if="index==2" class="fz18 fontWeight400 colorFF5858 absolute airTicketDetailsCard-timeT">
10-01 周日
<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']">09:00 </view>
<view class="MT35" :class="[index!=2?'fz24':'fz28 fontBold']">
11:30
<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">
......@@ -86,35 +92,39 @@
<view class="bgE1C278 absolute WH6R50 airTicketDetailsCard-LinT3"></view>
</template>
<view class="bgE1C278 absolute WH12R50 airTicketDetailsCard-LinB"></view>
<template v-if="index!=2">
<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>
<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="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696749257000_469.png"/>
:src="item.AlImage"/>
<view class="flexG">
<text class="block width100One overflow fz20 ML5 color9999A5 fontWeight400">东航 CA1852 </text>
<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">CTU 双流机场 T2</text>
<text class="block width100One hidden">{{item.DepartureName}} {{item.dName}} </text>
</view>
<view class="fz28 fontBold MT25">
<text class="block width100One hidden">PEK 首都机场 T3</text>
<text class="block width100One hidden">{{item.ArrivalCityName}} {{item.aName}} </text>
</view>
</view>
</view>
</view>
</template>
</view>
</view>
</view>
</template>
<script>
export default {
props:['DetailsList'],
components: {
},
......@@ -132,6 +142,15 @@
},
onLoad(options){
},
watch: {
DetailsList:{
handler(newVal, oldval) {
this.dataList = JSON.parse(JSON.stringify(this.DetailsList))
},
deep: true,
immediate: true
}
},
created() {},
methods: {
......
......@@ -75,11 +75,11 @@
<view class="FlightDirection-Price flexS column">
<view class="colorC09D4F fontBold row-aic-n MT25">
<view class="FlightDirection-Price-symbol MR10">
<text class="fz20 relative" v-if="(isToken?item.B2BPrice:item.B2CPrice)>0">¥</text>
<text class="fz20 relative" v-if="item.Price>0">¥</text>
</view>
<text :class="[(isToken?item.B2BPrice:item.B2CPrice)>0?'fz36':'fz22 fontWeight400']">
<template v-if="(isToken?item.B2BPrice:item.B2CPrice)>0">
{{isToken?item.B2BPrice:item.B2CPrice}}
<text :class="[item.Price>0?'fz36':'fz22 fontWeight400']">
<template v-if="item.Price>0">
{{item.Price}}
</template>
<template v-else>暂无报价</template>
</text>
......@@ -88,7 +88,7 @@
<text class="FlightDirection-zhang border1 borde fz18"
:class="[item.B2BSellNum>0?'borderFF5858 colorFF5858':'borderF5 color9999A5']">
<template v-if="item.B2BSellNum>0">{{item.B2BSellNum}}</template>
<template v-if="(isToken?item.B2BPrice:item.B2CPrice)>0&&item.B2BSellNum==0">售罄</template>
<template v-if="item.Price>0&&item.B2BSellNum==0">售罄</template>
</text>
</view>
</view>
......@@ -109,10 +109,9 @@
},
created() {},
methods: {
getPriceDetail(item){
uni.navigateTo({
url: '/pages/airTicket/airTicketDetails'
url: `/pages/airTicket/airTicketDetails?TCID=${item.TCID}&Price=${item.Price}`
});
},
}
......
......@@ -168,4 +168,33 @@ export const formatDate = (date, fmt) => {
else{week = '日'}
return week;
}
// 根据身份证获取生日 年龄 性别
export const parseIDCard = (idCard)=> {
// 正则表达式匹配身份证号格式
var reg = /^\d{17}[\dXx]$/;
if (reg.test(idCard)) {
// 提取出生日期
var birthday = idCard.substring(6, 14);
var year = birthday.substring(0, 4);
var month = birthday.substring(4, 6);
var day = birthday.substring(6, 8);
// 计算年龄
var currentYear = new Date().getFullYear();
var age = currentYear - parseInt(year);
// 提取性别
var genderCode = parseInt(idCard.charAt(16));
var gender = genderCode % 2 === 0 ? "女" : "男";
return {
birthday: year + "-" + month + "-" + day,
age: age,
gender: gender
};
}
return null; // 身份证号格式不正确
}
\ 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