NurseStationApp/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue
2022-12-06 10:10:34 +08:00

128 lines
3.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="app">
<view class="" v-if="total>0">
<view class="item" v-for="(item,index) in list" :key="index">
<view class="name">
{{item.createTime}}
<span>{{item.orderStatus=='WAIT_PAY'&&item.timestamp>0?'待付款':''}}
{{item.orderStatus=='WAIT_PAY'&&item.timestamp<=0?'订单已关闭':''}}
{{item.orderStatus=='PAY'?'已付款':''}}
{{item.orderStatus=='WAIT_DISPATCH'?'待服务':''}}
{{item.orderStatus=='NOT_FINISH'?'待完成':''}}
{{item.orderStatus=='COMPLETE'?'待评价':''}}
{{item.orderStatus=='EVALUATED'?'服务完成':''}}
{{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>
</view>
</view>
<view class="submit" @tap='buy(item)' style="background-color:coral;"
v-if="item.orderStatus=='WAIT_PAY'&&item.timestamp>0">
去支付
</view>
<!-- <view class="submit" style="background-color: crimson;" v-if="item.orderStatus=='WAIT_REFUND'">退款进度</view> -->
<!-- <view class="submit"
v-if="item.orderStatus=='PAY'||item.orderStatus=='WAIT_DISPATCH'||item.orderStatus=='NOT_FINISH'">
确认完成
</view> -->
</view>
</view>
<view class="noorder" v-else>
<image src="../../static/noorder.png" mode=""></image>
<view class="">
暂无服务订单
</view>
</view>
</view>
</template>
<script>
import baseurl from '@/api/baseurl.js'
import {
appServiceOrder
} from '@/api/Nursingstationserviceorder/Nursingstationserviceorder.js'
export default {
data() {
return {
baseurl: '',
patientId: null,
total: 0,
pageNum: 1,
pageSize: 10,
list: [],
}
},
onLoad() {
this.baseurl = baseurl
let that = this
try {
const value = uni.getStorageSync('patientId');
if (value) {
that.patientId = value
that.getinfo()
}
} catch (e) {}
},
methods: {
//支付
buy(item) {
},
getinfo() {
appServiceOrder(this.patientId, this.pageSize, this.pageNum).then(res => {
this.list = res.rows;
this.total = res.total
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
})
})
},
gofinished(item) {
uni.navigateTo({
url: `/pages/ServiceDetails/ServiceDetails?orderNo=${item.orderNo}`
})
}
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.pageNum++
appServiceOrder(this.patientId, this.pageSize, this.pageNum).then(res => {
res.rows.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
this.list.push(e)
})
})
}
},
onPullDownRefresh() { //下拉刷新
this.pageNum = 1;
this.getinfo()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
@import './Nursingstationserviceorder.scss';
</style>