贾宇博 пре 1 месец
родитељ
комит
f9a0dd6f6a
1 измењених фајлова са 6 додато и 7 уклоњено
  1. 6 7
      pages/goodsDetails/goodsDetails.vue

+ 6 - 7
pages/goodsDetails/goodsDetails.vue

@@ -183,6 +183,7 @@
 	const onePrice = ref(400)
 	const value = ref(''); //备注响应式
 	const volunteerId = ref(''); // 存储志愿者ID
+	const serviceCategory = ref('') //存储大类别
 	const doorToDoorTimeArr = ref([]) // 完整时间范围
 	const doorToDoorTime = ref([]) // 只具备开始、结束 时间
 	const timeHostArr = ref([]) // 时间段数组
@@ -301,16 +302,17 @@
 		// 解析传递过来的参数对象
 		const params = JSON.parse(options.params);
 		const {
-			volunteerId: id, // 重命名以避免命名冲突
-			serviceCategory
+			volunteerId: id,
+			serviceCategory: categoy
 		} = params;
 
 		// 将volunteerId赋值给响应式变量
 		volunteerId.value = id;
+		serviceCategory.value = categoy
 		// 使用传递的参数调用 API
 		const res = await getDetailsvolunteerId({
 			volunteerId: id,
-			serviceCategory
+			serviceCategory: categoy
 		});
 
 		// 将获取到的结果赋值给响应式变量
@@ -356,9 +358,7 @@
 					timeStamp: new Date(date + ' ' + item.reservationTime).getTime() / 1000
 				}
 			})
-
 			let arr = []
-
 			doorToDoorTimeArr.value.forEach(() => {
 				arr.push(TArr)
 			})
@@ -373,7 +373,6 @@
 	const getByTime = (timeObj) => {
 		currentTime.value = timeObj.hours
 		totalTimes.value += 1 // 记录点击次数
-		console.log(totalTimes.value, '>>>>>>>>>totalTimes.value');
 	}
 
 	// 立即购买显示时执行
@@ -390,7 +389,7 @@
 			orders: {
 				serviceOnePrice: onePrice.value, //需要传400死值返回给后端
 				serviceTotalPrice: computeMoney.value, //需要传获取到的总价
-				serviceCategory: 2,
+				serviceCategory: serviceCategory.value, //大类别参数
 				totalTimes: totalTimes.value, //点击的次数
 				serviceStartDate: "2025-04-18",
 				startTime: "8:00",