123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- <template>
- <view>
- <u-navbar title="预约单详情">
- </u-navbar>
-
- <u-alert-tips type="warning" v-if="detail.chargingAppointment.status == '0'" :description="description"></u-alert-tips>
- <view class="reverse-time">
- <view class="time" v-if="detail.chargingAppointment.status == '0'">
- 预留{{detail.chargingAppointment.reserveMinutes}}分钟
- </view>
- <view class="time" v-if="detail.chargingAppointment.status == '1'">
- 预留{{detail.chargingAppointment.reserveMinutes}}分钟
- <view class="img-box">
- <img src="../../assets/img/finished.png" alt="">
- </view>
- </view>
- <view class="time" v-if="detail.chargingAppointment.status == '3'">
- 预留{{detail.chargingAppointment.reserveMinutes}}分钟
- <view class="img-box">
- <img src="../../assets/img/canc.png" alt="">
- </view>
- </view>
- <view class="time" v-if="detail.chargingAppointment.status == '2'">
- 预留{{detail.chargingAppointment.reserveMinutes}}分钟
- <view class="img-box">
- <img src="../../assets/img/f.png" alt="">
- </view>
- </view>
- <view class="time refused" v-if="detail.chargingAppointment.status == '4'">
- {{detail.chargingAppointment.statusText}}
- </view>
- <view class="time refused" v-if="detail.chargingAppointment.status == '9'">
- {{detail.chargingAppointment.statusText}}
- </view>
- <view class="details-item">
- <view class="item">
- <view class="item-name">
- 预约单号
- </view>
- <view class="item-content">
- {{detail.chargingAppointment.flowNo}}
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 预计开始充电
- </view>
- <view class="item-content">
- {{detail.chargingAppointment.endTime}}
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 预计充电时长
- </view>
- <view class="item-content">
- {{(detail.chargingAppointment.estimateMinutes/60).toFixed(2)}}
- </view>
- </view>
- </view>
- </view>
- <!-- 充电桩详情 -->
- <view class="charge-pile">
- <view class="box">
- <view class="name ellipsis">
- {{detail.chargingDevice.stationName}}/{{detail.chargingDevice.name}}
- </view>
- <view class="address ellipsis">
- {{detail.chargingDevice.address}}
- </view>
- <text class="iconfont more">
- 
- </text>
- </view>
- <view class="tel" @click="phoneClick(detail.chargingAppointment)">
- <view class="tel-text">
- 联系电话
- </view>
- <view class="tel-num">
- {{detail.chargingAppointment.regUserName.slice(0,1)+'先生'}}{{" "}}{{detail.chargingAppointment.phone}}
- <text class="iconfont more2">
- 
- </text>
- </view>
- </view>
- <view class="details-item">
- <view class="item">
- <view class="item-name">
- 预约单生成时间
- </view>
- <view class="item-content">
- {{detail.chargingAppointment.createTime}}
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 电费单价
- </view>
- <view class="item-content">
- {{detail.price.electricityPrice }}元/度
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 充电服务费
- </view>
- <view class="item-content">
- {{detail.price.servicePrice }}元/度
- </view>
- </view>
- </view>
- </view>
- <!-- 底部按钮 -->
- <view class="bottom">
- <u-button shape='circle' class="refuse-btn" v-if="detail.chargingAppointment.status == '0'" @click="refuseClick(detail.chargingAppointment)">拒绝</u-button>
- <u-button type="success" shape='circle' v-if="detail.chargingAppointment.status == '0'" @click="sureClick(detail.chargingAppointment)">确认</u-button>
- <!-- <u-button shape='circle' class="cancel-btn" v-if="detail.chargingAppointment.status == '4' || detail.chargingAppointment.status == '9'">删除订单</u-button> -->
- </view>
- </view>
- </template>
- <script>
- import * as myApi from '@/apis/my.js'
- import {
- hourDistanceArr,
- currentTimeStamp,
- parseUnixTime
- } from '@/utils'
-
- export default {
- data() {
- return {
- description: '等待桩主确认预约单,剩余时间04:59:59',
- id: '',
- detail: {},
- estimateMinutes: '',
- }
- },
- onLoad(op) {
- if(op.id) {
- this.id = op.id;
- this.getAppointmentDetail();
- }
- },
- methods: {
- getAppointmentDetail() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- myApi.merchantAppointmentDetail(this.id).then((res) => {
- uni.hideLoading();
-
- this.detail = res.data;
-
- if(this.detail.chargingAppointment.status=="0"){
- //this.description= '等待桩主确认预约单,剩余时间'
- var data=new Date(this.detail.chargingAppointment.createTime).getTime()
- var c=hourDistanceArr(new Date(),new Date(data+5*60*1000))
-
- this.description= '等待桩主确认预约单,剩余时间'+c[1]+'分'+c[2]+"秒";
-
-
- setTimeout(()=>{
- this.getInfo(true);
- },2000)
- }
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- phoneClick(item) {
- uni.makePhoneCall({
- phoneNumber: item.phone
- });
- },
- sureClick(item) {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- myApi.merchantChangeStatus({
- id: item.id,
- status: '1'
- }).then((res) => {
- uni.hideLoading();
- this.getAppointmentList(true);
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- refuseClick(item) {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- myApi.merchantChangeStatus({
- id: item.id,
- status: '4'
- }).then((res) => {
- uni.hideLoading();
- this.getAppointmentList(true);
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- page{
- padding-bottom: 151px;
- }
- .tittle-font {
- font-size: 24px;
- position: fixed;
- top: 12px;
- right: 16px;
- z-index: 99999;
- }
- /deep/.u-alert-desc {
- width: 100vw;
- text-align: center;
- color: #ff5a00;
- }
- .reverse-time {
- background-color: #fff;
- padding: 36px 12px 16px 28px;
- .time {
- height: 36px;
- color: rgba(0, 185, 98, 100);
- font-size: 36px;
- text-align: center;
- position: relative;
- .img-box{
- width: 72px;
- height: 72px;
- img{
- width: 72px;
- height: 72px;
- position: absolute;
- top: -12px;
- right: -2px;
- }
- }
- }
- .refused{
- color: #666666;
- }
-
- }
- .details-item {
- margin-top: 40px;
- padding-right: 16px;
- padding-bottom: 12px;
- .item {
- display: flex;
- justify-content: space-between;
- margin-top: 8px;
- }
- }
- // 充电桩详情
- .charge-pile {
- background-color: #fff;
- margin-top: 12px;
- padding: 0 0 12px 16px;
- .box {
- position: relative;
- height: 66px;
- padding: 12px 0;
- .more {
- position: absolute;
- top: 19px;
- right: 12px;
- font-size: 24px;
- color: #b3b3b3;
- }
- }
-
- .name {
- width: 90%;
- line-height: 18px;
- color: rgba(16, 16, 16, 100);
- font-size: 18px;
- font-weight: 600;
- }
- .ellipsis{
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- }
- .address {
- width: 90%;
- line-height: 20px;
- color: rgba(51, 51, 51, 100);
- margin-top: 4px;
- }
- // 联系电话
- .tel {
- line-height: 48px;
- display: flex;
- justify-content: space-between;
- border: 1px solid #eef2f0;
- border-left: none;
- position: relative;
- .tel-num {
- width: 50%;
- }
- .more2 {
- display: inline-block;
- font-size: 24px;
- color: #b3b3b3;
- height: 48px;
- position: absolute;
- top: 1px;
- right: 12px;
- }
- }
- .item {
- margin-top: 20px;
- }
- }
- // 按钮
- .bottom{
- width: 100%;
- height: 56px;
- position: fixed;
- bottom: 0;
- background-color: #fff;
- display: flex;
- .refuse-btn{
- background-color: #DBDBDB;
- }
- .u-btn{
- width: 44%;
- height: 40px;
- margin: auto;
- font-size: 18px;
-
- }
- .cancel-btn{
- width: 91.4%;
- background-color: #dbdbdb;
- color: #666666
- }
- }
- </style>
|