服务预约

This commit is contained in:
闫晓茹 2023-10-11 17:38:22 +08:00
parent 5c9c7901c5
commit 13c4cc9c24
6 changed files with 147 additions and 42 deletions

View File

@ -4,17 +4,17 @@
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/homepage/homepage",
"style": {
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/startup/startup",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/homepage/homepage",
"style": {
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/medicalservice/medicalservice",

View File

@ -201,11 +201,14 @@
},
//
goappoint() {
if (!this.userinfo && !this.identity) {
this.gologin();
} else {
this.detailinfo('', '/pagesC/ServiceAppointment/ServiceAppointment')
}
uni.navigateTo({
url: '/pagesC/ServiceAppointment/ServiceAppointment'
})
// if (!this.userinfo && !this.identity) {
// this.gologin();
// } else {
// this.detailinfo('', '/pagesC/ServiceAppointment/ServiceAppointment')
// }
},
//
servicerecord() {
@ -235,4 +238,4 @@
<style lang="scss">
@import "./homepage.scss";
</style>
</style>

View File

@ -17,6 +17,7 @@
},
onLoad(options) { //
this.item = JSON.parse(decodeURIComponent(options.item))
console.log(this.item)
this.item.informationContent = this.item.informationContent.replace(/\<img/gi,
"<br/> <img class='richPic'")
this.item.informationContent = this.item.informationContent.replace(/\<p/gi,

View File

@ -95,7 +95,8 @@
}
.big {
padding: 35rpx 50rpx 30rpx 50rpx;
// padding: 35rpx 50rpx 30rpx 50rpx;
padding: 27rpx 84rpx 29rpx 46rpx;
font-size: 32rpx;
font-family: Source Han Sans CN;
font-weight: 500;
@ -103,4 +104,4 @@
line-height: 38rpx;
}
}
}
}

View File

@ -7,55 +7,80 @@
</view>
<view class="inputs">
<i class="icon"></i>
<input v-model="goodsName" type="text" name="" id="" class="input" placeholder="搜索服务"
<input v-model="projectName" type="text" name="" id="" class="input" placeholder="搜索服务"
placeholder-class="placeholder">
</view>
</u-navbar>
<view class="content">
<view class="big">大生化
<view class="content" v-for="(item ,index) in listinfo" :key="index">
<view class="big">{{item.projectName}}
</view>
<view class="servename">
高血压个性服务包
{{item.packageName}}
</view>
<view class="appoint" @tap="goapponint">
<view class="appoint" @tap="goapponint(item)">
预约
</view>
</view>
<view class="content">
<view class="big">大生化
</view>
<view class="servename">
高血压个性服务包
</view>
<view class="appoint" @tap="goapponint">
预约
</view>
</view>
</view>
</template>
<script>
import {
getForm,
} from '@/api/pagesC/ServiceAppointment/ServiceAppointment.js'
export default {
data() {
return {
background: {
backgroundColor: '#26A888',
},
goodsName:'',
projectName: '',
identity: '372431196910127051',
region: '',
listinfo: [],
appointlist:[],
packageNo:'',
formName:'',
formNo:'',
};
},
onShow() {
this.getlist()
},
watch: { //
projectName(e) {
this.getlist()
},
},
methods: {
getlist() {
this.userinfo = uni.getStorageSync('userinfo');
this.region = this.userinfo.cityCode;
getForm(this.identity, this.region, this.projectName).then(res => {
// console.log(res, '555')
this.listinfo = res.data
})
},
goprevious() {
uni.navigateBack({
delta: 1
})
},
goapponint() {
uni.navigateTo({
url: '/pagesC/appointmenttime/appointmenttime'
})
goapponint(item) {
uni.navigateTo({
// url: '/pagesC/appointmenttime/appointmenttime',
url: `/pagesC/appointmenttime/appointmenttime?item=${JSON.stringify(item)}`
})
// }
}
},
}

View File

@ -3,26 +3,100 @@
<view class="content">
<view class="appointtime">预约时间
</view>
<u-calendar v-model="show" :mode="mode" @change="change"></u-calendar>
<view class="time" @tap="show=true">
<image src="/static/pageC/time.png" mode=""></image>
</view>
<view class="submit">
<uni-datetime-picker v-model="datetimerange" type="datetimerange" rangeSeparator="至" />
<view class="submit" @tap="submit">
提交
</view>
<u-toast ref="uToast" />
</view>
</view>
</template>
<script>
import {
detail,
save
} from '@/api/pagesC/ServiceAppointment/ServiceAppointment.js'
export default {
data() {
return {
show: false,
mode: 'date'
mode: 'date',
appointlist: [],
listitem: {
bookingTime: '',
},
datetimerange: [Date.now(), this.todayEndTime()],
};
},
onLoad(e) {
this.appointlist = JSON.parse(e.item)
//
this.listitem = this.appointlist
this.listitem.formName = this.appointlist.projectName
this.listitem.packageNo = this.appointlist.packageId
this.listitem.formNo = this.appointlist.projectId
this.$delete(this.listitem, 'projectId')
this.$delete(this.listitem, 'projectName')
// this.single= new Date();
},
methods: {
maskClick(e) {
console.log(e, '55')
},
change(e) {
// console.log(e)
this.listitem.bookingTime = e.result
},
todayEndTime() {
let todayYear = (new Date()).getFullYear();
let todayMonth = (new Date()).getMonth();
let todayDay = (new Date()).getDate();
let todayTime = (new Date(todayYear, todayMonth, todayDay, '23', '59', '59')).getTime();
return todayTime
},
submit() {
this.listitem.applyStartTime = this.datetimerange[0]
this.listitem.applyEndTime = this.datetimerange[1]
if (this.listitem.sourceType == '1') {
console.log(this.listitem, '55')
detail(this.listitem).then(res => {
// console.log(res)
if (res.code == 200) {
this.$refs.uToast.show({
title: '预约成功',
type: 'error'
})
} else if (res.code == '500') {
this.$refs.uToast.show({
title: res.msg,
type: 'error'
})
}
})
} else if (this.listitem.sourceType == '2') {
console.log(this.listitem, '555')
save(this.listitem).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '预约成功',
type: 'error'
})
} else if (res.code == '500') {
this.$refs.uToast.show({
title: res.msg,
type: 'error'
})
}
// console.log(res, '9595')
// this.appointlistinfo = res.data
})
}
},
},
}
</script>
@ -43,7 +117,7 @@
.submit {
width: 496rpx;
height: 61rpx;
background: #26A888;
border-radius: 5rpx;
line-height: 61rpx;
@ -68,6 +142,7 @@
.time {
margin: 0 auto;
padding: 17rpx;
width: 80%;
height: 63rpx;
background: #F6F6F6;
@ -86,4 +161,4 @@
}
}
</style>
</style>