NurseStationApp/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue

216 lines
5.9 KiB
Vue
Raw Normal View History

2022-10-28 15:37:07 +08:00
<template>
<view class="app">
2022-11-15 15:36:29 +08:00
<view class="" v-if="total>0">
<view class="item" v-for="(item,index) in list" :key="index">
<view class="name">
{{item.createTime}}
2023-01-13 13:55:31 +08:00
<span>{{item.orderStatus=='WAIT_PAY'?'待付款':''}}
2022-11-15 15:36:29 +08:00
{{item.orderStatus=='PAY'?'已付款':''}}
{{item.orderStatus=='WAIT_DISPATCH'?'待服务':''}}
{{item.orderStatus=='NOT_FINISH'?'待完成':''}}
2022-12-01 17:03:02 +08:00
{{item.orderStatus=='COMPLETE'?'待评价':''}}
2022-11-23 16:41:09 +08:00
{{item.orderStatus=='EVALUATED'?'服务完成':''}}
2022-11-15 15:36:29 +08:00
{{item.orderStatus=='WAIT_REFUND'?'退款中':''}}
{{item.orderStatus=='REFUNDED'?'已退款':''}}
{{item.orderStatus=='CANCEL'?'已取消':''}}
</span>
</view>
<view class="detailslist" @tap="gofinished(item)">
<image :src="baseurl+item.itemPictureUrl" mode=""></image>
<view class="model">
<view class="top">
<span>{{item.nurseItemName}}</span>
<span>{{item.totalPrice}}</span>
</view>
<view class="bottom">
<span>服务时长{{item.itemServeDurationUnit}}</span>
</view>
2022-10-28 15:37:07 +08:00
</view>
</view>
2022-11-15 15:36:29 +08:00
<view class="submit" @tap='buy(item)' style="background-color:coral;"
2023-01-13 13:55:31 +08:00
v-if="item.orderStatus=='WAIT_PAY'">
2022-11-15 15:36:29 +08:00
去支付
</view>
2022-12-27 09:21:01 +08:00
<view class="submit" v-if="item.orderStatus=='WAIT_REFUND'" style="background-color: coral;">退款中</view>
<view class="submit" v-if="item.orderStatus=='COMPLETE'" @tap='gorate(item)'
style="background-color: #60c5f1;">立即评价</view>
<view class="submit" v-if="item.orderStatus=='EVALUATED'" @tap='lookrate(item)'>查看评价</view>
2022-11-03 17:26:15 +08:00
</view>
2022-11-15 15:36:29 +08:00
</view>
<view class="noorder" v-else>
2023-03-20 14:49:18 +08:00
<u-empty mode="list" icon-size='220' text='暂无服务订单'></u-empty>
2022-10-28 15:37:07 +08:00
</view>
2022-12-27 09:21:01 +08:00
<u-toast ref="uToast" />
<u-mask :show="rateshow" @tap="rateshow = false" class='masks'>
<view class="mask">
<view class="rateitem" @tap="taprate('SATISFIED')">
满意
</view>
<view class="rateitem" @tap="taprate('COMMONLY')">
一般
</view>
<view class="rateitem" @tap="taprate('DISSATISFIED')">
不满意
</view>
</view>
</u-mask>
<u-mask :show="lookrateshow" @tap="lookrateshow = false" class='masks'>
<image :src="baseurl+rateimgtitle.img" mode=""></image>
<view class="ratetitle">
{{rateimgtitle.title}}
</view>
<view class="mask">
<view class="lookrateitem" :style="ratelist.evaluateSatisfaction=='SATISFIED'?'background: #4C7BC9':''">
满意
</view>
<view class="lookrateitem" :style="ratelist.evaluateSatisfaction=='COMMONLY'?'background: #4C7BC9':''">
一般
</view>
<view class="lookrateitem"
:style="ratelist.evaluateSatisfaction=='DISSATISFIED'?'background: #4C7BC9':''">
不满意
</view>
</view>
</u-mask>
2022-10-28 15:37:07 +08:00
</view>
</template>
<script>
import baseurl from '@/api/baseurl.js'
2022-12-27 09:21:01 +08:00
import {
lookrate
} from '@/api/lookrate/index.js'
import {
appServiceOrder
} from '@/api/Nursingstationserviceorder/Nursingstationserviceorder.js'
2022-12-27 09:21:01 +08:00
import {
addAppointmentEvaluate
} from '@/api/ServiceDetails/ServiceDetails.js'
2022-10-28 15:37:07 +08:00
export default {
data() {
return {
2022-12-27 09:21:01 +08:00
rateimgtitle: {
img: null,
title: null,
},
ratelist: {
evaluateSatisfaction: '',
}, //评价list
rateshow: false, //评价
lookrateshow: false, //查看评价
2022-11-03 17:26:15 +08:00
baseurl: '',
patientId: null,
pageNum: 1,
2022-12-27 09:21:01 +08:00
total: 0,
pageSize: 10,
list: [],
2022-12-27 09:21:01 +08:00
orderNo: null,
timer: null,
2022-10-28 15:37:07 +08:00
}
},
2022-12-06 10:10:34 +08:00
onLoad() {
2022-12-27 09:21:01 +08:00
this.lookrateshow = false
this.rateshow = false
2022-11-03 17:26:15 +08:00
this.baseurl = baseurl
let that = this
2022-11-09 16:38:05 +08:00
try {
const value = uni.getStorageSync('patientId');
if (value) {
that.patientId = value
2022-11-03 17:26:15 +08:00
that.getinfo()
}
2022-11-09 16:38:05 +08:00
} catch (e) {}
},
2022-10-28 15:37:07 +08:00
methods: {
2022-11-03 17:26:15 +08:00
//支付
buy(item) {
2022-12-27 09:21:01 +08:00
},
//去评价
gorate(item) {
this.orderNo = item.orderNo
this.rateshow = true
},
//查看评价
lookrate(item) {
this.rateimgtitle.img = item.itemPictureUrl
this.rateimgtitle.title = item.nurseItemName
this.lookrateshow = true
lookrate(item.orderNo).then(res => {
this.ratelist = res.data
})
},
//评价
taprate(item) {
var obj = {
"patientId": this.patientId,
"orderNo": this.orderNo,
"evaluateChannel": "PHONE_APP",
"evaluateSatisfaction": item,
}
addAppointmentEvaluate(obj).then(res => {
if (res.code == 200) {
this.orderNo = null
this.$refs.uToast.show({
title: '评价成功',
type: 'success',
duration: '1500'
})
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(e => {
uni.navigateTo({
url: `/pages/ratesuccess/ratesuccess`
})
}, 1500)
}
})
2022-11-03 17:26:15 +08:00
},
getinfo() {
2022-12-27 09:21:01 +08:00
this.pageNum = 1
2022-11-03 17:26:15 +08:00
appServiceOrder(this.patientId, this.pageSize, this.pageNum).then(res => {
this.list = res.rows;
this.total = res.total
2023-01-13 13:55:31 +08:00
// this.list.forEach(e => {
// e.timestamp = null
// var time = new Date(e.createTime).getTime() / 1000 + (60 * 60 * 24)
// var times = new Date().getTime() / 1000
// e.timestamp = time - times
// })
})
},
2022-11-03 17:26:15 +08:00
gofinished(item) {
2022-10-28 15:37:07 +08:00
uni.navigateTo({
2022-11-11 17:23:23 +08:00
url: `/pages/ServiceDetails/ServiceDetails?orderNo=${item.orderNo}`
2022-10-28 15:37:07 +08:00
})
2022-11-09 16:40:20 +08:00
}
2022-11-03 17:26:15 +08:00
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.pageNum++
appServiceOrder(this.patientId, this.pageSize, this.pageNum).then(res => {
res.rows.forEach(e => {
2023-01-13 13:55:31 +08:00
// e.timestamp = null
// var time = new Date(e.createTime).getTime() / 1000 + (60 * 60 * 24)
// var times = new Date().getTime() / 1000
// e.timestamp = time - times
2022-11-03 17:26:15 +08:00
this.list.push(e)
})
})
}
},
onPullDownRefresh() { //下拉刷新
this.pageNum = 1;
this.getinfo()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
2022-10-28 15:37:07 +08:00
}
</script>
<style lang="scss">
2022-11-03 17:26:15 +08:00
@import './Nursingstationserviceorder.scss';
2022-10-28 15:37:07 +08:00
</style>