chuangte_bike_newxcx/page_user/yongche/orderxq.vue

512 lines
12 KiB
Vue
Raw Normal View History

2025-04-01 21:35:30 +08:00
<template>
<view class="page">
2025-04-12 18:01:40 +08:00
<u-navbar title="订单详情" :border-bottom="false" :background="bgc" title-color='#000' title-size='36' height='45' back-icon-color='#000'></u-navbar>
<view class="jiaoyi">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uiXte3LpSV30jyvTUR2R" mode=""></image>
<text v-if="info.status == 'PROCESSING'">进行中</text>
<text v-if="info.status == 'WAIT_PAY'">待支付</text>
<text v-if="info.status == 'CANCELED'">已取消</text>
<text v-if="info.status == 'FINISHED'">交易完成</text>
<text v-if="info.status == 'WAIT_VERIFY'">待审核</text>
</view>
<view class="gx">
<text v-if="info.status == 'PROCESSING'">订单进行中</text>
<text v-if="info.status == 'WAIT_PAY'">订单待支付</text>
<text v-if="info.status == 'CANCELED'">订单已取消</text>
<text v-if="info.status == 'FINISHED'">感谢您的支持欢迎再次光临</text>
<text v-if="info.status == 'WAIT_VERIFY'">订单待审核</text>
</view>
2025-04-01 21:35:30 +08:00
</view>
2025-04-12 18:01:40 +08:00
<view class="ordermx">
<view class="top">
订单明细
2025-04-01 21:35:30 +08:00
</view>
2025-04-12 18:01:40 +08:00
<view class="xuxian">
<view class="one">
<view class="qian">
订单编号
2025-04-01 21:35:30 +08:00
</view>
2025-04-12 18:01:40 +08:00
<view class="shen">
{{info.no == null ? '--' : info.no}} <image src="https://api.ccttiot.com/smartmeter/img/static/uimYURcxkn9ItLquwPpM" mode=""></image>
2025-04-01 21:35:30 +08:00
</view>
</view>
2025-04-12 18:01:40 +08:00
<view class="one">
<view class="qian">
下单时间
2025-04-01 21:35:30 +08:00
</view>
2025-04-12 18:01:40 +08:00
<view class="shen">
{{info.createTime == null ? '--' : info.createTime}}
2025-04-01 21:35:30 +08:00
</view>
</view>
2025-04-12 18:01:40 +08:00
<view class="one">
<view class="qian">
结束时间
</view>
<view class="shen">
{{info.endTime == null ? '--' : info.endTime}}
</view>
</view>
</view>
<view class="xuxian">
<view class="one">
<view class="qian">
2025-04-01 21:35:30 +08:00
骑行费
</view>
2025-04-12 18:01:40 +08:00
<view class="shen">
{{info.ridingFee == null ? '0.00' : info.ridingFee}}
2025-04-01 21:35:30 +08:00
</view>
</view>
2025-04-12 18:01:40 +08:00
<view class="one">
<view class="qian">
2025-04-01 21:35:30 +08:00
停车点外调度费
</view>
2025-04-12 18:01:40 +08:00
<view class="shen">
{{info.manageFee == null ? '0.00' : info.manageFee}}
2025-04-01 21:35:30 +08:00
</view>
</view>
2025-04-12 18:01:40 +08:00
<view class="one">
<view class="qian">
2025-04-01 21:35:30 +08:00
运营区外调度费
</view>
2025-04-12 18:01:40 +08:00
<view class="shen">
{{info.dispatchFee == null ? '0.00' : info.dispatchFee}}
</view>
</view>
</view>
<view class="xuxian">
<view class="one">
<view class="qian">
合计
</view>
<view class="shen">
{{info.totalFee == null ? '0.00' : info.totalFee}}
</view>
</view>
<view class="one">
<view class="qian">
预存金额
</view>
<view class="shen">
{{info.depositFee == null ? '0.00' : info.depositFee}}
</view>
</view>
<view class="one">
<view class="qian">
退款金额
</view>
<view class="shen">
{{info.payRefunded == null ? '0.00' : info.payRefunded}}
2025-04-01 21:35:30 +08:00
</view>
</view>
2025-04-12 18:01:40 +08:00
</view>
<view class="xuxian" style="border: 0;">
2025-04-23 17:50:42 +08:00
<view class="one" v-if="info.status == 'PROCESSING'">
<view class="qian">
预估金额
</view>
<view class="shen">
<span style="color: #E7612E;font-size: 40rpx;">{{yugumoney}}</span>
</view>
</view>
2025-04-12 18:01:40 +08:00
<view class="one">
<view class="qian">
实付金额
</view>
<view class="shen">
<span style="color: #E7612E;font-size: 40rpx;">{{info.payAmount == null ? '0.00' : info.payAmount}}</span>
</view>
2025-04-01 21:35:30 +08:00
</view>
</view>
2025-04-12 18:01:40 +08:00
</view>
<view class="qixing">
<view class="top">
骑行信息
</view>
<view class="xuxian">
<view class="one">
<view class="qian">
骑行时长
</view>
<view class="shen">
{{ rideDuration == '' ? '--' : rideDuration}}
</view>
</view>
<view class="one">
<view class="qian">
骑行距离
</view>
2025-04-23 17:50:42 +08:00
<view class="shen" v-if="info.status != 'PROCESSING'">
2025-04-21 18:00:19 +08:00
{{info.distance > 1000 ? (info.distance / 1000).toFixed(2) + 'km' : info.distance.toFixed(2) + 'm'}}
2025-04-12 18:01:40 +08:00
</view>
2025-04-23 17:50:42 +08:00
<view class="shen" v-else>
订单结束后展示
</view>
2025-04-12 18:01:40 +08:00
</view>
<view class="one">
<view class="qian">
运营区
</view>
<view class="shen">
{{info.areaName == null ? '--' : info.areaName}}
</view>
</view>
<view class="one">
<view class="qian">
车牌号
</view>
<view class="shen">
{{info.deviceVehicleNum == null ? '--' : info.deviceVehicleNum}}
</view>
</view>
<view class="one">
<view class="qian">
车辆编号SN
</view>
<view class="shen">
{{info.deviceSn == null ? '--' : info.deviceSn}}
</view>
2025-04-01 21:35:30 +08:00
</view>
</view>
</view>
2025-04-10 08:57:21 +08:00
<view class="kefu" @click="btntel">
2025-04-16 09:14:52 +08:00
联系客服
2025-04-10 08:57:21 +08:00
</view>
2025-04-16 09:14:52 +08:00
<!-- 平台客服弹窗 -->
<view class="kefutc" v-if="kefuflag">
<image src="https://api.ccttiot.com/smartmeter/img/static/umtjJg2CJLiOS6hfAEzo" mode="" @click="kefuflag = false"></image>
<view class="box">
<view class="" style="max-height: 280rpx;overflow: scroll;">
<view class="top" v-for="(item,index) in kefulist" :key="index">
<view class="dianhua">
{{item.name == null ? '--' : item.name}}{{item.contact == null ? '--' : item.contact}}
<view class="wz">
工作时间{{item.startTime}}~{{item.endTime}}
</view>
</view>
<view class="boda" @click.stop="btnptkf(item.contact)">
<u-icon name="phone-fill" color="#4297F3" size="28"></u-icon>
<text>拨打</text>
</view>
</view>
</view>
<view class="bot">
<view class="wzs">
客服电话高峰期可能遇忙请耐心等待
</view>
</view>
</view>
</view>
<view class="mask" v-if="kefuflag"></view>
2025-04-01 21:35:30 +08:00
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
2025-04-12 18:01:40 +08:00
backgroundColor: "#fff",
2025-04-01 21:35:30 +08:00
},
id: 0,
info: {},
2025-04-16 09:14:52 +08:00
rideDuration: '' ,// 新增属性用于存储骑行时间
kefulist:[],
kefuflag:false,
2025-04-23 17:50:42 +08:00
yugumoney:''
2025-04-01 21:35:30 +08:00
}
},
onLoad(e) {
this.id = e.id
this.orderInfo()
2025-04-23 17:50:42 +08:00
this.getyugu()
2025-04-01 21:35:30 +08:00
},
methods: {
2025-04-23 17:50:42 +08:00
// 请求预估金额
getyugu() {
let data = {
orderId:this.id,
checkLocation:false
}
this.$u.post(`/app/order/calcFee`,data).then((res) => {
if (res.code == 200) {
this.yugumoney = res.data.ridingFee
}
})
},
2025-04-10 08:57:21 +08:00
// 请求订单详情
2025-04-01 21:35:30 +08:00
orderInfo() {
this.$u.get("/app/order/mineDetail?id=" + this.id).then((res) => {
if (res.code == 200) {
this.info = res.data
2025-04-10 08:57:21 +08:00
this.calculateRideDuration() // 计算骑行时间
2025-04-01 21:35:30 +08:00
}
2025-04-10 08:57:21 +08:00
})
2025-04-01 21:35:30 +08:00
},
2025-04-10 08:57:21 +08:00
// 计算骑行时间
2025-04-01 21:35:30 +08:00
calculateRideDuration() {
2025-04-23 17:50:42 +08:00
if(this.info.startTime != null){
const createTime = new Date(this.info.startTime)
let returnTime = ''
if(this.info.status === 'PROCESSING'){
// 进行中订单,计算到当前时间
returnTime = new Date()
const duration = (returnTime - createTime) / 1000 // 时间差,单位秒
const hours = Math.floor(duration / 3600)
const minutes = Math.floor((duration % 3600) / 60)
if (hours > 0) {
this.rideDuration = `${hours}小时${minutes}`
} else {
this.rideDuration = `${minutes}`
}
} else if(this.info.endTime != null){
// 非进行中订单,计算到结束时间
returnTime = new Date(this.info.endTime)
const duration = (returnTime - createTime) / 1000 // 时间差,单位秒
const hours = Math.floor(duration / 3600)
const minutes = Math.floor((duration % 3600) / 60)
const seconds = Math.floor(duration % 60)
if (hours > 0) {
this.rideDuration = `${hours}小时${minutes}${seconds}`
} else {
this.rideDuration = `${minutes}${seconds}`
}
}
2025-04-10 08:57:21 +08:00
}
},
2025-04-16 09:14:52 +08:00
// 点击拨打平台客服电话
btnptkf(tel){
uni.makePhoneCall({
phoneNumber: tel,
success: function(res) {
console.log('拨打电话成功', res)
},
fail: function(err) {
console.error('拨打电话失败', err)
}
})
},
2025-04-10 08:57:21 +08:00
btntel(){
2025-04-21 18:00:19 +08:00
this.$u.get(`/app/customerService/list?pageNum=1&pageSize=999&areaId=${this.info.areaId}`).then(res => {
2025-04-16 09:14:52 +08:00
if(res.code == 200){
if(res.rows.length > 0){
this.kefulist = res.rows
this.kefuflag = true
}else{
uni.showToast({
title: '暂无客服电话',
icon: 'none',
duration:2000
})
2025-04-10 08:57:21 +08:00
}
2025-04-16 09:14:52 +08:00
}
})
2025-04-01 21:35:30 +08:00
}
}
}
</script>
<style lang="scss" >
page{
background-color: #F7FAFE;
}
2025-04-16 09:14:52 +08:00
.kefutc{
animation: fadeIn 0.5s ease-in-out forwards;
position: fixed;
top: 660rpx;
left: 50%;
transform: translateX(-50%);
z-index: 10;
.bot{
margin-top: 30rpx;
.wz{
margin-top: 10rpx;
font-weight: 600;
font-size: 28rpx;
color: #3D3D3D;
}
.wzs{
margin-top: 10rpx;
font-size: 24rpx;
color: #7C7C7C;
}
}
.top{
width: 538rpx;
height: 122rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);
border-radius: 14rpx 14rpx 14rpx 14rpx;
display: flex;
justify-content: space-between;
align-items: center;
padding-right: 14rpx;
box-sizing: border-box;
margin-top: 20rpx;
.dianhua{
font-weight: 600;
font-size: 28rpx;
color: #3D3D3D;
padding-left: 26rpx;
box-sizing: border-box;
}
.boda{
width: 94rpx;
height: 94rpx;
background: #DCEDFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
text-align: center;
padding-top: 8rpx;
box-sizing: border-box;
text{
display: block;
}
}
}
image{
position: absolute;
top: -280rpx;
z-index: -1;
left: 50%;
transform: translateX(-50%);
width: 614rpx;
height: 748rpx;
}
}
.mask{
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0,0,0,0.3);
z-index: 9;
}
2025-04-01 21:35:30 +08:00
.page{
width: 750rpx;
2025-04-12 18:01:40 +08:00
background: #F7F7F7;
2025-04-01 21:35:30 +08:00
border-radius: 0rpx 0rpx 0rpx 0rpx;
2025-04-12 18:01:40 +08:00
padding-bottom: 200rpx;
box-sizing: border-box;
2025-04-10 08:57:21 +08:00
.kefu{
width: 680rpx;
height: 100rpx;
line-height: 100rpx;
2025-04-12 18:01:40 +08:00
background-color: #4C97E7;
2025-04-10 08:57:21 +08:00
color: #fff;
font-size: 36rpx;
font-weight: 600;
text-align: center;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 50rpx;
border-radius: 20rpx;
}
2025-04-12 18:01:40 +08:00
.qixing{
width: 702rpx;
height: 466rpx;
2025-04-01 21:35:30 +08:00
background: #FFFFFF;
2025-04-12 18:01:40 +08:00
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 0 42rpx;
box-sizing: border-box;
margin: auto;
margin-top: 32rpx;
.top{
font-weight: 600;
font-size: 32rpx;
2025-04-01 21:35:30 +08:00
color: #3D3D3D;
2025-04-12 18:01:40 +08:00
padding: 36rpx 0 24rpx 0;
box-sizing: border-box;
border-bottom: 1px dashed #D8D8D8;
2025-04-01 21:35:30 +08:00
}
2025-04-12 18:01:40 +08:00
.xuxian{
.one{
2025-04-01 21:35:30 +08:00
display: flex;
justify-content: space-between;
2025-04-12 18:01:40 +08:00
align-items: center;
margin-top: 30rpx;
.qian{
color: #808080;
2025-04-01 21:35:30 +08:00
font-size: 28rpx;
}
2025-04-12 18:01:40 +08:00
.shen{
2025-04-01 21:35:30 +08:00
color: #3D3D3D;
}
}
}
2025-04-12 18:01:40 +08:00
}
.ordermx{
width: 702rpx;
max-height: 1862rpx;
background: #FFFFFF;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 0 42rpx;
box-sizing: border-box;
margin: auto;
margin-top: 32rpx;
.xuxian{
padding-bottom: 24rpx;
box-sizing: border-box;
border-bottom: 1px dashed #D8D8D8;
.one{
2025-04-01 21:35:30 +08:00
display: flex;
2025-04-12 18:01:40 +08:00
justify-content: space-between;
2025-04-01 21:35:30 +08:00
align-items: center;
2025-04-12 18:01:40 +08:00
margin-top: 30rpx;
.qian{
color: #808080;
font-size: 28rpx;
2025-04-01 21:35:30 +08:00
}
2025-04-12 18:01:40 +08:00
.shen{
2025-04-01 21:35:30 +08:00
color: #3D3D3D;
2025-04-12 18:01:40 +08:00
image{
width: 23rpx;
height: 28rpx;
vertical-align: baseline;
margin-left: 10rpx;
}
2025-04-01 21:35:30 +08:00
}
}
}
2025-04-12 18:01:40 +08:00
.top{
font-weight: 600;
font-size: 32rpx;
color: #3D3D3D;
padding: 36rpx 0 24rpx 0;
box-sizing: border-box;
border-bottom: 1px dashed #D8D8D8;
}
}
.jiaoyi{
width: 702rpx;
height: 182rpx;
background: #FFFFFF;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin: auto;
text-align: center;
margin-top: 26rpx;
.pic{
padding-top: 34rpx;
2025-04-01 21:35:30 +08:00
display: flex;
align-items: center;
2025-04-12 18:01:40 +08:00
justify-content: center;
width: 100%;
image{
width: 38rpx;
height: 38rpx;
margin-right: 10rpx;
2025-04-01 21:35:30 +08:00
}
2025-04-12 18:01:40 +08:00
font-weight: 600;
font-size: 40rpx;
color: #4C97E7;
}
.gx{
font-size: 28rpx;
color: #808080;
margin-top: 20rpx;
2025-04-01 21:35:30 +08:00
}
}
}
</style>