xy 2 years ago
parent c197ec9b30
commit 7436b7c576

@ -12,14 +12,14 @@
content: "新版本已经准备好,是否重启应用?",
success(res) {
if (res.confirm) {
// applyUpdate
// applyUpdate
updateManager.applyUpdate();
}
}
});
});
updateManager.onUpdateFailed(function() {
//
//
uni.showModal({
title: "已经有新版本了哟~",
content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~"
@ -29,8 +29,9 @@
});
updateManager.onUpdateFailed(function(res) {
//
//
});
},
onShow: function() {
console.log('App Show')

@ -15,6 +15,8 @@ let apiTask = {
noticeList: "/api/nurse/notice-list",
noticeDetail: "/api/nurse/notice-detail",
statistic: "/api/nurse/statistic",
customerAndOrder: "/api/nurse/customer-and-order",
scheduleSave: "/api/nurse/schedule-save",
};
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作
const install = (Vue, vm) => {
@ -32,6 +34,8 @@ const install = (Vue, vm) => {
let noticeList = (params = {}) => vm.$u.get(apiTask.noticeList, params);
let noticeDetail = (params = {}) => vm.$u.get(apiTask.noticeDetail, params);
let statistic = (params = {}) => vm.$u.get(apiTask.statistic, params);
let customerAndOrder = (params = {}) => vm.$u.get(apiTask.customerAndOrder, params);
let scheduleSave = (data = {}) => vm.$u.post(apiTask.scheduleSave, data)
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = {
login,
@ -45,7 +49,9 @@ const install = (Vue, vm) => {
nurseCalendar,
noticeList,
noticeDetail,
statistic
statistic,
customerAndOrder,
scheduleSave
};
};

@ -0,0 +1,201 @@
<template>
<view v-if="showPrivacy" :class="privacyClass">
<view :class="contentClass">
<view class="title">隐私保护指引</view>
<view class="des">
感谢选择我们的小程序我们非常重视您的个人信息安全和隐私保护根据最新法律要求使用我们的产品前请仔细阅读<text class="link"
@tap="openPrivacyContract">{{privacyContractName}}
</text>以便我们向您提供更优质的服务<br />我们将尽全力保护您的个人信息及合法权益感谢您的信任
<br />
</view>
<view class="btns">
<button class="item reject" @tap="exitMiniProgram"></button>
<button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'PrivacyPopup',
data() {
return {
privacyContractName: '',
showPrivacy: false,
isRead: false,
resolvePrivacyAuthorization: null,
};
},
props: {
position: {
type: String,
default: 'center'
}
},
computed: {
privacyClass() {
return this.position === 'bottom' ? 'privacy privacy-bottom' : 'privacy';
},
contentClass() {
return this.position === 'bottom' ? 'content content-bottom' : 'content';
}
},
mounted() {
if (wx.onNeedPrivacyAuthorization) {
wx.onNeedPrivacyAuthorization((resolve) => {
this.resolvePrivacyAuthorization = resolve;
});
}
if (wx.getPrivacySetting) {
wx.getPrivacySetting({
success: (res) => {
console.log(res, 'getPrivacySetting');
if (res.needAuthorization) {
this.privacyContractName = res.privacyContractName;
this.showPrivacy = true;
}
},
});
}
},
methods: {
openPrivacyContract() {
wx.openPrivacyContract({
success: () => {
this.isRead = true;
},
fail: () => {
uni.showToast({
title: '遇到错误',
icon: 'error',
});
},
});
},
exitMiniProgram() {
this.$emit('reject-privacy'); //
wx.exitMiniProgram();
},
handleAgreePrivacyAuthorization() {
// if (this.isRead) {
this.showPrivacy = false;
this.$emit('agree-privacy'); //
if (typeof this.resolvePrivacyAuthorization === 'function') {
this.resolvePrivacyAuthorization({
buttonId: 'agree-btn',
event: 'agree',
});
}
// } else {
// uni.showToast({
// title: '',
// icon: 'error',
// });
// }
},
},
};
</script>
<style scoped>
.privacy {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, .5);
z-index: 9999999;
display: flex;
align-items: center;
justify-content: center;
}
.privacy-bottom {
align-items: flex-end;
}
.content {
width: 632rpx;
padding: 48rpx;
box-sizing: border-box;
background: #fff;
border-radius: 16rpx;
}
.content-bottom {
position: absolute;
bottom: 0;
width: 96%;
padding: 36rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
border-radius: 16rpx 16rpx 0 0;
}
.content .title {
text-align: center;
color: #333;
font-weight: bold;
font-size: 32rpx;
}
.content .des {
font-size: 26rpx;
color: #666;
margin-top: 40rpx;
text-align: justify;
line-height: 1.6;
}
.content .des .link {
color: #07c160;
text-decoration: underline;
}
.btns {
margin-top: 48rpx;
margin-bottom: 12rpx;
display: flex;
}
.btns .item {
width: 200rpx;
height: 72rpx;
overflow: visible;
display: flex;
align-items: center;
justify-content: center;
/* border-radius: 16rpx; */
box-sizing: border-box;
border: none !important;
}
.btns .reject {
background: #f4f4f5;
color: #666;
font-size: 14px;
font-weight: 300;
margin-right: 16rpx;
}
.btns .agree {
width: 320rpx;
background: #07c160;
color: #fff;
font-size: 16px;
}
.privacy-bottom .btns .agree {
width: 440rpx;
}
</style>

@ -63,7 +63,8 @@
"requiredPrivateInfos" : [ "getLocation" ],
"optimization" : {
"subPackages" : true
}
},
"__usePrivacyCheck__" : true
},
"mp-alipay" : {
"usingComponents" : true

@ -70,7 +70,7 @@
</view>
<view class="content">
<u-checkbox-group :max="(detail.product.demand === 1) ? 1 : 999">
<view class="content-item" v-for="(item,index) in skuList" :key='item.info.id'>
<view class="content-item" v-if="skuList.length > 1" v-for="(item,index) in skuList" :key='item.info.id'>
<u-checkbox class="checkbox" label-size="34" size="36" :disabled="detail.status === 2"
v-model="item.isSelect" shape="square" :name="item.form.name"
@change="selectPick($event,item)">
@ -85,6 +85,12 @@
<view style="font-size: 34rpx;">分钟</view>
</view>
</view>
<view class="content-item" v-else v-for="(item,index) in skuList" :key='item.info.id'>
<view style="width: 210rpx;text-align: center;font-weight: bold;color: #333;">{{ item.info.name }}</view>
<view style="width: 220rpx;text-align: center;font-weight: bold;color: #333;">
{{item.info.time_lenth}}分钟
</view>
</view>
</u-checkbox-group>
</view>
</view>
@ -150,7 +156,7 @@
</u-modal>
<imgUpload ref="imgUpload" :isShow.sync="isShowImg" :type="type" @confirm="clock"></imgUpload>
</view>
</view>
</template>
<script>
@ -244,10 +250,10 @@
if (item.sku_id && item.sku_info) {
this.skuList.push({
info: item.sku_info,
isSelect: item.time ? true : false,
isSelect: (item.time || res.sku.length === 1),
form: {
id: item.id,
time: item.time || '',
time: res.sku.length === 1 ? (item.sku_info.time_lenth) : (item.time || ''),
sku_id: item.sku_id,
}
})
@ -265,6 +271,28 @@
console.log(this.skuList);
},
getMapDistance (location1,location2) {
const [lat1,lng1] = location1;
const [lat2,lng2] = location2;
let radLat1 = lat1*Math.PI / 180.0;
let radLat2 = lat2*Math.PI / 180.0;
let a = radLat1 - radLat2;
let b = lng1*Math.PI / 180.0 - lng2*Math.PI / 180.0;
let s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) +
Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));
s = s *6378.137 ;// EARTH_RADIUS;
s = Math.round(s * 10000) / 10000;
s = s * 1000
if (isNaN(s)) {
return false;
}
return Math.floor(s/1000 * 100) / 100;
},
//
getLoaction() {
return new Promise((resolve, reject) => {
@ -479,51 +507,70 @@
//退
checkSignOut() {
//
if (this.detail.logs_count < this.detail.product.process_total) {
uni.showToast({
icon: 'none',
title: `请先完成${this.detail.product.process_total}次打卡,再签退。当前完成打卡次数${this.detail.logs_count}`
})
return
}
//
let flag = false
for (let i of this.skuList) {
if (i.isSelect && i.form.time) {
flag = true
}
}
if (!flag) {
uni.showToast({
icon: 'none',
title: `请选择并填写服务项目与时间`
})
return
}
//
let useTotalTime = 0
for (let i of this.skuList) {
if (i.isSelect && i.form.time) {
useTotalTime += Number(i.form.time)
}
}
let totalTime = this.$moment(new Date()).diff(this.$moment(this.detail.sign_in), 'minutes')
if (useTotalTime <= (totalTime + 10) && useTotalTime > totalTime && this.detail.demand === 2) {
this.signOut()
uni.showToast({
icon:'none',
title:'请下次补足时间',
duration:2000
})
} else if (useTotalTime <= totalTime){
this.signOut()
} else {
this.tips="当前勾选的时间为"+useTotalTime+"分钟,实际服务时间为"+totalTime+"分钟。系统要求实际服务时间要大于您勾选的时间。";
this.isShowModal = true
}
uni.getLocation({
type: 'gcj02',
isHighAccuracy: true
}).then(res => {
if (res[1]) {
//
const distance = this.getMapDistance([res[1].latitude,res[1].longitude],this.detail.sign_in_loc.split(","))
console.log('distance',distance)
if (!distance && distance > 2) {
uni.showToast({
icon:'none',
title:'当前签退位置距离签到位置过远!',
duration:2000
})
return
}
//
if (this.detail.logs_count < this.detail.product.process_total) {
uni.showToast({
icon: 'none',
title: `请先完成${this.detail.product.process_total}次打卡,再签退。当前完成打卡次数${this.detail.logs_count}`
})
return
}
//
let flag = false
for (let i of this.skuList) {
if (i.isSelect && i.form.time) {
flag = true
}
}
if (!flag) {
uni.showToast({
icon: 'none',
title: `请选择并填写服务项目与时间`
})
return
}
//
let useTotalTime = 0
for (let i of this.skuList) {
if (i.isSelect && i.form.time) {
useTotalTime += Number(i.form.time)
}
}
let totalTime = this.$moment(new Date()).diff(this.$moment(this.detail.sign_in), 'minutes')
if (useTotalTime <= (totalTime + 10) && useTotalTime > totalTime && this.detail.demand === 2) {
this.signOut()
uni.showToast({
icon:'none',
title:'请下次补足时间',
duration:2000
})
} else if (useTotalTime <= totalTime){
this.signOut()
} else {
this.tips="当前勾选的时间为"+useTotalTime+"分钟,实际服务时间为"+totalTime+"分钟。系统要求实际服务时间要大于您勾选的时间。";
this.isShowModal = true
}
}
})
},
//退
signOut() {
@ -634,7 +681,6 @@
.name {
height: 48rpx;
font-size: 32rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #333333;
line-height: 24rpx;
@ -649,7 +695,6 @@
.age {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #A7AFBC;
line-height: 34rpx;
@ -661,7 +706,6 @@
background: #FDECEC;
opacity: 0.5;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
text-align: center;
@ -675,7 +719,6 @@
height: 40rpx;
background: #F9F9F9;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 40rpx;
@ -711,7 +754,6 @@
display: flex;
align-items: center;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
@ -748,7 +790,6 @@
.text {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #A7AFBC;
line-height: 34rpx;
@ -767,7 +808,6 @@
.title {
font-size: 32rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #333333;
@ -829,7 +869,6 @@
&>view {
height: 40rpx;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 40rpx;
@ -883,7 +922,6 @@
.text-class {
height: 46rpx;
font-size: 32rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #FFFFFF;
line-height: 46rpx;
@ -903,7 +941,6 @@
.clock-info {
width: 650rpx;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 40rpx;

@ -291,7 +291,6 @@
width: 392rpx;
height: 34rpx;
font-size: 32rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 34rpx;
@ -411,7 +410,6 @@
width: 302rpx;
height: 50rpx;
font-size: 36rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #FFFFFF;
line-height: 50rpx;
@ -425,7 +423,6 @@
width: 500rpx;
height: 40rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #FFFFFF;
line-height: 40rpx;
@ -485,7 +482,6 @@
width: 270rpx;
height: 48rpx;
font-size: 32rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #333333;
line-height: 48rpx;
@ -517,7 +513,6 @@
width: 48rpx;
height: 34rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #A7AFBC;
line-height: 34rpx;
@ -544,7 +539,6 @@
width: 200rpx;
height: 40rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #ABAEBE;
line-height: 20rpx;
@ -572,7 +566,6 @@
.number {
height: 50rpx;
font-size: 36rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #36596A;
line-height: 50rpx;
@ -583,7 +576,6 @@
.unit {
height: 50rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #ABAEBE;
line-height: 50rpx;
@ -609,7 +601,6 @@
width: 84rpx;
height: 40rpx;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 40rpx;
@ -622,7 +613,6 @@
.number {
height: 50rpx;
font-size: 36rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #36596A;
line-height: 50rpx;
@ -635,7 +625,6 @@
width: 100rpx;
height: 50rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #ABAEBE;
line-height: 50rpx;
@ -676,7 +665,6 @@
.info-title {
width: 480rpx;
font-size: 32rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 46rpx;
@ -686,7 +674,6 @@
width: 600rpx;
height: 40rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #ABAEBE;
line-height: 40rpx;
@ -715,4 +702,4 @@
padding: 0 10rpx;
}
</style>
</style>

@ -197,7 +197,7 @@
this.nursingList = []
this.getList()
},
calendarShow(e) {
if (e === 2) {
this.isShowCalendar = true
@ -324,7 +324,6 @@
/deep/.u-dropdown__menu__item__text {
flex: 1 !important;
font-size: 32rpx !important;
font-family: PingFang-SC-Medium, PingFang-SC !important;
font-weight: 500 !important;
color: #333333 !important;
text-align: center;
@ -395,7 +394,6 @@
.time {
height: 40rpx;
font-size: 40rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 40rpx;
@ -416,7 +414,6 @@
width: 84rpx;
height: 40rpx;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 40rpx;
@ -455,7 +452,6 @@
width: 270rpx;
height: 48rpx;
font-size: 32rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #333333;
}
@ -463,7 +459,6 @@
.tel {
height: 40rpx;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 40rpx;
@ -479,7 +474,6 @@
.address {
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 40rpx;
@ -509,7 +503,6 @@
width: 28rpx;
height: 34rpx;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #36596A;
line-height: 34rpx;
@ -537,7 +530,6 @@
.distance-text {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #A7AFBC;
line-height: 34rpx;
@ -555,7 +547,6 @@
.to-there-text {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #A7AFBC;
line-height: 34rpx;

@ -146,7 +146,6 @@
width: 400rpx;
height: 168rpx;
font-size: 120rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
line-height: 168rpx;
}
@ -155,7 +154,6 @@
width: 384rpx;
height: 46rpx;
font-size: 32rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
line-height: 46rpx;
@ -178,7 +176,6 @@
width: 84rpx;
height: 40rpx;
font-size: 28rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #666666;
line-height: 40rpx;
@ -219,7 +216,6 @@
width: 144rpx;
height: 34rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #fff;
line-height: 34rpx;
@ -232,7 +228,6 @@
width: 298rpx;
height: 34rpx;
font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #ffffff;
line-height: 34rpx;

@ -90,7 +90,7 @@
<view class="top">{{item.customer.name}}</view>
<view class="bottom">
<view class="time">
{{dateFormat(item.start_time,'HH:mm')}}~{{dateFormat(item.end_time,'HH:MM')}}
{{dateFormat(item.start_time,'HH:mm')}}~{{dateFormat(item.end_time,'HH:mm')}}
</view>
<view class="list-status-icon"
:class="{icon1:item.status === 0,icon2:item.status === 2,icon3:item.status === 1}">
@ -190,8 +190,6 @@
lng: '',
sex: '',
status: '',
lng: '',
lat: ''
}
}
},
@ -382,9 +380,9 @@
this.getCalendar(this.select.year, this.select.month)
this.selector.date = `${this.select.year}-${this.select.month}-${this.select.date}`
this.$u.debounce(() => {
this.getList()
this.getCalendarStatus()
this.$u.debounce(() => {
this.getList()
this.getCalendarStatus()
},700)
},
immediate: true,
@ -722,4 +720,4 @@
}
}
}
</style>
</style>

@ -2,69 +2,287 @@
<view>
<cpn-navbar title="预约护理" :is-back="true"></cpn-navbar>
<view>
<view style="padding-bottom: 40rpx;">
<!-- 用户信息 -->
<!-- <view class="user-info" v-if="detail.customer">-->
<!-- <view class="top">-->
<!-- <view class="left">-->
<!-- <u-image :src="detail.customer.sex === '男' ? vuex_male_img : vuex_female_img" width="104"-->
<!-- height="104" shape="circle"></u-image>-->
<!-- </view>-->
<!-- <view class="center">-->
<!-- <view class="name">{{detail.customer.name}}</view>-->
<!-- <view class="infos">-->
<!-- <view class="age">{{ageComputed(detail.customer.idcard)}}-->
<!-- </view>-->
<!-- <view class="sex">{{detail.customer.sex}}</view>-->
<!-- <view class="organ">机构护理</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="right">-->
<!-- <template v-if="detail.status === 0">-->
<!-- <view class="icon1"></view>-->
<!-- <view>待护理</view>-->
<!-- </template>-->
<!-- <template v-if="detail.status === 1">-->
<!-- <view class="icon3"></view>-->
<!-- <view>护理中</view>-->
<!-- </template>-->
<!-- <template v-if="detail.status === 2">-->
<!-- <view class="icon2"></view>-->
<!-- <view>已护理</view>-->
<!-- </template>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="line"></view>-->
<!-- <view class="bottom">-->
<!-- <view class="client">-->
<!-- <u-icon name="/static/detail/people.png" width="26" height="26"></u-icon>-->
<!-- <view>委托人{{detail.customer.contact_name}}</view>-->
<!-- </view>-->
<!-- <view class="address">-->
<!-- <u-icon name="map" width="28" height="28" color="#1479FF"></u-icon>-->
<!-- <view>{{ addressFormat(detail.customer.customer_address) }}</view>-->
<!-- </view>-->
<!-- <view class="phone">-->
<!-- <u-icon name="phone" width="28" height="28" color="#1479FF"></u-icon>-->
<!-- <view>{{detail.customer.phone}}</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<view class="user-info" v-if="vuex_selected_customer">
<view class="top">
<view class="left">
<u-image :src="vuex_selected_customer.sex === '男' ? vuex_male_img : vuex_female_img" width="104"
height="104" shape="circle"></u-image>
</view>
<view class="center">
<view class="name">{{vuex_selected_customer.name}}</view>
<view class="infos">
<view class="age">{{ageComputed(vuex_selected_customer.idcard)}}
</view>
<view class="sex">{{vuex_selected_customer.sex}}</view>
<view class="organ">机构护理</view>
</view>
</view>
<view class="right">
<template v-if="vuex_selected_customer.status === 1">
<view class="icon1"></view>
<view>正常</view>
</template>
<template v-if="vuex_selected_customer.status === 2">
<view class="icon3"></view>
<view>暂停</view>
</template>
<template v-if="vuex_selected_customer.status === 3">
<view class="icon2"></view>
<view>签退</view>
</template>
</view>
</view>
<view class="line"></view>
<view class="bottom">
<view class="client">
<u-icon name="/static/detail/people.png" width="26" height="26"></u-icon>
<view>委托人{{vuex_selected_customer.contact_name}}</view>
</view>
<view class="address">
<u-icon name="map" width="28" height="28" color="#1479FF"></u-icon>
<view>{{ customerAddress(vuex_selected_customer.customer_address) }}</view>
</view>
<view class="phone">
<u-icon name="phone" width="28" height="28" color="#1479FF"></u-icon>
<view>{{vuex_selected_customer.phone}}</view>
</view>
</view>
</view>
<!-- 护理项目-->
<view class="sku-list">
<view class="title">
项目选择
</view>
<view class="line"></view>
<view class="sku-content">
<view class="sku-content__item"
:class="{ 'sku-content__item-active': form.schedule_list_skus.find(i => i.sku_id === item.id) }"
v-for="item in mySkus"
:key="item.id"
@click="form.schedule_list_skus = [{ sku_id: item.id }]">
<view style="font-weight: 600;">{{ item.name }}</view>
<view style="transform: scale(.8,.8)">{{ item.worth }}工时</view>
</view>
</view>
</view>
<!-- 服务时间-->
<view class="service-time">
<view class="title">
时间选择
</view>
<view class="line"></view>
<view class="time-content" @click="showTimePicker = true">
<view>
<span>预约时间</span><span style="color: red;">*</span>
<view style="margin-top: 10rpx;">
<u-tag mode="dark" type="primary" v-if="form.start_time && form.end_time" :text="`${$moment(form.start_time).format('YYYY-MM-DD HH:mm')} ~ ${$moment(form.end_time).format('HH:mm')}`"></u-tag>
</view>
</view>
<u-icon name="arrow-right" label="请选择" label-pos="left"></u-icon>
</view>
</view>
<!-- 地址选择-->
<view class="address-select">
<view class="title">
上门地址
</view>
<view class="line"></view>
<view class="address-content" @click="showAddressSelect = true">
<view>
<span>地址选择</span><span style="color: red;">*</span>
<view style="margin-top: 10rpx;">
<u-tag mode="dark" type="primary" v-if="form.address && form.address_id" :text="form.address"></u-tag>
</view>
</view>
<u-icon name="arrow-right" label="请选择" label-pos="left"></u-icon>
</view>
</view>
<u-button :custom-style="{ 'margin': '40rpx 20rpx' }" type="primary" :ripple="true" @click="submit"></u-button>
</view>
<u-picker :title="pickerType === 1 ? '开始时间' : '结束时间'"
mode="time"
v-model="showTimePicker"
:params="params"
@confirm="confirm"></u-picker>
<u-select v-model="showAddressSelect" :list="vuex_selected_customer.customer_address" value-name="id" label-name="address" @confirm="pickAddress"></u-select>
<u-toast ref="uToast" />
</view>
</template>
<script>
import { getAgeByIdcard } from "@/common/util";
export default {
data() {
return {};
}
return {
showAddressSelect: false,
pickerType: 1,//12
showTimePicker: false,
form: {
schedule_list_skus: [],
customer_id: '',
product_id: '',
order_id: '',
address_id: '',
address: '',
start_time: '',
end_time: ''
}
};
},
computed: {
serviceTime () {
},
customerAddress () {
return function (addresses) {
return addresses.find(i => i.default)?.address || addresses[0]?.address || '无'
}
},
ageComputed() {
return function(idcard) {
return getAgeByIdcard(idcard)
}
},
mySkus () {
return this.vuex_user.nurse_sku_links.map(i => i.sku)
},
params () {
return this.pickerType === 1 ? {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: false,
timestamp: true
} : {
year: false,
month: false,
day: false,
hour: true,
minute: true,
second: false,
timestamp: true
}
}
},
methods: {
getOrder () {
if (this.vuex_selected_customer.orders.length === 1) {
return this.vuex_selected_customer.orders[0]
} else if (this.vuex_selected_customer.orders.length > 1) {
return this.vuex_selected_customer.orders.find(i => {
let now = this.$moment().valueOf()
return (this.$moment(i.start_date).valueOf() <= now) && (this.$moment(i.end_date).valueOf() >= now)
})
} else {
return {}
}
},
confirm (time) {
console.log(time)
if (this.pickerType === 1) {
this.form.start_time = this.$moment(time.timestamp * 1000).format('YYYY-MM-DD HH:mm:ss')
} else {
this.form.end_time = `${this.$moment(this.form.start_time).format('YYYY-MM-DD')} ${this.$moment(time.timestamp * 1000).format('HH:mm:ss')}`
}
this.pickerType = this.pickerType === 1 ? 2 : 1
if (this.pickerType === 2) {
setTimeout(() => this.showTimePicker = true,500)
}
console.log(this.form)
},
pickAddress (e) {
this.form.address = e[0].label;
this.form.address_id = e[0].value;
},
submit () {
if (this.vuex_selected_customer.status !== 1) {
this.$refs.uToast.show({
title: '用户状态不为正常',
type: 'warning'
})
return
}
if (!(this.form.start_time && this.form.end_time)) {
this.$refs.uToast.show({
title: '请选择预约时间',
type: 'warning'
})
return
}
if (!(this.form.address && this.form.address_id)) {
this.$refs.uToast.show({
title: '请选择上门地址',
type: 'warning'
})
return
}
if (!(this.form.schedule_list_skus instanceof Array) || this.form.schedule_list_skus.length === 0) {
this.$refs.uToast.show({
title: '请选择一项服务内容',
type: 'warning'
})
return
}
const order = this.getOrder()
if (order.id && order.product_id) {
this.form.order_id = order.id
this.form.product_id = order.product_id
this.form.customer_id = this.vuex_selected_customer.id
this.$u.api.scheduleSave(this.form).then(res => {
this.$refs.uToast.show({
title: '预约成功',
type: 'success'
})
setTimeout(() => {
uni.navigateBack()
},2000)
})
} else {
this.$refs.uToast.show({
title: '无效订单',
type: 'warning'
})
}
}
},
onShow() {
},
}
</script>
<style lang="scss">
.line {
width: 670rpx;
height: 2rpx;
border: 2rpx solid #EEEFF5;
margin: 30rpx auto 0 auto;
}
.user-info {
width: 710rpx;
background: #FFFFFF;
@ -149,14 +367,6 @@ export default {
}
}
.line {
width: 670rpx;
height: 2rpx;
border: 2rpx solid #EEEFF5;
margin: 30rpx auto 0 auto;
}
.bottom {
padding: 26rpx 0 34rpx 24rpx;
@ -210,4 +420,115 @@ export default {
}
}
}
.sku-list {
width: 710rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(219, 218, 218, 0.5);
margin: 40rpx auto 0 auto;
padding: 20rpx;
position: relative;
.title {
color: #3877f6;
font-size: 34rpx;
font-weight: 600;
line-height: 2;
}
.line {
margin-top: 20rpx;
}
.sku-content {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 40rpx;
margin-top: 20rpx;
&__item {
color: #333;
border-radius: 10rpx;
border: 2rpx #ccc solid;
text-align: center;
transition: all .2s;
padding: 20rpx 0;
&-active {
color: #fff;
background: #3877f6;
border-color: #5086f5;
filter: drop-shadow(0 0 10rpx #5086f5);
}
}
}
}
.service-time {
width: 710rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(219, 218, 218, 0.5);
margin: 40rpx auto 0 auto;
padding: 20rpx;
position: relative;
.title {
color: #3877f6;
font-size: 34rpx;
font-weight: 600;
line-height: 2;
}
.line {
margin-top: 20rpx;
}
.time-content {
display: flex;
align-content: center;
justify-content: space-between;
text-indent: 10rpx;
margin-top: 20rpx;
& > view {
font-weight: 600;
letter-spacing: 2rpx;
}
}
}
.address-select {
width: 710rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(219, 218, 218, 0.5);
margin: 40rpx auto 0 auto;
padding: 20rpx;
position: relative;
.title {
color: #3877f6;
font-size: 34rpx;
font-weight: 600;
line-height: 2;
}
.line {
margin-top: 20rpx;
}
.address-content {
display: flex;
align-content: center;
justify-content: space-between;
text-indent: 10rpx;
margin-top: 20rpx;
& > view {
font-weight: 600;
letter-spacing: 2rpx;
}
}
}
</style>

@ -4,54 +4,66 @@
<view>
<!-- 搜索 -->
<view class="search">
<view class="input-content">
<u-input :clearable="false" value="" placeholder="请输入要搜索的内容" height="30" :custom-style="inputStyle"
@input=""></u-input>
</view>
<view class="icon">
<u-icon name="search" size="46" color="#ABAEBE"></u-icon>
</view>
</view>
<!-- <view class="search">-->
<!-- <view class="input-content">-->
<!-- <u-input :clearable="false" value="" placeholder="请输入要搜索的内容" height="30" :custom-style="inputStyle"-->
<!-- @input=""></u-input>-->
<!-- </view>-->
<!-- <view class="icon">-->
<!-- <u-icon name="search" size="46" color="#ABAEBE"></u-icon>-->
<!-- </view>-->
<!-- </view>-->
<view class="customer-list">
<view class="customer-list__item" v-for="(item, index) in customers" :key="item.id">
<view class="top">
<view class="avatar">
<u-image :src="item.customer.sex === '男' ? vuex_male_img : vuex_female_img" height="104"
<u-image :src="item.sex === '男' ? vuex_male_img : vuex_female_img" height="104"
width="104" shape="circle"></u-image>
</view>
<view class="user-info">
<view class="name">{{item.customer.name}}</view>
<view class="name">
<view>
{{item.name}}
</view>
<view class="sex">
<view class="sex-text">
{{item.sex || '无'}}
</view>
</view>
<view class="time">
<span style="padding: 0 6rpx;">{{ Number(item.total_worth).toFixed(2) }}/{{ Number(item.all_worth).toFixed(2) }}</span>
<span style="zoom: .7;">工时</span>
</view>
</view>
<view class="tel">
<view>
<u-icon name="phone" size="28" color="#1479FF"></u-icon>
</view>
<view class="text">{{item.customer.phone || '无'}}</view>
<view class="text">{{item.phone || '无'}}</view>
</view>
<view class="address">
<view>
<u-icon name="map" size="28" color="#1479FF"></u-icon>
</view>
<view class="text">{{item.customer_address.address || '无'}}</view>
</view>
</view>
<view class="sex">
<view class="sex-text">
{{item.customer.sex || '无'}}
<view class="text">{{ customerAddress(item.customer_address) }}</view>
</view>
</view>
</view>
<view class="line"></view>
<view class="bottom" @click="toAddOrder">
<view class="bottom" @click="toAddOrder(item)">
<u-icon color="#1479FF" name="bell-fill"></u-icon>
<span>立即预约</span>
</view>
</view>
</view>
</view>
<u-modal v-model="isShowModal" content="预约用户剩余工时小于0" @confirm="isShowModal = false">
</u-modal>
</view>
</template>
@ -59,23 +71,50 @@
export default {
data() {
return {
isShowModal: false,
inputStyle: {
width: "600rpx",
fontSize: "28rpx",
fontWeight: "500"
},
customers: [{"id":11395,"no":"202312250933084cac20335","order_id":892,"admin_id":1,"department_id":null,"customer_id":768,"product_id":24,"date":"2023-12-25","start_time":"2023-12-25 09:31:13","end_time":"2023-12-25 11:31:20","nurse_id":90,"status":2,"address_id":1592,"created_at":"2023-12-25 09:33:08","updated_at":"2023-12-25 10:32:08","deleted_at":null,"sign_in":"2023-12-25 09:39:49","sign_in_address":"江苏省苏州市吴中区太湖东路288号长桥苏州市吴中区人民政府(太湖东路北)","sign_in_loc":"31.26249,120.63212","sign_out":"2023-12-25 10:32:08","sign_out_address":"江苏省苏州市吴中区太湖东路288号长桥苏州市吴中区人民政府(太湖东路北)","sign_out_loc":"31.26249,120.63212","is_error":0,"address":"金坛区直溪镇溪滨村村民委员会","month_count":"1","month_time":"0","distance":12878.6,"status_text":"已护理","customer":{"id":768,"name":"叶华","phone":"18861212210","idcard":"320124197907010227","sex":"女","birthday":"1979-07-01","contact_name":"耿志俊","contact_phone":"18861212210","idcard_address":"直溪镇溪滨村村委会大耿庄85","is_dead":0,"remark":null,"level_id":18,"created_at":"2023-11-20 13:58:47","updated_at":"2023-11-20 13:58:47","deleted_at":null,"city_id":"21","area_id":"15","street_id":"27","level_type":34,"status":1},"customer_address":{"id":1592,"name":null,"customer_id":768,"address":"金坛区直溪镇溪滨村村民委员会","comment":null,"lat":"31.868529","lng":"119.454772","created_at":"2023-11-20 13:58:47","updated_at":"2023-11-20 13:58:47","deleted_at":null,"default":1}},{"id":11396,"no":"20231225111421dc2e75816","order_id":891,"admin_id":1,"department_id":null,"customer_id":768,"product_id":17,"date":"2023-12-25","start_time":"2023-12-25 11:14:00","end_time":"2023-12-25 12:14:02","nurse_id":90,"status":2,"address_id":1592,"created_at":"2023-12-25 11:14:21","updated_at":"2023-12-25 11:19:02","deleted_at":null,"sign_in":"2023-12-25 11:14:51","sign_in_address":"江苏省苏州市吴中区太湖东路288号长桥苏州市吴中区人民政府(太湖东路北)","sign_in_loc":"31.26249,120.63212","sign_out":"2023-12-25 11:19:01","sign_out_address":"江苏省苏州市吴中区太湖东路288号长桥苏州市吴中区人民政府(太湖东路北)","sign_out_loc":"31.26249,120.63212","is_error":0,"address":"金坛区直溪镇溪滨村村民委员会","month_count":"1","month_time":"0","distance":12878.6,"status_text":"已护理","customer":{"id":768,"name":"叶华","phone":"18861212210","idcard":"320124197907010227","sex":"女","birthday":"1979-07-01","contact_name":"耿志俊","contact_phone":"18861212210","idcard_address":"直溪镇溪滨村村委会大耿庄85","is_dead":0,"remark":null,"level_id":18,"created_at":"2023-11-20 13:58:47","updated_at":"2023-11-20 13:58:47","deleted_at":null,"city_id":"21","area_id":"15","street_id":"27","level_type":34,"status":1},"customer_address":{"id":1592,"name":null,"customer_id":768,"address":"金坛区直溪镇溪滨村村民委员会","comment":null,"lat":"31.868529","lng":"119.454772","created_at":"2023-11-20 13:58:47","updated_at":"2023-11-20 13:58:47","deleted_at":null,"default":1}},{"id":11397,"no":"20231225112026a43896149","order_id":893,"admin_id":1,"department_id":null,"customer_id":767,"product_id":24,"date":"2023-12-25","start_time":"2023-12-25 11:20:19","end_time":"2023-12-25 12:20:20","nurse_id":90,"status":1,"address_id":1591,"created_at":"2023-12-25 11:20:26","updated_at":"2023-12-25 11:20:44","deleted_at":null,"sign_in":"2023-12-25 11:20:44","sign_in_address":"江苏省苏州市吴中区太湖东路288号长桥苏州市吴中区人民政府(太湖东路北)","sign_in_loc":"31.26249,120.63212","sign_out":null,"sign_out_address":null,"sign_out_loc":null,"is_error":0,"address":"直溪镇新河村退役军人服务站","month_count":null,"month_time":null,"distance":12878.6,"status_text":"护理中","customer":{"id":767,"name":"吴浩","phone":"13813519467","idcard":"320482199412044619","sex":"男","birthday":"1994-12-04","contact_name":"吴冬兆","contact_phone":"13813519467","idcard_address":"直溪镇新河村村委会上新河村8号","is_dead":0,"remark":null,"level_id":19,"created_at":"2023-11-20 13:51:25","updated_at":"2023-11-20 13:51:25","deleted_at":null,"city_id":"21","area_id":"15","street_id":"27","level_type":35,"status":1},"customer_address":{"id":1591,"name":null,"customer_id":767,"address":"直溪镇新河村退役军人服务站","comment":null,"lat":"31.836242","lng":"119.508225","created_at":"2023-11-20 13:51:25","updated_at":"2023-11-20 13:51:25","deleted_at":null,"default":1}}]
customers: [],
};
},
methods: {
toAddOrder () {
toAddOrder (item) {
if (((Number(item.all_worth)) - Number(item.total_worth)) <= 0) {
this.isShowModal = true;
return
}
this.$u.vuex('vuex_selected_customer', item)
uni.$u.throttle(() => {
uni.navigateTo({
url: `/pages/order/addOrder`
})
})
},
async getCustomer () {
const res = await this.$u.api.customerAndOrder()
console.log(res)
this.customers = res
}
}
},
computed: {
customerAddress () {
return function (addresses) {
return addresses.find(i => i.default)?.address || addresses[0]?.address || '无'
}
},
hasFormat () {
return function (item) {
return (Number(item.all_worth)) - Number(item.total_worth)
}
}
},
onShow() {
this.getCustomer()
},
}
</script>
@ -130,11 +169,19 @@ export default {
padding-left: 24rpx;
.name {
width: 270rpx;
height: 48rpx;
font-size: 32rpx;
font-weight: 500;
color: #333333;
display: flex;
align-items: center;
.time {
color: #3877f6;
margin-left: auto;
margin-right: 20rpx;
}
}
.tel {
@ -178,7 +225,7 @@ export default {
justify-content: center;
align-items: center;
margin-right: 20rpx;
margin-left: 20rpx;
.sex-text {
width: 28rpx;

@ -2,17 +2,17 @@
<view>
<cpn-navbar :isRefreshBtn="true" title="今日护理"></cpn-navbar>
<view class="content">
<view>
<view style="float: left;margin-left: 20rpx;">
<u-button :custom-style="{'width':'200rpx;'}" shape="circle" type="warning" @click="getToday"></u-button>
</view>
<view class="map">
<view class="map-text">护理地图</view>
<view class="map-icon" @click="toMap">
<u-image src="/static/todayNursing/map.png" height="84" width="84" shape="circle"></u-image>
</view>
</view>
<view class="content">
<view>
<view style="float: left;margin-left: 20rpx;">
<u-button :custom-style="{'width':'200rpx;'}" shape="circle" type="warning" @click="getToday"></u-button>
</view>
<view class="map">
<view class="map-text">护理地图</view>
<view class="map-icon" @click="toMap">
<u-image src="/static/todayNursing/map.png" height="84" width="84" shape="circle"></u-image>
</view>
</view>
</view>
<view class="nursing-list">
@ -94,15 +94,18 @@
</view>
<doingOrder></doingOrder>
<privacyPopup ref="privacyPopup"></privacyPopup>
</view>
</template>
<script>
import moment from "@/libs/moment.min.js"
import doingOrder from '../../components/doingOrder/doingOrder.vue'
import privacyPopup from '@/components/privacy-popup/privacy-popup.vue'
export default {
components: {
doingOrder
doingOrder,
privacyPopup
},
data() {
return {
@ -405,4 +408,4 @@
left: 50%;
}
}
</style>
</style>

@ -38,6 +38,8 @@ const store = new Vuex.Store({
vuex_male_img: '/static/male.png',
vuex_female_img: '/static/female.png',
vuex_list_status: '',
vuex_selected_customer: {},//预约护理下选择的用户信息
},
mutations: {
$uStore(state, payload) {
@ -68,7 +70,7 @@ const store = new Vuex.Store({
state.vuex_token = null
uni.removeStorageSync("lifeData")
}
},
},
actions: {

Loading…
Cancel
Save