Commit 29784e70 authored by 华国豪's avatar 华国豪 🙄

引入拼音JS

parent 6067a0e8
var util = require('../../utils/util.js')
Component({
/**
* 组件的属性列表
*/
properties: {
dateData: {
type: Array
},
day: {
type: String
}
},
/**
* 组件的初始数据
*/
data: {
week: ['日', '一', '二', '三', '四', '五', '六'],
priceData: [],
DaysInMonth: [],
daysData: [],
isSelect: -1,
mydate: -1,
today_after7: util.AddDays(new Date().Format("yyyy-MM-dd"), 7),
dateIndex: -1,
},
/**
* 组件的方法列表
*/
methods: {
selectDate(e) {
let item = e.currentTarget.dataset.item;
let index = e.currentTarget.dataset.index;
if (this.data.daysData[index].price == "0.00" || this.data.daysData[index].price == "") {
return;
} else {
this.setData({
dateIndex: index
})
this.triggerEvent('childrenEvent', this.data.daysData[index]);
}
},
getYearMonthDay(list) {
this.setData({
priceData: list[0]
})
let day = this.data.day;
let currentYear = day.substring(0, 4); //当前年份
let currentMonth = day.substring(5, 7); //当前月份
let date = new Date();
let strDate = date.getDate();
let strMonth = (date.getMonth() + 1).toString();
// alert(typeof strMonth)
//判断是否是闰年
if (this.isleapYears(currentYear)) {
this.setData({
DaysInMonth: [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
})
} else {
this.setData({
DaysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
})
}
let monthDay = this.data.DaysInMonth[Number(currentMonth) - 1];//当前月的天数
let daysData = [];
//给数据源赋值
for (let i = 0; i < Number(monthDay); i++) {
var priceDict = { 'day': String(i + 1), 'price': 0, 'dis': false, date_str: '', priceId: "" };
daysData.push(priceDict);
}
console.log(monthDay)
this.setData({
daysData: daysData
})
var currentDay = `${currentYear}-${currentMonth}-01`;
var dateObject = new Date(currentDay);
var firstDay = dateObject.getDay();//得到每个月1号是周几
let today = new Date().Format("yyyy-MM-dd");
for (let i = 0; i < this.data.priceData.length; i++) {
let price = this.data.priceData[i];
let dateStr = new Date(price.dateStr).Format("yyyy-MM-dd");
var dayIndex = price.dateStr.substring(price.dateStr.length - 2, price.dateStr.length);
var dayDict = daysData[Number(dayIndex) - 1];
if (price.dateStr < this.data.today_after7) {
dayDict.price = '';
} else {
dayDict.price = price.price;
dayDict.priceId = price.priceId;
}
dayDict.date_str = price.dateStr;
if (dayIndex < strDate && strMonth == currentMonth) {
dayDict.price = '';
}
}
if (firstDay > 0) {
var firstDayData = [];
for (var i = 0; i < firstDay; i++) {
var dict = { 'day': ' ', price: '', 'dis': true };
firstDayData.push(dict);
}
this.setData({
daysData: firstDayData.concat(daysData)
})
} else {
this.setData({
daysData: daysData
})
}
},
isleapYears(year) {
if (((year % 4) == 0) && ((year % 100) != 0) || ((year % 400) == 0)) {
return true;
} else {
return false;
}
},
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="newcalendar-box" id='calendar'>
<view class="calendar">
<view class="Head">
<text wx:for="{{week}}" wx:key="index">{{item}}</text>
</view>
</view>
<view class="dayView">
<view bindtap="selectDate" data-item="{{item}}" data-index="{{index}}" class="{{item.price == '0.00' ? 'grey':'black'}} {{dateIndex==index ? 'Active' :''}} {{(item.price==''||item.price==0)?'grey':'black'}}" wx:for="{{daysData}}" wx:key="index">
<view hidden="{{item.day=='0 '}}">{{item.day}}</view>
<view hidden="{{item.price==''||item.price==0 ||!item.price}}" class="price">¥{{item.price}}</view>
</view>
</view>
</view>
\ No newline at end of file
.Head text{
width: 107rpx;
height: 80rpx;
display: inline-block;
line-height: 80rpx;
text-align: center;
font-size: 30rpx;
}
.Active{
background: #ff4646;
color: #fff!important;
}
.dayView>view{
width: 107rpx;
height: 80rpx;
display: inline-flex;
flex-direction: column;
align-items: center;
font-size: 30rpx;
}
.dayView{
min-height: 300rpx;
}
.dayView .black{
color:#333333;
}
.dayView .grey{
color:#CCCCCC;
}
.dayView .price{
font-size: 20rpx;
}
\ No newline at end of file
let app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
personNum: {
ManNum: 0,
ChirdNum: 0,
BabyNum: 0,
OldPeopleNum: 0,
GuestList: [],
PreferPrice: 0,//应收总金额,
ContactMobile: '',
ContactEmail: '',
ContactName: '',
EnterID: 0,
CustomerId: 0,
PlaceOrderFrom: 1,
OrderForm: 7,
OrderSource: 2,
},
cr:0,
et:0,
ye:0,
lr:0,
allPP: 0,
userInfo: {},
isLogin: app.isLogin,
editIndex: -1,
details: {},
price: 0,
allPrice: 0,
detailShow: false,
priceShow: false,
},
// 价格详情
priceBoxShow: function () {
this.setData({
priceShow: !this.data.priceShow,
})
},
// 详情弹窗
closeDetail: function (){
this.setData({
detailShow: !this.data.detailShow,
})
},
//联系人信息填写
lianxirenChange: function (e) {
let name = e.currentTarget.dataset.type
this.data.personNum[name] = e.detail.value
this.setData({
personNum: this.data.personNum
})
},
// 增加完事后 变动价格数据
setPrice: function (){
// ageType 1 成年 2小孩 3婴儿 4老人
let cr = 0, et = 0, ye = 0,lr = 0;
let ppList = this.data.personNum.GuestList;
for (let i = 0; i < ppList.length; i++) {
if (ppList[i].ageType == 0) {
cr = cr + 1
} else if (ppList[i].ageType == 1) {
et = et + 1
} else if (ppList[i].ageType == 2) {
ye = ye + 1
} else if (ppList[i].ageType == 3) {
lr = lr + 1
}
}
this.setData({
cr: cr,
et: et,
ye: ye,
lr: lr,
allPP: cr + et + lr,
allPrice: (cr + et + lr) * this.data.price
})
},
// 付款生成订单按钮
StartYd: function () {
let msg = this.data.personNum
if (this.data.allPP < 1) {
wx.showToast({
title: '请添加乘机人',
icon: 'none',
duration: 1000
})
return
}
if (msg.ContactName == "") {
wx.showToast({
title: '请填写联系人',
icon: 'none',
duration: 1000
})
return
}
if (msg.ContactMobile == "") {
wx.showToast({
title: '请填写联系人手机号码',
icon: 'none',
duration: 1000
})
return
}
msg.ManNum = this.data.cr
msg.ChirdNum = this.data.et
msg.BabyNum = this.data.ye
msg.OldPeopleNum = this.data.lr
msg.GuestNum = this.data.allPP + this.data.ye
msg.seatNum = this.data.allPP
msg.PreferPrice = this.data.allPP * this.data.price
for (let i = 0; i < msg.GuestList.length; i++){
msg.GuestList[i].airOrderId = msg.airOrderId
msg.GuestList[i].airProductId = msg.airProductId
}
console.log(msg)
app.$api('sellorder_post_SetOrderInfoForAirTicket', msg).then(res => {
console.log(res)
}).catch(err => { });
},
// deletePP 删除乘机人
deletePP: function (e){
let index = Number(e.currentTarget.dataset.index);
let pp = this.data.personNum.GuestList[index];
let _this = this;
wx.showModal({
title: '是否删除“' + pp.SurName + pp.Name +'”',
content: '删除后不可恢复',
success(res) {
if (res.confirm) {
_this.data.personNum.GuestList.splice(index, 1)
_this.setData({
personNum: _this.data.personNum
})
_this.setPrice()
} else if (res.cancel) {
}
}
})
},
//addPP 添加乘机人
addPP: function () {
// if (this.data.allPP == this.data.details.residue) {
// wx.showToast({
// title: '位置不够了~',
// icon: 'none',
// duration: 1000
// })
// return
// }
wx.navigateTo({
url: '/pages/Ticket/TicketSetpp/TicketSetpp?edit=' + 0 + '&app=' + this.data.allPP + '&residue=' + this.data.details.residue,
})
this.setData({
editIndex: -1
})
wx.removeStorage({
key: 'Addppdate',
success: function (res) { },
})
},
// 修改乘机人
editPP: function (e){
let index = Number(e.currentTarget.dataset.index)
this.setData({
editIndex: index
})
wx.removeStorage({
key: 'Addppdate',
success: function(res) {},
})
wx.setStorage({
key: "ppdate",
data: this.data.personNum.GuestList[index]
})
wx.navigateTo({
url: '/pages/Ticket/TicketSetpp/TicketSetpp?edit=' + 1 + '&app=' + this.data.allPP + '&residue=' + this.data.details.residue,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.removeStorage({
key: 'Addppdate',
success: function (res) { },
})
console.log(options)
let userInfo = wx.getStorageSync('admin');
this.setData({
userInfo: userInfo,
"personNum.CustomerId": userInfo.id
})
app.$api('sell_get_GetCustomerToSellInfo', {}).then(res => {
this.setData({
"personNum.EnterID": res[0].EmployeeId
})
}).catch(err => { });
this.getDetails(options.id)
},
// 获取机票详情
getDetails: function (id) {
app.$apiJavaNew('/api/dmc/airticket/getB2BAirticketInfo', { AirTicketId: id}).then(res => {
let data = res
this.setData({
details: res,
"personNum.airProductId": data.airProductId,
"personNum.airTicketId": data.id,
"personNum.departureCityId": data.departure_city,
"personNum.Unit_Price": this.isLogin ? data.scatterB2BPrice : data.scatterB2CPrice,// 成交单价
"personNum.TC_Price": this.isLogin ? data.scatterB2BPrice : data.scatterB2CPrice,//机票单价
"personNum.returnArriveCityId": data.arrival_city,
"personNum.TCID": data.tCID,
"personNum.FreightSpace": data.freightSpace,
"personNum.GoCityTime": data.goFlightTime,
"personNum.BackCityTime": data.backFlightTime,
"perSonNum.PreferPrice": this.isLogin ? data.scatterB2BPrice : data.scatterB2CPrice,
price: this.isLogin ? data.scatterB2BPrice : data.scatterB2CPrice,
})
}).catch(err => {})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let _this = this
wx.getStorage({
key: 'Addppdate',
success(res) {
console.log(res)
let data = res.data
if (_this.data.editIndex == -1) { // 新增
_this.data.personNum.GuestList.push(data)
_this.setData({
personNum: _this.data.personNum
})
} else { // 修改
_this.data.personNum.GuestList[_this.data.editIndex] = data
_this.setData({
personNum: _this.data.personNum
})
}
_this.setPrice()
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class='commonF TicketOrder'>
<scroll-view style='height: calc(100vh - 100rpx);' scroll-y>
<view class='top-box'>
<view class='tit flex-ter' bindtap='closeDetail'>
<view class='flex-ter'>
<text class='f22 cee type mg-r10'>去</text>
<text class='f28 c11 mg-r30'>{{details.goFlightTime}} {{details.goStartHouseTime}}</text>
<text class='f22 cee type mg-r10'>返</text>
<text class='f28 c11'>{{details.backFlightTime}} {{details.backEndHouseTime}}</text>
</view>
<image src='../../../images/ticket/right_arr.png'></image>
</view>
<view class='info flex-ter f26 c66'>
<view>
<!-- <view>退票1000元起,不得改期 | 有免费托运行李额</view> -->
<view>含税价:成人¥{{price}} 儿童¥{{price}} 老人¥{{price}}</view>
</view>
<view class='residue'>
余票:{{details.residue}}
</view>
<!-- <image src='../../../images/ticket/right_arr.png'></image> -->
</view>
</view>
<view class='xuanzeren addpeople-btn'>
<view class='renshu'>
<text class='f30 c11'>选择乘机人</text>
<text class='f22 c99'>成人{{cr}}人,儿童{{et}}人,婴儿{{ye}}人,老人{{lr}}人</text>
</view>
<view class='pp-box'>
<view class='pp-item c99 f28' wx:for="{{personNum.GuestList}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view>
<text>{{item.SurName + item.Name}}</text>
<text class='f26'>{{item.PassportNo}}</text>
</view>
<view>
<image bindtap='editPP' data-index='{{index}}' src='../../../images/memberInfo/qianbi.png'></image>
<image bindtap='deletePP' class='' data-index='{{index}}' src='../../../images/product/ico_clear.png'></image>
</view>
</view>
<view class='btn'>
<view bindtap='addPP'>
<image src='../../../images/visa/addren.png'></image>
<text>添加乘机人</text>
</view>
</view>
</view>
</view>
<view class='peisong'>
<view class='tit'>
<text class='f30'>联系人信息</text>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>联系人</text>
<input class='f24 ' placeholder='请输入联系人名称' data-type="ContactName" bindinput='lianxirenChange'></input>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>手机号码</text>
<text class='f24 c11 mg10'>+86</text>
<input class='f24 ' type='number' data-type="ContactMobile" bindinput='lianxirenChange' placeholder='请输入联系人电话'></input>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>电子邮件</text>
<input class='f24 ' type='text' data-type="ContactEmail" bindinput='lianxirenChange' placeholder='用于接收确认单,非必填'></input>
</view>
</view>
</scroll-view>
<view class="PayView">
<view style="width:310rpx;">
<text class="f20">¥</text>
<text class="f46 cee">{{allPrice}}</text>
<text class="f20 c88">/元</text>
<text class='f22 c55 margin-left15' bindtap='priceBoxShow'>明细 ∧</text>
</view>
<view style="width:100rpx;border-left:1px solid #E9E9E9;padding-top:29rpx;">
<image style="width:45rpx;height:45rpx" src="/images/group/pay.png"></image>
</view>
<view bindtap='StartYd' class="startPay">去付款</view>
</view>
<!-- 飞机详情弹窗 -->
<view wx:if="{{detailShow}}" class='detail-box' bindtap='closeDetail'>
<view>
<image class='close-img' src='../../../images/ticket/close-img.png' catchtap="closeDetail"></image>
<view class='screen-box-top tct c11 f30'>
航班详情
</view>
</view>
<scroll-view scroll-y style='height: 750rpx;position:absolute;bottom:0;padding-bottom:30rpx;'>
<view class='detail-box-tit f22'>
<text class='cee'>去</text>
<text class='c11'>{{details.goFlightTime}} {{details.goStartCityName}}-{{details.goEndCityName}} 共{{details.goTotalTime}}</text>
</view>
<view wx:for="{{details.flightList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class='detail-box-item'>
<view class='detail-box-left'>
<view class='f30 c11 bold'>{{item.departuretime}}</view>
<view class='f24 cff'>3小时0分</view>
<view class='f30 c11 bold'>{{item.arrivaltime}}</view>
</view>
<view class='detail-box-right'>
<view class='f28 c11 bold margin-b10'>{{item.dIATA}} {{item.dName}}</view>
<view class='f24 c99 imgs-item'> <image src='{{details.airlineUrl}}'></image> {{item.alName}}</view>
<view class='f24 cff imgs-item'> 四川航空</view>
<!-- <image src='../../../images/ticket/dafeiji.png'></image> -->
<view class='f28 c11 bold margin-t10'>{{item.aIATA}} {{item.aName}}</view>
</view>
</view>
<view class='detail-box-zhuan f22' wx:if="{{index!==details.flightList.length -1}}">
<text class='cee'>中转</text>
<text class='c66'>{{item.arrivalCityName}}</text>
<text class='cee'>行李直达</text>
</view>
</view>
<view class='detail-box-tit f22 margin-top30'>
<text class='cee'>返</text>
<text class='c11'>{{details.backFlightTime}} {{details.backStartCityName}}-{{details.backEndCityName}} 共{{details.backTotalTime}}</text>
</view>
<view wx:for="{{details.backFlightList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class='detail-box-item'>
<view class='detail-box-left'>
<view class='f30 c11 bold'>{{item.departuretime}}</view>
<view class='f24 cff'>3小时0分</view>
<view class='f30 c11 bold'>{{item.arrivaltime}}</view>
</view>
<view class='detail-box-right'>
<view class='f28 c11 bold margin-b10'>{{item.dIATA}} {{item.dName}}</view>
<view class='f24 c99 imgs-item'> <image src='{{details.airlineUrl}}'></image> {{item.alName}}</view>
<view class='f24 cff imgs-item'> 四川航空</view>
<!-- <image src='../../../images/ticket/dafeiji.png'></image> -->
<view class='f28 c11 bold margin-t10'>{{item.aIATA}} {{item.aName}}</view>
</view>
</view>
<view class='detail-box-zhuan f22' wx:if="{{index!==details.backFlightList.length -1}}">
<text class='cee'>中转</text>
<text class='c66'>{{item.arrivalCityName}}</text>
<text class='cee'>行李直达</text>
</view>
</view>
</scroll-view>
</view>
<!-- 费用详情 -->
<view wx:if="{{priceShow}}" class='detail-box detail-box2' bindtap='priceBoxShow'>
<view>
<image class='close-img' src='../../../images/ticket/close-img.png' catchtap="priceBoxShow"></image>
<view class='screen-box-top tct c11 f30'>
费用明细
</view>
<view class='price-detai-box'>
<view class='c11 f26'>
<text>总金额:</text>
<text class='f24'>¥{{allPrice}}</text>
</view>
<view class='f22 c33' wx:if="{{cr>0}}">
<text>成人:</text>
<text class='f24'>¥{{price}}*{{cr}}</text>
</view>
<view class='f22 c33' wx:if="{{et>0}}">
<text>小孩:</text>
<text class='f24'>¥{{price}}*{{et}}</text>
</view>
<view class='f22 c33' wx:if="{{lr>0}}">
<text>老人:</text>
<text class='f24'>¥{{price}}*{{lr}}</text>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
.TicketOrder{
background-color: #f5f5f5;
}
.top-box{
margin: 30rpx;
border-radius:12rpx;
box-shadow:2px 2px 5px 0px rgba(76,76,76,0.15);
}
.top-box .tit{
padding: 20rpx 30rpx;
background-color: #F4F4F4;
justify-content: space-between;
}
.top-box .tit image,.info image{
width: 10rpx;
height: 21rpx;
}
.top-box .tit .type{
display: inline-block;
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background-color: #FAC7CB;
text-align: center;
line-height: 32rpx;
}
.mg-r10{
margin-right: 10rpx;
}
.mg-r30{
margin-right: 30rpx;
}
.info{
background-color: white;
padding: 30rpx;
justify-content: space-between;
}
.info>view>view:nth-child(1){
margin-bottom: 15rpx;
}
.xuanzeren{
padding: 30rpx;
background-color: white;
}
.xuanzeren text:nth-child(1) {
margin-right: 20rpx;
}
.addpeople-btn .btn{
display: flex;
justify-content: center;
margin-top: 20rpx;
}
.addpeople-btn view.btn view{
width:300rpx;
height:66rpx;
border:1px solid rgba(85, 151, 255, 1);
border-radius:12rpx;
font-size: 28rpx;
color: #5597FF;
display: flex;
align-items: center;
justify-content: center;
}
.addpeople-btn view.btn view image{
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
}
.pp-item{
display: flex;
align-items: center;
justify-content: space-between;
margin: 10rpx 0;
padding: 20rpx 0;
border-bottom: 1px solid #E9E9E9;
}
.pp-item image{
width: 30rpx;
height: 32rpx;
}
.pp-item image:nth-child(2){
width: 24rpx;
height: 32rpx;
margin-left: 20rpx;
}
.peisong{
background-color: white;
margin-top: 30rpx;
}
.peisong .tit>text:nth-child(1){
margin-right: 30rpx;
}
.peisong .tit,.peisong .tips,.peisong .info-item{
display: flex;
align-items: center;
padding: 30rpx;
}
.peisong .tips{
margin-top: 20rpx;
}
.tips-img{
width: 22rpx;
height: 22rpx;
margin-right: 10rpx;
}
.info-item .name,.fapiao-info-item .name{
display: inline-block;
width: 150rpx;
}
.PayView{
width:100%;
height:100rpx;
line-height:100rpx;
border-top:1px solid #E9E9E9;
display: flex;
align-items: center;
}
.PayView>view{
display: inline-flex;
justify-content: center;
height: 100%;
}
.startPay{
width:341rpx;
background:rgba(238,68,84,1);
color: #fff;
font-size: 30rpx;
}
.detail-box{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
background:rgba(17,17,17, .5);
z-index: 2;
}
.detail-box2{
height: calc(100% - 100rpx);
bottom: 100rpx
}
.detail-box.detail-box2>view{
height: 460rpx;
}
.detail-box>view{
height: 870rpx;
position: absolute;
bottom: 0;
width: 100%;
background-color: white;
}
.detail-box-tit{
background-color: #FFE9EB;
height: 30rpx;
line-height: 30rpx;
border-radius:12rpx 12rpx 0 0;
overflow: hidden;
margin-bottom: 30rpx;
}
.detail-box-tit text:nth-child(1) {
width: 30rpx;
text-align: center;
display: inline-block;
background:rgba(250,199,203,1);
margin-right: 20rpx;
}
.detail-box-item{
display: flex;
}
.detail-box-item .detail-box-left{
width: 25%;
border-right: 4rpx solid #E9E9E9;
padding-right: 30rpx;
text-align: right;
}
.detail-box-item .detail-box-left view:nth-child(2){
margin: 10rpx 0 37rpx 0;
}
.detail-box-item .detail-box-right{
flex: 1;
padding-left: 30rpx;
}
.detail-box-item .detail-box-right view.imgs-item{
display: flex;
align-items: center;
}
.detail-box-item .detail-box-right view.imgs-item image{
width: 24rpx;
height: 24rpx;
margin-right: 15rpx;
}
.margin-b10{
margin-bottom: 10rpx;
}
.margin-t10{
margin-top: 10rpx;
}
.detail-box-zhuan{
margin: 28rpx 0 28rpx 138rpx;
}
.detail-box-zhuan text:nth-child(2){
padding: 0 10rpx;
border-right: 1px solid #CCCCCC;
margin-right: 10rpx;
}
.margin-top30{
margin-top: 30rpx;
}
.margin-left15{
margin-left: 15rpx;
}
.close-img{
width: 30rpx;
height: 30rpx;
position: absolute;
right: 30rpx;
top: 30rpx;
}
.screen-box-top{
padding: 30rpx;
text-align: center;
}
.price-detai-box{
padding: 0 30rpx 30rpx 30rpx;
}
.price-detai-box>view{
display: flex;
align-items: center;
justify-content: space-between;
}
.residue{
background-color: #EE4454;
color: white;
padding: 0 10rpx;
border-radius: 6rpx;
}
\ No newline at end of file
let app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
info:{
ageType: "0",//1 成年 2小孩 3婴儿 4老人
airOrderId: 0,//机票订单id
airProductId: 0,//机票产品id
airProductId: '',//机票产品id
Birthday: '',//出生日期
MobilePhone: '',
SurName: '',
Name: "",
Nationality: 2,
PassportNo: "",//护照号码
Sex: '1',
PassportExpiry: "",
},
ppType: [
{
id: "1",
name: "成人"
},
{
id: "2",
name: "小孩"
},
{
id: "3",
name: "婴儿"
},
{
id: "4",
name: "老人"
},
],
ppTypeIndex: 0,
countroylist: [],
countroylistIndex: 0,
allpp: 0,
residue: 0,
},
lianxirenChange: function (e){
let name = e.currentTarget.dataset.type
this.data.info[name] = e.detail.value
this.setData({
info: this.data.info
})
},
//切换性别
changeSex:function(e){
let type = e.currentTarget.dataset.type
this.setData({
"info.Sex": type
})
},
// 添加人
addpp: function(e) {
let msg = this.data.info
console.log(msg)
let allpp = this.data.allpp + 1;
if (msg.ageType !== '2' && allpp > this.data.residue) {
wx.showToast({
title: '余票不够了',
icon: 'none',
duration: 1000
})
return
}
if (msg.Birthday == "") {
wx.showToast({
title: '请选择出生日期',
icon: 'none',
duration: 1000
})
return
}
if (msg.SurName == "" || msg.Name == "" ) {
wx.showToast({
title: '请填写姓或名',
icon: 'none',
duration: 1000
})
return
}
if (msg.PassportNo == "") {
wx.showToast({
title: '请填写护照信息',
icon: 'none',
duration: 1000
})
return
}
if (msg.PassportNo == "") {
wx.showToast({
title: '请选择证件有效期',
icon: 'none',
duration: 1000
})
return
}
if (msg.MobilePhone == "") {
wx.showToast({
title: '请输入手机号码',
icon: 'none',
duration: 1000
})
return
}
wx.setStorage({
key: "Addppdate",
data: msg
})
wx.navigateBack({
delta: 1 // 返回上一级页面。
})
},
bindDateChange(e) {
let t = e.currentTarget.dataset.type
if (t == 'b') {
this.setData({
'info.Birthday': e.detail.value
})
} else {
this.setData({
'info.PassportExpiry': e.detail.value
})
}
},
//类型切换
bindPickerChangeType: function (e) {
this.setData({
"info.ageType": e.detail.value,
ppTypeIndex: e.detail.value
})
},
// 国籍切换
bindPickerChangeCoun: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
"info.Nationality": this.data.countroylist[e.detail.value].ID,
countroylistIndex: e.detail.value
})
},
// 获取国籍
getcountroylist: function (){
app.$api('b2b_get_GetCountryForSMAirTick', {}).then(res => {
this.setData({
countroylist: res
})
}).catch(err => { });
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
let _this = this
this.setData({
allpp: Number(options.app),
residue: Number(options.residue)
})
if (options.edit == "0"){ // 新增
} else { // 修改
wx.getStorage({
key: 'ppdate',
success(res) {
console.log(res.data)
_this.setData({
info: res.data
})
}
})
}
wx.removeStorage({
key: 'ppdate',
success: function(res) {},
})
this.getcountroylist()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class='add commonF'>
<view class='saomiao'>
<view class='saomiao-box'>
<view class='f28 cee'>
<image src='../../../images/ticket/saomiao.png'></image>
<text>护照扫描</text>
</view>
<view class='f22 c99'>当前仅支持中国大陆护照</view>
</view>
</view>
<view class='cee f22 xiaotieshi'>
<view>
<text>小贴士:</text>
<text class='c11'>姓名需与乘机证件一致,否则会影响登记</text>
</view>
<view>护照填写规范{{'>'}}</view>
</view>
<view>
<view class='peisong'>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>类型</text>
<picker bindchange="bindPickerChangeType" value="{{info.ageType}}" range-key="name" range="{{ppType}}">
<view class="f24 c11">
{{ppType[info.ageType].name}}
</view>
</picker>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>中文姓</text>
<input class='f24 ' placeholder='请输入中文姓' value='{{info.SurName}}' data-type="SurName" bindinput='lianxirenChange'></input>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>中文名</text>
<input class='f24 ' placeholder='请输入中文名' value='{{info.Name}}' data-type="Name" bindinput='lianxirenChange'></input>
</view>
</view>
<view class='peisong'>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>性别</text>
<view class='sex-box f24' wx:if="{{info.Sex == '2'}}">
<view bindtap='changeSex' data-type='1'>
<image src='../../../images/ticket/man.png'></image>
<text class='c99 '>男</text>
</view>
<view>
<image src='../../../images/ticket/nv2.png'></image>
<text class='cee'>女</text>
</view>
</view>
<view class='sex-box f24' wx:else>
<view>
<image src='../../../images/ticket/man2.png'></image>
<text class='cee'>男</text>
</view>
<view bindtap='changeSex' data-type='2'>
<image src='../../../images/ticket/nv.png'></image>
<text class='c99'>女</text>
</view>
</view>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>出生日期</text>
<picker class="pcikerView" mode="date" bindchange="bindDateChange" data-type="b" value="{{info.Birthday}}">
<view class="picker f24 c11" wx:if="{{info.Birthday}}">
{{info.Birthday}}
</view>
<view class='f24 c88' wx:else>
请选择出生日期
</view>
</picker>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>国籍</text>
<picker bindchange="bindPickerChangeCoun" value="{{countroylistIndex}}" range-key="Name" range="{{countroylist}}">
<view class="f24 c11">
{{countroylist[countroylistIndex].Name}}
</view>
</picker>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>护照信息</text>
<input class='f24 ' placeholder='请输入护照号' value='{{info.PassportNo}}' data-type="PassportNo" bindinput='lianxirenChange'></input>
</view>
<view class='bb1e9 info-item'>
<text class='f30 name c11'>证件有效期</text>
<picker class="pcikerView" mode="date" bindchange="bindDateChange" data-type="p" value="{{info.PassportExpiry}}">
<view class="picker f24 c11" wx:if="{{info.PassportExpiry}}">
{{info.PassportExpiry}}
</view>
<view class='f24 c88' wx:else>
请选择有效期
</view>
</picker>
</view>
<view class='info-item'>
<text class='f26 name c11'>手机号码</text>
<text class='f24 c11 mg10'>+86</text>
<input class='f26' placeholder='请输入手机号码' value='{{info.MobilePhone}}' data-index="{{index}}" data-type="MobilePhone" bindinput='lianxirenChange'></input>
</view>
</view>
</view>
<view class='order-tips f20 c11'>
<view>点击确定表示您已阅读并同意以下内容</view>
<view class='c99'>根据实名制要求,购买机票需提交乘机人身份证信息,并在乘机时出具对应身
份证件用于验证,请确保录入信息真实有效。</view>
</view>
<view class='addpp'>
<view bindtap='addpp'>确定</view>
</view>
</view>
\ No newline at end of file
.add{
background-color: #f5f5f5 !important;
}
.saomiao{
margin: 30rpx;
}
.saomiao-box{
background:rgba(255,255,255,1);
border-radius:12rpx;
text-align: center;
padding: 20rpx 0;
}
.saomiao-box image{
width: 30rpx;
height: 28rpx;
}
.saomiao-box>view:nth-child(1){
display: flex;
align-items: center;
justify-content: center;
}
.xiaotieshi{
margin-top: 20rpx;
background-color: #FFE9EB;
display: flex;
align-items: center;
justify-content: space-between;
padding: 19rpx 30rpx;
}
.peisong{
background-color: white;
margin-bottom: 30rpx;
}
.peisong .tit>text:nth-child(1){
margin-right: 30rpx;
}
.peisong .tit,.peisong .tips,.peisong .info-item{
display: flex;
align-items: center;
padding: 30rpx;
}
.info-item .name,.fapiao-info-item .name{
display: inline-block;
width: 180rpx;
}
.picker{
width: 330rpx;
height: 54rpx;
line-height: 54rpx;
}
.order-tips{
padding: 0 30rpx 30rpx 30rpx;
}
.addpp{
padding:0 30rpx 30rpx 30rpx;
}
.addpp view{
text-align: center;
padding: 20rpx;
background:rgba(238,68,84,1);
border-radius:12rpx;
color: white;
}
.sex-box{
display: flex;
}
.sex-box>view{
width: 200rpx;
display: flex;
align-items: center;
}
.sex-box image{
width: 26rpx;
height: 30rpx;
margin-right: 10rpx;
}
\ No newline at end of file
......@@ -16,10 +16,19 @@ Page({
hotvisa: [],
isLogin: app.isLogin,
},
// 跳转详情
goDetailsPage: function (e) {
let id = encodeURIComponent(e.currentTarget.dataset.id)
wx.navigateTo({
url: '/pages/visa/visaDetails/visaDetails?id=' + id,
})
},
// 跳转签证列表页
goListPage: function () {
goListPage: function (e) {
let id = e.currentTarget.dataset.id ? e.currentTarget.dataset.id : ''
let path = id ? '/pages/visa/visaList/visaList?id=' + id : '/pages/visa/visaList/visaList'
wx.navigateTo({
url: '/pages/visa/visaList/visaList',
url: path,
})
},
// 限时优惠
......
......@@ -45,7 +45,7 @@
<text class="f30 bold">限时优惠</text>
</view>
<view class="VisaView">
<view class="VisaList XianItem" bindtap='goListPage' wx:for="{{timeList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="VisaList XianItem" bindtap='goDetailsPage' data-id='{{item.idDes}}' wx:for="{{timeList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<image src='http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190626102629935.png'></image>
<view class="XianDes">
<view>
......@@ -85,7 +85,7 @@
<text class="f24" style="color:#888888;float:right" bindtap='goListPage'>查看更多</text>
</view>
<view class="VisaView">
<view class="VisaList hotCountry" bindtap='goListPage' wx:for="{{hotcountry}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="VisaList hotCountry" bindtap='goListPage' data-id='{{item.id}}' wx:for="{{hotcountry}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<image src='{{item.countryImage[0]}}'></image>
<view class="CountryDes">
<image src='{{item.countryIcon}}'></image>
......@@ -99,7 +99,7 @@
<text class="f24" style="color:#888888;float:right" bindtap='goListPage'>查看更多</text>
</view>
<view class="VisaView" style='margin-left: -40rpx;'>
<view class="VisaList hotVisa" bindtap='goListPage' wx:for="{{hotvisa}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="VisaList hotVisa" bindtap='goDetailsPage' data-id='{{item.idDes}}' wx:for="{{hotvisa}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view style="width:142rpx;height:98rpx">
<image src='{{item.countryIcon}}'></image>
</view >
......
......@@ -188,11 +188,11 @@ Page({
})
},
// 获取签证国家
GetVisaCountry: function () {
GetVisaCountry: function (id) {
app.$apiJavaNew('api/b2b/visa/getVisaProductSearchItem', this.data.GetVisaCountryMsg).then(res => {
this.setData({
hotcountry: res.pageData,
CountryId: res.pageData[0].id
CountryId: id !== 0 ? id : res.pageData[0].id
})
this.GetVisaProListChoose();
}).catch(err => { });
......@@ -201,7 +201,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.GetVisaCountry()
console.log(options)
let id = options.id ? Number(options.id) : 0
this.GetVisaCountry(id)
},
/**
......
let app = getApp();
var languageUtils = require('../../../utils/languageUtils.js')
Page({
/**
......@@ -246,6 +247,13 @@ Page({
let name = e.currentTarget.dataset.type
let picker = e.currentTarget.dataset.picker
this.data.ppList[index][name] = e.detail.value
if (name == 'SurName') {
let enSurName = languageUtils.languageUtils(e.detail.value)
this.data.ppList[index]['ESurName'] = enSurName
} else if (name == 'Name') {
let enName = languageUtils.languageUtils(e.detail.value)
this.data.ppList[index]['EName'] = enName
}
if (picker) { // 客户类型
this.data.ppList[index][picker] = this.data.DutyList[e.detail.value]
this.setData({
......
This diff is collapsed.
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