|
@@ -96,16 +96,47 @@
|
|
|
|
|
|
<!-- 第二个弹框-->
|
|
|
<up-popup v-model:show="showSecond">
|
|
|
- <view @click="jumpToAddressSelect">
|
|
|
+ <view>
|
|
|
<up-cell-group>
|
|
|
- <up-cell icon="setting-fill" title="请选择服务地址"></up-cell>
|
|
|
-
|
|
|
- </up-cell-group>
|
|
|
+ <view @click="jumpToAddressSelect" style="display: flex; align-items: center; padding: 10px;">
|
|
|
+ <up-icon name="more-dot-fill" size="16" />
|
|
|
+
|
|
|
+ <view v-if="selectedAddress" style="margin-left: 8px; flex: 1;">
|
|
|
+ <view class="address-display">
|
|
|
+ <text class="address-line">
|
|
|
+ {{ selectedAddress.provinceName }}{{ selectedAddress.cityName }}{{ selectedAddress.districtName }}
|
|
|
+ </text>
|
|
|
+ <view class="contact-info">
|
|
|
+ <text class="contact-name">{{ selectedAddress.name }}</text>
|
|
|
+ <text class="contact-phone">{{ selectedAddress.telephone }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <text v-else style="margin-left: 8px; font-size: 14px;">请选择服务地址</text>
|
|
|
+ </view>
|
|
|
+ <view class="card-container" v-for="(item, index) in computeClickTime" :key="index">
|
|
|
+ <image class="card-image" :src="listData.volunteerPicture" mode="aspectFill"></image>
|
|
|
+ <view class="card-content"> <!-- Content container -->
|
|
|
+ <view class="info-item">服务项目:{{listData.projectName}}</view>
|
|
|
+ <view class="Telephone">服务时长:{{listData.businessDuration}}</view>
|
|
|
+ <view class="date">日期:{{item.date}}</view>
|
|
|
+ <view class="time">
|
|
|
+ 时间:
|
|
|
+ <span v-for="(i,ind) in item.timeArr" :key="ind">
|
|
|
+ {{i}}
|
|
|
+ </span>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </up-cell-group>
|
|
|
</view>
|
|
|
<view class="Wrap-detils-btn">
|
|
|
- <up-button type="primary" shape="circle" @click="closeSecond">取消</up-button>
|
|
|
- <up-button type="error" shape="circle" @click="handleSecond">立即预约¥{{ computeMoney }}</up-button>
|
|
|
+ <up-button type="primary" shape="circle" :customStyle="wrapqx" @click="closeSecond">取消</up-button>
|
|
|
+ <up-button type="error" shape="circle" :customStyle="wrapqx" @click="handleSecond">
|
|
|
+ 购买¥{{ computeMoney }}
|
|
|
+ </up-button>
|
|
|
</view>
|
|
|
+
|
|
|
</up-popup>
|
|
|
|
|
|
|
|
@@ -164,6 +195,10 @@
|
|
|
</view>
|
|
|
</up-popup>
|
|
|
|
|
|
+ <view v-if="addressFlag" class="box">
|
|
|
+ <addressComponent :modelValue="addressFlag" @update:modelValue="val => addressFlag = val"
|
|
|
+ :addressInfo="addressInfo" @update:addressInfo="handleAddressUpdate"></addressComponent>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -187,6 +222,7 @@
|
|
|
|
|
|
import itsCalendar from '@/components/its-calendar/its-calendar.vue';
|
|
|
import uniDatetimePickerMy from "@/uni_modules/lic-uni-datetime-picker/components/lic-uni-datetime-picker/lic-uni-datetime-picker.vue"
|
|
|
+ import addressComponent from "@/pages_home/components/volunteerSide/adresss.vue"
|
|
|
|
|
|
const src = ref('http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg')
|
|
|
const businessPrice = ref() //价格
|
|
@@ -208,23 +244,25 @@
|
|
|
const showSecond = ref(false) //第二层弹框
|
|
|
const showThird = ref(false) //第二层弹框
|
|
|
const showSum = ref(false);
|
|
|
- const showNotify = ref(false) //支付成功提示
|
|
|
const remark = ref('') //备注
|
|
|
const radiovalue1 = ref('苹果');
|
|
|
// Radio 单选框数据
|
|
|
const radiolist1 = reactive([{
|
|
|
- name: '',
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
+ name: '',
|
|
|
+ disabled: false,
|
|
|
+ }, ]);
|
|
|
+
|
|
|
+ const selectedAddress = ref(null);
|
|
|
+ const addressFlag = ref(false)
|
|
|
+
|
|
|
+ const addressInfo = ref(null)
|
|
|
|
|
|
- ]);
|
|
|
-
|
|
|
// 详情底部立即购买弹框
|
|
|
const buttonClick = (e) => {
|
|
|
show.value = true; // 打开弹框
|
|
|
};
|
|
|
|
|
|
- // 第一层弹框
|
|
|
+ // 详情页第一层弹框
|
|
|
function open() {
|
|
|
show.value = true;
|
|
|
}
|
|
@@ -233,33 +271,33 @@
|
|
|
// 关闭逻辑,设置 show 为 false
|
|
|
show.value = false;
|
|
|
}
|
|
|
+
|
|
|
// 第一个弹框逻辑
|
|
|
const handleBuy = () => {
|
|
|
show.value = false; // 关闭第一个弹框
|
|
|
showSecond.value = true; // 打开第二个弹框
|
|
|
};
|
|
|
|
|
|
- // 第二层弹框
|
|
|
- function openSecond() {
|
|
|
- showSecond.value = true;
|
|
|
- }
|
|
|
+
|
|
|
// 第二层弹框取消
|
|
|
function closeSecond() {
|
|
|
// 关闭逻辑,设置 show 为 false
|
|
|
showSecond.value = false;
|
|
|
show.value = true; // 打开第一个弹框
|
|
|
}
|
|
|
-
|
|
|
- // 第三层弹框
|
|
|
- function openSum() {
|
|
|
- // 打开逻辑,比如设置 show 为 true
|
|
|
+
|
|
|
+ // 第二层弹框打开第三层
|
|
|
+ function handleSecond() {
|
|
|
showSum.value = true;
|
|
|
}
|
|
|
+
|
|
|
+ // 第三层弹框
|
|
|
+ // function openSum() {
|
|
|
+ // // 打开逻辑,比如设置 show 为 true
|
|
|
+ // showSum.value = true;
|
|
|
+ // }
|
|
|
|
|
|
- function closeSum() {
|
|
|
- showSum.value = false;
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
|
|
|
const handlCancel = () => {
|
|
|
show.value = false; // 关闭第一个弹框
|
|
@@ -267,13 +305,16 @@
|
|
|
totalTimes.value = 0; // 重置点击次数
|
|
|
}
|
|
|
|
|
|
+ const jumpToAddressSelect = () => {
|
|
|
+ addressFlag.value = true;
|
|
|
+ };
|
|
|
|
|
|
- const jumpToAddressSelect = () =>{
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages_mine/pages/selectAddress/index'
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
+ // 新增:处理子组件传回的地址数据
|
|
|
+ const handleAddressUpdate = (newAddress) => {
|
|
|
+ selectedAddress.value = newAddress;
|
|
|
+ addressFlag.value = false; // 关闭选择器
|
|
|
+ console.log('selectedAddress更新后:', JSON.stringify(selectedAddress.value)); // 添加这行
|
|
|
+ };
|
|
|
// 详情底部底部数据
|
|
|
const options = ref([{
|
|
|
icon: 'headphones',
|
|
@@ -317,7 +358,7 @@
|
|
|
volunteerId: id,
|
|
|
serviceCategory: categoy,
|
|
|
businessManagementId: manage
|
|
|
- } = params;
|
|
|
+ } = params
|
|
|
volunteerId.value = id;
|
|
|
serviceCategory.value = categoy;
|
|
|
businessManagementId.value = manage;
|
|
@@ -410,6 +451,9 @@
|
|
|
});
|
|
|
|
|
|
totalTimes.value = selectedTimes.value.length; // 更新点击次数
|
|
|
+
|
|
|
+
|
|
|
+ console.log(selectedTimes.value, '>>>>>selectedTimes.value');
|
|
|
}
|
|
|
|
|
|
// 立即购买显示时执行
|
|
@@ -424,6 +468,26 @@
|
|
|
const computeMoney = computed(() => {
|
|
|
return totalTimes.value * businessPrice.value
|
|
|
})
|
|
|
+ const computeClickTime = computed(() => {
|
|
|
+ let timeArr = []
|
|
|
+ let nyr = selectedTimes.value.map(item => {
|
|
|
+ return item.date
|
|
|
+ })
|
|
|
+
|
|
|
+ let nyrSet = Array.from(new Set(nyr)).map(item => {
|
|
|
+ return {
|
|
|
+ date: item,
|
|
|
+ timeArr: []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ selectedTimes.value.forEach(item => {
|
|
|
+ nyrSet.forEach(i => {
|
|
|
+ if (item.date == i.date) i.timeArr.push(item.time)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log(nyrSet, '>>>>>nyrSet');
|
|
|
+ return nyrSet
|
|
|
+ })
|
|
|
|
|
|
const certificationPictures = computed(() => {
|
|
|
if (listData.value.certificationPicture) {
|
|
@@ -450,20 +514,8 @@
|
|
|
businessManagementId: businessManagementId.value,
|
|
|
volunteerInfoId: listData.value.volunteerInfoId,
|
|
|
},
|
|
|
- workDateList: [
|
|
|
- // {
|
|
|
- // workDate: currentDate.value,//需要传获取到的时间,就是某个月份
|
|
|
- // }
|
|
|
- ]
|
|
|
+ workDateList: []
|
|
|
};
|
|
|
-
|
|
|
-
|
|
|
- // currentDate.value.length && (new Set(currentDate.value)).forEach((item) => {
|
|
|
- // orderData.workDateList.push({
|
|
|
- // workDate: item,
|
|
|
- // workStartTime: currentTime.value,
|
|
|
- // })
|
|
|
- // })
|
|
|
// 转换所有选择的时间
|
|
|
selectedTimes.value.forEach(item => {
|
|
|
orderData.workDateList.push({
|
|
@@ -472,13 +524,9 @@
|
|
|
});
|
|
|
});
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
try {
|
|
|
const res = await ordersCreateOrder(orderData);
|
|
|
if (res.code == 200) {
|
|
|
- showNotify.value = true
|
|
|
uni.reLaunch({
|
|
|
url: '/pages/index'
|
|
|
});
|
|
@@ -494,6 +542,16 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+ .box {
|
|
|
+ height: 100vh;
|
|
|
+ width: 100vw;
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 999999;
|
|
|
+ background: red;
|
|
|
+ }
|
|
|
+
|
|
|
.card-container {
|
|
|
display: flex;
|
|
|
position: relative;
|
|
@@ -702,4 +760,78 @@
|
|
|
.certificate-img {
|
|
|
margin-bottom: 24rpx;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /* 第二层弹框 */
|
|
|
+ .card-container {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: flex-start;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card-image {
|
|
|
+ width: 100px;
|
|
|
+ /* Adjust as needed */
|
|
|
+ height: 100px;
|
|
|
+ /* Adjust as needed */
|
|
|
+ border-radius: 8px;
|
|
|
+ margin-right: 15px;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card-content {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .info-item,
|
|
|
+ .Telephone,
|
|
|
+ .date,
|
|
|
+ .time {
|
|
|
+ margin-bottom: 5px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+
|
|
|
+ .time span {
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ .address-line {
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20rpx;
|
|
|
+ /* 行高20rpx */
|
|
|
+ color: #333;
|
|
|
+ /* 深色文字 */
|
|
|
+ display: block;
|
|
|
+ /* 确保独占一行 */
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ /* 下边距30rpx */
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 联系人信息容器 */
|
|
|
+ .contact-info {
|
|
|
+ display: flex;
|
|
|
+ gap: 20rpx;
|
|
|
+ /* 姓名和电话之间的间距 */
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 姓名样式 */
|
|
|
+ .contact-name {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #999;
|
|
|
+ /* 灰色文字 */
|
|
|
+ line-height: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 电话样式 */
|
|
|
+ .contact-phone {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #999;
|
|
|
+ /* 灰色文字 */
|
|
|
+ line-height: 20rpx;
|
|
|
+ }
|
|
|
</style>
|