Procházet zdrojové kódy

兼容一口价的票,最少观影人,最多观影人提示

gcz před 1 měsícem
rodič
revize
6ec11aff53
1 změnil soubory, kde provedl 28 přidání a 7 odebrání
  1. 28 7
      pages/bookticket.vue

+ 28 - 7
pages/bookticket.vue

@@ -60,7 +60,10 @@
 			</view>
 			<view class="block-wrap visitors">
 				<view class="block-title u-flex">
-					<view class="name">观影人信息</view>
+					<view class="name">观影人信息 
+						<text class="tip" v-if="pageContent.touristMin">最少{{pageContent.touristMin}}个观影人</text>
+						<text class="tip" v-if="pageContent.touristMax">最多{{pageContent.touristMax}}个观影人</text> 
+					</view>
 					<!-- <text v-if="needIdcardNumber">需要{{needIdcardNumber}}张身份证</text> -->
 				</view>
 				<view class="people-list">
@@ -225,12 +228,22 @@
 		computed: {
 			totalPrice() {
 				let that = this;
-				return this.visitors.reduce((total, item) => {
-					let price = null;
-					price = Number(that.pageData.salePrice);
-					total += price;
-					return total;
-				}, 0).toFixed(2);
+				console.log('that.pageData.priceType',that.pageContent.priceType);
+				console.log('that.pageData.priceType',typeof that.pageContent.priceType);
+				if(that.pageContent.priceType===1){
+					if(this.visitors.length>0){
+						return that.pageContent.salePrice
+					}else{
+						return 0
+					}
+				}else{
+					return this.visitors.reduce((total, item) => {
+						let price = null;
+						price = Number(that.pageData.salePrice);
+						total += price;
+						return total;
+					}, 0).toFixed(2);
+				}
 			},
 			totalVisitor() {
 				let that = this;
@@ -933,6 +946,14 @@
 	}
 
 	.visitors {
+		.block-title{
+			.tip{
+				margin-left: 10px;
+				font-size: 28rpx;
+				font-weight: normal;
+				color: #ef3642;
+			}
+		}
 		margin-bottom: 20rpx;
 	}