From 0bd57bceb21189f3f6123d430dbcb86b3f180c2d Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Wed, 1 Mar 2023 17:31:27 +0800 Subject: [PATCH] 2023-3-1 --- main.js | 4 +++- pages.json | 12 +++++------ pages/detailNursing/detailNursing.vue | 31 +++++++++++++++++---------- pages/enter/enter.vue | 2 +- pages/home/home.vue | 8 +++---- pages/list/list.vue | 4 ++-- pages/todayNursing/todayNursing.vue | 6 +++--- 7 files changed, 39 insertions(+), 28 deletions(-) diff --git a/main.js b/main.js index a72eab0..62d7f5c 100644 --- a/main.js +++ b/main.js @@ -8,7 +8,6 @@ Vue.use(uView); let vuexStore = require('@/store/$u.mixin.js'); Vue.mixin(vuexStore); - Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ @@ -34,3 +33,6 @@ Vue.prototype.$showimg = function (data) { animationType: "fade-in", }) } + +import moment from '@/libs/moment.min.js' +Vue.prototype.$moment = moment \ No newline at end of file diff --git a/pages.json b/pages.json index b825c9c..92a4e5e 100644 --- a/pages.json +++ b/pages.json @@ -94,12 +94,6 @@ "color": "#ABAEBE", "selectedColor": "#1479FF", "list": [{ - "iconPath": "/static/tabbar/home.png", - "selectedIconPath": "/static/tabbar/home-active.png", - "pagePath": "pages/home/home", - "text": "首页" - }, - { "iconPath": "/static/tabbar/notification.png", "selectedIconPath": "/static/tabbar/notification-active.png", "pagePath": "pages/todayNursing/todayNursing", @@ -116,6 +110,12 @@ "selectedIconPath": "/static/tabbar/list-active.png", "pagePath": "pages/list/list", "text": "护理列表" + }, + { + "iconPath": "/static/tabbar/home.png", + "selectedIconPath": "/static/tabbar/home-active.png", + "pagePath": "pages/home/home", + "text": "我的" } ] diff --git a/pages/detailNursing/detailNursing.vue b/pages/detailNursing/detailNursing.vue index 98604d6..8efc3d5 100644 --- a/pages/detailNursing/detailNursing.vue +++ b/pages/detailNursing/detailNursing.vue @@ -26,11 +26,11 @@ @@ -144,7 +144,7 @@ - + @@ -396,7 +396,8 @@ this.getDeatil(this.id) }).catch(err => { uni.showToast({ - title: '操作失败,请重试' + title: '操作失败,请重试', + icon: "none" }) }) }).catch(err => { @@ -489,18 +490,26 @@ return } - //时间是否超出120分钟 - let totalTime = 0 + //判断时间是否超出 + let useTotalTime = 0 for (let i of this.skuList) { if (i.isSelect && i.form.time) { - totalTime += Number(i.form.time) + useTotalTime += Number(i.form.time) } } - console.log(11111, totalTime); - if (totalTime > 120) { - this.isShowModal = true - } else { + let totalTime = this.$moment(new Date()).diff(this.$moment(this.detail.sign_in), 'minutes') + if (useTotalTime >= (totalTime - 10) && useTotalTime < totalTime) { this.signOut() + + uni.showToast({ + icon:'none', + title:'请下次补足时间', + duration:2000 + }) + } else if (useTotalTime >= totalTime && useTotalTime <= (totalTime + 10)){ + this.signOut() + } else { + this.isShowModal = true } }, //签退 diff --git a/pages/enter/enter.vue b/pages/enter/enter.vue index 9382b27..e83ef9f 100644 --- a/pages/enter/enter.vue +++ b/pages/enter/enter.vue @@ -22,7 +22,7 @@ onShow() { setTimeout(() => { uni.switchTab({ - url: "/pages/home/home", + url: "/pages/todayNursing/todayNursing", complete: (res) => { console.log(res); } diff --git a/pages/home/home.vue b/pages/home/home.vue index 32613ac..634a165 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -81,7 +81,7 @@ - 进行中 + 护理中 @@ -105,7 +105,7 @@ - 已完成 + 已护理 @@ -166,9 +166,9 @@ - 进行中 + 护理中 待护理 - 已完成 + 已护理 diff --git a/pages/list/list.vue b/pages/list/list.vue index fe09d89..03cc528 100644 --- a/pages/list/list.vue +++ b/pages/list/list.vue @@ -38,9 +38,9 @@ - 进行中 + 护理中 待护理 - 已完成 + 已护理 diff --git a/pages/todayNursing/todayNursing.vue b/pages/todayNursing/todayNursing.vue index c300b8d..0a6124c 100644 --- a/pages/todayNursing/todayNursing.vue +++ b/pages/todayNursing/todayNursing.vue @@ -25,9 +25,9 @@ - 进行中 + 护理中 待护理 - 已完成 + 已护理 @@ -55,7 +55,7 @@ - {{item.customer.sex}} + {{ item.customer.sex || '无' }}