|
@@ -46,16 +46,18 @@
|
|
|
<view class="block-wrap visitors">
|
|
|
<view class="block-title u-flex">
|
|
|
<view class="name">观影人信息</view>
|
|
|
- <!-- <text>用于入园身份验证</text> -->
|
|
|
+ <!-- <text v-if="needIdcardNumber">需要{{needIdcardNumber}}张身份证</text> -->
|
|
|
</view>
|
|
|
<view class="people-list">
|
|
|
<!-- <view class="people btn" v-if="visitors.length>0" v-for="(visitor,index) in visitors" :key="index">
|
|
|
{{visitor.name}}
|
|
|
</view> -->
|
|
|
+ <!-- <view class="add-wrap" v-if="visitors.length<needIdcardNumber||!needIdcardNumber"> -->
|
|
|
<view class="add-wrap">
|
|
|
<u--input placeholder="请输入观影人姓名" border="surround" v-model="newVisitor.name"></u--input>
|
|
|
<u--input placeholder="请输入观影人身份证" border="surround" v-model="newVisitor.cardId"></u--input>
|
|
|
</view>
|
|
|
+ <!-- v-if="visitors.length<needIdcardNumber||!needIdcardNumber" -->
|
|
|
<view class="btn u-flex u-row-center" @click="addVisitor">
|
|
|
<u-icon name="plus-circle" color="#2D2D2D" size="32rpx"></u-icon>
|
|
|
<text class="text">新增观影人</text>
|
|
@@ -220,6 +222,15 @@
|
|
|
return total;
|
|
|
}, 0);
|
|
|
},
|
|
|
+ needIdcardNumber(){
|
|
|
+ if(this.pageContent.oneMany===1&&this.pageContent.personnelNum!==0){
|
|
|
+ return this.pageContent.personnelNum
|
|
|
+ }else if(this.pageContent.oneMany===1&&this.pageContent.personnelNum===0){
|
|
|
+ return null
|
|
|
+ }else if(this.pageContent.oneMany===2){
|
|
|
+ return 1
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
onShow() {
|
|
|
// this.getSettlement();
|
|
@@ -277,6 +288,13 @@
|
|
|
},
|
|
|
confirmVisitor() {
|
|
|
let that = this;
|
|
|
+ if(this.needIdcardNumber&&this.needIdcardNumber!==this.selectedVisitor.length){
|
|
|
+ uni.showToast({
|
|
|
+ title:`身份证数量应该为${this.needIdcardNumber}张`,
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
// console.log('selectedVisitor',this.selectedVisitor);
|
|
|
this.visitorShow = false;
|
|
|
this.visitors = this.visitorList.filter(obj => that.selectedVisitor.includes(obj.id)).map(item => {
|
|
@@ -325,6 +343,29 @@
|
|
|
})
|
|
|
},
|
|
|
applyOrder(){
|
|
|
+ // 一证多票调整暂时隐藏
|
|
|
+ // if(this.needIdcardNumber&&this.needIdcardNumber!==this.visitors.length){
|
|
|
+ // uni.showToast({
|
|
|
+ // title:'观影人信息不正确',
|
|
|
+ // icon:'none'
|
|
|
+ // })
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // if(this.pageContent.oneMany === 2 && this.pageContent.personnelNum!==0){//一证多票,补齐观影人信息
|
|
|
+ // let dontNeedCardsNumber = this.pageContent.personnelNum - this.visitors.length;
|
|
|
+ // if(dontNeedCardsNumber>0){//
|
|
|
+ // for (let i = 0;i<dontNeedCardsNumber;i++) {
|
|
|
+ // console.log('dontNeedCardsNumber',dontNeedCardsNumber);
|
|
|
+ // console.log('this.visitors---',this.visitors);
|
|
|
+ // this.visitors.push({
|
|
|
+ // name: this.visitors[0].name,
|
|
|
+ // cardId: this.visitors[0].cardId,
|
|
|
+ // // mobile: this.visitors[0].mobile,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // 一证多票调整暂时隐藏
|
|
|
console.log('applyOrder');
|
|
|
this.cansubmit = false;
|
|
|
// console.log('this.pageContent',this.pageContent);
|
|
@@ -355,6 +396,26 @@
|
|
|
})
|
|
|
},
|
|
|
submitorder() {
|
|
|
+ if(this.needIdcardNumber&&this.needIdcardNumber!==this.visitors.length){
|
|
|
+ uni.showToast({
|
|
|
+ title:'观影人信息不正确',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.pageContent.oneMany === 2 && this.pageContent.personnelNum!==0){//一证多票,补齐观影人信息
|
|
|
+ let dontNeedCardsNumber = this.pageContent.personnelNum - this.visitors.length;
|
|
|
+ if(dontNeedCardsNumber>0){//
|
|
|
+ for (let i = 0;i<dontNeedCardsNumber;i++) {
|
|
|
+ console.log('dontNeedCardsNumber',dontNeedCardsNumber);
|
|
|
+ this.visitors.push({
|
|
|
+ name: this.visitors[0].name,
|
|
|
+ idcard: this.visitors[0].idcard,
|
|
|
+ mobile: this.visitors[0].mobile,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
let params = {
|
|
|
performId: this.pageContent.performId,
|
|
|
goodsList: [{
|
|
@@ -561,6 +622,13 @@
|
|
|
}, interval);
|
|
|
},
|
|
|
addVisitor(){
|
|
|
+ // if(this.needIdcardNumber&&this.visitors.length>=this.needIdcardNumber){
|
|
|
+ // uni.showToast({
|
|
|
+ // title:'不需要身份证了',
|
|
|
+ // icon:'none'
|
|
|
+ // })
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
if(!this.newVisitor.name){
|
|
|
uni.$u.toast('请填写观影人姓名')
|
|
|
return
|
|
@@ -573,10 +641,13 @@
|
|
|
// console.log('this.newVisitor.cardId',this.newVisitor.cardId);
|
|
|
// console.log('visitors',this.visitors);
|
|
|
// 检查是否存在相同身份证号的观影人
|
|
|
- if(this.visitors.some(visitor => visitor.cardId === this.newVisitor.cardId)){
|
|
|
- uni.$u.toast('相同身份证号的观影人已存在')
|
|
|
- return
|
|
|
+ if(this.pageContent.oneMany==1){
|
|
|
+ if(this.visitors.some(visitor => visitor.cardId === this.newVisitor.cardId)){
|
|
|
+ uni.$u.toast('相同身份证号的观影人已存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
console.log('this.newVisitor',this.newVisitor);
|
|
|
this.visitors.push(this.newVisitor);
|
|
|
this.newVisitor = {name:'',cardId:''};
|