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

组合票联系人处理

parent 18a1c610
...@@ -7,9 +7,9 @@ if(process.env.NODE_ENV === 'development'){//开发环境 ...@@ -7,9 +7,9 @@ if(process.env.NODE_ENV === 'development'){//开发环境
} }
const request = (url = '', data = {},showLoad) => { const request = (url = '', data = {},showLoad) => {
data.reqId = new Date().getTime() //获取时间戳 data.reqId = new Date().getTime() //获取时间戳
let show=showLoad||true let show=showLoad||false
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if(show){ if(!show){
uni.showLoading({ uni.showLoading({
title:'加载中', title:'加载中',
mask:true mask:true
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<script> <script>
export default { export default {
props: ['editContact','contactTotal'], props: ['editContactData'],
data() { data() {
return { return {
showPop: false, //控制组件显示隐藏 showPop: false, //控制组件显示隐藏
...@@ -56,9 +56,8 @@ export default { ...@@ -56,9 +56,8 @@ export default {
} }
}, },
watch: { watch: {
editContact: { editContactData: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
console.log(this.reviseContactId)
this.name = newValue.name||'' this.name = newValue.name||''
this.credentialNumber = newValue.credentialNumber||'' this.credentialNumber = newValue.credentialNumber||''
this.reviseContactId = newValue.id||'' this.reviseContactId = newValue.id||''
......
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
:defaultAreaCode="defaultAreaCode" :defaultAreaCode="defaultAreaCode"
></chooseArea> ></chooseArea>
<times ref="times" :chooseTimeList="timeList" @timeConfig="timeConfig" :timeActive="timeActive"></times> <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 <contactList
ref="contactList" ref="contactList"
:contactTotal="contactTotal" :contactTotal="contactTotal"
...@@ -418,7 +418,7 @@ export default { ...@@ -418,7 +418,7 @@ export default {
dateList: [], //日期列表 dateList: [], //日期列表
timeList: [], //时间列表 timeList: [], //时间列表
buyKnowData: '', //购买须知数据 buyKnowData: '', //购买须知数据
editContact: '', //编辑联系人传值对象 editContactData: '', //编辑联系人传值对象
productId: '', //产品Id productId: '', //产品Id
merchantId: '', //商户Id merchantId: '', //商户Id
ticketPhone: '', //联系电话 ticketPhone: '', //联系电话
...@@ -828,7 +828,7 @@ export default { ...@@ -828,7 +828,7 @@ export default {
showEdit(data) { showEdit(data) {
let obj=data||'' let obj=data||''
this.$refs.editContacts.showPop = true this.$refs.editContacts.showPop = true
this.editContact = obj this.editContactData = obj
}, },
//---展示新增联系人,并获取联系人列表 //---展示新增联系人,并获取联系人列表
showContacts() { showContacts() {
...@@ -836,23 +836,22 @@ export default { ...@@ -836,23 +836,22 @@ export default {
}, },
//---游客选择 //---游客选择
visitorChoose(i) { visitorChoose(i) {
let chooseList = this.chooseContact //直接传入item,会造成item.ifChoose值变,但是this.contactTotal[i].ifChoose没变,故选择传入下标
let data = this.contactTotal let item = this.contactTotal[i]
data[i].ifChoose = !data[i].ifChoose item.ifChoose = !item.ifChoose
if (data[i].ifChoose) { if (item.ifChoose) {
if (chooseList.length == this.contactNum) { if (this.chooseContact.length == this.contactNum) {
//需要人数满足时,点击增加联系人时,删除最后一个,增加点击的那个人 //需要人数满足时,点击增加联系人时,删除最后一个,增加点击的那个人
chooseList[chooseList.length - 1].ifChoose = false this.chooseContact[this.chooseContact.length - 1].ifChoose = false
chooseList.splice(chooseList.length - 1, 1) this.chooseContact.splice(this.chooseContact.length - 1, 1)
} }
chooseList.push(data[i]) //加入数组 this.chooseContact.push(item) //加入数组
} else { } else {
let index = chooseList.findIndex(items => { let index = this.chooseContact.findIndex(items => {
return items.id == data[i].id return items.id == item.id
}) })
chooseList.splice(index, 1) //删除数组 this.chooseContact.splice(index, 1) //删除数组
} }
this.$forceUpdate()
}, },
//---订单数量变化 //---订单数量变化
buyNumChange(e) { buyNumChange(e) {
...@@ -965,7 +964,7 @@ export default { ...@@ -965,7 +964,7 @@ export default {
merchantId: this.merchantId, //商户Id merchantId: this.merchantId, //商户Id
openid:this.openid openid:this.openid
} }
this.$request('wechatUser/myPage/usableCouponList', data).then((res) => { this.$request('wechatUser/myPage/usableCouponList', data,true).then((res) => {
if (res.code == '00') { if (res.code == '00') {
this.couponData = res.data this.couponData = res.data
let masterSlaveCouponList=res.data.masterSlaveCouponList let masterSlaveCouponList=res.data.masterSlaveCouponList
...@@ -992,7 +991,7 @@ export default { ...@@ -992,7 +991,7 @@ export default {
this.savedMoney=this.chooseCouponObj.savedMoney this.savedMoney=this.chooseCouponObj.savedMoney
} else { } else {
if (res.data.unusableCouponList.length > 0) { if (res.data.unusableCouponList.length > 0) {
res.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券 res.data.unusableCouponList.forEach((item) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
if (item.isProduct == 1) { if (item.isProduct == 1) {
this.ableConpon = item this.ableConpon = item
} }
...@@ -1143,12 +1142,11 @@ export default { ...@@ -1143,12 +1142,11 @@ export default {
//下架状态,点击无效 //下架状态,点击无效
return return
} }
if (this.productIfo.tripTemplateFlag != 2) { if (this.productIfo.isFetch == 1 && this.areaUp) {
//需要填写电话号码 //需要选择站点的票种,必须选择站点
if (!this.$commonjs.phoneReg().test(this.ticketPhone) && this.productIfo.tripTemplateFlag != 2) { if (!this.areaObj.areaCode) {
//未填写正确手机号码
uni.showToast({ uni.showToast({
title: '请填写正确的手机号码', title: '请选择站点',
icon: 'none' icon: 'none'
}) })
return return
...@@ -1161,40 +1159,29 @@ export default { ...@@ -1161,40 +1159,29 @@ export default {
}) })
return return
} }
if (this.productIfo.tripTemplateFlag == 1) { if (this.productIfo.productType == 3) {
//实名制 //如果为班次票,需要选择班次
if (this.chooseContact.length != this.buyNum) { if (this.cruisePlanId == '') {
uni.showToast({
title: '需要添加' + this.buyNum + '位出行人',
icon: 'none'
})
return
}
} else if (this.productIfo.tripTemplateFlag == 0) {
//非实名制
if (this.chooseContact.length < 1) {
uni.showToast({ uni.showToast({
title: '需要添加一位出行人', title: '该票为班次票,请选择游玩时间',
icon: 'none' icon: 'none'
}) })
return return
} }
} }
if (this.productIfo.productType == 3) { if (this.chooseContact.length != this.contactNum) {
//如果为班次票,需要选择班次
if (this.cruisePlanId == '') {
uni.showToast({ uni.showToast({
title: '该票为班次票,请选择游玩时间', title: '需要添加' + this.contactNum + '位出行人',
icon: 'none' icon: 'none'
}) })
return return
} }
} if (this.productIfo.tripTemplateFlag != 2) {
if (this.productIfo.isFetch == 1 && this.areaUp) { //需要填写电话号码
//需要选择站点的票种,必须选择站点 if (!this.$commonjs.phoneReg().test(this.ticketPhone) && this.productIfo.tripTemplateFlag != 2) {
if (!this.areaObj.areaCode) { //未填写正确手机号码
uni.showToast({ uni.showToast({
title: '请选择站点', title: '请填写正确的手机号码',
icon: 'none' icon: 'none'
}) })
return return
......
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