839877316@qq.com hai 5 meses
pai
achega
95b70e8a2e
Modificáronse 1 ficheiros con 26 adicións e 4 borrados
  1. 26 4
      pages/index/index.vue

+ 26 - 4
pages/index/index.vue

@@ -87,7 +87,7 @@
 								placeholder-style="color: #c0c4cc" type="number" />
 						</view>
 						<view class="delete-btn" v-if="formData.accompanyPersons.length > 1"
-							@click="removeAccompany(index)">
+							@click.stop="removeAccompany(index)">
 							<uni-icons type="trash" size="18" color="#ff4757"></uni-icons>
 						</view>
 					</view>
@@ -381,8 +381,23 @@
 
 			// 删除随行人员
 			removeAccompany(index) {
+				console.log('删除随行人员,索引:', index, '当前数量:', this.formData.accompanyPersons.length);
 				if (this.formData.accompanyPersons.length > 1) {
-					this.formData.accompanyPersons.splice(index, 1);
+					uni.showModal({
+						title: '确认删除',
+						content: '确定要删除这个随行人员吗?',
+						success: (res) => {
+							if (res.confirm) {
+								this.formData.accompanyPersons.splice(index, 1);
+								console.log('删除成功,剩余数量:', this.formData.accompanyPersons.length);
+							}
+						}
+					});
+				} else {
+					uni.showToast({
+						title: '至少保留一个随行人员',
+						icon: 'none'
+					});
 				}
 			},
 
@@ -722,14 +737,21 @@
 		position: absolute;
 		top: 10rpx;
 		right: 10rpx;
-		width: 60rpx;
-		height: 60rpx;
+		width: 70rpx;
+		height: 70rpx;
 		display: flex;
 		align-items: center;
 		justify-content: center;
 		background-color: #fff;
 		border-radius: 50%;
 		box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
+		z-index: 10;
+		cursor: pointer;
+		
+		&:active {
+			opacity: 0.7;
+			transform: scale(0.95);
+		}
 	}
 
 	.add-accompany-btn {