From 5f2a4eef445658031efc9e43d9f3416567598a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Fri, 10 Nov 2023 15:44:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=88=91=E7=9A=84=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=E5=92=8C=E6=9C=8D=E5=8A=A1=E9=A2=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 +- pagesC/Myappointment/Myappointment.scss | 6 +- pagesC/Myappointment/Myappointment.vue | 67 +++++++++++----- pagesC/appointmenttime/appointmenttime.vue | 90 +++++++++++++--------- 4 files changed, 108 insertions(+), 57 deletions(-) diff --git a/pages.json b/pages.json index 4f65026..42db9af 100644 --- a/pages.json +++ b/pages.json @@ -512,7 +512,7 @@ "path": "Myappointment/Myappointment", "style": { "navigationBarTitleText": "我的预约", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { "path": "healthtest/healthtest", diff --git a/pagesC/Myappointment/Myappointment.scss b/pagesC/Myappointment/Myappointment.scss index e282560..56b011f 100644 --- a/pagesC/Myappointment/Myappointment.scss +++ b/pagesC/Myappointment/Myappointment.scss @@ -7,6 +7,10 @@ background: #F7F5F5; width: 60%; } + .app .record .top ._span:nth-child(1) { + color: #26A888; + + } ::v-deep .u-scroll-view { background: #F7F5F5 !important; @@ -32,7 +36,7 @@ span:nth-child(1) { font-size: 27rpx; font-weight: 600; - color: #000000; + // color: #000000; position: absolute; overflow: hidden; text-overflow: ellipsis; diff --git a/pagesC/Myappointment/Myappointment.vue b/pagesC/Myappointment/Myappointment.vue index f1120e4..dba74f3 100644 --- a/pagesC/Myappointment/Myappointment.vue +++ b/pagesC/Myappointment/Myappointment.vue @@ -6,10 +6,10 @@ {{item.formName}} - 已完成 - - 待批准 - 未完成 + 已完成 + 已同意 + 已拒绝 + 待审批 已取消 @@ -50,6 +50,7 @@ export default { data() { return { + name: '', tabslist: [{ name: '全部', completed: '', @@ -61,6 +62,7 @@ completed: '1', }, ], tabscurrent: 0, + listtotal: 0, query: { pageNum: 1, pageSize: 10, @@ -70,32 +72,59 @@ appointmentlist: [], } }, - onShow() { + mounted() { const value = uni.getStorageSync('userinfo'); this.query.identity = value.cardNo this.info(); }, + onReachBottom() { //下滑加载 + if (this.appointmentlist.length >= this.listtotal) {} else { + this.query.pageNum++ + list(this.query).then(res => { + this.appointmentlist = res.rows + }) + } + }, + onPullDownRefresh() { //下拉刷新 + this.info(); + // this.query.pageNum++ + this.query.pageNum = 1; + setTimeout(function() { + uni.stopPullDownRefresh(); + }, 1000); + + }, methods: { info() { list(this.query).then(res => { this.appointmentlist = res.rows + this.listtotal = res.total }) }, evaluatetime(item) { - cancel(item.bookingNo).then(res => { - if (res.code == 200) { - this.$refs.uToast.show({ - title: '取消预约成功', - type: 'success', - duration: '1500' - }) - this.info(); - } else if (res.code == 500) { - this.$refs.uToast.show({ - title: res.msg, - type: 'error', - duration: '1500' - }) + uni.showModal({ + title: '提示', + content: '确定取消预约吗', + cancelText: "取消", // 取消按钮的文字 + confirmText: "确认", // 确认按钮文字 + success: (res) => { + console.log(res, '78') + if (res.confirm) { + cancel(item.bookingNo).then(res => { + if (res.code == 200) { + uni.showModal({ + title: '提示', + content: '取消预约成功', + }) + this.info(); + } else if (res.code == 500) { + uni.showModal({ + title: '提示', + content: res.msg, + }) + } + }) + } } }) }, diff --git a/pagesC/appointmenttime/appointmenttime.vue b/pagesC/appointmenttime/appointmenttime.vue index 34a8435..0a8c7f1 100644 --- a/pagesC/appointmenttime/appointmenttime.vue +++ b/pagesC/appointmenttime/appointmenttime.vue @@ -55,10 +55,10 @@ console.log(this.listitem.sourceType, '57') }, methods: { - changeLog(e){ - console.log(e,'747') - this.listitem.bookingTime=e - + changeLog(e) { + console.log(e, '747') + this.listitem.bookingTime = e + }, change(e) { this.listitem.bookingTime = e.result @@ -75,45 +75,63 @@ this.listitem.packageNo = this.appointlist.packageId this.listitem.formNo = this.appointlist.projectId this.listitem.identity = this.userinfo.cardNo - // this.listitem.applyStartTime = this.datetimerange[0] - // this.listitem.applyEndTime = this.datetimerange[1] this.listitem.formName = this.appointlist.projectName - this.$delete(this.listitem, 'projectId') - this.$delete(this.listitem, 'projectName') - console.log(this.listitem, '55') - detail(this.listitem).then(res => { - if (res.code == 200) { - this.$refs.uToast.show({ - title: '预约成功', - type: 'success' - }) - } else if (res.code == '500') { - this.$refs.uToast.show({ - title: res.msg, - type: 'error' - }) - } - }) + // this.$delete(this.listitem, 'projectId') + // this.$delete(this.listitem, 'projectName') + if (!this.listitem.bookingTime) { + this.$refs.uToast.show({ + title: '请选择预约时间', + type: 'error' + }) + } else { + detail(this.listitem).then(res => { + if (res.code == 200) { + this.$refs.uToast.show({ + title: '预约成功', + type: 'success', + url: '/pagesC/ServiceAppointment/ServiceAppointment' + }) + } else if (res.code == '500') { + this.$refs.uToast.show({ + title: res.msg, + type: 'error' + }) + } + }) + } + } else if (this.listitem.sourceType == '2') { this.listitem.identity = this.userinfo.cardNo this.listitem.applyStartTime = this.datetimerange[0] this.listitem.applyEndTime = this.datetimerange[1] console.log(this.listitem, '555') - save(this.listitem).then(res => { - if (res.code == 200) { - this.$refs.uToast.show({ - title: '预约成功', - type: 'success' - }) - } else if (res.code == '500') { - this.$refs.uToast.show({ - title: res.msg, - type: 'error' - }) - } - }) + if (!this.listitem.applyStartTime && !this.listitem.applyEndTime) { + this.$refs.uToast.show({ + title: '请选择预约时间', + type: 'error' + }) + } else { + save(this.listitem).then(res => { + if (res.code == 200) { + this.$refs.uToast.show({ + title: '预约成功', + type: 'success', + url: '/pagesC/ServiceAppointment/ServiceAppointment' + }) + // uni.navigateTo({ + // url: "/pagesC/ServiceAppointment/ServiceAppointment" + // }) + + } else if (res.code == '500') { + this.$refs.uToast.show({ + title: res.msg, + type: 'error' + }) + } + }) + } } - }, + } }, }