diff --git a/App.vue b/App.vue index e29f6aa..d8ca554 100644 --- a/App.vue +++ b/App.vue @@ -86,15 +86,16 @@ &::after { content: ''; - width: 24rpx; - height: 24rpx; + width: 16rpx; + height: 16rpx; border: 2rpx solid #2EC28B; + box-sizing: border-box; border-radius: 100%; animation: icon-scale 3s linear infinite; position: absolute; - top: -10rpx; - left: -10rpx; + top: -2rpx; + left: -2rpx; } @keyframes icon-scale { @@ -103,7 +104,7 @@ 30%, 100%, 40% { - transform: scale(0.7, 0.7); + transform: scale(1.5, 1.5); } 70% { diff --git a/manifest.json b/manifest.json index c5f9600..c465036 100644 --- a/manifest.json +++ b/manifest.json @@ -1,77 +1,77 @@ { - "name" : "uni", - "appid" : "__UNI__3136F4B", - "description" : "", - "versionName" : "1.0.0", - "versionCode" : "100", - "transformPx" : false, - /* 5+App特有相关 */ - "app-plus" : { - "usingComponents" : true, - "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 - }, - /* 模块配置 */ - "modules" : {}, - /* 应用发布信息 */ - "distribute" : { - /* android打包配置 */ - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - /* ios打包配置 */ - "ios" : {}, - /* SDK配置 */ - "sdkConfigs" : {} - } - }, - /* 快应用特有相关 */ - "quickapp" : {}, - /* 小程序特有相关 */ - "mp-weixin" : { - "appid" : "wx2129de75c4937c40", - "setting" : { - "urlCheck" : false - }, - "usingComponents" : true, - "permission" : { - "scope.userLocation" : { - "desc" : "获取位置" - } - } - }, - "mp-alipay" : { - "usingComponents" : true - }, - "mp-baidu" : { - "usingComponents" : true - }, - "mp-toutiao" : { - "usingComponents" : true - }, - "uniStatistics" : { - "enable" : false - }, - "vueVersion" : "2" + "name": "uni", + "appid": "__UNI__3136F4B", + "description": "", + "versionName": "1.0.0", + "versionCode": "100", + "transformPx": false, + /* 5+App特有相关 */ + "app-plus": { + "usingComponents": true, + "nvueStyleCompiler": "uni-app", + "compilerVersion": 3, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": true, + "autoclose": true, + "delay": 0 + }, + /* 模块配置 */ + "modules": {}, + /* 应用发布信息 */ + "distribute": { + /* android打包配置 */ + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios": {}, + /* SDK配置 */ + "sdkConfigs": {} + } + }, + /* 快应用特有相关 */ + "quickapp": {}, + /* 小程序特有相关 */ + "mp-weixin": { + "appid": "wx958ba927f572e88f", + "setting": { + "urlCheck": false + }, + "usingComponents": true, + "permission": { + "scope.userLocation": { + "desc": "获取位置" + } + } + }, + "mp-alipay": { + "usingComponents": true + }, + "mp-baidu": { + "usingComponents": true + }, + "mp-toutiao": { + "usingComponents": true + }, + "uniStatistics": { + "enable": false + }, + "vueVersion": "2" } diff --git a/pages.json b/pages.json index 3a72716..594c5f8 100644 --- a/pages.json +++ b/pages.json @@ -57,6 +57,13 @@ "style": { "navigationStyle": "custom" } + }, + { + "path": "uview-ui/components/u-avatar-cropper/u-avatar-cropper", + "style": { + "navigationBarTitleText": "头像裁剪", + "navigationBarBackgroundColor": "#000000" + } } ], "subPackages": [{ diff --git a/pages/detailNursing/detailNursing.vue b/pages/detailNursing/detailNursing.vue index 774047e..3374c2c 100644 --- a/pages/detailNursing/detailNursing.vue +++ b/pages/detailNursing/detailNursing.vue @@ -19,10 +19,18 @@ + + @@ -35,7 +43,7 @@ - 通园路666号(地图:通园路66号) + {{ addressFormat(detail.customer.customer_address) }} @@ -60,7 +68,7 @@ - {{item.sku_id}} + {{item.sku.name}} - + 过程打卡 (1) - + 更新定位 {{$u.timeFormat(time,'hh:MM:ss')}} @@ -99,6 +107,8 @@ export default { data() { return { + isClick: false, + type: '', qqmapsdk: null, inputStyle: { fontSize: "24rpx", @@ -106,6 +116,12 @@ width: "140rpx", background: "#F9F9F9" }, + btnStyle: { + width: '100rpx', + height: '100rpx', + borderRadius: '100%', + background: 'blue' + }, form: [], detail: {}, time: new Date(), @@ -132,30 +148,80 @@ this.form = res.product.product_skus.map(item => { return { isSelect: false, + sku_id: item.id, time: '' } }) }, + save(type) { + this.$u.api.nurseSave({ + id: this.detail.id, + sku_time_list: this.form.filter(item => { + return item.isSelect + }), + logs: [{ + lat: this.location.lat, + lng: this.location.lng, + address: this.location.address, + type + }] + }).then(res => { + if (type === 1) { + uni.showToast({ + icon: 'success', + title: '打卡成功' + }) + } + if (type === 2) { + uni.showToast({ + icon: 'success', + title: '更新定位成功' + }) + } + }) + }, + punch() { + this.$u.throttle(() => { + this.type = 1 + this.isClick = true + this.save(1) + setTimeout(() => { + this.isClick = false + }, 10000) + }, 10000) + + }, //更新定位 locate() { this.$u.throttle(() => { + this.type = 2 + this.isClick = true + setTimeout(() => { + this.isClick = false + }, 10000) uni.getLocation().then(res => { this.location.lat = res[1]?.latitude this.location.lng = res[1]?.longitude this.location.time = this.time - this.qqmapsdk.reverseGeocoder({ - location: { - latitude: this.location.lat, - longitude: this.location.lng - }, - success: (r) => { - this.location.address = r.result.address - } + new Promise((reject, resolve) => { + this.qqmapsdk.reverseGeocoder({ + location: { + latitude: this.location.lat, + longitude: this.location.lng + }, + success: (r) => { + reject(r) + } + }) + }).then(res => { + this.location.address = res.result.address + + this.save(2) }) }) - }, 5000) + }, 10000) }, }, computed: { @@ -163,6 +229,13 @@ return function(birth) { return new Date().getFullYear() - new Date(birth).getFullYear() } + }, + addressFormat() { + return function(addresses) { + return addresses.filter(item => { + item.default === 1 + })[0]?.address || addresses[0]?.address || '无' + } } }, onLoad(option) { @@ -182,64 +255,6 @@ display: inline !important; } - // 待护理 - .icon1 { - width: 16rpx; - height: 16rpx; - background: #FDB030; - border-radius: 100%; - - margin-right: 14rpx; - } - - //已完成 - .icon2 { - width: 16rpx; - height: 16rpx; - background: #1173FF; - border-radius: 100%; - - margin-right: 14rpx; - } - - //进行中 - .icon3 { - width: 12rpx; - height: 12rpx; - background: #2EC28B; - border-radius: 100%; - - margin-right: 14rpx; - position: relative; - - &::after { - content: ''; - width: 24rpx; - height: 24rpx; - border: 2rpx solid #2EC28B; - border-radius: 100%; - animation: icon-scale 3s linear infinite; - - position: absolute; - top: -8rpx; - left: -8rpx; - } - - @keyframes icon-scale { - - 0%, - 30%, - 100%, - 40% { - transform: scale(0.7, 0.7); - } - - 70% { - transform: scale(1, 1); - } - } - } - .user-info { width: 710rpx; background: #FFFFFF; @@ -508,6 +523,33 @@ .text2 { @extend .text-class; } + + &-active { + + &::after { + content: ''; + width: 80rpx; + height: 80rpx; + background: rgba(180, 180, 180, 0.5); + border-radius: 100%; + animation: ripper 270ms linear forwards; + + position: absolute; + top: calc(50% - 40rpx); + left: calc(50% - 40rpx); + } + + @keyframes ripper { + from { + opacity: 0.8; + } + + to { + opacity: 0.1; + transform: scale(2.6, 2.6); + } + } + } } } diff --git a/pages/home/home.vue b/pages/home/home.vue index d7e1122..33f82ce 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -129,7 +129,7 @@ - + @@ -144,6 +144,10 @@ + + + + @@ -176,15 +180,7 @@ value: 136, type: 1 }], - infoList: [{ - title: "学习护理让老年人活动康复的训练", - time: "2022-06-26 12:23:45" - }, - { - title: "学习护理让老年人活动康复的训练", - time: "2022-06-26 12:23:45" - } - ] + infoList: [] } }, methods: { @@ -202,6 +198,10 @@ async getStatistic() { let res = await this.$u.api.statistic() console.log(res); + }, + async getRemind() { + let res = await this.$u.api.noticeList() + this.infoList = res.data } }, computed: { @@ -209,6 +209,7 @@ }, onShow() { this.getStatistic() + this.getRemind() } } @@ -636,5 +637,12 @@ } } } + + .no-data { + transform: translate(-50%, -50%); + position: absolute; + top: 50%; + left: 50%; + } } diff --git a/pages/list/list.vue b/pages/list/list.vue index ac1785f..f99343b 100644 --- a/pages/list/list.vue +++ b/pages/list/list.vue @@ -15,10 +15,12 @@ - - + + - + @@ -76,7 +78,7 @@ {{item.distance}}公里 - + 去那里 @@ -95,7 +97,9 @@ - + + + @@ -110,8 +114,12 @@ fontWeight: "500" }, optionsStatus: [{ + label: '全部', + value: '' + }, + { label: '待护理', - value: 0, + value: '0', }, { label: '护理中', @@ -121,15 +129,21 @@ label: '已护理', value: 2, }, + ], optionsSex: [{ + label: '全部', + value: '' + }, + { label: '男', value: '男', }, { label: '女', value: '女', - } + }, + ], status: 'loadmore', loadText: { @@ -144,10 +158,11 @@ page_size: 10, page: 1, sex: '', - date: '', status: '', lat: '', - lng: '' + lng: '', + start_time: '', + end_time: '', }, } }, @@ -161,24 +176,57 @@ this.isShowCalendar = false }, datePick(e) { - this.select.date = e.result + console.log(e); + this.select.start_time = e.startDate + this.select.end_time = `${e.endDate} 23:59:59` + this.$refs['dropdown'].close() + this.nursingList = [] this.getList() }, async getList() { - let res = await this.$u.api.nurseList(this.select) - if (res.data.length > 0 && res.data) { - this.nursingList.push(...res.data) - this.status = 'loadmore' - } else { - this.status = 'nomore' - this.select.page-- - } + this.$u.throttle(async () => { + let res = await this.$u.api.nurseList(this.select) + if (res.data.length > 0 && res.data) { + this.nursingList.push(...res.data) + this.status = 'loadmore' + } else { + this.status = 'nomore' + if (this.select.page > 1) { + this.select.page-- + } + } + }) }, + toThere(item) { + this.$u.throttle(() => { + uni.openLocation({ + latitude: Number(item.customer.lat), + longitude: Number(item.customer.lng), + name: item.customer.address + }) + }) + } }, computed: { - + statusComputed() { + return function(status) { + switch (status) { + case '0': + return "待护理" + break; + case 1: + return "护理中" + break; + case 2: + return "已护理" + break; + default: + return '全部' + } + } + } }, onShow() { uni.getLocation().then(res => { @@ -191,6 +239,7 @@ onReachBottom() { this.select.page++ this.status = 'loading'; + this.getList() } } diff --git a/pages/map/map.vue b/pages/map/map.vue index 4cd9962..750a25d 100644 --- a/pages/map/map.vue +++ b/pages/map/map.vue @@ -4,16 +4,24 @@ - + {{selectMarker.info.customer.name}} {{selectMarker.info.customer.sex}} - + 进行中 + + + 待护理 + + + + 已完成 + @@ -65,6 +73,7 @@ [2, '/static/map/done.png'], ]), isShowPopup: false, + popHeight: '294rpx', selectMarker: null, } }, @@ -187,7 +196,6 @@ computed: { }, - async onReady() { await this.getNowLocation() @@ -270,8 +278,7 @@ .center { - padding-left: 40rpx; - padding-top: 18rpx; + padding: 18rpx 0 20rpx 40rpx; .tel { height: 40rpx; @@ -289,12 +296,10 @@ } .address { - height: 40rpx; font-size: 28rpx; font-family: PingFang-SC-Medium, PingFang-SC; font-weight: 500; color: #36596A; - line-height: 40rpx; display: flex; margin-top: 8rpx; @@ -311,7 +316,7 @@ justify-content: space-between; align-items: center; - margin-top: 20rpx; + padding-bottom: 20rpx; .distance { align-items: center; diff --git a/pages/nursingCalendar/nursingCalendar.vue b/pages/nursingCalendar/nursingCalendar.vue index f83bf0d..dca0256 100644 --- a/pages/nursingCalendar/nursingCalendar.vue +++ b/pages/nursingCalendar/nursingCalendar.vue @@ -115,7 +115,7 @@ export default { data() { return { - testDay: [{ + statusDay: [{ date: 1, status: 2 }, @@ -166,18 +166,15 @@ page: 1, date: '', lat: '', - lng: '' + lng: '', + sex: '', + status: '', + lng: '', + lat: '' } } }, methods: { - //判断日期是否有护理 - dateIn(date) { - let res = this.testDay.filter(item => { - return item.date === date - }) - return res[0] ? res[0].status : false - }, monthPlus() { this.$u.throttle(() => { if (this.select.month < 12) { @@ -295,6 +292,21 @@ }) }) }, + getCalendarStatus() { + this.$u.api.nurseList({ + start_time: `${this.select.year}-${this.select.month.toString().padStart(2,'0')}-01`, + end_time: `${this.select.year}-${this.select.month.toString().padStart(2,'0')}-${31} 23:59:59`, + page_size: 999, + page: 1, + }).then(res => { + this.statusDay = res.data.map(item => { + return { + date: new Date(item.date).getDate(), + status: item.status + } + }) + }) + } }, computed: { getDay() { @@ -323,6 +335,15 @@ } } }, + //判断日期是否有护理 + dateIn() { + return function(date) { + let res = this.statusDay.filter(item => { + return item.date === date + }) + return res[0] ? res[0].status : false + } + }, }, watch: { select: { @@ -331,6 +352,7 @@ this.selector.date = `${this.select.year}-${this.select.month}-${this.select.date}` this.getList() + this.getCalendarStatus() }, immediate: true, deep: true diff --git a/pages/setting/setting.vue b/pages/setting/setting.vue index 0d1093c..cb2655d 100644 --- a/pages/setting/setting.vue +++ b/pages/setting/setting.vue @@ -1,207 +1,248 @@ diff --git a/pages/todayNursing/todayNursing.vue b/pages/todayNursing/todayNursing.vue index 48a74b8..83ba09b 100644 --- a/pages/todayNursing/todayNursing.vue +++ b/pages/todayNursing/todayNursing.vue @@ -60,7 +60,7 @@ {{item.distance}}公里 - + 去那里 @@ -116,6 +116,16 @@ let res = await this.$u.api.nurseList(this.select) console.log(res); this.nursingList = res.data + }, + + toThere(item) { + this.$u.throttle(() => { + uni.openLocation({ + latitude: Number(item.customer.lat), + longitude: Number(item.customer.lng), + name: item.customer.address + }) + }) } }, computed: { diff --git a/store/index.js b/store/index.js index 26e2bc9..1754399 100644 --- a/store/index.js +++ b/store/index.js @@ -58,6 +58,7 @@ const store = new Vuex.Store({ saveLifeData(saveKey, state[saveKey]) }, + logout(state) { state.vuex_user = null state.vuex_loginStatus = 0