|
@@ -46,8 +46,9 @@
|
|
|
</view>
|
|
|
<view class="block-wrap visitors" v-for="(goods, goodsIndex) in pageContent.goodsList" :key="goodsIndex">
|
|
|
<view class="block-title u-flex">
|
|
|
- <view class="name">{{goods.goodsName}}</view>
|
|
|
+ <view class="name">{{goods.goodsName}}({{goods.saleNum}}张)</view>
|
|
|
<text v-if="goods.realList && goods.realList[0]">需要{{goods.realList[0].realNum}}张身份证</text>
|
|
|
+ <!-- <text v-else>不需要身份证</text> -->
|
|
|
</view>
|
|
|
|
|
|
<view class="people-list u-flex u-flex-wrap">
|
|
@@ -57,7 +58,7 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 添加观影人按钮 -->
|
|
|
- <view class="btn u-flex u-row-center" @click="showVisitorSelect(goodsIndex)">
|
|
|
+ <view v-if="goods.realList && goods.realList[0]" class="btn u-flex u-row-center" @click="showVisitorSelect(goodsIndex)">
|
|
|
<u-icon name="plus-circle" color="#2D2D2D" size="32rpx"></u-icon>
|
|
|
<text class="text">新增/更换</text>
|
|
|
</view>
|
|
@@ -470,6 +471,7 @@ import {
|
|
|
}
|
|
|
this.retailId = retailId;
|
|
|
console.log('submitorder retailId',this.retailId);
|
|
|
+ console.log('this.pageContent',this.pageContent);
|
|
|
// 构建订单参数
|
|
|
let params = {
|
|
|
performId: this.pageContent.performId,
|
|
@@ -477,7 +479,7 @@ import {
|
|
|
return {
|
|
|
goodsId: goods.goodsId,
|
|
|
saleNum: goods.saleNum,
|
|
|
- tourists: goods.visitors.map(visitor => {
|
|
|
+ tourists: (goods.visitors ?? []).map(visitor => {
|
|
|
return {
|
|
|
realType: goods.realList[0].realType,
|
|
|
name: visitor.name,
|
|
@@ -862,13 +864,19 @@ import {
|
|
|
setTemplate() {
|
|
|
// 检查是否所有商品都选择了足够的观影人
|
|
|
const isValid = this.pageContent.goodsList.every(goods => {
|
|
|
- if(!goods.visitors || !goods.realList[0]) return false;
|
|
|
+ // 如果没有realList或realList[0]为空,则不需要验证观影人数量
|
|
|
+ if(!goods.realList || !goods.realList[0]) return true;
|
|
|
+
|
|
|
+ // 如果需要观影人但没有选择任何观影人
|
|
|
+ if(!goods.visitors) return false;
|
|
|
+
|
|
|
+ // 验证观影人数量是否符合要求
|
|
|
return goods.visitors.length === goods.realList[0].realNum;
|
|
|
});
|
|
|
|
|
|
if(!isValid) {
|
|
|
uni.showToast({
|
|
|
- title: '请为每个票种选择足够的观影人',
|
|
|
+ title: '请为需要实名认证的票种选择足够的观影人',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
return;
|