Commit 529804ff authored by 潘永坪's avatar 潘永坪

组合票联系人处理

parent 18a1c610
......@@ -7,9 +7,9 @@ if(process.env.NODE_ENV === 'development'){//开发环境
}
const request = (url = '', data = {},showLoad) => {
data.reqId = new Date().getTime() //获取时间戳
let show=showLoad||true
let show=showLoad||false
return new Promise((resolve, reject) => {
if(show){
if(!show){
uni.showLoading({
title:'加载中',
mask:true
......
......@@ -141,7 +141,7 @@
</view>
</view>
<!-- 有可用优惠券,并且未选中 -->
<view class=" list-coupon" v-if="item.couponData&&item.couponData.masterSlaveCouponList&&item.couponData.masterSlaveCouponList.length>0&&!item.chooseCouponObj" @click="showCoupon()">
<view class=" list-coupon" v-if="item.couponData&&item.couponData.masterSlaveCouponList&&item.couponData.masterSlaveCouponList.length>0&&!item.chooseCouponObj" @click="showCoupon(index)">
<view>
</view>
......@@ -154,7 +154,7 @@
<u-icon name="arrow-right" color="#3688FF"></u-icon>
</view>
<!-- 有可用优惠券 -->
<view class=" list-coupon" v-if="item.chooseCouponObj&&item.chooseCouponObj.savedMoney>0" @click="showCoupon()">
<view class=" list-coupon" v-if="item.chooseCouponObj&&item.chooseCouponObj.savedMoney>0" @click="showCoupon(index)">
<view>
</view>
......@@ -169,7 +169,7 @@
<u-icon name="arrow-right" color="#3688FF"></u-icon>
</view>
<!-- 可用优惠券条件-->
<view class=" list-coupon" v-if="item.ableConpon" @click="showCoupon()">
<view class=" list-coupon" v-if="item.ableConpon" @click="showCoupon(index)">
<view>
</view>
......@@ -195,22 +195,22 @@
<!-- <text class="title-bold" v-if="contactNum - chooseContact.length > 0">,还需{{ contactNum - chooseContact.length }}</text> -->
</text>
</view>
<view class="visitorPlus" v-if="contactTotal.length>0">
<view class="visitorPlus" v-if="item.contactTotal&&item.contactTotal.length>0">
<!-- 这里key必须是index,如果是id会出现数据改变和样式不改变的bug -->
<view
class="plus-list"
:class="{on:item.ifChoose}"
v-for="(item2, index2) of contactTotal.slice(0, 3)"
@click="visitorChoose(index2)"
:class="{on:item2.ifChoose}"
v-for="(item2, index2) of item.contactTotal.slice(0, 3)"
@click="visitorChoose(index,index2)"
:key="index2"
>
{{ item2.name }}
<view v-if="item.ifChoose" class="date-icon">
<view v-if="item2.ifChoose" class="date-icon">
<u-icon name="checkmark" color="#ffffff"></u-icon>
</view>
</view>
<view @click="showContacts()" class="plus-list plus-list-last">
<view @click="showContacts(index)" class="plus-list plus-list-last">
选择/新增
<u-icon name="arrow-right" color="#3688FF"></u-icon>
</view>
......@@ -220,9 +220,9 @@
<text style="margin-left:16rpx;">新增</text>
</view>
<view class="visitorEdit" v-show="item.chooseContact&&item.chooseContact.length > 0">
<view class="visitorEdit" v-show="item.chooseContact&&item.chooseContact.length>0">
<view class="edit-list" v-for="(item2, index2) of item.chooseContact" :key="item2.id">
<view @click="delChooseContact(item2, index2)">
<view @click="delChooseContact(item,item2,index2)">
<u-icon name="close-circle" color="#3688ff" size="40"></u-icon>
</view>
......@@ -295,11 +295,11 @@
:defaultAreaCode="defaultAreaCode"
></chooseArea>
<times ref="times" :chooseTimeList="chooseTimeList" @timeConfig="timeConfig" :timeActive="timeActive"></times>
<editContacts ref="editContacts" :editContact="editContact" :contactTotal="contactTotal"></editContacts>
<editContacts ref="editContacts" :editContactData="editContactData" ></editContacts>
<contactList
ref="contactList"
:contactTotal="contactTotal"
:contactNum="contactNum"
:contactTotal="productList[moreContactIndex].contactTotal"
:contactNum="productList[moreContactIndex].contactNum"
></contactList>
<orderCoupon :couponData="couponData" ref="orderCoupon" @couponChoose="couponChoose" :chooseCouponObj="chooseCouponObj"></orderCoupon>
<!--一个站点时获取排队信息弹窗-->
......@@ -364,26 +364,19 @@ export default {
productIdList:[],//产品id列表入参
timeActive: 10000, //时间下标,默认不选中
buyKnowData: '', //购买须知数据
editContact: '', //编辑联系人传值对象
editContactData: '', //编辑联系人传值对象
ticketPhone: '', //联系电话
chooseContact: [], //选中的游客信息列表
timeNumber: '', //当前时间转化为数字
timeFlag: '', //setTimeout函数
productDepositTotal: 0, //产品总押金
docQuery: '', //元素变量
timeScroll: '' ,//时间滚动值
openid:uni.getStorageSync('openid') || '',//openid
couponData:[], //所有劵数据
chooseCouponObj: '', //默认选中最优价格优惠券
ableConpon: '', //没有可用优惠券时,达到一定条件可用,显示达到的条件
orderStatus:'',//上下架状态,任何一个产品状态为下架,该状态为下架
chooseTimeList:[],//选中产品时间列表
moreDateIndex:0,//点击的更多日期下标
moreTimeIndex:0,//点击的更多时间下标
chooseDateList:[],//点击更多日期时对应的日期列表
showTelephone:true,//用于判断是否显示输入联系人电话号码
areaIndex:0,//选择站点时对应的产品下标
contactTotal: [], //所有联系人列表
originalTotal:0,//原价总价
sellTotal:0,//卖价总价
maxBookNum:999,//最大购买数量
......@@ -393,7 +386,12 @@ export default {
sortInforPop: false, //一个站点时获取排队信息弹窗
showChooseArea: false, //控制选择站点弹窗显示隐藏
defaultAreaCode:'',//默认站点
numberSync:true,//数量和联系人同步
moreDateIndex:0,//点击的更多日期下标
moreTimeIndex:0,//点击的更多时间下标
moreContactIndex:0,//点击的选择、新增联系人下标
couponIndex:'',//点击的券的下标
couponData:[], //选择产品的所有劵数据
chooseCouponObj: '', //选择产品选中的券
}
},
onLoad(option) {
......@@ -633,25 +631,28 @@ export default {
}
this.$request('wechatUser/contact/findContactList', data).then(res => {
if (res.code == '00') {
this.contactTotal = res.data
this.contactTotal.forEach(item => {
let contactTotal = res.data||[]
contactTotal.forEach(item => {
//用于判断是否被选中
item.ifChoose = false
})
//编辑成功重新调该方法时,把之前选中的游客,设为选中状态
this.contactTotal.forEach(item => {
this.chooseContact.forEach(item2 => {
if (item.id == item2.id) {
item.ifChoose = true
}
})
})
//删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
this.chooseContact.forEach((item, index) => {
if (!this.contactTotal.find(item2 => item.id == item2.id)) {
this.chooseContact.splice(index, 1)
}
})
this.productList.forEach((item)=>{
item.contactTotal=JSON.parse(JSON.stringify(contactTotal))
})
// //编辑成功重新调该方法时,把之前选中的游客,设为选中状态
// this.contactTotal.forEach(item => {
// this.chooseContact.forEach(item2 => {
// if (item.id == item2.id) {
// item.ifChoose = true
// }
// })
// })
// //删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
// this.chooseContact.forEach((item, index) => {
// if (!this.contactTotal.find(item2 => item.id == item2.id)) {
// this.chooseContact.splice(index, 1)
// }
// })
} else {
uni.showToast({
title: res.message,
......@@ -811,45 +812,73 @@ export default {
this.$forceUpdate()
}).exec()
},
//---删除选中的联系人
delChooseContact(item, index) {
//---删除选中的联系人---已修改
delChooseContact(item,item2,index2) {
//所有联系人中找到删除联系人下标,改成未选中状态
let sub = this.contactTotal.findIndex(item2 => item2.id == item.id)
this.contactTotal[sub].ifChoose = false
this.chooseContact.splice(index, 1) //删除数组
let sub = item.contactTotal.findIndex(item3 => item3.id == item2.id)
item.contactTotal[sub].ifChoose = false
item.chooseContact.splice(index2, 1) //删除数组
//解决样式和数据未及时更新问题
this.$forceUpdate()
},
//---展示编辑联系人
//---展示编辑联系人---已修改
showEdit(data) {
let obj=data||''
this.$refs.editContacts.showPop = true
this.editContact = obj
this.editContactData = obj
},
//---展示新增联系人,并获取联系人列表
showContacts() {
//---展示新增联系人,并获取联系人列表---已修改
showContacts(index) {
this.moreContactIndex=index
this.$refs.contactList.showPop = true
},
//---游客选择
visitorChoose(i) {
let chooseList = this.chooseContact
let data = this.contactTotal
data[i].ifChoose = !data[i].ifChoose
if (data[i].ifChoose) {
if (chooseList.length == this.contactNum) {
//---游客选择---已修改
visitorChoose(index,index2) {
//底层原理不明,特殊情况,需特殊处理
//直接传入item,item2时 会报错,故选择传入下标
let item=this.productList[index]
let item2=this.productList[index].contactTotal[index2]
item2.ifChoose=!item2.ifChoose
if (item2.ifChoose) {
if (item.chooseContact.length == item.contactNum) {
//需要人数满足时,点击增加联系人时,删除最后一个,增加点击的那个人
chooseList[chooseList.length - 1].ifChoose = false
chooseList.splice(chooseList.length - 1, 1)
item.chooseContact[item.chooseContact.length - 1].ifChoose = false
item.chooseContact.splice(item.chooseContact.length - 1, 1)
}
chooseList.push(data[i]) //加入数组
item.chooseContact.push(item2) //加入数组
} else {
let index = chooseList.findIndex(items => {
return items.id == data[i].id
let index = item.chooseContact.findIndex(items => {
return items.id == item2.id
})
chooseList.splice(index, 1) //删除数组
item.chooseContact.splice(index, 1) //删除数组
}
//先注释
// this.$forceUpdate()
//解决选中联系人样式不更新的bug
this.$forceUpdate()
},
//---添加并选中联系人--用于添加联系人之后直接从联系人列表选出需要填写的几位联系人
addChoose() {
let data = {
openid:this.openid
}
this.$request('wechatUser/contact/findContactList', data).then(res => {
if (res.code == '00') {
this.contactTotal = res.data
for (let i = 0; i < this.contactNum; i++) {
let item = this.contactTotal[i] || null
if (item) {
item.ifChoose = true
}
}
this.chooseContact = this.contactTotal.slice(0, this.contactNum)
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
//---订单数量变化---正在修改
//---订单数量变化---修改
buyNumChange(e) {
let value=e.value
let index=e.name
......@@ -870,13 +899,13 @@ export default {
//当选中联系人数量大于购买数量时
item.chooseContact.splice(item.chooseContact.length - 1, 1) //删除多余的联系人
//联系人列表重新判断是否选中
item.contactTotal.forEach(item=>{
item.ifChoose=false
item.contactTotal.forEach(item2=>{
item2.ifChoose=false
})
item.chooseContact.forEach(item=>{
item.contactTotal.forEach(item2=>{
if(item.id==item2.id){
item2.ifChoose=true
item.chooseContact.forEach(item2=>{
item.contactTotal.forEach(item3=>{
if(item2.id==item3.id){
item3.ifChoose=true
}
})
})
......@@ -889,81 +918,58 @@ export default {
this.computedPrice()
clearTimeout(this.timeFlag)
this.timeFlag = setTimeout(()=>{
this.initCoupon()
this.initCoupon(item)
}, 1500)
},
//---展示购票须知---已修改
showBuyKnow(index) {
this.buyKnowData=this.productList[index]
this.$refs.buyKnow.showPop = true
},
//---添加并选中联系人--用于添加联系人之后直接从联系人列表选出需要填写的几位联系人
addChoose() {
let data = {
openid:this.openid
}
this.$request('wechatUser/contact/findContactList', data).then(res => {
if (res.code == '00') {
this.contactTotal = res.data
for (let i = 0; i < this.contactNum; i++) {
let item = this.contactTotal[i] || null
if (item) {
item.ifChoose = true
}
}
this.chooseContact = this.contactTotal.slice(0, this.contactNum)
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
this.buyKnowData=this.productList[index]
this.$refs.buyKnow.showPop = true
},
//---加载优惠券
initCoupon() {
//---加载优惠券---已修改
initCoupon(item) {
let savedMoneyList = []
this.chooseCouponObj = ''
this.ableConpon = ''
this.couponData=[]
item.chooseCouponObj=''
item.ableConpon=''
item.couponData=[]
let data = {
productId: this.productId, //产品id
tickets: this.buyNum, //房间数量
singleMoney: this.sellingPrice, //单价
money: parseFloat((this.buyNum * this.sellingPrice).toFixed(2)), //订单总价,不算券,和现金红包
merchantId: this.merchantId, //商户Id
productId: item.id, //产品id
tickets: item.buyNum, //数量
singleMoney:item.sellingPrice, //单价
money: parseFloat((item.buyNum * item.sellingPrice).toFixed(2)), //订单总价,不算券,和现金红包
merchantId: item.merchantId, //商户Id
openid:this.openid
}
this.$request('wechatUser/myPage/usableCouponList', data).then((res) => {
this.$request('wechatUser/myPage/usableCouponList', data,true).then((res) => {
if (res.code == '00') {
this.couponData = res.data
item.couponData = res.data
let masterSlaveCouponList=res.data.masterSlaveCouponList
if (masterSlaveCouponList&&masterSlaveCouponList.length>0) {
masterSlaveCouponList.forEach((item) => { //获取最优券
savedMoneyList.push(item.savedMoney)
masterSlaveCouponList.forEach((item2) => { //获取最优券
savedMoneyList.push(item2.savedMoney)
})
let maxMoney = Math.max.apply(null, savedMoneyList)
let arr=masterSlaveCouponList.filter((item)=>{//找到最大值的数组
return item.savedMoney==maxMoney
let arr=masterSlaveCouponList.filter((item2)=>{//找到最大值的数组
return item2.savedMoney==maxMoney
})
if(arr.length==1){
this.chooseCouponObj=arr[0]
item.chooseCouponObj=arr[0]
}else{
let index=arr.findIndex((item)=>{//如果有多个,找到是否有平台券,平台劵优先
return item.createSource==1
let index=arr.findIndex((item2)=>{//如果有多个,找到是否有平台券,平台劵优先
return item2.createSource==1
})
if(index>-1){
this.chooseCouponObj=arr[index]
item.chooseCouponObj=arr[index]
}else{
this.chooseCouponObj=arr[0]
item.chooseCouponObj=arr[0]
}
}
this.savedMoney=this.chooseCouponObj.savedMoney
item.savedMoney=item.chooseCouponObj.savedMoney
} else {
if (res.data.unusableCouponList.length > 0) {
res.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
if (item.isProduct == 1) {
this.ableConpon = item
res.data.unusableCouponList.forEach((item2, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
if (item2.isProduct == 1) {
item.ableConpon = item2
}
})
}
......@@ -972,32 +978,25 @@ export default {
}
})
},
//---获取优惠价格
getDiscountPrice() {
let data = {
productId: this.productId, //产品ID
merchantId: this.merchantId, //商家ID
companyId: this.companyId, //公司ID
openid: this.openid //openid
}
this.$request('scenic/user/productRule/getProductRule', data).then(res => {})
},
//---子组件券选择之后触发的事件
//---子组件券选择之后触发的事件---已修改
couponChoose(data) {
if(data){
this.chooseCouponObj = data
this.savedMoney=this.chooseCouponObj.savedMoney||0
this.productList[this.couponIndex].chooseCouponObj=data
}else{
this.chooseCouponObj = ''
this.savedMoney=0
this.productList[this.couponIndex].chooseCouponObj=''
}
this.computedPrice()
//复制公众号,还未复现是否需要
this.$forceUpdate()
},
//---展示券列表
showCoupon() {
//---展示券列表---已修改
showCoupon(index) {
this.couponIndex=index
this.couponData=this.productList[index].couponData
this.chooseCouponObj=this.productList[index].chooseCouponObj
this.$refs.orderCoupon.showPop=true
},
//---下单---正在修改
//---下单---修改
goPay() {
if (this.orderStatus == 1) {
//下架状态,点击无效
......@@ -1021,6 +1020,41 @@ export default {
})
return
}
if (item.isFetch == 1 && item.areaUp) {
//需要选择站点的票种,必须选择站点
if (!item.areaObj.areaCode) {
uni.showToast({
title: '请选择站点',
icon: 'none'
})
return
}
}
if (!item.startDate || !item.endDate) {
//游玩日期未选择
uni.showToast({
title:item.merchantName+'请选择游玩日期',
icon: 'none'
})
return
}
if(item.productType==3){
//如果为班次票,需要选择班次
if(!item.cruisePlanId){
uni.showToast({
title: '请选择'+item.merchantName+'游玩时间',
icon: 'none'
})
return
}
}
if(item.chooseContact.length!=item.contactNum){
uni.showToast({
title: item.merchantName+'需要添加'+item.contactNum+'位出行人',
icon: 'none'
})
return
}
}
if (this.showTelephone) {
//需要填写电话号码
......@@ -1033,70 +1067,21 @@ export default {
return
}
}
// if (!item.startDate || !item.endDate) {
// uni.showToast({
// title:item.merchantName+'请选择游玩日期',
// icon: 'none'
// })
// return
// }
//循环判断联系人数量,班次,站点是否填写完善
for(let i=0;i<this.productList.length;i++){
let item=this.productList[i]
if(item.tripTemplateFlag==1){//实名制
if(item.orderTouristList.length!=item.buyNum){
uni.showToast({
title: item.merchantName+'需要添加'+item.buyNum+'位出行人',
icon: 'none'
})
return
}
}
if(item.tripTemplateFlag==0){//非实名制
if(item.orderTouristList.length<1){
uni.showToast({
title: item.merchantName+'需要添加一位出行人',
icon: 'none'
})
return
}
}
if(item.productType==3){//如果为班次票,需要选择班次
if(!item.cruisePlanId){
uni.showToast({
title: '请选择'+item.merchantName+'游玩时间',
icon: 'none'
})
return
}
}
if (item.isFetch == 1 && item.areaUp) {
//需要选择站点的票种,必须选择站点
if (!item.areaObj.areaCode) {
uni.showToast({
title: '请选择站点',
icon: 'none'
})
return
}
}
}
this.preOrder()
},
//---预下单
preOrder() {
//获取游客信息参数
// let orderTouristList = this.chooseContact.map((item) => {
// return {
// category: 0,
// name: item.name,
// credentialNumber: item.credentialNumber
// }
// })
//获取券参数
this.productList.forEach(item=>{
if(item.chooseCouponObj){
//获取游客信息参数
item.orderTouristList =item.chooseContact.map((item2) => {
return {
category: 0,
name: item2.name,
credentialNumber: item2.credentialNumber
}
})
//获取券参数
if(item.chooseCouponObj){
//有从券取值从券,没有从券取值主劵
if(item.chooseCouponObj.slaveList.length>0){
item.couponList=[//券列表
......@@ -1119,9 +1104,9 @@ export default {
}
]
}
}else{
item.couponList=[]
}
}else{
item.couponList=[]
}
})
//额外服务不为空,联票购买不为空,带有儿童票,组合购买不为空,单品购买为空
let orderProductList=this.productList.map((item)=>{
......@@ -1139,8 +1124,8 @@ export default {
subOrderType:0,//产品类型,网络
unitPrice:item.sellingPrice,//产品单价
distributionPrice:item.sellingPrice,//临时用
productAreaCode:item.areaObj.areaCode||item.defaultAreaCode,//出发站点
orderTouristList:item.chooseTourist,//游客信息
productAreaCode:item.areaObj?item.areaObj.areaCode:'',//出发站点
orderTouristList:item.orderTouristList,//游客信息
couponList:item.couponList//优惠券
}
})
......
......@@ -45,7 +45,7 @@
<script>
export default {
props: ['editContact','contactTotal'],
props: ['editContactData'],
data() {
return {
showPop: false, //控制组件显示隐藏
......@@ -56,9 +56,8 @@ export default {
}
},
watch: {
editContact: {
editContactData: {
handler(newValue, oldValue) {
console.log(this.reviseContactId)
this.name = newValue.name||''
this.credentialNumber = newValue.credentialNumber||''
this.reviseContactId = newValue.id||''
......
......@@ -344,7 +344,7 @@
:defaultAreaCode="defaultAreaCode"
></chooseArea>
<times ref="times" :chooseTimeList="timeList" @timeConfig="timeConfig" :timeActive="timeActive"></times>
<editContacts ref="editContacts" :editContact="editContact" :contactTotal="contactTotal"></editContacts>
<editContacts ref="editContacts" :editContactData="editContactData"></editContacts>
<contactList
ref="contactList"
:contactTotal="contactTotal"
......@@ -418,7 +418,7 @@ export default {
dateList: [], //日期列表
timeList: [], //时间列表
buyKnowData: '', //购买须知数据
editContact: '', //编辑联系人传值对象
editContactData: '', //编辑联系人传值对象
productId: '', //产品Id
merchantId: '', //商户Id
ticketPhone: '', //联系电话
......@@ -828,7 +828,7 @@ export default {
showEdit(data) {
let obj=data||''
this.$refs.editContacts.showPop = true
this.editContact = obj
this.editContactData = obj
},
//---展示新增联系人,并获取联系人列表
showContacts() {
......@@ -836,23 +836,22 @@ export default {
},
//---游客选择
visitorChoose(i) {
let chooseList = this.chooseContact
let data = this.contactTotal
data[i].ifChoose = !data[i].ifChoose
if (data[i].ifChoose) {
if (chooseList.length == this.contactNum) {
//直接传入item,会造成item.ifChoose值变,但是this.contactTotal[i].ifChoose没变,故选择传入下标
let item = this.contactTotal[i]
item.ifChoose = !item.ifChoose
if (item.ifChoose) {
if (this.chooseContact.length == this.contactNum) {
//需要人数满足时,点击增加联系人时,删除最后一个,增加点击的那个人
chooseList[chooseList.length - 1].ifChoose = false
chooseList.splice(chooseList.length - 1, 1)
this.chooseContact[this.chooseContact.length - 1].ifChoose = false
this.chooseContact.splice(this.chooseContact.length - 1, 1)
}
chooseList.push(data[i]) //加入数组
this.chooseContact.push(item) //加入数组
} else {
let index = chooseList.findIndex(items => {
return items.id == data[i].id
let index = this.chooseContact.findIndex(items => {
return items.id == item.id
})
chooseList.splice(index, 1) //删除数组
this.chooseContact.splice(index, 1) //删除数组
}
this.$forceUpdate()
},
//---订单数量变化
buyNumChange(e) {
......@@ -965,7 +964,7 @@ export default {
merchantId: this.merchantId, //商户Id
openid:this.openid
}
this.$request('wechatUser/myPage/usableCouponList', data).then((res) => {
this.$request('wechatUser/myPage/usableCouponList', data,true).then((res) => {
if (res.code == '00') {
this.couponData = res.data
let masterSlaveCouponList=res.data.masterSlaveCouponList
......@@ -992,7 +991,7 @@ export default {
this.savedMoney=this.chooseCouponObj.savedMoney
} else {
if (res.data.unusableCouponList.length > 0) {
res.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
res.data.unusableCouponList.forEach((item) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
if (item.isProduct == 1) {
this.ableConpon = item
}
......@@ -1143,12 +1142,11 @@ export default {
//下架状态,点击无效
return
}
if (this.productIfo.tripTemplateFlag != 2) {
//需要填写电话号码
if (!this.$commonjs.phoneReg().test(this.ticketPhone) && this.productIfo.tripTemplateFlag != 2) {
//未填写正确手机号码
if (this.productIfo.isFetch == 1 && this.areaUp) {
//需要选择站点的票种,必须选择站点
if (!this.areaObj.areaCode) {
uni.showToast({
title: '请填写正确的手机号码',
title: '请选择站点',
icon: 'none'
})
return
......@@ -1161,25 +1159,6 @@ export default {
})
return
}
if (this.productIfo.tripTemplateFlag == 1) {
//实名制
if (this.chooseContact.length != this.buyNum) {
uni.showToast({
title: '需要添加' + this.buyNum + '位出行人',
icon: 'none'
})
return
}
} else if (this.productIfo.tripTemplateFlag == 0) {
//非实名制
if (this.chooseContact.length < 1) {
uni.showToast({
title: '需要添加一位出行人',
icon: 'none'
})
return
}
}
if (this.productIfo.productType == 3) {
//如果为班次票,需要选择班次
if (this.cruisePlanId == '') {
......@@ -1190,15 +1169,23 @@ export default {
return
}
}
if (this.productIfo.isFetch == 1 && this.areaUp) {
//需要选择站点的票种,必须选择站点
if (!this.areaObj.areaCode) {
uni.showToast({
title: '请选择站点',
icon: 'none'
})
return
}
if (this.chooseContact.length != this.contactNum) {
uni.showToast({
title: '需要添加' + this.contactNum + '位出行人',
icon: 'none'
})
return
}
if (this.productIfo.tripTemplateFlag != 2) {
//需要填写电话号码
if (!this.$commonjs.phoneReg().test(this.ticketPhone) && this.productIfo.tripTemplateFlag != 2) {
//未填写正确手机号码
uni.showToast({
title: '请填写正确的手机号码',
icon: 'none'
})
return
}
}
this.preOrder()
},
......
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