| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793 |
- <template>
- <view class="container" :class="{disableScroll:disableScroll}">
- <view class="info-box order-status">
- <view class="status-text">
- <span class="status">订单状态:{{getStatusTxt(orderInfo.status)}}</span>
- <span v-if="orderInfo.hasRefund">(有退款)</span>
- </view>
- <view class="refund-btn" v-if="orderInfo.hasRefund" @click="viewRefund">查看退款信息</view>
- </view>
- <view class="order-info">
- <image :src="orderInfo.hospitalVo.logoUrl" mode="aspectFill"></image>
- <view class="info-content">
- <span class="name">{{orderInfo.hospitalVo.name || '-'}}</span>
- <span class="address">
- <u-icon name="map" color="#999999" size="14"></u-icon>
- <span class="txt">{{orderInfo.hospitalVo.address || '-'}}</span>
- </span>
- <!-- <span class="area">所属区:{{orderInfo.hospitalVo.areaName || '-'}}</span> -->
- </view>
- </view>
- <view class="info-box">
- <view class="info-item">
- <span class="title">所在科室</span>
- <span class="txt">{{orderInfo.hospitalDepartmentName || '-'}}</span>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">房床号</span>
- <span class="txt">{{orderInfo.roomNumber || '-'}}</span>
- </view>
- <u-line></u-line>
- <view class="info-item info-item-spa">
- <span class="title">备注</span>
- <span class="txt">{{orderInfo.remarks || '-'}}</span>
- </view>
- </view>
- <view class="info-box">
- <view class="info-item">
- <span class="title">就诊人</span>
- <span class="txt">{{orderInfo.patientVo.name || '-'}}({{orderInfo.patientVo.mobile || '-'}})</span>
- </view>
- </view>
- <view class="info-box">
- <view class="info-item">
- <span class="title">服务产品</span>
- <span class="txt">{{orderInfo.serviceName || '-'}}</span>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">期望时间</span>
- <span class="txt">{{orderInfo.expectedTime || '-'}}</span>
- </view>
- </view>
- <!-- 基本信息 -->
- <view class="info-box">
- <span class="title-m">基本信息</span>
- <view class="info-item">
- <span class="title">订单号</span>
- <span class="txt">{{orderInfo.orderNo || '-'}}</span>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">下单时间</span>
- <span class="txt">{{orderInfo.createTime || '-'}}</span>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">下单数量</span>
- <span class="txt">{{orderInfo.orderNum || '-'}}({{ getUnitTxt(orderInfo.serviceUnit) }})</span>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">销售价格</span>
- <span class="txt">¥{{orderInfo.sellingPrice || "0.00"}}</span>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">应付金额</span>
- <span class="txt">¥{{orderInfo.totalPrice || "0.00"}}</span>
- </view>
- </view>
- <!-- 护工信息 -->
- <view class="info-box">
- <span class="title-m">护工信息</span>
- <view class="info-item">
- <span class="title">姓名</span>
- <span class="txt">{{orderInfo.orderWorkerChangeRecord.workerName || '-'}}</span>
- </view>
- <!-- <u-line></u-line>
- <view class="info-item">
- <span class="title">电话</span>
- <span class="txt">{{orderInfo.createTime || '-'}}</span>
- </view> -->
- <u-line></u-line>
- <view class="info-item">
- <span class="title">性别</span>
- <span class="txt">{{orderInfo.orderWorkerChangeRecord.sex == 1 ? '男' : '女' || '-'}}</span>
- </view>
- </view>
- <!-- 服务信息 -->
- <view class="info-box" v-if="orderInfo.status != '1' || orderInfo.status != '2'">
- <span class="title-m">服务信息</span>
- <view class="info-item">
- <span class="title">开始时间</span>
- <span class="txt">{{orderInfo.orderWorkerChangeRecord.workerStartTime || '-'}}</span>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">完成时间</span>
- <span class="txt">{{orderInfo.orderWorkerChangeRecord.workerEndTime || '-'}}</span>
- </view>
- </view>
- <!-- 评价信息 -->
- <view class="info-box" v-if="orderInfo.status == '5'">
- <span class="title-m">评价信息</span>
- <view class="info-item">
- <span class="title">服务态度</span>
- <u-rate :count="count" v-model="orderInfo.orderReviews.serviceAttitude"></u-rate>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">着装仪态</span>
- <u-rate :count="count" v-model="orderInfo.orderReviews.dressAppearance"></u-rate>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">沟通能力</span>
- <u-rate :count="count" v-model="orderInfo.orderReviews.communicationAbility"></u-rate>
- </view>
- <u-line></u-line>
- <view class="tip-txt">
- 文字评价:{{orderInfo.orderReviews.content}}
- </view>
- </view>
- <!-- 底部按钮 -->
- <view class="footer-box" v-if="orderInfo.status !=5 || orderInfo.status !=6">
- <view class="btn-box">
- <!-- 待确认 -->
- <span class="btn " v-if="orderInfo.status == 1" @click.stop="cancleOrder(orderInfo.id)">取消订单</span>
- <!-- 待服务 -->
- <template v-if="orderInfo.status == 2 || orderInfo.status == 3">
- <span class="btn" @click.stop="apllyRefund(orderInfo.id)">申请退款</span>
- <span class="btn btn1" @click.stop="contactPerson(orderInfo.id)">联系护工</span>
- </template>
- <!-- 待评价 -->
- <span class="btn btn1" v-if="orderInfo.status == 4" @click.stop="evaluateShow = true">去评价</span>
- </view>
- </view>
- <!-- 评价 -->
- <u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="evaluateShow"
- @close="evaluateClose" @open="evaluateOpen" :round="20">
- <view class="pop-box">
- <view class="pop-title">订单评价</view>
- <view class="pop-content">
- <view class="info-item">
- <span class="title">服务态度</span>
- <u-rate :count="count" size="20" v-model="evaluateInfo.serviceAttitude"></u-rate>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">着装仪态</span>
- <u-rate :count="count" size="20" v-model="evaluateInfo.dressAppearance"></u-rate>
- </view>
- <u-line></u-line>
- <view class="info-item">
- <span class="title">沟通能力</span>
- <u-rate :count="count" size="20" v-model="evaluateInfo.communicationAbility"></u-rate>
- </view>
- <u-line></u-line>
- <view class="tip-txt">
- <span class="name">文字评价</span>
- <u--textarea v-model="evaluateInfo.content" placeholder="请输入内容"></u--textarea>
- </view>
- </view>
- <view class="footer-btn">
- <span class="btn" @click="confirmEvaluate">确认提交</span>
- </view>
- </view>
- </u-popup>
- <!-- 联系护工 -->
- <u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="popShow" @close="popClose"
- @open="open" :round="20">
- <view class="pop-box">
- <view class="pop-title">联系护工</view>
- <view class="pop-content">
- <view class="pop-item" v-for="item,index in workerList" :key="index"
- @click="confirmAndCall(item.phoneNumber)">
- <u-icon name="phone" color="#fff"></u-icon>
- <span class="txt">{{item.phoneNumber || '-'}}</span>
- </view>
- </view>
- <view class="pop-footer-btn">
- <span class="btn" @click="popClose()">取消</span>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import {
- getOrderDetail,
- getServiceUnit,
- getOrderStatus,
- cancelOrder,
- getServicePhoneList,
- evaluateOrder
- } from '@/api/order.js'
- export default {
- components: {},
- data() {
- return {
- evaluateShow: '',
- count: 5,
- value: 3,
- orderInfo: {
- serviceUnit: ''
- },
- typeList: [],
- couponList: [],
- disableScroll: false,
- timer: null,
- unitList: [],
- orderId: '',
- evaluateInfo: {
- content: '',
- serviceAttitude: 0,
- dressAppearance: 0,
- communicationAbility: 0,
- },
- workerList: [],
- popShow: false,
- }
- },
- onLoad(options) {
- if (options.id) {
- this.orderId = options.id;
- }
- this.getOrderStatus();
- this.getServiceUnit();
- },
- onShow() {
- // this.getOrderStatus();
- this.getInfoById(this.orderId);
- },
- onUnload() {
- // 当页面关闭或卸载时清除定时器
- },
- methods: {
- evaluateOpen() {
- this.evaluateShow = true;
- },
- evaluateClose() {
- this.evaluateShow = false;
- },
- getStatusTxt(value) {
- let obj = this.typeList.find(item => item.code == value);;
- return obj ? obj.value : '待确认'
- },
- getUnitTxt(value) {
- let obj = this.unitList.find(item => item.code == value);;
- return obj ? obj.value : ''
- },
- //查询订单状态
- getOrderStatus() {
- let that = this;
- getOrderStatus().then(res => {
- if (res.code == 200) {
- let data = res.data.orderStatus;
- data.unshift({
- value: '全部',
- code: '',
- })
- this.typeList = data;
- }
- })
- .catch((err) => {
- console.log(err);
- })
- },
- //查询单位
- getServiceUnit() {
- let that = this;
- getServiceUnit().then(res => {
- if (res.code == 200) {
- this.unitList = res.data.serviceUnit;
- }
- })
- .catch((err) => {
- console.log(err);
- })
- },
- //查看退款信息
- viewRefund() {
- let id = this.orderInfo.refundList[0].id;
- uni.navigateTo({
- url: '/pages/order/refundDetails?id=' + id
- })
- },
- getInfoById(id) {
- let that = this;
- uni.showLoading({
- title: '加载中',
- mask: true,
- });
- getOrderDetail(id).then(res => {
- if (res.code == 200) {
- let data = res.data;
- this.orderInfo = data;
- }
- })
- .catch((err) => {
- console.log(err);
- })
- .finally(() => {
- uni.hideLoading();
- });
- },
- //取消订单
- cancleOrder(id) {
- //确认是否删除
- uni.showModal({
- title: '提示',
- content: '确定取消订单吗?',
- success: (res) => {
- if (res.confirm) {
- console.log('用户点击确定');
- cancelOrder(id).then(res => {
- if (res.code == 200) {
- uni.showToast({
- title: '取消成功',
- icon: 'success'
- })
- this.getInfoById(this.orderId);
- }
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- },
- })
- },
- //申请退款
- apllyRefund(id) {
- uni.navigateTo({
- url: '/pages/order/applyRefund?id=' + id
- })
- },
- confirmAndCall(phoneNumber) {
- // 先验证电话号码
- if (!this.isValidPhoneNumber(phoneNumber)) {
- uni.showToast({
- title: '电话号码格式不正确',
- icon: 'none'
- });
- return;
- }
- // 显示确认对话框
- uni.showModal({
- title: '确认拨打电话',
- content: `确定要拨打 ${phoneNumber} 吗?`,
- success: (res) => {
- if (res.confirm) {
- // 用户点击确定,执行拨打电话
- this.makePhoneCall(phoneNumber);
- }
- }
- });
- },
- isValidPhoneNumber(phoneNumber) {
- // 简单的电话号码验证
- return /^1[3-9]\d{9}$/.test(phoneNumber);
- },
- makePhoneCall(phoneNumber) {
- uni.makePhoneCall({
- phoneNumber: phoneNumber,
- success: () => {
- console.log('拨打电话成功');
- },
- fail: (err) => {
- console.error('拨打电话失败', err);
- uni.showToast({
- title: '拨打电话失败',
- icon: 'none'
- });
- }
- });
- },
- //联系护工
- contactPerson(item) {
- this.open()
- },
- open() {
- let that = this;
- getServicePhoneList().then(res => {
- if (res.code == 200) {
- let data = res.data;
- this.workerList = data;
- this.popShow = true;
- }
- })
- .catch((err) => {
- console.log(err);
- })
- },
- popClose() {
- this.popShow = false;
- },
- // 评价订单
- confirmEvaluate() {
- if (!this.evaluateInfo.content) {
- uni.showToast({
- title: '请填写内容',
- icon: 'none'
- });
- return
- }
- let that = this;
- uni.showLoading({
- title: '评价中',
- mask: true,
- });
- that.evaluateInfo.orderId = that.orderId
- evaluateOrder(that.evaluateInfo).then(res => {
- if (res.code == 200) {
- let data = res.data;
- that.evaluateInfo = {
- content: '',
- serviceAttitude: 0,
- dressAppearance: 0,
- communicationAbility: 0,
- }
- that.evaluateClose()
- that.getInfoById(that.orderId)
- }
- })
- .catch((err) => {
- console.log(err);
- })
- .finally(() => {
- uni.hideLoading();
- });
- },
- //下拉刷新回调函数
- onPullDownRefresh() {
- this.getInfoById(this.orderId);
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- },
- }
- </script>
- <style lang='scss' scoped>
- .container {
- padding: 20rpx 20rpx 200rpx;
- .order-status {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 40rpx 20rpx !important;
- .status-text {
- /* text-align: center; */
- font-weight: bold;
- font-size: 30rpx;
- color: #333;
- }
- .refund-btn {
- font-size: 28rpx;
- color: #4B91D1;
- }
- }
- .order-info {
- display: flex;
- align-items: center;
- padding: 20rpx;
- background: #fff;
- border-radius: 10rpx;
- margin-bottom: 20rpx;
- image {
- width: 180rpx;
- height: 180rpx;
- border-radius: 10rpx;
- margin-right: 20rpx;
- }
- .info-content {
- display: flex;
- flex-direction: column;
- flex: 1;
- .name {
- word-break: break-all;
- font-size: 32rpx;
- color: #333;
- font-weight: bold;
- }
- .address {
- font-size: 28rpx;
- color: #666;
- margin-top: 20rpx;
- width: 100%;
- font-weight: 500;
- line-height: 35rpx;
- display: flex;
- justify-content: flex-start;
- align-items: flex-start;
- overflow: hidden; //超出的文本隐藏
- text-overflow: ellipsis; //溢出用省略号显示
- white-space: normal; //处理元素中的 空白
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- display: -moz-box;
- -moz-line-clamp: 2;
- -moz-box-orient: vertical;
- overflow-wrap: break-word;
- word-break: break-all;
- ::v-deep .u-icon {
- display: inline-block;
- }
- .txt {
- margin-left: 15rpx;
- }
- }
- .area {
- font-size: 28rpx;
- color: #666;
- margin-top: 10rpx;
- }
- }
- }
- .info-box {
- padding: 20rpx;
- background: #fff;
- border-radius: 10rpx;
- margin-bottom: 20rpx;
- .info-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 30rpx 0;
- .title {
- width: 250rpx;
- font-size: 28rpx;
- color: #333;
- }
- .txt {
- /* flex: 1; */
- max-width: 540rpx;
- text-align: left;
- font-size: 28rpx;
- color: #757575;
- }
- }
- .info-item-spa {
- align-items: flex-start;
- flex-direction: column;
- .txt {
- margin-left: 0;
- margin-top: 20rpx;
- text-align: left;
- }
- }
- .tip-txt {
- padding: 30rpx 0;
- font-size: 28rpx;
- color: #333;
- }
- }
- .title-m {
- /* 竖线和文字对齐 */
- display: flex;
- align-items: center;
- padding: 20rpx 0;
- font-size: 28rpx;
- color: #333;
- font-weight: bold;
- line-height: 28rpx;
- /* 左边加一个竖线 */
- &::before {
- content: '';
- display: inline-block;
- width: 6rpx;
- height: 30rpx;
- background: #4B91D1;
- margin-right: 10rpx;
- }
- }
- .footer-box {
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- padding: 50rpx 30rpx;
- box-sizing: border-box;
- font-size: 28rpx;
- background-color: #fff;
- box-shadow: 0 -2rpx 30rpx #c5c5c53a;
- .btn-box {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .btn {
- width: 170rpx;
- height: 60rpx;
- margin-left: 20rpx;
- line-height: 60rpx;
- text-align: center;
- background-color: #fff;
- border: 1rpx solid #4B91D1;
- color: #4B91D1;
- border-radius: 30rpx;
- font-size: 24rpx;
- margin-left: 30rpx;
- }
- .btn1 {
- background-color: #00aa00;
- border: 1rpx solid #00aa00;
- color: #fff;
- }
- .btn2 {
- background-color: #4B91D1;
- border: 1rpx solid #4B91D1;
- color: #fff;
- }
- }
- }
- }
- .pop-box {
- .pop-title {
- font-size: 32rpx;
- font-weight: bold;
- text-align: center;
- padding: 20rpx 0;
- }
- .pop-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-top: 30rpx;
- font-size: 28rpx;
- color: #6F6F6F;
- padding: 0 20rpx;
- .info-item {
- display: flex;
- justify-content: space-between;
- padding: 20rpx 0;
- width: 100%;
- }
- .tip-txt {
- display: flex;
- flex-direction: column;
- padding: 20rpx 0;
- width: 100%;
- .name {
- margin-bottom: 20rpx;
- }
- }
- &>view {
- margin-bottom: 20rpx;
- &:last-child {
- margin-bottom: 0;
- }
- }
- .pop-item {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 500rpx;
- padding: 20rpx 0;
- background-color: #4B91D1;
- border-radius: 40rpx;
- color: #fff;
- .txt {
- font-size: 28rpx;
- }
- }
- }
- .footer-btn {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-top: 30rpx;
- padding: 20rpx;
- .btn {
- width: 100%;
- padding: 20rpx 0;
- border: 1rpx solid #4B91D1;
- background-color: #4B91D1;
- border-radius: 40rpx;
- color: #fff;
- text-align: center;
- }
- }
- .pop-footer-btn {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-top: 60rpx;
- .btn {
- width: 500rpx;
- padding: 20rpx 0;
- border: 1rpx solid #4B91D1;
- border-radius: 40rpx;
- color: #333;
- text-align: center;
- }
- }
- }
- </style>
|