no message

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:00:29 +08:00
commit 4d06351f6a
2830 changed files with 166480 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<template>
<view class="p30">
<mp-html :content="info.protocolContent" />
<view style="height: 100rpx;"></view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { selectProtocolInfo } from '@/api/api.js';
let info = ref({});
onLoad(async (options) => {
let _res = await selectProtocolInfo({ id: options.id });
info.value = _res;
});
</script>
<style></style>

445
pages/home/detail.vue Normal file
View File

@@ -0,0 +1,445 @@
<template>
<view class="orderdetail">
<!-- <statusBar /> -->
<view class="orderdetail_header p30" :style="{ backgroundColor: headerBg ? '#FFF' : '' }">
<view :style="{ height: statusBarHeight }"></view>
<view style="height: 44px; display: flex; align-items: center" @click="">
<up-icon name="arrow-left" bold color="#000" @click="back"></up-icon>
<view @click="back" style="margin-left: 25rpx; transition: all 0.5s" :style="{ opacity: headerBg ? 1 : 0 }">电站详情</view>
</view>
</view>
<up-swiper :list="info.pictures" height="530rpx"></up-swiper>
<view class="p30" style="margin-top: -80rpx">
<orderList
:info="{
...info,
priceAmount: fullCost.totalAmount
}"
type="info"
></orderList>
<view style="height: 30rpx"></view>
<view class="orderdetail_info" style="margin-bottom: 30rpx">
<view class="orderdetail_info_title">
<view>费用信息</view>
<view style="display: flex; align-items: center" @click="showJf = true">
价格详情
<view style="margin-left: 30rpx">
<up-icon color="#333" size="28rpx" name="arrow-right"></up-icon>
</view>
</view>
</view>
<view style="max-width: 420rpx">
<up-tag size="mini" :text="`当前计费时间段:${fullCost.startTime}-${fullCost.endTime}`" plain plainFill></up-tag>
</view>
<view class="orderdetail_info_fy">
<view class="orderdetail_info_fy_left">电站价格</view>
<view class="orderdetail_info_fy_right">
{{ fullCost.totalAmount }}
<text style="font-weight: 500; font-size: 24rpx; color: #333; margin-left: 15rpx">/</text>
</view>
</view>
</view>
<view class="orderdetail_info" style="margin-bottom: 30rpx">
<view>
<view class="orderdetail_info_title">终端明细</view>
</view>
<view class="orderdetail_info_zd" style="position: relative" @click="showZd">
<view class="orderdetail_info_zd_zdbg"></view>
<image
src="/static/icon/eleclist-terminal.png"
style="transform: rotateY(180deg); position: absolute; left: 0; bottom: 0; width: 100rpx; height: 100rpx"
mode="widthFix"
></image>
<view>交流</view>
<view style="display: flex; align-items: center">
{{ info.gunCount - info.gunUseCount }}
<text style="font-size: 28rpx; opacity: 0.9; margin-left: 10rpx">空闲</text>
<text style="font-size: 24rpx; opacity: 0.8">/{{ info.gunCount }}</text>
<view style="margin-left: 30rpx">
<up-icon color="#fff" size="28rpx" name="arrow-right"></up-icon>
</view>
</view>
</view>
</view>
<view class="orderdetail_info">
<view class="orderdetail_info_title">基本信息</view>
<view class="orderdetail_info_view">
<view class="orderdetail_info_view_left">服务提供方</view>
<view class="orderdetail_info_view_right" @click="lookImg([info.licenseImage])">
{{ info.merchantName }}
<image src="/static/icon/9you.png" mode="widthFix"></image>
</view>
</view>
<!-- <view class="orderdetail_info_view">
<view class="orderdetail_info_view_left" style="color: #232323">{{ info.merchantName }}</view>
</view> -->
<view class="orderdetail_info_view">
<view class="orderdetail_info_view_left">营业时间</view>
<view class="orderdetail_info_view_right" @click="lookImg([info.licenseImage])">
{{ info.busineHours }}
</view>
</view>
<!-- <view class="orderdetail_info_view">
<view class="orderdetail_info_view_left" style="margin-right: 30rpx">
{{ info.busineHours }}
</view>
</view> -->
<view class="orderdetail_info_xian"></view>
<view class="orderdetail_info_view">
<view class="orderdetail_info_view_left">发票服务</view>
<view class="orderdetail_info_view_right">{{ info.invoice }}</view>
</view>
<view class="orderdetail_info_view">
<view class="orderdetail_info_view_left">备注信息</view>
<view class="orderdetail_info_view_right">{{ info.remarks || '' }}</view>
</view>
<view class="orderdetail_info_view">
<view class="orderdetail_info_view_left">服务提供方</view>
<view class="orderdetail_info_view_right" @click="call(info.stationTel)" style="color: #4879e6; font-weight: bold">{{ info.stationTel }}</view>
</view>
</view>
</view>
<view class="orderdetail_btn p30">
<view class="orderdetail_btn_left">
{{ fullCost.totalAmount }}
<text>/</text>
</view>
<view class="orderdetail_btn_right" @click="toRecharge">扫码充电</view>
</view>
<view style="height: 150rpx"></view>
<up-popup :show="show" @close="show = false" closeable round="10">
<view class="orderdetail_info" style="padding-top: 50rpx">
<view class="orderdetail_info_zd" style="position: relative" @click="show = true">
<view class="orderdetail_info_zd_zdbg"></view>
<image
src="/static/icon/eleclist-terminal.png"
style="transform: rotateY(180deg); position: absolute; left: 0; bottom: 0; width: 100rpx; height: 100rpx"
mode="widthFix"
></image>
<view>交流</view>
<view style="display: flex; align-items: center">
{{ info.gunCount - info.gunUseCount }}
<text style="font-size: 28rpx; opacity: 0.9; margin-left: 10rpx">空闲</text>
<text style="font-size: 24rpx; opacity: 0.8">/{{ info.gunCount }}</text>
</view>
</view>
</view>
<view class="gun">
<z-paging ref="paging" :fixed="false" :loading-more-enabled="false" v-model="dataList" @query="queryList" height="600rpx;" :auto="false" show-refresher-when-reload>
<view class="gun_list" v-for="(item, index) in dataList" :key="index">
<view class="gun_list_left">
<view class="gun_list_left_view1">
<up-tag v-if="item.realtimeStatus == 1" size="mini" type="error" text="故障" plain plainFill></up-tag>
<up-tag v-else-if="item.realtimeStatus == 2" size="mini" type="success" text="空闲" plain plainFill></up-tag>
<up-tag v-else-if="item.realtimeStatus == 3" size="mini" type="warning" text="充电中" plain plainFill></up-tag>
<up-tag v-else size="mini" type="error" text="离线" plain plainFill></up-tag>
<view style="margin-left: 15rpx"><up-tag v-if="item.insertStatus == 1" size="mini" text="已插枪" plain plainFill></up-tag></view>
<view style="margin-left: 15rpx">{{ item.gunName }}</view>
</view>
<view class="gun_list_left_view">{{ item.deviceNo }}</view>
<view class="gun_list_left_view">
<view>最高功率{{ item.maxPower }}KW</view>
<view style="margin-left: 30rpx">电压{{ item.maxVoltage }}V</view>
</view>
</view>
<view>
<up-button @click="startCd(item)" v-if="item.realtimeStatus == 2" shape="circle" type="success" :plain="true" text="启动充电"></up-button>
<up-button
v-if="item.realtimeStatus == 1 || item.realtimeStatus == 0"
shape="circle"
type="error"
:plain="true"
text="报故障"
openType="contact"
></up-button>
</view>
</view>
</z-paging>
</view>
</up-popup>
<up-popup :show="showJf" @close="showJf = false" closeable round="10">
<view style="font-size: 36rpx; font-weight: bold; padding: 30rpx">价格详情</view>
<view style="padding: 30rpx; padding-top: 0">
<scroll-view scroll-y="true" style="height: 800rpx">
<view v-for="(item, index) in info.priceList" :key="index" style="margin-bottom: 30rpx; position: relative; position: relative">
<view
style="
height: 80rpx;
background: linear-gradient(to right, rgba(72, 121, 230, 1), rgba(72, 121, 230, 0.4));
border-radius: 15rpx;
color: #fff;
font-size: 28rpx;
padding-top: 10rpx;
padding-left: 30rpx;
"
>
<text v-if="item.isCurrent == 1" style="margin-right: 30rpx">当前计费时间段</text>
{{ item.startTime }}-{{ item.endTime }}
</view>
<view style="border: 1rpx solid #4879e6; border-radius: 15rpx; padding: 30rpx; margin-top: -30rpx; background-color: #fff; font-size: 28rpx">
<view style="display: flex; justify-content: space-between; margin-bottom: 15rpx">
<view>电费</view>
<view>{{ item.electricityRate }}/</view>
</view>
<view style="display: flex; justify-content: space-between; margin-bottom: 15rpx">
<view>服务费</view>
<view>{{ item.serviceFeeRate }}/</view>
</view>
<view style="border-top: 1rpx solid #eee; margin-bottom: 15rpx"></view>
<view style="display: flex; justify-content: space-between">
<view>总计</view>
<view>{{ item.totalAmount }}/</view>
</view>
</view>
</view>
</scroll-view>
</view>
</up-popup>
</view>
</template>
<script setup>
import { ref, reactive, computed } from 'vue';
import { infoAroundApi, listByStationId, startCharging } from '@/api/api.js';
import { onLoad, onPageScroll } from '@dcloudio/uni-app';
import { lookImg, call, urlQuery } from '@/utils/fun.js';
import { useNav } from '@/hooks/useNav.js';
const { nav, navTo } = useNav();
const headerBg = ref(false);
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let info = reactive({});
let show = ref(false);
const dataList = ref([]);
const paging = ref(null);
let showJf = ref(false);
const fullCost = computed(() => {
let data = info?.priceList?.find((val) => val.isCurrent == 1);
return data || {};
});
onLoad((options) => {
getInfo(options.id, options.distance);
});
onPageScroll((e) => {
if (e.scrollTop > uni.getSystemInfoSync().statusBarHeight + 44) {
headerBg.value = true;
} else {
headerBg.value = false;
}
});
const getInfo = async (e, distance) => {
let _res = await infoAroundApi({ id: e });
_res.distance = distance;
Object.assign(info, _res);
};
// 使用 ref 创建响应式引用
const list3 = ref(['https://cdn.uviewui.com/uview/swiper/swiper3.png', 'https://cdn.uviewui.com/uview/swiper/swiper2.png', 'https://cdn.uviewui.com/uview/swiper/swiper1.png']);
let toRecharge = () => {
uni.scanCode({
success: function (res) {
let query = urlQuery(res.result);
if (!query.num) {
uni.showToast({
title: '请扫描正确的设备码',
icon: 'none'
});
} else {
navTo(`/pages/home/star?id=${query.num}`);
}
// navTo(`/pages/home/star?id=${res.result}`);
}
});
};
const back = () => {
uni.navigateBack();
};
const queryList = async () => {
listByStationId({ stationId: info.id })
.then((res) => {
paging.value.complete(res);
})
.catch((res) => {
paging.value.complete(false);
});
};
const showZd = () => {
show.value = true;
paging.value.reload();
};
const startCd = async (e) => {
uni.navigateTo({
url: './star?id=' + e.deviceGunNo
});
// let _res = startCharging({
// deviceNo: e.deviceNo,
// gunNo: e.gunNo
// });
};
</script>
<style scoped lang="scss">
.orderdetail {
padding-bottom: 150rpx;
&_header {
width: 750rpx;
position: fixed;
left: 0;
top: 0;
z-index: 99;
transition: all 0.5s;
}
&_info {
background: #ffffff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 25rpx;
box-shadow: 0rpx -6rpx 8rpx 2rpx rgba(66, 115, 229, 0.05);
&_title {
font-size: 32rpx;
color: #232323;
margin-bottom: 30rpx;
@include flex($space: space-between);
}
&_fy {
background: linear-gradient(to right, rgba(72, 121, 230, 0.4), rgba(72, 121, 230, 0));
border-radius: 15rpx;
padding: 40rpx 20rpx 40rpx 40rpx;
color: #fff;
margin-top: 30rpx;
@include flex;
&_left {
font-size: 32rpx;
font-weight: 800;
font-style: italic;
color: #4879e6;
}
&_right {
font-size: 36rpx;
font-weight: 800;
color: #4879e6;
margin-left: 30rpx;
@include flex;
}
}
&_zd {
border-radius: 15rpx;
padding: 40rpx 20rpx 40rpx 130rpx;
background-color: #4879e6;
color: #fff;
@include flex($space: space-between);
&_zdbg {
position: absolute;
left: 0;
top: 0;
width: 40%;
height: 100%;
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 100%);
}
}
&_view {
@include flex($space: space-between);
margin-bottom: 30rpx;
&_left {
font-weight: 400;
font-size: 28rpx;
color: #232323;
}
&_right {
@include flex;
font-weight: bold;
font-size: 28rpx;
color: #232323;
image {
width: 28rpx;
height: 28rpx;
margin-left: 10rpx;
}
}
}
&_xian {
width: 100%;
border: 2rpx solid #707070;
margin-bottom: 30rpx;
opacity: 0.06;
}
}
&_btn {
width: 100%;
position: fixed;
left: 0;
bottom: 40rpx;
@include flex($space: space-between);
view {
@include flex($space: center);
width: 330rpx;
height: 92rpx;
border-radius: 46rpx 46rpx 46rpx 46rpx;
}
&_left {
background-color: #e5eaf4;
color: #4879e6;
font-size: 34rpx;
font-weight: bold;
text {
font-size: 26rpx;
}
}
&_right {
background: #4879e6;
color: #fff;
font-weight: bold;
font-size: 32rpx;
}
}
.gun {
height: 600rpx;
&_list {
@include flex($space: space-between);
padding: 30rpx;
&_left {
flex: 1;
&_view {
font-size: 24rpx;
color: #b0b2b6;
margin-bottom: 10rpx;
@include flex;
}
&_view1 {
@include flex;
font-size: 28rpx;
color: #333;
margin-bottom: 10rpx;
}
}
}
}
::v-deep .u-popup__content__close--top-right {
top: 10rpx;
}
}
</style>

292
pages/home/home.vue Normal file
View File

@@ -0,0 +1,292 @@
<template>
<view>
<view class="search_header p30">
<!-- position: sticky; top: 0; left: 0; z-index: 999; -->
<view style="width: 100%">
<view class="search_header_blur"></view>
<search @search="searchChange" />
</view>
<view style="margin: 30rpx 0 0">
<up-swiper :list="list1" height="150rpx" keyName="imageUrl" indicator></up-swiper>
</view>
<view class="search_header_grid" style="position: sticky; top: 0; left: 0; background-color: #ffffff; padding: 15rpx">
<view class="search_header_grid_view" @click="toOrder">
<image src="/static/icon/dd.png"></image>
<view>我的订单</view>
</view>
<view class="search_header_grid_view" @click="showMode">
<image src="/static/icon/kj.png"></image>
<view>卡卷中心</view>
</view>
<view class="search_header_grid_view" @click="navTo('/pageMake/invoice/invoice')">
<image src="/static/icon/kp.png"></image>
<view>我要开票</view>
</view>
<!-- open-type="contact" -->
<button style="all: unset" @click="toKft">
<view class="search_header_grid_view">
<image src="/static/icon/kf.png"></image>
<view>在线客服</view>
</view>
</button>
</view>
</view>
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view style="height: 35rpx"></view>
<!-- <view style="padding: 0 30rpx">
<view class="order_list" style="position: sticky; top: 0; left: 0">
<view class="order_list_header p30">
<view class="order_list_header_view" @click="tabChange(1)">
<view>距我最近</view>
<view v-if="query.orderByType == 1" class="order_list_header_view_dian"></view>
</view>
<view class="order_list_header_view" @click="tabChange(2)">
<view>空闲最多</view>
<view v-if="query.orderByType == 2" class="order_list_header_view_dian"></view>
</view>
</view>
</view>
</view> -->
<view class="order_list">
<view :class="[query.orderByType == 1 ? 'order_list_active' : '']" class="order_list_view" @click="tabChange(1)">距我最近</view>
<view :class="[query.orderByType == 2 ? 'order_list_active' : '']" class="order_list_view" @click="tabChange(2)">空闲最多</view>
</view>
<!-- <view style="display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 30rpx">
<view style="background-color: #ffffff; width: 690rpx">
</view>
</view> -->
<view style="margin-bottom: 30rpx; padding: 0 30rpx" v-for="(item, index) in dataList" :key="index">
<orderList toNav :info="item"></orderList>
</view>
</z-paging>
<view style="height: 180rpx"></view>
<!-- <tabbar path="/pages/home/home"></tabbar> -->
<cc-myTabbar :tabBarShow="0"></cc-myTabbar>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onShow, onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import { aroundAreaApi, bannerList } from '@/api/api.js';
import { useNav } from '@/hooks/useNav.js';
const { nav, navTo } = useNav();
const dataList = ref([]);
const paging = ref(null);
const query = reactive({
lon: '',
lat: '',
orderByType: 1, //1-最近;2-空闲较多
keyWord: ''
});
const list1 = ref([]);
onLoad(async () => {
let _res = await bannerList();
list1.value = _res;
});
onShow(() => {
uni.hideTabBar();
});
let toKft = (e) => {
uni.makePhoneCall({
phoneNumber: '4008005326' //仅为示例
});
};
const queryList = async () => {
uni.showLoading({
title: '加载中...'
});
try {
if (!query.lon && !query.lat) {
const { longitude: lon, latitude: lat } = await uni.getLocation();
query.lon = lon;
query.lat = lat;
}
} catch (err) {
console.log(err);
}
console.log(query);
aroundAreaApi(query)
.then((res) => {
console.log(res, 'list');
paging.value.complete(res);
uni.hideLoading();
})
.catch((res) => {
paging.value.complete(false);
uni.hideLoading();
});
};
let tabChange = (e) => {
query.orderByType = e;
paging.value.reload();
};
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 toOrder = () => {
uni.switchTab({
url: '/pages/order/order'
});
};
let searchChange = (e) => {
query.keyWord = e;
paging.value.reload();
};
let showMode = () => {
uni.showModal({
title: '提示',
content: '暂未开放',
showCancel: false,
confirmText: '确认',
success: () => {}
});
};
</script>
<style>
page {
/* background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%); */
background-color: #f7f7f7;
}
</style>
<style lang="scss" scoped>
.search_header {
position: relative;
&_blur {
width: 100%;
height: 185rpx;
position: absolute;
top: 0;
left: 0;
background: #dbe6ff;
opacity: 0.8;
filter: blur(50px);
/* #ifdef MP-ALIPAY */
z-index: 0;
/* #endif */
/* #ifdef MP-WEIXIN */
z-index: -1;
/* #endif */
}
&_grid {
// margin: 35rpx 0;
margin-top: 25rpx;
border-radius: 15rpx;
@include flex($space: space-between);
&_view {
display: flex;
flex-direction: column;
align-items: center;
width: 126rpx;
font-size: 26rpx;
// background: #ffffff;
// border-radius: 24rpx 24rpx 24rpx 24rpx;
image {
width: 99rpx;
height: 99rpx;
margin-bottom: 10rpx;
}
}
}
}
.order_list {
display: flex;
align-items: center;
padding: 15rpx;
margin-bottom: 30rpx;
font-size: 30rpx;
background-color: #fff;
width: 690rpx;
margin: 0 30rpx 30rpx;
border-radius: 15rpx;
// width: 690rpx;
// background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 100%);
// box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(88, 140, 255, 0.1);
// border-radius: 44rpx 44rpx 0rpx 0rpx;
&_view {
padding: 15rpx 30rpx;
background-color: #fff;
border-radius: 15rpx;
margin-right: 30rpx;
}
&_active {
background-color: #4879e6;
color: #fff;
}
// &_header {
// width: 100%;
// height: 100rpx;
// @include flex;
// font-weight: bold;
// font-size: 36rpx;
// color: #232323;
// background-color: #ffffff;
// position: sticky;
// top: 360rpx;
// left: 0;
// &_view {
// position: relative;
// margin-right: 50rpx;
// view {
// position: relative;
// z-index: 99;
// }
// &_dian {
// position: absolute !important;
// bottom: 0rpx;
// right: 20rpx;
// width: 66rpx;
// height: 20rpx;
// background-color: #4879e6;
// border-radius: 10rpx;
// z-index: 1 !important;
// }
// }
// }
}
button::after {
all: unset;
}
</style>

561
pages/home/star.vue Normal file
View File

@@ -0,0 +1,561 @@
<template>
<view class="p30">
<!-- <view class="star_pile" style="margin-bottom: 30rpx"></view> -->
<view class="orderdetail_info" style="margin-bottom: 30rpx">
<view class="orderdetail_info_title">
<view>{{ info.stationName }}</view>
</view>
<view style="font-size: 26rpx; margin-bottom: 15rpx; display: flex; align-items: center">
<view style="opacity: 0.7">枪号{{ info.gunName }}</view>
<image style="width: 40rpx; height: 40rpx; margin-left: 15rpx" src="/static/icon/copy.png" @click="copy(info.gunName)" mode="widthFix"></image>
</view>
<view style="font-size: 26rpx; margin-bottom: 15rpx; opacity: 0.7">停车收费说明{{ info.occupyCostInfo }}</view>
<view style="font-size: 26rpx; opacity: 0.7">占用收费说明{{ info.parkCostInfo }}</view>
</view>
<view class="orderdetail_info" style="margin-bottom: 30rpx">
<view class="orderdetail_info_title">
<view>费用信息</view>
</view>
<view style="max-width: 420rpx">
<up-tag size="mini" :text="`当前计费时间段:${currentPrice.startTime}-${currentPrice.endTime}`" plain plainFill></up-tag>
</view>
<view class="orderdetail_info_fy">
<view class="orderdetail_info_fy_left">电站价格</view>
<view class="orderdetail_info_fy_right">
{{ currentPrice.totalAmount }}
<text style="font-weight: 500; font-size: 24rpx; color: #333; margin-left: 15rpx">/</text>
</view>
</view>
</view>
<view class="orderdetail_info" style="margin-bottom: 30rpx">
<view class="orderdetail_info_title">
<view style="display: flex; align-items: center">
<view>支付方式</view>
<!-- -->
<view style="margin-left: 15rpx">
<up-tag v-if="store.state.insertStatus == 1" size="mini" text="已插枪" plain plainFill></up-tag>
</view>
</view>
<view style="display: flex; align-items: center">
<up-button type="primary" size="small" :plain="true" text="余额充值" @click="navTo('/pages/money/recharge')"></up-button>
</view>
</view>
<view style="font-size: 30rpx; margin-bottom: 30rpx">
<!-- @click="payTo" -->
<!-- <view>支付方式</view> -->
<!-- <view>{{ payType == 1 ? '余额付款' : payType == 2 ? '电卡支付' : payType == 3 ? '预付款' : '请选择' }}</view> -->
<view>
<view
class="flex-acsb"
style="padding: 15rpx 30rpx; border-radius: 10rpx"
v-for="(item, index) in payList"
:key="index"
:style="{
border: item.id == payType ? '1rpx solid #4879e6' : ''
}"
@click="payType = item.id"
>
<view style="display: flex; align-items: center">
<image :src="`/static/icon/lie${item.id}.png`" style="width: 50rpx; height: 50rpx; margin-right: 25rpx"></image>
{{ item.name }}
</view>
<view v-if="item.id == 1" style="font-size: 28rpx; opacity: 0.7">可用余额{{ infoUser.balance || 0 }}</view>
</view>
</view>
</view>
</view>
<view class="orderdetail_info" style="margin-bottom: 30rpx">
<view class="orderdetail_info_yf">
<view class="orderdetail_info_yf_left">
<view class="orderdetail_info_yf_left_tit">
<view style="margin-right: 30rpx">预付费</view>
<up-tag size="mini" :text="`余额原路退款`" plain plainFill></up-tag>
</view>
<!-- <view>{{ dataForm.money }} </view> -->
<view class="orderdetail_info_yf_left_mon">
<!-- 预付金额 -->
<view
@click="
dataForm.money = 30;
inputBorder = false;
"
:style="{ border: `1rpx solid ${dataForm.money == 30 && !inputBorder ? '#4879e6' : '#c5c5c5'}` }"
>
30
</view>
<view
@click="
dataForm.money = 50;
inputBorder = false;
"
:style="{ border: `1rpx solid ${dataForm.money == 50 && !inputBorder ? '#4879e6' : '#c5c5c5'}` }"
>
50
</view>
<view
@click="
dataForm.money = 100;
inputBorder = false;
"
:style="{ border: `1rpx solid ${dataForm.money == 100 && !inputBorder ? '#4879e6' : '#c5c5c5'}` }"
>
100
</view>
<view @click="inputClik" :style="{ border: `1rpx solid ${inputBorder ? '#4879e6' : '#c5c5c5'}` }">
<input adjust-position v-if="inputBorder" focus type="number" v-model="dataForm.money" placeholder="自定义" />
<text v-else>自定义</text>
</view>
</view>
</view>
<!-- <view class="orderdetail_info_yf_right" @click="openDialog">预付金额</view> -->
</view>
</view>
<view class="orderdetail_info" style="margin-bottom: 30rpx" v-if="payType == 2">
<view>
<view class="flex-acsb" style="font-size: 30rpx; margin-bottom: 20rpx">
<view>当前可用电卡</view>
</view>
<view @click="userCardId = item.id" style="margin-bottom: 30rpx; position: relative" class="mt30 wallet_list" v-for="(item, index) in userCard" :key="index">
<view v-if="userCardId == item.id" style="position: absolute; top: 0; left: 0; background-color: #e45656; border-radius: 0 0 20rpx 0">
<up-icon name="checkbox-mark" color="#fff"></up-icon>
</view>
<view style="color: #fff">
<view style="font-weight: bold; font-size: 30rpx; margin-bottom: 18rpx">
{{ item.name }}
</view>
<view style="font-size: 28rpx; color: #eee">卡号{{ item.cardNo }}</view>
</view>
<view style="display: flex; flex-direction: column; align-items: center; color: #fff; font-weight: bold; font-size: 26rpx">
<view style="font-size: 36rpx; margin-bottom: 10rpx">{{ item.balance }}</view>
<view style="font-weight: 500">余额</view>
</view>
</view>
</view>
</view>
<view style="height: 500rpx"></view>
<view class="orderdetail_btn p30" style="background-color: #fff">
<view class="orderdetail_btn_left">
{{ currentPrice.totalAmount }}
<text>/ 免费停车</text>
</view>
<view>
<up-button v-if="!payType" :customStyle="{ height: '80rpx', width: '230rpx' }" disabled color="#4879e6" text="请选择支付方式" shape="circle"></up-button>
<up-button v-if="payType == 1" :customStyle="{ height: '80rpx', width: '280rpx' }" @click="toRecharge" color="#4879e6" shape="circle" text="启动充电"></up-button>
<up-button
v-if="payType == 3"
:customStyle="{ height: '80rpx', width: '280rpx' }"
@click="toRechargeYuFu"
color="#4879e6"
shape="circle"
:text="`预付${dataForm.money}元,启动充电`"
></up-button>
<!-- :text="`预付${dataForm.money}元,启动充电`" -->
<up-button
v-if="payType == 2"
:customStyle="{ height: '80rpx', width: '280rpx' }"
:disabled="!userCardId"
color="#4879e6"
:text="userCardId ? '启动充电' : '请选择电卡'"
shape="circle"
@click="toRechargeCard"
></up-button>
</view>
<!-- <view v-if="!payType" class="orderdetail_btn_right" style="opacity: 0.5;">请选择支付方式</view> -->
<!-- <view v-if="payType == 1" class="orderdetail_btn_right" @click="toRecharge">预付{{ dataForm.money }}启动充电</view> -->
<!-- <view v-if="payType == 2" class="orderdetail_btn_right" @click="toRecharge">电卡支付启动充电</view> -->
</view>
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog
ref="inputClose"
mode="input"
title="请输入预付金额"
:value="dataForm.money"
placeholder="请输入内容"
@confirm="dialogInputConfirm"
></uni-popup-dialog>
</uni-popup>
</view>
</template>
<script setup>
import { ref, reactive, computed } from 'vue';
import { gunInfo, infoAroundApi, startChargingByWallet, userCardUsableList, startChargingByCard, ordersInfo, startChargingByAdaPay, userInfo } from '@/api/api.js';
import { onLoad, onShow } from '@dcloudio/uni-app';
import store from '@/store/index.js';
import { copy } from '@/utils/fun.js';
import { useNav } from '@/hooks/useNav.js';
const { navTo } = useNav();
const inputDialog = ref(null);
let info = reactive({});
let infoUser = reactive({});
let inputBorder = ref(false);
let currentPrice = ref({});
let id = ref('');
let userCard = ref([]);
let userCardId = ref(null);
let payType = ref(1);
let dataForm = reactive({
money: 30
});
let payList = reactive([
{
id: 1,
name: '余额支付'
}
]);
onLoad((options) => {
if (options.q) {
let search = decodeURIComponent(options.q);
search = search.split('?')[1];
const pairs = search ? search.split('&') : [];
const query = {};
for (let i = 0; i < pairs.length; ++i) {
const [key, value] = pairs[i].split('=');
query[key] = query[key] || decodeURIComponent(value);
}
if (query.num) {
id.value = query.num;
infoDate(query.num);
}
}
if (options.id) {
id.value = options.id;
infoDate(options.id);
}
});
onShow(async () => {
if (uni.getStorageSync('token') && id.value) {
infoDate(id.value);
let _res = await userInfo();
infoUser.value = _res;
}
});
let getUserCard = async (e) => {
let _res = await userCardUsableList({ stationId: e });
userCard.value = _res;
if (_res.length == 0) {
payType.value = 1;
} else {
payType.value = 2;
userCardId.value = _res[0].id;
if (!payList.find((val) => val.name == '电卡支付')) {
payList.push({
id: 2,
name: '电卡支付'
});
}
}
};
let inputClik = () => {
inputBorder.value = true;
dataForm.money = dataForm.money == 30 || dataForm.money == 50 || dataForm.money == 100 ? '' : dataForm.money;
};
let infoDate = async (e) => {
let _res = await gunInfo({ deviceNo: e });
info = _res;
getUserCard(_res.stationId);
currentPrice.value = _res.currentPrice;
console.log(_res.deviceNo, '_res.deviceNo');
console.log(_res.gunNo, '_res.gunNo');
store.commit('setInsertStatus', _res.insertStatus);
uni.sendSocketMessage({
data: JSON.stringify({
command: 'sub',
deviceNo: _res.deviceNo,
gunNo: _res.gunNo
}),
success: (res) => {
console.log('发送成功');
},
fail: (err) => {
console.log(err);
console.log('发送失败');
}
});
};
let dialogInputConfirm = (e) => {
dataForm.money = e;
};
let openDialog = () => {
console.log(12345);
inputDialog.value.open();
};
let toRechargeCard = async () => {
uni.showLoading({
title: '启动充电中...',
mask: true
});
let _res = await startChargingByCard({
deviceNo: info.deviceNo,
gunNo: info.gunNo,
amount: dataForm.money,
userCardId: userCardId.value
});
};
let toRechargeYuFu = async () => {
uni.showLoading({
title: '启动充电中...',
mask: true
});
let _res = await startChargingByAdaPay({
deviceNo: info.deviceNo,
gunNo: info.gunNo,
amount: dataForm.money
});
let data = _res.payInfo;
uni.requestPayment({
provider: 'wxpay',
timeStamp: data.timeStamp,
nonceStr: data.nonceStr,
package: data.package,
signType: data.signType,
paySign: data.paySign,
success: function (r) {
store.commit('setTransactionNo', _res.transactionNo);
store.commit('setSokStatus', 0);
timeMap(_res);
},
fail: function (err) {
uni.showToast({
title: '已取消支付',
icon: 'none'
});
console.log('fail:' + JSON.stringify(err));
}
});
// store.commit('setTransactionNo', _res.transactionNo);
// store.commit('setSokStatus', 0);
// timeMap(_res);
// uni.navigateTo({
// url: `/pageOrder/recharge/recharge?transactionNo=${_res.transactionNo}&type=order`
// });
};
let toRecharge = async () => {
uni.showLoading({
title: '启动充电中...',
mask: true
});
let _res = await startChargingByWallet({
deviceNo: info.deviceNo,
gunNo: info.gunNo,
amount: dataForm.money
});
store.commit('setTransactionNo', _res.transactionNo);
store.commit('setSokStatus', 0);
timeMap(_res);
// uni.navigateTo({
// url: `/pageOrder/recharge/recharge?transactionNo=${_res.transactionNo}&type=order`
// });
// uni.navigateTo({
// url: `/pageOrder/recharge/recharge?transactionNo=${_res.transactionNo}`
// });
// console.log(_res);
};
const timeMap = (_res) => {
var time = setInterval(async () => {
if (store.state.sokStatus != 1) {
let _data = await ordersInfo({
transactionNo: _res.transactionNo
});
store.commit('setDataObj', _data);
if (_data.status == 3) {
uni.hideLoading();
uni.navigateTo({
url: `/pageOrder/recharge/recharge?transactionNo=${_res.transactionNo}&type=order`
});
clearTimeout(time);
store.commit('setSokStatus', 0);
}
if (_data.status == -1) {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '启动失败,请重试',
showCancel: false,
confirmText: '确认',
success: () => {}
});
clearTimeout(time);
store.commit('setSokStatus', 0);
}
if (_data.status == -2) {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '启动超时,请重试',
showCancel: false,
confirmText: '确认',
success: () => {}
});
clearTimeout(time);
store.commit('setSokStatus', 0);
}
}
}, 5000);
};
const payTo = () => {
let itemList = ['余额付款'];
if (userCard.value.length != 0) {
itemList.push('电卡支付');
}
// itemList.push('预付款');
uni.showActionSheet({
itemList: itemList,
success: function (res) {
// if (itemList[1] == '预付款' && res.tapIndex == 1) {
// payType.value = 3;
// } else {
// payType.value = res.tapIndex + 1;
// }
payType.value = res.tapIndex + 1;
},
fail: function (res) {
console.log(res.errMsg);
}
});
};
</script>
<style lang="scss">
.star_pile {
width: 100%;
box-shadow: 0rpx -6rpx 8rpx 2rpx rgba(66, 115, 229, 0.05);
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 20rpx;
background-color: #fff;
}
.orderdetail_info {
background: #ffffff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 25rpx;
box-shadow: 0rpx -6rpx 8rpx 2rpx rgba(66, 115, 229, 0.05);
&_title {
font-size: 32rpx;
color: #232323;
margin-bottom: 30rpx;
@include flex($space: space-between);
}
&_fy {
background: linear-gradient(to right, rgba(72, 121, 230, 0.4), rgba(72, 121, 230, 0));
border-radius: 15rpx;
padding: 40rpx 20rpx 40rpx 40rpx;
color: #fff;
margin-top: 30rpx;
@include flex;
&_left {
font-size: 32rpx;
font-weight: 800;
font-style: italic;
color: #4879e6;
}
&_right {
font-size: 36rpx;
font-weight: 800;
color: #4879e6;
margin-left: 30rpx;
@include flex;
}
}
&_yf {
@include flex($space: space-between);
&_left {
flex: 1;
// view {
// @include flex;
// }
&_tit {
font-size: 28rpx;
color: rgba(51, 51, 51, 0.8);
margin-bottom: 20rpx;
@include flex;
}
&_mon {
font-size: 30rpx;
@include flex($space: space-between);
view {
// width: 22%;
padding: 15rpx 35rpx;
border: 1rpx solid #c5c5c5;
margin-right: 15rpx;
border-radius: 10rpx;
}
input {
width: 100rpx;
}
}
}
&_right {
padding: 15rpx 30rpx;
color: #1779ff;
border: 1rpx solid #1779ff;
border-radius: 50rpx;
}
}
}
.orderdetail_btn {
width: 100%;
position: fixed;
left: 0;
bottom: 0rpx;
padding: 30rpx;
@include flex($space: space-between);
&_left {
// background-color: #e5eaf4;
color: #333;
font-size: 38rpx;
font-weight: bold;
text {
font-size: 26rpx;
font-weight: 500;
}
}
&_right {
background: #1779ff;
color: #fff;
font-weight: bold;
font-size: 32rpx;
padding: 0 40rpx;
}
}
.wallet_list {
border-radius: 15rpx;
background-color: #4879e6;
padding: 20rpx 50rpx 20rpx 30rpx;
display: flex;
align-items: flex-end;
justify-content: space-between;
}
</style>

266
pages/index/index.vue Normal file
View File

@@ -0,0 +1,266 @@
<template>
<view class="content">
<!-- <search :Fixed="true" /> -->
<map
id="map"
:longitude="longitude"
@markertap="markerClick"
@callouttap="markerClick"
@regionchange="regionchange"
height="90"
width="90"
:markers="markList"
:latitude="latitude"
class="map_content"
>
<cover-view slot="callout">
<template v-for="(item, index) in markList">
<cover-view class="callout" :marker-id="item.id">
<cover-view class="callout_item">
<cover-image class="callout_item_img" src="/static/icon/mc.png"></cover-image>
<cover-view class="callout_item_view"> {{ item.gunUseCount || 0 }}/{{ item.gunCount || 0 }}</cover-view>
</cover-view>
</cover-view>
</template>
</cover-view>
</map>
<uni-transition ref="mapLocationRef" :show="true">
<view class="map-location" @click="mapLocation">
<image src="/static/icon/location-marker-icon.png" mode="widthFix"></image>
</view>
</uni-transition>
<uni-transition modeClass="fade" :show="mapBox">
<view class="map_box">
<orderList toNav :Image="true" :info="infoDz" :list="infoDz.pictures" />
</view>
</uni-transition>
<cc-myTabbar :tabBarShow="1"></cc-myTabbar>
<!-- <tabbar path="/pages/index/index"></tabbar> -->
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { aroundAreaMap, infoAroundApi } from '@/api/api.js';
let longitude = ref(113.675688);
let latitude = ref(34.75527700365562);
let mapContext = ref(null);
let mapBox = ref(false);
let mapLocationRef = ref();
let infoDz = ref([]);
let markList = ref([]);
onLoad(async () => {
// #ifndef MP-WEIXIN
uni.hideTabBar();
// #endif
mapContext.value = uni.createMapContext('map');
const { longitude: lon, latitude: lat } = await uni.getLocation({
type: 'gcj02' // 根据实际需要选择坐标系
});
latitude.value = lat;
longitude.value = lon;
getInfo();
setTimeout(() => {
mapLocation();
}, 300);
});
let getInfo = async () => {
let _res = await aroundAreaMap({
orderByType: 1,
lat: latitude.value,
lon: longitude.value
});
let list = _res.map((item, index) => {
return {
id: item.id,
longitude: item.location.lng,
latitude: item.location.lat,
iconPath: '/static/icon/marker-pointer.png',
width: 20,
height: 23,
content: '2',
gunUseCount: item.gunUseCount,
gunCount: item.gunCount,
distance: item.distance,
customCallout: {
display: 'ALWAYS', // 显示方式
anchorX: 0, // 锚点X轴
anchorY: -10 // 锚点Y轴
}
};
});
list.unshift({
longitude: longitude.value,
latitude: latitude.value,
iconPath: '/static/icon/my-location-default.png',
width: 45,
height: 45,
id: -1
});
markList.value = list;
};
const mapLocation = () => {
const log = longitude.value;
const lat = latitude.value;
mapContext.value.moveToLocation({
longitude: log,
latitude: lat
});
};
// 地图缩放移动触发
const regionchange = (e) => {
// 地图移动手松开结束触发type:end
if (e.type == 'end') {
console.log(e);
console.log(e.detail.scale);
mapBox.value = false;
mapLocationRefStep(false);
}
};
// marker点击事件
const markerClick = async (e) => {
console.log(e, 'eeeeeee');
if (e.markerId == -1) {
return;
}
uni.showLoading();
let _res = await infoAroundApi({
id: e.markerId
});
let markerInfo = markList.value.find((val) => val.id == e.markerId);
let data = _res?.priceList?.find((val) => val.isCurrent == 1);
infoDz.value = {
..._res,
distance: markerInfo.distance,
priceAmount: data.totalAmount
};
console.log(infoDz, 'infoDzinfoDz');
// infoDz.value.priceAmount = data.totalAmount;
// infoDz.value.distance = data.distance;
uni.hideLoading();
mapBox.value = true;
mapLocationRefStep(true);
};
const mapLocationRefStep = (type) => {
if (type) {
mapLocationRef.value.step(
{
translateY: '-200rpx'
},
{
timingFunction: 'ease-in',
duration: 100
}
);
} else {
mapLocationRef.value.step(
{
translateY: '0rpx'
},
{
timingFunction: 'ease',
duration: 500
}
);
}
mapLocationRef.value.run();
};
</script>
<style lang="scss">
.map_content {
width: 750rpx;
height: 100vh;
/* #ifdef MP-ALIPAY */
height: calc(100vh - 100upx);
/* #endif */
}
.map-location {
width: 90rpx;
height: 90rpx;
background-color: #fff;
position: fixed;
left: 30rpx;
bottom: 570rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 5px 11px rgba(0, 0, 0, 0.2);
image {
width: 45rpx;
height: 45rpx;
}
}
.callout {
box-sizing: border-box;
background: rgba(15, 75, 203, 0.26);
border-radius: 15rpx 15rpx 15rpx 0;
padding: 10rpx 15rpx;
@include flex($direction: column);
&_item {
@include flex;
font-weight: bold;
font-size: 28rpx;
color: #ffffff;
box-sizing: border-box;
&_img {
width: 40rpx;
height: 40rpx;
margin-right: 15rpx;
}
}
&_item:nth-child(1) {
margin-bottom: 15rpx;
}
}
.recharge {
width: 690rpx;
background-color: #fff;
min-height: 300rpx;
position: fixed;
left: 30rpx;
bottom: 250rpx;
border-radius: 20rpx;
padding: 20rpx;
box-shadow: 0 5px 11px rgba(0, 0, 0, 0.2);
&_title {
font-size: 36rpx;
margin-bottom: 20rpx;
}
&_con {
font-size: 26rpx;
}
}
.map_box {
width: 690rpx;
position: fixed;
left: 30rpx;
bottom: 230rpx;
z-index: 999;
}
</style>

166
pages/login/login.vue Normal file
View File

@@ -0,0 +1,166 @@
<template>
<view class="content">
<view class="head">
<image src="/static/image/login26_bg.png" mode="widthFix"></image>
</view>
<view class="title">
<text class="name">Hello!</text>
<text class="sub-name">欢迎登录云快充</text>
</view>
<view class="form-box">
<button class="login-btn" :disabled="!aloneChecked" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">一键注册登录</button>
<view class="tip-link" style="display: flex; align-items: center">
<up-checkbox shape="circle" name="agree" usedAlone @change="change"></up-checkbox>
我已阅读并同意
<text @click="toNav('/pages/agreement/agreement?id=9')">用户协议</text>
<text @click="toNav('/pages/agreement/agreement?id=10')">隐私政策</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { login } from '@/common/js/user.js';
let aloneChecked = ref(false);
let getPhoneNumber = async (e) => {
if (!aloneChecked.value) {
return uni.showToast({
title: '请先阅读并同意用户协议和隐私政策',
icon: 'none'
});
}
try {
login(e, 2);
// let token = uni.getStorageSync('token');
// if (!token) {
// login(e, 2);
// } else {
// login();
// uni.navigateBack();
// }
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
});
}
};
const toNav = (e) => {
uni.navigateTo({
url: e
});
};
const change = (e) => {
aloneChecked.value = e;
};
</script>
<style lang="scss">
page {
background-color: #e9edf6;
}
.head {
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 30vh;
z-index: -1;
image {
width: 100%;
height: 100%;
}
}
.title {
padding-left: 80rpx;
padding-top: 100rpx;
display: flex;
justify-content: center;
align-items: flex-start;
flex-direction: column;
height: 30vh;
.name {
font-size: 70rpx;
line-height: 100rpx;
font-weight: bold;
}
.sub-name {
line-height: 80rpx;
font-size: 45rpx;
letter-spacing: 8rpx;
font-weight: bold;
}
}
.form-box {
padding: 0rpx 80rpx;
.row-input {
display: flex;
justify-content: flex-start;
align-items: center;
height: 100rpx;
background-color: #ffffff;
border-radius: 12rpx;
margin: 50rpx 0rpx;
image {
margin: 0 25rpx;
flex-shrink: 0;
width: 31rpx;
height: 35rpx;
}
input {
font-size: 30rpx;
flex: 1;
}
}
.menu-link {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 26rpx;
}
.login-btn {
margin-top: 250rpx;
display: flex;
justify-content: center;
align-items: center;
height: 90rpx;
border-radius: 12rpx;
background-color: #819682;
color: #f4f4f4;
font-size: 30rpx;
letter-spacing: 5rpx;
box-shadow: 0rpx 5rpx 20rpx #94ac95;
}
.tip-link {
display: flex;
justify-content: center;
letter-spacing: 3rpx;
line-height: 150rpx;
font-size: 26rpx;
text {
color: #57a2ee;
}
}
}
</style>

96
pages/mine/card.vue Normal file
View File

@@ -0,0 +1,96 @@
<template>
<view class="earnings p30">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view style="margin-bottom: 30rpx" @click="toCrud(item)" class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
<view style="color: #fff">
<view style="font-weight: bold; font-size: 32rpx; margin-bottom: 18rpx">
{{ item.name }}
</view>
<view style="margin-bottom: 12rpx; font-size: 28rpx; color: #eee">
卡号{{ item.cardNo }}
</view>
<view style="margin-bottom: 12rpx; font-size: 28rpx; color: #eee">
电站{{ item.stationName }}
</view>
<view style="font-size: 28rpx; color: #eee">
商户{{ item.merchantName }}
</view>
</view>
<view style="display: flex; flex-direction: column; align-items: center; color: #fff; font-weight: bold; font-size: 26rpx">
<view style="font-size: 55rpx; margin-bottom: 30rpx">{{ item.balance }}</view>
<view style="font-weight: 500">余额</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { reactive, ref, computed } from 'vue';
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import { timeFormat } from '@/uni_modules/uview-plus';
import { userCardList } from '@/api/api.js';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { useNav } from '@/hooks/useNav.js';
const changeSele = (e) => {
paging.value.reload();
};
const { nav, navTo } = useNav();
let getInfo = ref({});
const paging = ref(null);
let dataList = ref([]);
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 queryList = (pageNo, pageSize) => {
const params = {
current: pageNo,
pageSize: pageSize
};
userCardList(params)
.then((res) => {
paging.value.complete(res);
})
.catch((res) => {
paging.value.complete(false);
});
};
let toCrud = ()=>{
uni.navigateTo({
url:'./cardList?id=' + e.id
})
}
</script>
<style scoped lang="scss">
.wallet_list {
border-radius: 15rpx;
background-color: #4879e6;
padding: 35rpx 50rpx 35rpx 30rpx;
display: flex;
align-items: flex-end;
justify-content: space-between;
}
</style>

151
pages/mine/cardList.vue Normal file
View File

@@ -0,0 +1,151 @@
<template>
<view class="earnings p30">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view style="margin-bottom: 30rpx" class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
<view class="wallet_list_left">
<view>{{ item.recordName || '-' }}</view>
<view>{{ item.createTime }}</view>
</view>
<view class="wallet_list_right" style="display: flex; flex-direction: column; align-items: flex-end">
<!-- <view style="margin-bottom: 10rpx; width: 75rpx">
<view></view>
<up-tag v-if="item.pointType == 2" size="mini" text="余额" type="warning" plain plainFill></up-tag>
<up-tag v-if="item.pointType == 1" size="mini" text="收益" plain plainFill></up-tag>
</view> -->
<view>{{ item.amount }}</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { reactive, ref, computed } from 'vue';
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import { timeFormat } from '@/uni_modules/uview-plus';
import { userCardRecord } from '@/api/api.js';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { useNav } from '@/hooks/useNav.js';
let id = ref('');
const changeSele = (e) => {
paging.value.reload();
};
const { nav, navTo } = useNav();
let getInfo = ref({});
const paging = ref(null);
let dataList = ref([]);
let isPagingRefNotFound = () => {
return !paging.value;
};
onLoad((options) => {
id.value = options.id;
});
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 queryList = (pageNo, pageSize) => {
const params = {
current: pageNo,
pageSize: pageSize,
id: id.value
};
userCardRecord(params)
.then((res) => {
paging.value.complete(res);
})
.catch((res) => {
paging.value.complete(false);
});
};
</script>
<style scoped lang="scss">
.wallet_pall {
width: 690rpx;
height: 272rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 40rpx;
background: #ffffff;
&_header {
font-weight: bold;
font-size: 26rpx;
color: #002ea4;
}
&_ye {
display: flex;
align-items: center;
justify-content: space-between;
height: 70%;
view:nth-child(1) {
font-weight: bold;
font-size: 68rpx;
color: #002ea4;
}
view:nth-child(2) {
width: 128rpx;
height: 58rpx;
background: rgba(0, 46, 164, 0.07);
border-radius: 32rpx 32rpx 32rpx 32rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #002ea4;
}
}
}
.wallet_list {
width: 690rpx;
// height: 120rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 15rpx 30rpx;
@include flex($space: space-between);
&_left {
view:nth-child(1) {
font-weight: bold;
font-size: 28rpx;
color: #232323;
margin-bottom: 10rpx;
}
view:nth-child(2) {
font-size: 24rpx;
color: #232323;
}
view:nth-child(3) {
font-size: 24rpx;
color: #232323;
}
view:nth-child(4) {
font-size: 24rpx;
color: #232323;
}
}
&_right {
font-weight: bold;
font-size: 28rpx;
color: #ff2727;
}
}
</style>

18
pages/mine/earnings.vue Normal file
View File

@@ -0,0 +1,18 @@
<template>
<view class="earnings">
<up-cell-group>
<up-cell icon="integral-fill" title="会员等级" value="新版本"></up-cell>
</up-cell-group>
</view>
</template>
<script>
export default {
data() {
return {};
},
methods: {}
};
</script>
<style></style>

146
pages/mine/incomeList.vue Normal file
View File

@@ -0,0 +1,146 @@
<template>
<view class="earnings p30">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view style="margin-bottom: 30rpx;" class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
<view class="wallet_list_left">
<view>{{ item.recordName || '-' }}</view>
<view>{{ item.createTime }}</view>
</view>
<view class="wallet_list_right" style="display: flex; flex-direction: column; align-items: flex-end">
<!-- <view style="margin-bottom: 10rpx; width: 75rpx">
<view></view>
<up-tag v-if="item.pointType == 2" size="mini" text="余额" type="warning" plain plainFill></up-tag>
<up-tag v-if="item.pointType == 1" size="mini" text="收益" plain plainFill></up-tag>
</view> -->
<view>{{ item.amount }}</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { reactive, ref, computed } from 'vue';
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import { timeFormat } from '@/uni_modules/uview-plus';
import { walletRecord } from '@/api/api.js';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { useNav } from '@/hooks/useNav.js';
const changeSele = (e) => {
paging.value.reload();
};
const { nav, navTo } = useNav();
let getInfo = ref({});
const paging = ref(null);
let dataList = ref([]);
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 queryList = (pageNo, pageSize) => {
const params = {
current: pageNo,
pageSize: pageSize,
};
walletRecord(params)
.then((res) => {
paging.value.complete(res);
})
.catch((res) => {
paging.value.complete(false);
});
};
</script>
<style scoped lang="scss">
.wallet_pall {
width: 690rpx;
height: 272rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 40rpx;
background: #ffffff;
&_header {
font-weight: bold;
font-size: 26rpx;
color: #002ea4;
}
&_ye {
display: flex;
align-items: center;
justify-content: space-between;
height: 70%;
view:nth-child(1) {
font-weight: bold;
font-size: 68rpx;
color: #002ea4;
}
view:nth-child(2) {
width: 128rpx;
height: 58rpx;
background: rgba(0, 46, 164, 0.07);
border-radius: 32rpx 32rpx 32rpx 32rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #002ea4;
}
}
}
.wallet_list {
width: 690rpx;
// height: 120rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 15rpx 30rpx;
@include flex($space: space-between);
&_left {
view:nth-child(1) {
font-weight: bold;
font-size: 28rpx;
color: #232323;
margin-bottom: 10rpx;
}
view:nth-child(2) {
font-size: 24rpx;
color: #232323;
}
view:nth-child(3) {
font-size: 24rpx;
color: #232323;
}
view:nth-child(4) {
font-size: 24rpx;
color: #232323;
}
}
&_right {
font-weight: bold;
font-size: 28rpx;
color: #ff2727;
}
}
</style>

257
pages/mine/mine.vue Normal file
View File

@@ -0,0 +1,257 @@
<template>
<view class="mine">
<statusBar />
<view class="p30">
<view class="mine_header">
<view class="mine_header_img">
<up-avatar size="150rpx" :src="info.avatar"></up-avatar>
</view>
<!-- <image :src="info.avatar" class="mine_header_img" mode="aspectFill"></image> -->
<view class="mine_header_user">
<view>{{ info.nickName }}</view>
<view>{{ info.phone || '' }}</view>
</view>
<image class="mine_header_sett" @click="toEarnings" src="/static/icon/sett.png"></image>
</view>
<view class="mine_money">
<view class="flex-acsb flex1 mine_money_top" style="width: 100%">
<view class="mine_money_left" @click="navTo('/pages/mine/incomeList')">
<view>{{ info.balance || 0 }}</view>
<view>钱包余额</view>
</view>
<view class="mine_money_left" @click="navTo('/pages/mine/incomeList')">
<view>0</view>
<view>赠送余额</view>
</view>
</view>
<view class="flex1 mine_money_bottom" style="display: flex; align-items: center">
<!-- class="mine_money_right" -->
<!-- class="mine_money_right" -->
<view @click="navTo(`/pageMake/refund/refund?balance=${info.refundableAmount}`)">退款</view>
<view @click="navTo('/pages/money/recharge')">充值</view>
</view>
</view>
<view class="mine_grid">
<view class="mine_grid_tit">常用功能</view>
<view class="mine_grid_views">
<view class="mine_grid_views_block" v-for="(item, index) in gridList" :key="index" @click="nav(item)">
<image :src="item.img" mode="widthFix"></image>
<view>{{ item.name }}</view>
</view>
</view>
</view>
<!-- <view class="mine_fun">
<view class="mine_fun_view" @click="navTo('/pages/mine/card')">
<image class="mine_fun_view_left" src="/static/icon/ka.png"></image>
<view class="mine_fun_view_name">充电卡</view>
<image class="mine_fun_view_right" src="/static/icon/9you.png" mode="widthFix"></image>
</view>
</view> -->
</view>
<view style="width: 100%; height: 100vh; background: #f7f7f7; position: absolute; top: 0; left: 0; z-index: -1"></view>
<cc-myTabbar :tabBarShow="4"></cc-myTabbar>
<!-- <tabbar path="/pages/mine/mine"></tabbar> -->
</view>
</template>
<script setup>
import { onShow } from '@dcloudio/uni-app';
import { userInfo } from '@/api/api.js';
import { ref } from 'vue';
import { useNav } from '@/hooks/useNav.js';
const { nav, navTo } = useNav();
let info = ref({});
let gridList = ref([
{
name: '我的电卡',
img: '/static/icon/dk_mine.png',
path: '/pages/mine/card',
type: 'nav'
},
{
name: '充电订单',
img: '/static/icon/cd_mine.png',
path: '/pages/order/order',
type: 'switchTab'
},
{
name: '余额明细',
img: '/static/icon/ye_mine.png',
path: '/pages/mine/incomeList',
type: 'nav'
},
{
name: '客服中心',
img: '/static/icon/kf_mine.png',
call: true
}
]);
onShow(async () => {
uni.hideTabBar();
let _res = await userInfo();
info.value = _res;
});
const toEarnings = () => {
uni.navigateTo({
url: './sett'
});
};
</script>
<style lang="scss" scoped>
.mine {
&_header {
@include flex($space: space-between);
&_img {
width: 150rpx;
height: 150rpx;
// border-radius: 50%;
margin-right: 15rpx;
}
&_user {
flex: 1;
view:nth-child(1) {
font-weight: bold;
font-size: 32rpx;
color: #232323;
margin-bottom: 15rpx;
}
view:nth-child(2) {
font-weight: bold;
font-size: 44rpx;
color: #232323;
}
}
&_sett {
width: 42rpx;
height: 42rpx;
}
}
&_money {
margin-top: 35rpx;
@include flex($direction: column);
width: 100%;
// height: 152rpx;
background: linear-gradient(178deg, #9ab6ff 0%, #4879e6 100%);
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 20rpx 0rpx 0;
&_top {
padding: 0 150rpx;
}
&_bottom {
width: 100%;
@include flex($space: center);
border-top: 1rpx solid rgba(255, 255, 255, 0.3);
margin-top: 20rpx;
padding: 15rpx 0;
view {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: #fff;
}
}
&_left {
@include flex($direction: column, $space: center);
view:nth-child(1) {
font-weight: bold;
font-size: 48rpx;
color: #ffffff;
margin-bottom: 5rpx;
}
view:nth-child(2) {
font-weight: bold;
font-size: 20rpx;
color: #ffffff;
}
}
&_right {
@include flex($space: center);
width: 124rpx;
height: 54rpx;
background: rgba(255, 255, 255, 0.24);
border-radius: 140rpx 140rpx 140rpx 140rpx;
font-weight: bold;
font-size: 24rpx;
color: #ffffff;
}
}
&_grid {
width: 100%;
padding: 20rpx 30rpx;
background-color: #fff;
border-radius: 15rpx;
margin-top: 30rpx;
&_tit {
font-size: 30rpx;
color: #333;
opacity: 0.8;
}
&_views {
margin-top: 20rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
width: 100%;
&_block {
height: 95rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
color: #333;
image {
width: 45rpx;
height: 45rpx;
}
}
}
}
&_fun {
margin-top: 35rpx;
width: 100%;
// background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
background-color: #fff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 35rpx;
&_view {
@include flex($space: space-between);
margin-bottom: 35rpx;
&_left {
width: 58rpx;
height: 58rpx;
margin-right: 20rpx;
// background: #eeeeee;
}
&_name {
flex: 1;
font-weight: bold;
font-size: 24rpx;
color: #232323;
}
&_right {
width: 24rpx;
height: 24rpx;
}
}
}
}
</style>

95
pages/mine/sett.vue Normal file
View File

@@ -0,0 +1,95 @@
<template>
<view class="p30">
<view style="background-color: #fff; border-radius: 15rpx">
<up-cell-group :border="false">
<button style="all: unset" open-type="chooseAvatar" @chooseavatar="chooseAvatar">
<up-cell title="头像" :isLink="true" size="min">
<template #value>
<up-avatar :src="info.avatar"></up-avatar>
</template>
</up-cell>
</button>
<up-cell title="昵称" :isLink="true" size="min" @click="upNickName">
<template #value>
<text class="u-slot-value">{{ info.nickName }}</text>
</template>
</up-cell>
<up-cell title="手机号" size="min" :border="false">
<template #value>
<text class="u-slot-value">{{ info.phone || '-' }}</text>
</template>
</up-cell>
</up-cell-group>
</view>
<view style="height: 100rpx"></view>
<up-button type="error" text="退出登录" @click="outLogin"></up-button>
</view>
</template>
<script setup>
import { onShow } from '@dcloudio/uni-app';
import { userInfo, updateNickName, updateAvatar } from '@/api/api.js';
import { ref } from 'vue';
import { uploadFiles } from '@/utils/fun.js';
let info = ref({});
onShow(async () => {
getInfo();
});
const getInfo = async () => {
let _res = await userInfo();
info.value = _res;
};
const chooseAvatar = async (e) => {
let img = await uploadFiles(e.detail.avatarUrl);
updateAvatar({ avatar: img }).then((res) => {
getInfo();
});
console.log(img);
};
const upNickName = () => {
uni.showModal({
title: '修改昵称',
content: info.value.nickName,
editable: true,
success: function (res) {
if (res.confirm) {
updateNickName({ nickName: res.content }).then((res) => {
getInfo();
});
console.log(res);
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
};
const outLogin = () => {
uni.showModal({
title: '提示',
content: '是否确认退出登录?',
success: (res) => {
if (res.confirm) {
uni.clearStorageSync();
uni.reLaunch({
url: '/pages/home/home'
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
};
</script>
<style>
button::after {
all: unset;
}
</style>

341
pages/money/recharge.vue Normal file
View File

@@ -0,0 +1,341 @@
<template>
<view class="buy">
<view class="title">
<!-- <image src="../../static/image/travel/matching/buy.png"></image> -->
<text class="text">当前余额</text>
<text class="num">{{info.balance}}</text>
</view>
<view class="number">
<view class="list">
<view :class="num == index ? 'item real' : 'item'" v-for="(item, index) in list" :key="index" @click="pick(item, index)">
<view class="card">
<view class="top">
<text>{{ item.number }}</text>
</view>
<!-- <text class="money">{{ item.money }}</text> -->
</view>
</view>
<view :class="num == 'input' ? 'item real' : 'item'" @click="pick('input', 'input')">
<view class="card">
<view class="top" style="padding: 0 15rpx; text-align: center">
<input @change="inputChange" placeholder="其他面额" style="font-weight: bold; color: #666666" v-model="moneyNum" type="number" />
</view>
<!-- <text class="money">{{ item.money }}</text> -->
</view>
</view>
</view>
<view class="tip">
<text class="titl">温馨提示</text>
<view>
<text>1本次充值金额尽可用于充电消费</text>
</view>
<view>
<text>2若充值时若使用了第三方优惠抵扣时,该笔金额不支持直接退款</text>
</view>
</view>
</view>
<view style="position: fixed; bottom: 0; left: 0; width: 750rpx">
<view style="display: flex; align-items: center; justify-content: center; font-size: 26rpx; background-color: rgba(72, 121, 230, 0.3); padding: 15rpx 0">
<up-checkbox shape="circle" name="agree" usedAlone @change="change"></up-checkbox>
我已阅读并同意
<text style="color: #4879e6">云充电用户充值协议</text>
</view>
<view style="display: flex; align-items: center; justify-content: space-between; padding: 20rpx 30rpx">
<view style="font-size: 40rpx; font-weight: bold">
{{ money }}
<text style="font-size: 26rpx; font-weight: 500"></text>
</view>
<view style="width: 220rpx">
<up-button @click="toUp" color="#4879e6" text="充值" shape="circle" :disabled="!aloneChecked"></up-button>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { jqbPay,userInfo,adaPay } from '@/api/api.js';
import { onShow, onLoad } from '@dcloudio/uni-app';
let info = ref({});
let money = ref(30);
let moneyNum = ref('');
let num = ref(0);
let aloneChecked = ref(false);
let list = ref([
{
number: '¥30',
money: '30'
},
{
number: '¥50',
money: '50'
},
{
number: '¥80',
money: '80'
},
{
number: '¥100',
money: '100'
},
{
number: '¥200',
money: '200'
},
{
number: '¥300',
money: '300'
},
{
number: '¥400',
money: '400'
},
{
number: '¥500',
money: '500'
}
]);
const pick = (item, index) => {
if (item != 'input') {
money.value = item.money;
moneyNum.value = '';
}
num.value = index;
};
const change = (e) => {
aloneChecked.value = e;
console.log(e);
};
const toUp = () => {
adaPay({
amount: money.value
}).then((res) => {
let data = res;
uni.requestPayment({
provider: 'wxpay',
timeStamp: data.timeStamp,
nonceStr: data.nonceStr,
package: data.package,
signType: data.signType,
paySign: data.paySign,
success: function (r) {
uni.showModal({
title: '提示',
content: '充值成功',
showCancel: false,
success: function (res) {
if (res.confirm) {
uni.navigateBack();
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
fail: function (err) {
console.log('fail:' + JSON.stringify(err));
}
});
});
// jqbPay({
// amount: money.value
// }).then((res) => {
// let data = JSON.parse(res.payData);
// uni.requestPayment({
// provider: 'wxpay',
// timeStamp: data.timeStamp,
// nonceStr: data.nonceStr,
// package: data.package,
// signType: data.signType,
// paySign: data.paySign,
// success: function (r) {
// uni.showModal({
// title: '提示',
// content: '充值成功',
// showCancel: false,
// success: function (res) {
// if (res.confirm) {
// uni.navigateBack();
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
// },
// fail: function (err) {
// console.log('fail:' + JSON.stringify(err));
// }
// });
// });
};
onShow(async () => {
let _res = await userInfo();
info.value = _res;
});
const inputChange = (e) => {
money.value = e.detail.value;
};
</script>
<style lang="scss" scoped>
.buy {
width: 100%;
height: 100%;
.title {
display: flex;
align-items: center;
padding: 20rpx 0 20rpx 50rpx;
background-color: #ffffff;
> image {
width: 32rpx;
height: 32rpx;
margin-right: 6rpx;
}
> text {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 40rpx;
}
.num {
color: #ff4141;
}
}
.number {
width: 100%;
background-color: #ffffff;
margin-top: 18rpx;
display: flex;
flex-direction: column;
align-items: center;
.list {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 38rpx 40rpx 0rpx 40rpx;
.item {
width: 194rpx;
height: 194rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(0, 0, 0, 0.1);
border-radius: 20rpx;
margin-bottom: 44rpx;
display: flex;
.card {
width: 194rpx;
height: 194rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.top {
display: flex;
align-items: center;
> text {
font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #666666;
line-height: 44rpx;
margin-right: 12rpx;
}
> image {
width: 30rpx;
height: 30rpx;
}
}
.money {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 34rpx;
margin-top: 12rpx;
}
}
.recommend {
width: 112rpx;
height: 36rpx;
background: #f3f2ea;
border-radius: 8rpx 0rpx 8rpx 0rpx;
position: absolute;
text-align: center;
margin-top: -18rpx;
> text {
font-size: 20rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #666666;
line-height: 36rpx;
}
}
}
.real {
border: 2rpx solid #f88700;
background-color: rgba(248, 135, 0, 0.1);
}
&:after {
content: '';
width: 194rpx;
}
}
.sure {
width: 582rpx;
height: 80rpx;
background: #ff6a5f;
border-radius: 40rpx;
text-align: center;
> text {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #ffffff;
line-height: 80rpx;
}
}
}
.tip {
background: #ffffff;
padding: 40rpx;
padding-top: 0;
.titl {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #666666;
line-height: 40rpx;
margin-bottom: 6rpx;
}
> view {
> text {
font-size: 22rpx;
font-family: PingFangSC-Regular, PingFang SC;
color: #999999;
line-height: 32rpx;
}
&:nth-child(2) {
> text:nth-child(2) {
color: #333333;
}
}
&:nth-child(5) {
> text:nth-child(2) {
color: #ff6a5f;
font-weight: 600;
border-bottom: 2rpx solid #ff6a5f;
}
}
}
}
}
</style>

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

@@ -0,0 +1,22 @@
<template>
<view>
<statusBar />
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

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

@@ -0,0 +1,205 @@
<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 style="height: 180rpx"></view>
<cc-myTabbar :tabBarShow="3"></cc-myTabbar>
<!-- <tabbar path="/pages/order/order"></tabbar> -->
</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 () => {
// #ifndef MP-WEIXIN
uni.hideTabBar();
// #endif
});
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>

132
pages/sweep/sweep.vue Normal file
View File

@@ -0,0 +1,132 @@
<template>
<view class="sweep">
<statusBar />
<view class="sweep_note">
<view class="sweep_note_view">
<view class="sweep_note_view_img">
<image src="/static/image/djk.png" mode="widthFix"></image>
</view>
<view>插上</view>
<view>充电枪</view>
</view>
<view class="sweep_note_view">
<view class="sweep_note_view_img">
<image src="/static/image/djs.png" mode="widthFix"></image>
</view>
<view>点击</view>
<view>扫码充电</view>
</view>
<view class="sweep_note_view">
<view class="sweep_note_view_img">
<image src="/static/image/cs.png" mode="widthFix"></image>
</view>
<view>点击</view>
<view>开始充电</view>
</view>
</view>
<view class="sweep_scan" style="margin-top: 300rpx">
<up-input placeholder="请输入充电枪编号" type="number" border="surround" v-model="value"></up-input>
<view style="width: 100rpx">
<up-button type="primary" text="确定" @click="toCd"></up-button>
</view>
</view>
<view class="sweep_scan" style="margin-top: 150rpx">
<up-button @click="scan" type="primary" shape="circle" text="扫码充电"></up-button>
</view>
<cc-myTabbar :tabBarShow="2"></cc-myTabbar>
<!-- <tabbar path="/pages/sweep/sweep" /> -->
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { useNav } from '@/hooks/useNav.js';
import { urlQuery } from '@/utils/fun.js';
const { nav, navTo } = useNav();
let value = ref('');
onLoad(() => {
// #ifndef MP-WEIXIN
uni.hideTabBar();
// #endif
});
const scan = async () => {
uni.scanCode({
success: function (res) {
let query = urlQuery(res.result);
if (!query.num) {
uni.showToast({
title: '请扫描正确的设备码',
icon: 'none'
});
} else {
navTo(`/pages/home/star?id=${query.num}`);
}
// navTo(`/pages/home/star?id=${res.result}`);
}
});
};
const toCd = async () => {
if (!value.value) {
uni.showToast({
title: '请输入枪号',
icon: 'none'
});
return;
}
navTo(`/pages/home/star?id=${value.value}`);
};
</script>
<style scoped lang="scss">
.sweep {
&_note {
padding: 0 60rpx;
@include flex($space: space-between);
&_view {
@include flex($direction: column, $space: center);
font-weight: 800;
font-size: 32rpx;
color: #4879e6;
&_img {
display: flex;
align-items: flex-end;
height: 115rpx;
margin-bottom: 30rpx;
}
}
&_view:nth-child(1) {
image {
width: 151rpx;
height: 99rpx;
}
}
&_view:nth-child(2) {
image {
width: 120rpx;
height: 99rpx;
}
}
&_view:nth-child(3) {
image {
width: 106rpx;
height: 113rpx;
}
}
}
&_scan {
@include flex;
padding: 0 120rpx;
}
}
</style>