|
|
|
|
@ -11,6 +11,7 @@
|
|
|
|
|
OrderCreateAction,
|
|
|
|
|
OrderPayAction,
|
|
|
|
|
BuyInfoAction,
|
|
|
|
|
AppointmentSelectToday,
|
|
|
|
|
$image,
|
|
|
|
|
$response
|
|
|
|
|
} from '@/api'
|
|
|
|
|
@ -23,11 +24,15 @@
|
|
|
|
|
const $store = useStore()
|
|
|
|
|
const buy_info = ref(false)
|
|
|
|
|
const BuyInfo = async () => {
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: '加载中'
|
|
|
|
|
});
|
|
|
|
|
const response = await BuyInfoAction($store.buy_info)
|
|
|
|
|
$response(response, () => {
|
|
|
|
|
buy_info.value = response.data
|
|
|
|
|
$store.buy_info.time = buy_info.value.time
|
|
|
|
|
})
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const user_info = ref(false)
|
|
|
|
|
@ -36,6 +41,7 @@
|
|
|
|
|
user_info.value = info
|
|
|
|
|
if (!!user_info.value.id) BuyInfo()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const nextClick = () => {
|
|
|
|
|
@ -85,6 +91,7 @@
|
|
|
|
|
}
|
|
|
|
|
const OrderCreate = async () => {
|
|
|
|
|
pay_action.value = true
|
|
|
|
|
|
|
|
|
|
const response = await OrderCreateAction({
|
|
|
|
|
...$store.buy_info,
|
|
|
|
|
referral: referral.value
|
|
|
|
|
@ -98,34 +105,73 @@
|
|
|
|
|
const referral = ref('')
|
|
|
|
|
const pay_action = ref(false)
|
|
|
|
|
//设置灰度
|
|
|
|
|
const SysGreyType=ref(0)
|
|
|
|
|
const GetGreySet=()=>{
|
|
|
|
|
uni.getStorage({
|
|
|
|
|
key: 'SysGreytype',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
console.log(res.data);
|
|
|
|
|
if(res.data==1){
|
|
|
|
|
SysGreyType.value=1
|
|
|
|
|
}
|
|
|
|
|
const SysGreyType = ref(0)
|
|
|
|
|
const GetGreySet = () => {
|
|
|
|
|
uni.getStorage({
|
|
|
|
|
key: 'SysGreytype',
|
|
|
|
|
success: function(res) {
|
|
|
|
|
// console.log(res.data);
|
|
|
|
|
if (res.data == 1) {
|
|
|
|
|
SysGreyType.value = 1
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
let hospital = ref('');
|
|
|
|
|
const autoSelectTime = async () => { //自动选择日期
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: '加载中'
|
|
|
|
|
});
|
|
|
|
|
const response = await AppointmentSelectToday({
|
|
|
|
|
hospital: hospital.value.id
|
|
|
|
|
})
|
|
|
|
|
$response(response, () => {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
if(response.data.time !==null){
|
|
|
|
|
$store.buy_info.time={
|
|
|
|
|
date:response.data.time.date,
|
|
|
|
|
id:response.data.time.id,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
buy_info.value={time:''}
|
|
|
|
|
buy_info.value.time= $store.buy_info.time
|
|
|
|
|
console.log('-------', buy_info.value)
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: "今日已无可预约名额",
|
|
|
|
|
icon:'none'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
getUserInfo()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onShow(() => {
|
|
|
|
|
uni.$lu.hospital((info) => {
|
|
|
|
|
hospital.value = info
|
|
|
|
|
autoSelectTime()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
GetGreySet()
|
|
|
|
|
getUserInfo()
|
|
|
|
|
|
|
|
|
|
console.log(JSON.stringify($store.buy_info))
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<view >
|
|
|
|
|
<view>
|
|
|
|
|
<view class="top_line_wrapper" :class="SysGreyType==1? 'grey' :''"></view>
|
|
|
|
|
<view v-if="!!buy_info" >
|
|
|
|
|
<view v-if="!!buy_info">
|
|
|
|
|
<view v-if="!!buy_info.combo" class="combo_info_wrapper" :class="SysGreyType==1? 'grey' :''">
|
|
|
|
|
<view class="combo_info_name_wrapper">{{ buy_info.combo.name }}</view>
|
|
|
|
|
<view class="combo_info_tag_wrapper">
|
|
|
|
|
<view class="combo_tag_sex_wrapper combo_tag_sex_all_wrapper" v-if="buy_info.combo.sex==='全部'">全部</view>
|
|
|
|
|
<view class="combo_tag_sex_wrapper combo_tag_sex_nan_wrapper" v-if="buy_info.combo.sex==='男'">男士</view>
|
|
|
|
|
<view class="combo_tag_sex_wrapper combo_tag_sex_nv_wrapper" v-if="buy_info.combo.sex==='女'">女士</view>
|
|
|
|
|
<view class="combo_tag_sex_wrapper combo_tag_sex_all_wrapper" v-if="buy_info.combo.sex==='全部'">全部
|
|
|
|
|
</view>
|
|
|
|
|
<view class="combo_tag_sex_wrapper combo_tag_sex_nan_wrapper" v-if="buy_info.combo.sex==='男'">男士
|
|
|
|
|
</view>
|
|
|
|
|
<view class="combo_tag_sex_wrapper combo_tag_sex_nv_wrapper" v-if="buy_info.combo.sex==='女'">女士
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="person_info_wrapper" :class="SysGreyType==1? 'grey' :''">
|
|
|
|
|
@ -134,7 +180,8 @@
|
|
|
|
|
<view v-if="$store.buy_info.person.length > 0">
|
|
|
|
|
<view class="person_info_name_wrapper">{{ $store.buy_info.person[0].name }}</view>
|
|
|
|
|
<view class="person_info_info_wrapper">
|
|
|
|
|
<view class="person_info_sex_wrapper">{{ Number($store.buy_info.person[0].sex) === 1 ? '男' : '女' }}性</view>
|
|
|
|
|
<view class="person_info_sex_wrapper">
|
|
|
|
|
{{ Number($store.buy_info.person[0].sex) === 1 ? '男' : '女' }}性</view>
|
|
|
|
|
<view class="person_info_marriage_wrapper">
|
|
|
|
|
{{ Number($store.buy_info.person[0].marriage) === 1 ? '已婚' : '未婚' }}
|
|
|
|
|
</view>
|
|
|
|
|
@ -152,10 +199,10 @@
|
|
|
|
|
<input type="text" v-model="referral" placeholder="请输入">
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view @click="chooseTimeClick()" class="time_wrapper">
|
|
|
|
|
<view class="time_wrapper">
|
|
|
|
|
<view class="time_title_wrapper">体检时间</view>
|
|
|
|
|
<view class="time_content_wrapper">
|
|
|
|
|
{{ buy_info.time.id !== 0 ? buy_info.time.show : '请选择体检时间'}}
|
|
|
|
|
{{ buy_info.time.id !== 0 ? buy_info.time.show : '今日已无可用名额'}}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="tip_wrapper" :class="SysGreyType==1? 'grey' :''">
|
|
|
|
|
@ -400,7 +447,8 @@
|
|
|
|
|
color: #EF7389;
|
|
|
|
|
border-color: #EF7389;
|
|
|
|
|
}
|
|
|
|
|
.grey{
|
|
|
|
|
filter: grayscale(100%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.grey {
|
|
|
|
|
filter: grayscale(100%);
|
|
|
|
|
}
|
|
|
|
|
</style>
|