first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-31 10:53:43 +08:00
commit f529129c93
770 changed files with 86065 additions and 0 deletions

362
pages/order/detail.vue Normal file
View File

@@ -0,0 +1,362 @@
<template>
<view class="order-detail-container">
<!-- <statusBar /> -->
<view class="top-area">
<view class="order-state">
<view class="state-left">
{{ detailData.status < 2 ? "待支付" : detailData.status < 5 ? "进行中" : detailData.status == 5 ? "已完成" : "" }}
<text class="pay-type">{{ getPayName(detailData.orderPlatform) }}</text>
</view>
<!-- view>
<button class="pay-btn" @click="goPay(detailData)">去支付</button>
</view> -->
</view>
<view class="number-area">
<view class="number-area-item">
<view>
订单编号
</view>
<view class="number-value">
{{ detailData.orderNo }}
<image class="copy-img" src="/static/icon/icon-copy.png" @click="copy(detailData.orderNo)"></image>
</view>
</view>
<view class="number-area-item">
<view>
充电桩编号
</view>
<view class="number-value">
{{ detailData.gunNo }}
<image class="copy-img" src="/static/icon/icon-copy.png" @click="copy(detailData.gunNo)"></image>
</view>
</view>
</view>
</view>
<view class="info-item">
<view class="info-item-title">
充电信息
</view>
<view class="flex-space-between">
<view class="text-one">
{{ detailData.startTime?.substring(5, 10)?.replace("-", "月") }}
</view>
<view class="text-one">
{{ detailData.endTime?.substring(5, 10)?.replace("-", "月") }}
</view>
</view>
<view class="flex-space-between mb16 item-flex-end">
<view class="text-one">
{{ detailData.startTime?.substring(11, 19) }}
</view>
<view class="time-area">
<view class="use-time">
{{ detailData.useTime }}分钟
</view>
<view class="arrow-line"></view>
</view>
<view class="text-one">
{{ detailData.endTime?.substring(11, 19) }}
</view>
</view>
<view class="flex-space-between">
<view class="text-two">
开始充电
</view>
<view class="text-two">
结束充电
</view>
</view>
<view class="line"></view>
<view class="flex-space-between item-center">
<view class="text-one">
合计充电量
</view>
<view>
<text class="text-three">{{ detailData.useDegree }}</text>
<text class="text-one"> </text>
</view>
</view>
</view>
<view class="info-item">
<view class="info-item-title">
费用信息
</view>
<view class="flex-space-between">
<view class="text-one">
订单总额
</view>
<view class="text-one">
{{ detailData.actuallyAmount }}
</view>
</view>
<view class="money-detail">
<view class="money-detail-box">
<view>
电费
<text class="text-one mx16">{{ detailData.electricityAmount }}</text>
</view>
<view>
服务费
<text class="text-one mx16">{{ detailData.serviceAmount }}</text>
</view>
</view>
</view>
<view class="flex-space-between mb16">
<view class="text-two">
支付金额
</view>
<view class="text-one">
{{ detailData.actuallyAmount }}
</view>
</view>
<view class="flex-space-between">
<view class="text-two">
{{ detailData.payTime }}
</view>
<view class="text-two">
{{ getPayName(detailData.orderPlatform) }}
</view>
</view>
<view class="line"></view>
<view class="flex-space-between item-center">
<view class="text-one">
实付金额
</view>
<view>
<text class="text-three">{{ detailData.actuallyAmount }}</text>
<text class="text-one"> </text>
</view>
</view>
</view>
<view class="info-item">
<view class="info-item-title">
终端信息
</view>
<!-- <view class="flex-space-between mb16">
<view class="text-two">
辅助电源
</view>
<view class="text-two text-bold">
12/24v
</view>
</view> -->
<view class="flex-space-between mb16">
<view class="text-two">
充电站
</view>
<view class="text-two text-bold">
{{ detailData.stationName }}
</view>
</view>
<view class="flex-space-between">
<view class="text-two">
终端名称
</view>
<view class="text-two text-bold">
{{ detailData.deviceNo }}
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { copy } from '@/utils/fun.js';
import { ordersInfo } from '@/api/api.js';
const detailData = ref();
onLoad((options) => {
getDetail(options.transactionNo);
});
const getDetail = async (transactionNo) => {
console.log("------transactionNo-----", transactionNo)
let _res = await ordersInfo({ transactionNo });
detailData.value = _res;
};
const getPayName = v => {
if(v == 1){
return "微信支付"
}else if(v == 2){
return "支付宝支付"
}else{
return ""
}
}
const goPay = () => {
console.log("去支付")
}
</script>
<style scoped lang="scss">
.order-detail-container {
.top-area {
background: linear-gradient( 180deg, #FFFFFF 0%, #F7F7F7 100%);
padding: 24rpx 30rpx 36rpx;
.order-state {
display: flex;
justify-content: space-between;
align-items: center;
.state-left {
font-weight: bold;
font-size: 44rpx;
color: #232323;
.pay-type {
width: 120rpx;
height: 38rpx;
background: rgba(111,162,86, 0.1);
border-radius: 8rpx;
font-weight: bold;
font-size: 24rpx;
color: #6FA256;
padding: 6rpx 12rpx;
margin-left: 8rpx;
}
}
.pay-btn {
width: 156rpx;
height: 50rpx;
line-height: 50rpx;
background: #6FA256;
border-radius: 26rpx;
font-weight: bold;
font-size: 30rpx;
color: #FFFFFF;
}
}
.number-area {
display: flex;
justify-content: space-between;
margin-top: 36rpx;
&-item {
width: 50%;
font-family: DIN, DIN;
font-weight: 400;
font-size: 24rpx;
color: #232323;
.number-value {
margin-top: 16rpx;
.copy-img {
width: 24rpx;
height: 24rpx;
margin-left: 6rpx;
}
}
}
}
}
.info-item {
background: #FFFFFF;
border-radius: 16rpx;
padding: 24rpx;
margin: 0 30rpx 36rpx;
.info-item-title {
font-weight: bold;
font-size: 32rpx;
color: #232323;
margin-bottom: 28rpx;
}
.time-area {
flex: 1;
margin: 0 18rpx;
.use-time {
font-weight: bold;
font-size: 28rpx;
color: #3BCF73;
text-align: center;
margin-bottom: 8rpx;
}
.arrow-line {
border-top: 2rpx dashed #999999;
padding-top: 6rpx;
position: relative;
}
.arrow-line::after {
content: '';
position: absolute;
width: 14rpx;
height: 14rpx;
right: 4rpx;
top: 0;
transform: translateY(-60%) rotate(-50deg);
border-right: 2rpx dashed #999999;
}
}
.money-detail {
padding: 24rpx 24rpx 0;
margin-bottom: 24rpx;
&-box {
background: rgba(111, 162, 86, 0.1);
font-weight: bold;
font-size: 24rpx;
color: #6FA256;
padding: 14rpx 30rpx;
border-radius: 16rpx;
display: flex;
justify-content: space-between;
position: relative;
}
&-box::after {
content: '';
position: absolute;
top: -10rpx;
right: 20rpx;
transform: translateY(-75%);
border-top: 20rpx solid transparent;
border-bottom: 20rpx solid rgba(111, 162, 86, 0.1);
border-left: 18rpx solid transparent;
border-right: 18rpx solid transparent;
}
}
}
.flex-space-between {
display: flex;
justify-content: space-between;
}
.item-flex-end {
align-items: flex-end;
}
.item-center {
align-items: center;
}
.mb16 {
margin-bottom: 16rpx;
}
.mx16 {
margin-left: 16rpx;
margin-right: 16rpx;
}
.text-one {
font-weight: bold;
font-size: 28rpx;
color: #232323;
}
.text-two {
font-weight: 400;
font-size: 24rpx;
color: #666666;
}
.text-three {
font-family: DIN, DIN;
font-weight: bold;
font-size: 44rpx;
color: #232323;
}
.text-bold {
font-weight: bold;
}
.line {
height: 0rpx;
border-bottom: 2rpx solid #EEEEEE;
margin: 24rpx 0 26rpx;
}
}
</style>

200
pages/order/order.vue Normal file
View File

@@ -0,0 +1,200 @@
<template>
<view class="order">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view>
<statusBar />
<view class="p30">
<view class="order_header">
<view
class="order_header_view"
@click="chanStatus(item.type)"
v-for="(item, index) in status_list"
:key="index"
:class="status == item.type ? 'order_header_active' : ''"
>
{{ item.name }}
<view class="order_header_xian" v-if="item.type == status"></view>
</view>
</view>
</view>
</view>
<view class="p30">
<view class="order_list" v-for="(item, index) in dataList" :key="index" @click="toLink(item)">
<view class="order_list_header">订单编号{{ item.orderNo }}</view>
<view class="order_list_view">
<view>充电时间</view>
<view>{{ item.startTime }}</view>
</view>
<view class="order_list_view">
<view>结束时间</view>
<view>{{ item.endTime }}</view>
</view>
<view class="order_list_view">
<view>充电电量</view>
<view>{{ item.useDegree }}</view>
</view>
<view class="order_list_view">
<view>服务费</view>
<view>{{ item.serviceAmount }}</view>
</view>
<view class="order_list_view">
<view>电费</view>
<view>{{ item.electricityAmount }}</view>
</view>
<view class="order_list_view">
<view>预付金额</view>
<view>{{ item.preAmount }}</view>
</view>
<view class="order_list_total">实付金额{{ item.actuallyAmount }}</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onPullDownRefresh, onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app';
import { ordersList } from '@/api/api.js';
const paging = ref(null);
let dataList = ref([]);
let list = ref([]);
let status = ref(1);
let status_list = ref([
{
name: '全部',
type: ''
},
{
name: '进行中',
type: 1
},
{
name: '已完成',
type: 2
},
{
name: '待支付',
type: 3
}
]);
let chanStatus = (e) => {
status.value = e;
paging.value.reload();
};
onLoad(async () => {
});
let toLink = (e) => {
// 1-订单初始化;2-启动充电中;3-正在充电;4-充电结束中;5:交易记录确认;-1-启动失败;-2-启动超时
if (e.status == 2 || e.status == 3 || e.status == 4) {
uni.navigateTo({
url: `/pageOrder/recharge/recharge?transactionNo=${e.transactionNo}&type=order`
});
}
};
let isPagingRefNotFound = () => {
return !paging.value;
};
onPullDownRefresh(() => {
if (isPagingRefNotFound()) return;
paging.value.reload().catch(() => {});
});
onPageScroll((e) => {
if (isPagingRefNotFound()) return;
paging.value.updatePageScrollTop(e.scrollTop);
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
});
onReachBottom(() => {
if (isPagingRefNotFound()) return;
paging.value.pageReachBottom();
});
const upChange = (e) => {
console.log(dataFrom);
paging.value.reload();
};
const queryList = (pageNo, pageSize) => {
const params = {
current: pageNo,
pageSize: pageSize,
type: status.value
};
ordersList(params)
.then((res) => {
paging.value.complete(res);
})
.catch((res) => {
paging.value.complete(false);
});
};
</script>
<style lang="scss" scoped>
.order {
&_header {
@include flex($space: space-between);
font-weight: bold;
font-size: 36rpx;
color: #232323;
border-bottom: 4rpx solid #e9ecf2;
&_view {
padding: 15rpx 0;
position: relative;
view {
position: absolute;
left: calc(50% - 49rpx);
bottom: -4rpx;
width: 98rpx;
height: 8rpx;
background: #4879e6;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
}
&_active {
color: #4879e6;
}
}
&_list {
padding: 25rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
margin-top: 30rpx;
&_header {
font-weight: bold;
font-size: 26rpx;
color: #4879e6;
padding-bottom: 20rpx;
border-bottom: 2rpx solid #ebebeb;
margin-bottom: 20rpx;
}
&_view {
@include flex($space: space-between);
font-weight: 400;
font-size: 26rpx;
color: #232323;
margin-bottom: 20rpx;
}
&_total {
flex: 1;
text-align: right;
font-weight: bold;
font-size: 40rpx;
color: #4879e6;
}
}
}
</style>