225 lines
6.5 KiB
Vue
225 lines
6.5 KiB
Vue
<template>
|
||
<view class="app">
|
||
<!-- <view class="message">请填写下面的信息</view> -->
|
||
<view class="user">
|
||
<view class="item">
|
||
<span>姓名:</span>
|
||
<span class='addition'>{{personInfo.patientName}}</span>
|
||
</view>
|
||
<view class="item">
|
||
<span>电话:</span>
|
||
<span class='addition'>{{personInfo.phone}}</span>
|
||
</view>
|
||
<view class="item">
|
||
<span>地址:</span>
|
||
<span class='addition'>{{personInfo.address}}</span>
|
||
</view>
|
||
<view class="selecttime" @tap='timeshow=true'>
|
||
<span>时间:</span>
|
||
<text v-if="usertime==''" class='addition'>请选择时间
|
||
<image src="../../static/jiantou.png"></image>
|
||
</text>
|
||
<text v-else class='addition'>{{usertime}}</text>
|
||
</view>
|
||
</view>
|
||
<view class="remarks">
|
||
服务时长:
|
||
<span style='padding-left: 30rpx;' class='addition'>{{orderlist.serveDurationUnit}}</span>
|
||
</view>
|
||
<view class="Package">套餐信息:
|
||
<text class="money">¥{{orderlist.nurseItemPrice}}</text>
|
||
<text class="detail">
|
||
·<span style='padding-left: 10rpx;'>{{orderlist.nurseItemName}}</span>
|
||
</text>
|
||
</view>
|
||
<view class="Consumablespackage">耗材包详情:
|
||
<text class="money">¥{{orderlist.consumableTotalPrice}}</text>
|
||
<view class="detail" v-for="(item,index) in orderlist.itemConsumableList">
|
||
·<span style='padding-left: 10rpx;'>{{item.consumableDetail}}</span>
|
||
</view>
|
||
</view>
|
||
<view class="remarks">
|
||
<span>备注:</span>
|
||
<input placeholder="">
|
||
</view>
|
||
<view class="radio-content" @tap="changeRadio">
|
||
<view class="radio-right">
|
||
<view class="radio" :class="radio == 2 ? 'radio-default':''">
|
||
<view :class="radio == 2 ? 'radio-active':''"></view>
|
||
</view>
|
||
</view>
|
||
<text class="agreement">我已阅读并同意</text>
|
||
<text @tap='maskshow=true;showRegectAgreeButton=false'>《用户协议》</text>
|
||
</view>
|
||
<view class="priceback">
|
||
<view class="prices">¥{{orderlist.totalPrice}}</view>
|
||
<view class="xiugai" @tap='goaddress'>修改信息</view>
|
||
<view class="queren" @tap='updata'>确认预约</view>
|
||
</view>
|
||
<u-toast ref="uToast" />
|
||
<upicker v-model="timeshow" mode="time" start-year='2022' :params="timeparams" @confirm='timeconfirm'></upicker>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import {
|
||
getAppStationItemInfo,
|
||
getAppPatientList,
|
||
submitAppointment
|
||
} from '@/api/appointmenttime/appointmenttime.js'
|
||
import baseurl from '@/api/baseurl.js'
|
||
import upicker from '../picker/picker.vue'
|
||
export default {
|
||
components: {
|
||
upicker
|
||
},
|
||
data() {
|
||
return {
|
||
timeparams: { //picker组件所需
|
||
year: true,
|
||
month: true,
|
||
day: true,
|
||
hour: true,
|
||
endhour: true,
|
||
minute: true,
|
||
endminute: true,
|
||
},
|
||
timeshow: false, //时间开关
|
||
maskshow: false, //用户协议开关
|
||
radio: 1, //用户协议
|
||
personInfo: [], //用户信息
|
||
patientId: null,
|
||
usertime: '', //页面展示时间
|
||
orderlist: {
|
||
orderCount: 1,
|
||
patientId: '',
|
||
stationId: '',
|
||
stationItemId: '',
|
||
stationItemPriceId: '',
|
||
serviceAddress: "",
|
||
serviceDate: "",
|
||
serviceStartTime: "",
|
||
serviceEndTime: "",
|
||
nurseItemName: "",
|
||
nurseItemPrice: '',
|
||
serveDurationUnit: "",
|
||
consumableTotalPrice: '',
|
||
totalPrice: '',
|
||
remark: "",
|
||
orderConsumableList: [],
|
||
},
|
||
}
|
||
},
|
||
onShow() {
|
||
let that = this
|
||
uni.$on('updata', function(data) {
|
||
if (data.updata) {
|
||
that.orderlist = JSON.parse(data.updata)
|
||
}
|
||
if (data.useritem) {
|
||
that.useritem = JSON.parse(data.useritem)
|
||
that.orderlist.serviceAddress = that.useritem.address
|
||
that.personInfo.patientName = that.useritem.receiveName
|
||
that.personInfo.phone = that.useritem.receivePhone
|
||
that.personInfo.address = that.useritem.address
|
||
} else {}
|
||
})
|
||
setTimeout(e => {
|
||
if (!that.useritem) {
|
||
that.userinfo();
|
||
}
|
||
}, 500)
|
||
},
|
||
onLoad(options) {
|
||
//耗材包详情方法调用
|
||
this.getPatientInfo(options.stationId, options.stationItemId, options.stationItemPriceId)
|
||
},
|
||
methods: {
|
||
userinfo() {
|
||
//取出patientId
|
||
var that = this
|
||
try {
|
||
const value = uni.getStorageSync('patientId');
|
||
if (value) {
|
||
that.patientId = value
|
||
//被护理人信息
|
||
getAppPatientList(value).then(response => {
|
||
that.personInfo = response.data
|
||
that.personInfo.address = response.data.provinceName + response.data
|
||
.cityName + response.data.regionName + response.data.streetName +
|
||
response.data.address
|
||
that.orderlist.patientId = response.data.patientId
|
||
that.orderlist.serviceAddress = response.data.provinceName + response.data
|
||
.cityName + response.data.regionName + response.data.streetName +
|
||
response.data.address
|
||
})
|
||
}
|
||
} catch (e) {
|
||
// error
|
||
}
|
||
},
|
||
//获取耗材包详情
|
||
getPatientInfo(stationId, stationItemId, stationItemPriceId) {
|
||
let that = this;
|
||
getAppStationItemInfo(stationId, stationItemId, stationItemPriceId).then(res => {
|
||
if (res.code == 200) {
|
||
this.orderlist = res.data
|
||
}
|
||
})
|
||
},
|
||
//确认预约
|
||
updata() {
|
||
if (this.radio == 1) {
|
||
this.$refs.uToast.show({
|
||
title: '请阅读用户协议并同意',
|
||
type: 'error',
|
||
})
|
||
} else {
|
||
this.orderlist.orderChannel = "MOBILE_APP"
|
||
this.orderlist.buySource = "NURSE_STATION"
|
||
this.orderlist.orderCount = 1;
|
||
this.orderlist.orderConsumableList = this.orderlist.itemConsumableList
|
||
submitAppointment(this.orderlist).then(res => {
|
||
if (res.code == 500) {
|
||
this.$refs.uToast.show({
|
||
title: res.msg,
|
||
type: 'error',
|
||
})
|
||
} else if (res.code == 200) {
|
||
this.$refs.uToast.show({
|
||
title: '预约成功',
|
||
type: 'success',
|
||
url: '/pages/paysuccess/paysuccess',
|
||
toast: 1500
|
||
})
|
||
}
|
||
})
|
||
}
|
||
},
|
||
changeRadio() {
|
||
if (this.radio == 1) {
|
||
this.radio = 2;
|
||
} else {
|
||
this.radio = 1;
|
||
}
|
||
},
|
||
//获取时间
|
||
timeconfirm(e) {
|
||
this.orderlist.serviceDate = e.year + '-' + e.month + '-' + e.day
|
||
this.orderlist.serviceStartTime = e.hour + ":" + e.minute
|
||
this.orderlist.serviceEndTime = e.endhour + ":" + e.endminute
|
||
this.usertime = e.year + '年' + e.month + '月' + e.day + '日' + e.hour + ":" + e.minute + '至' + e.endhour +
|
||
":" + e.endminute
|
||
console.log(this.orderlist, this.usertime)
|
||
},
|
||
goaddress() {
|
||
uni.navigateTo({
|
||
url: `/pages/modifyAddress/modifyAddress?url=${'appointmenttime'}&updata=${JSON.stringify(this.orderlist)}`
|
||
})
|
||
},
|
||
}
|
||
}
|
||
</script>
|
||
<style lang="scss">
|
||
@import './appointmenttime.scss'
|
||
</style>
|