NurseStationApp/pages/ServiceDetails/ServiceDetails.vue

252 lines
6.9 KiB
Vue
Raw Normal View History

2022-10-28 15:37:07 +08:00
<template>
<view class="app">
2023-01-13 13:55:31 +08:00
<view class="time" style="" v-if="list.orderStatus=='WAIT_PAY'">
2022-12-06 10:10:34 +08:00
剩余付款时间
<u-count-down style='' :timestamp="timestamp">
</u-count-down>
</view>
2022-11-11 17:23:23 +08:00
<view class="OrderStatus" v-if="list.orderStatus=='REFUNDED'||list.orderStatus=='CANCEL'">
2022-11-03 17:26:15 +08:00
订单已关闭
</view>
2022-10-28 15:37:07 +08:00
<view class="content">
<view class="name">
服务商家
</view>
<view class="details">
<view class="detailslist">
2022-11-11 17:23:23 +08:00
<image :src="baseurl+list.stationPictureUrl" mode=""></image>
2022-10-28 15:37:07 +08:00
<view class="model">
<view class="top">
2022-11-11 17:23:23 +08:00
<view>{{list.nurseStationName}}</view>
2022-10-28 15:37:07 +08:00
</view>
<view class="bottom">
2022-11-11 17:23:23 +08:00
<view>{{list.address}}</view>
2022-11-03 17:26:15 +08:00
</view>
<view class="callme" @tap="gophone()">
<u-icon class='icon' name="phone-fill" color="#ffffff" size="30"></u-icon>
<view class="text">联系我们</view>
2022-10-28 15:37:07 +08:00
</view>
</view>
</view>
</view>
</view>
2022-11-03 17:26:15 +08:00
<view class="content">
2022-10-28 15:37:07 +08:00
<view class="name">
服务项目
</view>
2022-11-11 17:23:23 +08:00
<view class="drug">·{{list.nurseItemName}} </view>
2022-10-28 15:37:07 +08:00
</view>
2022-11-03 17:26:15 +08:00
<view class="content">服务信息
2022-11-11 17:23:23 +08:00
<view class="contacts">·联系人{{list.patientName}}</view>
2022-12-27 09:21:01 +08:00
<view class="contacts">·电话{{list.patientPhone}}</view>
2022-11-11 17:23:23 +08:00
<view class="contacts">·地址{{list.serviceAddress}}</view>
2022-11-23 16:41:09 +08:00
<view class="contacts">·时间{{list.serviceDate}} {{list.serviceStartTime}}-{{list.serviceEndTime}}</view>
2022-10-28 15:37:07 +08:00
</view>
<view class="Package">套餐信息
2022-11-11 17:23:23 +08:00
<span>{{list.nurseItemPrice}}</span>
2022-10-28 15:37:07 +08:00
<view class="detail">
2022-11-11 17:23:23 +08:00
·{{list.nurseItemName}}
2022-10-28 15:37:07 +08:00
</view>
</view>
2022-11-11 17:23:23 +08:00
<view class="Consumablespackage" v-if='list.itemConsumableList'>耗材包详情
2022-12-06 10:10:34 +08:00
<span v-if="list.consumableTotalPrice">{{list.consumableTotalPrice}}</span>
<span v-else>0</span>
2022-11-11 17:23:23 +08:00
<view class="detail" v-for='(item,index) in list.itemConsumableList' :key="index">
·{{item.orderConsumableName}}
2022-12-06 10:10:34 +08:00
<span
style='font-size: 30rpx;'>{{item.orderConsumableCount}}{{item.consumableUnit}}/{{item.orderConsumablePrice}}</span>
2022-10-28 15:37:07 +08:00
</view>
</view>
<view class="remarks">
<view>备注</view>
2022-12-27 09:21:01 +08:00
<input v-model='list.remark' :disabled="list.orderStatus=='WAIT_PAY'?false :true">
2022-10-28 15:37:07 +08:00
</view>
<view class="evaluate">
2022-11-10 16:40:00 +08:00
<view class="price">
2022-11-11 17:23:23 +08:00
{{list.totalPrice}}
2022-11-10 16:40:00 +08:00
</view>
2022-11-03 17:26:15 +08:00
<view class="cancelorder" @tap="cancelorderment()"
2022-11-23 16:41:09 +08:00
v-if="list.orderStatus=='PAY'||list.orderStatus=='WAIT_DISPATCH'||list.orderStatus=='NOT_FINISH'">取消订单
</view>
<view class="cancelorder" @tap='buy' style="background-color: darkorange;"
2023-01-13 13:55:31 +08:00
v-if="list.orderStatus=='WAIT_PAY'">
2022-11-10 16:40:00 +08:00
去支付
</view>
2022-12-27 09:21:01 +08:00
<view class="cancelorder" style="background: #4C7BC9;" v-if="list.orderStatus=='EVALUATED'" @tap='lookrate'>
查看评价</view>
<view class="cancelorder" style="background: #60c5f1;" @tap='rateshow= true'
2022-11-23 16:41:09 +08:00
v-if="list.orderStatus=='COMPLETE'">评价
</view>
2022-10-28 15:37:07 +08:00
</view>
2022-12-27 09:21:01 +08:00
<u-mask :show="rateshow" @tap="rateshow = false" class='masks'>
2022-11-23 16:41:09 +08:00
<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>
2022-12-27 09:21:01 +08:00
<u-mask :show="lookrateshow" @tap="lookrateshow = false" class='masks'>
<image :src="baseurl+list.itemPictureUrl" mode=""></image>
<view class="ratetitle">
{{list.nurseItemName}}
</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-11-23 16:41:09 +08:00
<u-toast ref="uToast" />
2022-10-28 15:37:07 +08:00
</view>
</template>
<script>
import baseurl from '@/api/baseurl.js'
import {
2022-11-11 17:23:23 +08:00
getAppointmentDetailsInfo
} from '@/api/ServiceDetails/ServiceDetails.js'
2022-12-27 09:21:01 +08:00
import {
lookrate
} from '@/api/lookrate/index.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
lookrateshow: false, //查看评价
2022-11-23 16:41:09 +08:00
rateshow: false, //评价
2022-11-03 17:26:15 +08:00
baseurl: '',
2022-11-11 17:23:23 +08:00
list: {},
2022-11-03 17:26:15 +08:00
orderNo: '',
2022-11-23 16:41:09 +08:00
patientId: '', //id
2022-12-02 16:04:52 +08:00
timer: null,
2022-12-06 10:10:34 +08:00
timestamp: 0,
2022-10-28 15:37:07 +08:00
}
},
2022-11-03 17:26:15 +08:00
onLoad(options) {
2022-12-27 09:21:01 +08:00
var that = this
try {
const value = uni.getStorageSync('patientId');
if (value) {
that.patientId = value
}
} catch (e) {}
2022-11-03 17:26:15 +08:00
this.orderNo = options.orderNo
this.baseurl = baseurl
this.getlist()
},
2022-10-28 15:37:07 +08:00
methods: {
2022-12-27 09:21:01 +08:00
//查看评价
lookrate() {
this.lookrateshow = true
lookrate(this.list.orderNo).then(res => {
this.ratelist = res.data
})
},
2022-11-23 16:41:09 +08:00
//评价
taprate(item) {
var obj = {
"patientId": this.patientId,
"orderNo": this.orderNo,
"evaluateChannel": "PHONE_APP",
"evaluateSatisfaction": item,
}
addAppointmentEvaluate(obj).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '评价成功',
type: 'success',
duration: '1500'
})
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(e => {
this.getlist();
2022-12-27 09:21:01 +08:00
uni.navigateTo({
url: `/pages/ratesuccess/ratesuccess?delta=${3}`
})
2022-11-23 16:41:09 +08:00
}, 1500)
2022-12-27 09:21:01 +08:00
} else {
this.$refs.uToast.show({
title: '评价失败',
type: 'error',
duration: '1500'
})
2022-11-23 16:41:09 +08:00
}
})
},
2022-11-11 17:23:23 +08:00
getlist() {
getAppointmentDetailsInfo(this.orderNo).then(res => {
this.list = res.data
2022-12-06 10:10:34 +08:00
var time = new Date(this.list.createTime).getTime() / 1000 + (60 * 60 * 24)
var times = new Date().getTime() / 1000
this.timestamp = time - times
2022-11-11 17:23:23 +08:00
})
},
2022-11-10 16:40:00 +08:00
//支付
buy() {
let obj = {
patientId: this.patientId,
2022-11-11 17:23:23 +08:00
orderNo: this.orderNo,
2022-11-10 16:40:00 +08:00
orderChannel: "WECHAT_APPLET",
2022-11-11 17:23:23 +08:00
paymentPrice: this.totalPrice,
2022-11-10 16:40:00 +08:00
payType: "WECHAT_PAY",
buySource: "NURSE_STATION",
}
},
2022-11-03 17:26:15 +08:00
gophone() {
var that = this
uni.getSystemInfo({
success: function(res) {
if (res.platform == 'ios') {
uni.makePhoneCall({
phoneNumber: that.nursestationlist.phone //仅为示例
});
} else {
uni.showActionSheet({
itemList: ['呼叫', ],
success: function(res) {
if (res.tapIndex + 1 == 1) {
uni.makePhoneCall({
phoneNumber: that.nursestationlist.phone //仅为示例
});
}
},
fail: function(res) {}
});
}
}
});
},
cancelorderment() {
uni.navigateTo({
2022-11-11 17:23:23 +08:00
url: `/pages/cancelorder/cancelorder?totalPrice=${this.list.totalPrice}&orderId=${this.list.appointmentOrderId}`
2022-11-03 17:26:15 +08:00
})
},
2022-10-28 15:37:07 +08:00
}
}
</script>
<style lang="scss">
2022-11-03 17:26:15 +08:00
@import './ServiceDetails.scss';
2022-10-28 15:37:07 +08:00
</style>