|
@@ -13,6 +13,7 @@
|
|
<view class="info-item">服务项目:{{listData.projectName}}</view>
|
|
<view class="info-item">服务项目:{{listData.projectName}}</view>
|
|
<view v-if="serviceSubjectName != null" class="info-item">类别:{{ listData.projectTypeName }}
|
|
<view v-if="serviceSubjectName != null" class="info-item">类别:{{ listData.projectTypeName }}
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="Telephone">服务时长:{{listData.businessDuration}}</view>
|
|
<view class="Telephone">科目:{{listData.serviceSubjectName}}</view>
|
|
<view class="Telephone">科目:{{listData.serviceSubjectName}}</view>
|
|
<view class="Telephone">电话:{{listData.phonenumber}}</view>
|
|
<view class="Telephone">电话:{{listData.phonenumber}}</view>
|
|
</view>
|
|
</view>
|
|
@@ -30,7 +31,8 @@
|
|
<up-card title="证书" :thumb="thumb" :head-style="{ height: '80rpx', padding: '20rpx',}">
|
|
<up-card title="证书" :thumb="thumb" :head-style="{ height: '80rpx', padding: '20rpx',}">
|
|
<template #body>
|
|
<template #body>
|
|
<view class="certificate">
|
|
<view class="certificate">
|
|
- <image v-for="item in certificationPictures" :key="item" :src="item" mode="" style="width: 100%;" class="certificate-img"></image>
|
|
|
|
|
|
+ <image v-for="item in certificationPictures" :key="item" :src="item" mode=""
|
|
|
|
+ style="width: 100%;" class="certificate-img"></image>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
</up-card>
|
|
</up-card>
|
|
@@ -59,8 +61,9 @@
|
|
<up-divider></up-divider>
|
|
<up-divider></up-divider>
|
|
<view class="Wrap-content1">
|
|
<view class="Wrap-content1">
|
|
<up-avatar :src="src"></up-avatar>
|
|
<up-avatar :src="src"></up-avatar>
|
|
- <text style="margin-top: 15rpx;">¥{{onePrice}}</text>
|
|
|
|
|
|
+ <text style="margin-top: 15rpx;">¥{{listData.businessPrice}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- -->
|
|
<view class="Wrap-info">
|
|
<view class="Wrap-info">
|
|
<text style="margin-left: 10rpx;">服务类别:</text>
|
|
<text style="margin-left: 10rpx;">服务类别:</text>
|
|
<up-text type="info" text="家庭教育"></up-text>
|
|
<up-text type="info" text="家庭教育"></up-text>
|
|
@@ -173,7 +176,7 @@
|
|
|
|
|
|
|
|
|
|
const src = ref('http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg')
|
|
const src = ref('http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg')
|
|
- const onePrice = ref(400)
|
|
|
|
|
|
+ const businessPrice = ref() //价格
|
|
const volunteerId = ref(''); // 存储志愿者ID
|
|
const volunteerId = ref(''); // 存储志愿者ID
|
|
const serviceCategory = ref('') //存储大类别
|
|
const serviceCategory = ref('') //存储大类别
|
|
const businessManagementId = ref('') //具体分类id
|
|
const businessManagementId = ref('') //具体分类id
|
|
@@ -194,11 +197,11 @@
|
|
const remark = ref('') //备注
|
|
const remark = ref('') //备注
|
|
|
|
|
|
const computeMoney = computed(() => {
|
|
const computeMoney = computed(() => {
|
|
- return totalTimes.value * onePrice.value
|
|
|
|
|
|
+ return totalTimes.value * businessPrice.value
|
|
})
|
|
})
|
|
|
|
|
|
- const certificationPictures =computed(()=>{
|
|
|
|
- if(listData.value.certificationPicture){
|
|
|
|
|
|
+ const certificationPictures = computed(() => {
|
|
|
|
+ if (listData.value.certificationPicture) {
|
|
return listData.value.certificationPicture.split(',')
|
|
return listData.value.certificationPicture.split(',')
|
|
}
|
|
}
|
|
return []
|
|
return []
|
|
@@ -299,26 +302,23 @@
|
|
|
|
|
|
// 获取传递的参数
|
|
// 获取传递的参数
|
|
onLoad(async (options) => {
|
|
onLoad(async (options) => {
|
|
- // 解析传递过来的参数对象
|
|
|
|
const params = JSON.parse(options.params);
|
|
const params = JSON.parse(options.params);
|
|
const {
|
|
const {
|
|
volunteerId: id,
|
|
volunteerId: id,
|
|
serviceCategory: categoy,
|
|
serviceCategory: categoy,
|
|
businessManagementId: manage
|
|
businessManagementId: manage
|
|
} = params;
|
|
} = params;
|
|
-
|
|
|
|
- // 将volunteerId赋值给响应式变量
|
|
|
|
volunteerId.value = id;
|
|
volunteerId.value = id;
|
|
- serviceCategory.value = categoy
|
|
|
|
- // 使用传递的参数调用 API
|
|
|
|
|
|
+ serviceCategory.value = categoy;
|
|
|
|
+
|
|
const res = await getDetailsvolunteerId({
|
|
const res = await getDetailsvolunteerId({
|
|
volunteerId: id,
|
|
volunteerId: id,
|
|
serviceCategory: categoy,
|
|
serviceCategory: categoy,
|
|
businessManagementId: manage,
|
|
businessManagementId: manage,
|
|
});
|
|
});
|
|
|
|
|
|
- // 将获取到的结果赋值给响应式变量
|
|
|
|
listData.value = res.data || {};
|
|
listData.value = res.data || {};
|
|
|
|
+ businessPrice.value = listData.value.businessPrice || 0;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -326,81 +326,82 @@
|
|
const getListTime = async () => {
|
|
const getListTime = async () => {
|
|
const params = {
|
|
const params = {
|
|
volunteerId: Number(volunteerId.value),
|
|
volunteerId: Number(volunteerId.value),
|
|
|
|
+ };
|
|
|
|
+ const res = await volunteerwork(params);
|
|
|
|
+
|
|
|
|
+ if (res.data && res.data.length > 0) {
|
|
|
|
+ doorToDoorTimeArr.value = res.data;
|
|
|
|
+ const newRes = [res.data[0], res.data[res.data.length - 1]];
|
|
|
|
+ doorToDoorTime.value = newRes;
|
|
|
|
+ startDisabled.value = doorToDoorTime.value[0];
|
|
|
|
+ endDisabled.value = doorToDoorTime.value[1];
|
|
|
|
+
|
|
|
|
+ // 默认加载第一个日期的排班时间
|
|
|
|
+ getByDate(res.data[0]);
|
|
|
|
+ } else {
|
|
|
|
+ console.error('接口返回的日期范围为空');
|
|
|
|
+ doorToDoorTimeArr.value = [];
|
|
|
|
+ timeHostArr.value = []; // 清空时间段
|
|
}
|
|
}
|
|
- const res = await volunteerwork(params)
|
|
|
|
- if (res.data) {
|
|
|
|
- console.log(res.data, '>>>>>res.data333');
|
|
|
|
- doorToDoorTimeArr.value = res.data
|
|
|
|
- const newRes = [res.data[0], res.data[res.data.length - 1]]
|
|
|
|
- doorToDoorTime.value = newRes
|
|
|
|
- startDisabled.value = doorToDoorTime.value[0]
|
|
|
|
- endDisabled.value = doorToDoorTime.value[1]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
|
|
// 获取志愿者排班时间
|
|
// 获取志愿者排班时间
|
|
const getByDate = async (date = doorToDoorTimeArr.value[0]) => {
|
|
const getByDate = async (date = doorToDoorTimeArr.value[0]) => {
|
|
- console.log(date, '获取日期2')
|
|
|
|
|
|
+ // 检查日期是否为空
|
|
|
|
+ if (!date) {
|
|
|
|
+ console.error('日期为空,跳过获取排班时间');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (!volunteerId.value) {
|
|
if (!volunteerId.value) {
|
|
console.error('volunteerId 为空');
|
|
console.error('volunteerId 为空');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
const params = {
|
|
const params = {
|
|
volunteerId: volunteerId.value,
|
|
volunteerId: volunteerId.value,
|
|
- date
|
|
|
|
|
|
+ date,
|
|
};
|
|
};
|
|
|
|
+
|
|
try {
|
|
try {
|
|
const res = await volunteergetTimesByDate(params);
|
|
const res = await volunteergetTimesByDate(params);
|
|
- const TArr = res.data.map(item => {
|
|
|
|
- return {
|
|
|
|
- ...item,
|
|
|
|
- hours: item.reservationTime,
|
|
|
|
- timeStamp: new Date(date + ' ' + item.reservationTime).getTime() / 1000
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- let arr = []
|
|
|
|
- doorToDoorTimeArr.value.forEach(() => {
|
|
|
|
- arr.push(TArr)
|
|
|
|
- })
|
|
|
|
- timeHostArr.value = arr
|
|
|
|
|
|
+ const TArr = res.data.map((item) => ({
|
|
|
|
+ ...item,
|
|
|
|
+ hours: item.reservationTime,
|
|
|
|
+ timeStamp: new Date(`${date} ${item.reservationTime}`).getTime() / 1000,
|
|
|
|
+ }));
|
|
|
|
+
|
|
|
|
+ // 如果 doorToDoorTimeArr.value 为空,直接返回
|
|
|
|
+ if (!doorToDoorTimeArr.value.length) {
|
|
|
|
+ console.error('可选的日期范围为空');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ // 填充时间段数组
|
|
|
|
+ timeHostArr.value = Array(doorToDoorTimeArr.value.length).fill(TArr);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('获取排班时间失败:', error);
|
|
console.error('获取排班时间失败:', error);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
-
|
|
|
|
- // 点击具体时间触发
|
|
|
|
- // const getByTime = (timeObj) => {
|
|
|
|
- // // 检查 timeObj 是否已经被点击过
|
|
|
|
- // if (timeObj.clicked) {
|
|
|
|
- // console.log('>>>>>> 已经点击过此时间');
|
|
|
|
- // return; // 如果已经点击过,就直接返回,后续操作不执行
|
|
|
|
- // }
|
|
|
|
- // console.log('>>>>>>触发111');
|
|
|
|
- // currentDate.value.push(timeObj.yearToDate)
|
|
|
|
- // currentTime.value = timeObj.hours
|
|
|
|
- // totalTimes.value += 1 // 记录点击次数
|
|
|
|
- // // 标记该时间已点击
|
|
|
|
- // timeObj.clicked = true;
|
|
|
|
- // }
|
|
|
|
|
|
+
|
|
const getByTime = (timeObj) => {
|
|
const getByTime = (timeObj) => {
|
|
- if (timeObj.clicked) {
|
|
|
|
- console.log('>>>>>> 已经点击过此时间');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 标记为已点击
|
|
|
|
- timeObj.clicked = true;
|
|
|
|
-
|
|
|
|
- // 添加到已选时间数组
|
|
|
|
- selectedTimes.value.push({
|
|
|
|
- date: timeObj.yearToDate,
|
|
|
|
- time: timeObj.hours,
|
|
|
|
- timestamp: timeObj.timeStamp
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- totalTimes.value = selectedTimes.value.length; // 更新点击次数
|
|
|
|
|
|
+ if (timeObj.clicked) {
|
|
|
|
+ console.log('>>>>>> 已经点击过此时间');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 标记为已点击
|
|
|
|
+ timeObj.clicked = true;
|
|
|
|
+
|
|
|
|
+ // 添加到已选时间数组
|
|
|
|
+ selectedTimes.value.push({
|
|
|
|
+ date: timeObj.yearToDate,
|
|
|
|
+ time: timeObj.hours,
|
|
|
|
+ timestamp: timeObj.timeStamp
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ totalTimes.value = selectedTimes.value.length; // 更新点击次数
|
|
}
|
|
}
|
|
|
|
|
|
// 立即购买显示时执行
|
|
// 立即购买显示时执行
|
|
@@ -415,7 +416,7 @@
|
|
// 定义要发送的数据
|
|
// 定义要发送的数据
|
|
const orderData = {
|
|
const orderData = {
|
|
orders: {
|
|
orders: {
|
|
- serviceOnePrice: onePrice.value, //需要传400死值返回给后端
|
|
|
|
|
|
+ serviceOnePrice: businessPrice.value,
|
|
serviceTotalPrice: computeMoney.value, //需要传获取到的总价
|
|
serviceTotalPrice: computeMoney.value, //需要传获取到的总价
|
|
serviceCategory: serviceCategory.value, //大类别参数
|
|
serviceCategory: serviceCategory.value, //大类别参数
|
|
totalTimes: totalTimes.value, //点击的次数
|
|
totalTimes: totalTimes.value, //点击的次数
|
|
@@ -442,14 +443,14 @@
|
|
// })
|
|
// })
|
|
// })
|
|
// })
|
|
// 转换所有选择的时间
|
|
// 转换所有选择的时间
|
|
- selectedTimes.value.forEach(item => {
|
|
|
|
- orderData.workDateList.push({
|
|
|
|
- workDate: item.date,
|
|
|
|
- workStartTime: item.time
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ selectedTimes.value.forEach(item => {
|
|
|
|
+ orderData.workDateList.push({
|
|
|
|
+ workDate: item.date,
|
|
|
|
+ workStartTime: item.time
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
@@ -467,7 +468,7 @@
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
await getListTime()
|
|
await getListTime()
|
|
- getByDate()
|
|
|
|
|
|
+ // getByDate()
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -670,11 +671,13 @@
|
|
.confirm-button {
|
|
.confirm-button {
|
|
margin-top: 40rpx;
|
|
margin-top: 40rpx;
|
|
}
|
|
}
|
|
|
|
+
|
|
.certificate {
|
|
.certificate {
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
.certificate-img {
|
|
.certificate-img {
|
|
margin-bottom: 24rpx;
|
|
margin-bottom: 24rpx;
|
|
}
|
|
}
|