<template>
|
<view>
|
<view class="box">
|
<text style="font-size: 22px;">泾川县人民医院体检中心</text>
|
</view>
|
<view style="width:100%;height: 100px;background-color: #fff;display: flex;flex-direction: column;
|
flex-wrap: nowrap;
|
justify-content: space-around;">
|
<text class="name">{{pacById.pacName}}</text>
|
<text class="miaoshu">套餐描述:{{pacById.pacRemark}}</text>
|
</view>
|
<view style="width: 100%;min-height: 300px;background-color: #fff;margin-top: 15px;padding: 15px;">
|
<view class="card1_header">预约情况</view>
|
<view style="display: flex;flex-direction: row;flex-wrap: wrap;justify-content: space-evenly;">
|
<view style="display: flex;flex-direction: row;flex-wrap: wrap;justify-content: space-evenly;"
|
v-for="(item, index) in list" :key="index">
|
<view @tap.native.stop.prevent="xuanze($event, { time: item.time,nowNum:item.nowNum})"
|
class="card1_char">
|
<text>{{item.time}}</text>
|
<text>余{{item.nowNum}}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getprojectListByPacId
|
} from "@/api/system/package";
|
import {
|
updateReservationTime,
|
|
} from "@/api/system/cart";
|
import {
|
listByDay
|
} from "@/api/system/inspect";
|
export default {
|
data() {
|
return {
|
pacById: {},
|
list: [{
|
time: "2025-04-28",
|
nowNum: 20
|
},
|
{
|
time: "2025-04-29",
|
nowNum: 20
|
},
|
{
|
time: "2025-04-30",
|
nowNum: 20
|
}, {
|
time: "2025-05-01",
|
nowNum: 20
|
}
|
],
|
id: ""
|
}
|
},
|
onLoad(option) {
|
|
this.getPacById(option.pacId);
|
if (option.id) {
|
this.id = option.id;
|
}
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
getList() {
|
listByDay().then(res => {
|
// this.list = res.data;
|
// console.log(this.list);
|
})
|
},
|
getPacById(pacId) {
|
getprojectListByPacId(pacId).then((response) => {
|
this.pacById = response.data
|
this.proList = response.data.tjProjectList
|
});
|
},
|
|
xuanze(event, _dataset) {
|
if (!this.id) {
|
if (_dataset.nowNum == 0) {
|
this.$modal.showToast('该时间段不可选!');
|
} else {
|
let time = _dataset.time
|
uni.$emit('time', time);
|
uni.navigateBack({
|
delta: 1
|
})
|
}
|
} else {
|
// console.log(this.dataList)
|
let data = {
|
id: this.id,
|
reservationTime: _dataset.time
|
}
|
updateReservationTime(data).then(res => {
|
this.$modal.msgSuccess("修改成功");
|
let pages = getCurrentPages()
|
let prePages = pages[pages.length - 2] //获取上一个页面的对象
|
|
uni.navigateBack({
|
// delta: 1
|
success() {
|
prePages.$vm.getOrderDetail() // 当返回成功的时候调用上一级页面的回调
|
}
|
});
|
// uni.navigateBack({
|
// delta: 1
|
// })
|
})
|
|
}
|
|
},
|
}
|
}
|
</script>
|
|
<style>
|
.box {
|
width: 100%;
|
height: 150px;
|
background: linear-gradient(#F8D6DC 0%, #FFFFFF 100%);
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.name {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: bold;
|
font-size: 32rpx;
|
color: #E30165;
|
line-height: 42rpx;
|
padding-top: 57rpx;
|
margin-left: 33rpx;
|
}
|
|
.miaoshu {
|
font-size: 28rpx;
|
color: #565860;
|
line-height: 44rpx;
|
margin: 40rpx 0 40rpx 34rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
}
|
|
.card1_header {
|
width: 702rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
padding-left: 30rpx;
|
background: linear-gradient(90deg, #FFF5F5 0%, #FFE4F1 100%);
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
color: #A20048;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 30rpx;
|
}
|
|
|
.card1_char {
|
width: 150px;
|
height: 50px;
|
background-color: #F4F5F8;
|
margin-top: 10px;
|
display: flex;
|
align-items: center;
|
justify-content: space-around;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #65686A;
|
|
}
|
</style>
|