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

View File

@@ -0,0 +1,184 @@
<template>
<view class="p30 piles" style="padding: 30rpx">
<view class="piles_card">
<view class="piles_card_title">充电桩汇总</view>
<view class="piles_card_view">
<view>
<text>{{ count.installDeviceNumber || 0 }}</text>
<text>已安装</text>
</view>
<view>
<text>{{ count.uninstallDeviceNumber || 0 }}</text>
<text>未安装数量</text>
</view>
<view>
<text>{{ count.deviceTotal || 0 }}</text>
<text>团队</text>
</view>
</view>
</view>
<up-subsection activeColor="rgba(111, 162, 86, 1)" :list="list" keyName="name" :current="current" @change="upChange"></up-subsection>
<view class="order_view" v-for="i in dataList" :key="i">
<view class="piles_list" v-if="current == 0">
<view class="piles_list_title">安装电站{{ i.stationName || '-' }}</view>
<view class="piles_list_view">
<view>设备ID</view>
<view>{{ i.id }}</view>
</view>
<view class="piles_list_view">
<view>设备功率</view>
<view>{{ i.deviceType }}KW</view>
</view>
<view class="piles_list_view" v-if="i.purposeType">
<view>设备类型</view>
<view>{{ i.purposeType == 1 ? '商用运维版' : i.purposeType == 2 ? '商用合作版' : i.purposeType == 3 ? '家用专业版' : '' }}</view>
</view>
<view class="piles_list_view">地址{{ i.stationAddress || '-' }}</view>
<!-- <view class="piles_list_view">
<view>电费费用</view>
<view>
<text>1.00</text>
/
</view>
</view>
<view class="piles_list_view">
<view>昨日收益</view>
<view>
<text>100.00 </text>
</view>
</view> -->
<view class="piles_list_view">
<view>下单时间</view>
<view>{{ timeFormat(new Date(i.createTime).getTime(), 'yyyy-mm-dd hh:MM') }}</view>
</view>
</view>
<view class="piles_list" v-if="current == 1">
<view class="piles_list_view">
<view>设备ID</view>
<view>{{ i.id }}</view>
</view>
<view class="piles_list_view">
<view>设备功率</view>
<view>{{ i.deviceType }}KW</view>
</view>
<view class="piles_list_view" v-if="i.purposeType">
<view>设备类型</view>
<view>{{ i.purposeType == 1 ? '商用运维版' : i.purposeType == 2 ? '商用合作版' : i.purposeType == 3 ? '家用专业版' : '' }}</view>
</view>
<view class="piles_list_view">
<view>下单时间</view>
<view>{{ timeFormat(new Date(i.createTime).getTime(), 'yyyy-mm-dd hh:MM') }}</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { getDeviceInfo } from '@/api/api.js';
import { onMounted, reactive, ref } from 'vue';
import { onPullDownRefresh, onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app';
import { timeFormat } from '@/uni_modules/uview-plus';
const paging = ref(null);
let dataList = ref([]);
let dataFrom = reactive({
deviceStatus: 1
});
let count = ref({});
onMounted(() => {
console.log(123456);
getDeviceInfo().then((res) => {
count.value = res;
dataList.value = res.installDeviceList;
});
});
const list = ref([
{
name: '已安装',
id: 1
},
{
name: '待安装',
id: 0
}
]);
const current = ref(0);
const upChange = (e) => {
current.value = e;
if (e == 0) {
dataList.value = count.value.installDeviceList || [];
} else {
dataList.value = count.value.uninstallDeviceList || [];
}
};
</script>
<style scoped lang="scss">
.piles {
padding: 30rpx;
&_card {
width: 690rpx;
height: 192rpx;
background: linear-gradient( 179deg, #81BF63 0%, #6FA256 100%);
border-radius: 8rpx 8rpx 0rpx 0rpx;
padding: 30rpx;
&_title {
font-weight: bold;
font-size: 28rpx;
color: #ffffff;
margin-bottom: 20rpx;
}
&_view {
padding: 0 80rpx;
flex-direction: column;
@include flex($space: space-between);
view {
@include flex($direction: column, $space: space-between);
text:nth-child(1) {
font-weight: bold;
font-size: 32rpx;
color: #ffffff;
margin-bottom: 15rpx;
}
text:nth-child(2) {
font-size: 26rpx;
color: #ffffff;
}
}
}
}
&_list {
padding: 25rpx;
width: 690rpx;
background: #ffffff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-top: 30rpx;
&_title {
font-weight: bold;
font-size: 28rpx;
color: #232323;
}
&_view {
@include flex;
color: #555555;
font-size: 28rpx;
margin-top: 15rpx;
view:nth-child(2) {
font-weight: bold;
font-size: 28rpx;
color: #232323;
}
text {
color: #ff2727;
}
}
}
}
</style>

View File

@@ -0,0 +1,182 @@
<template>
<view class="order">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<view style="height: 20rpx"></view>
<view style="display: flex; align-items: center; margin: 0 30rpx 30rpx">
<view
style="font-weight: bold; position: relative; margin-right: 50rpx"
:style="{
color: purposeType == item.id ? '#333' : '#bbb'
}"
v-for="(item, index) in tabbar"
:key="index"
@click="swichMenu(item.id)"
>
<view style="position: relative; z-index: 9">{{ item.name }}</view>
<view
v-if="purposeType == item.id"
style="width: 72rpx; height: 16rpx; background: #b6d0aa; border-radius: 48rpx 48rpx 48rpx 48rpx; position: absolute; bottom: -5rpx; left: 0"
></view>
</view>
</view>
<view class="p30">
<view class="order_view" v-for="i in dataList" :key="i" @click="navTo(`/pages/order/details?id=${i.id}`)">
<view class="order_view_dd">
<view>
<text style="font-weight: 500">订单号</text>
:{{ i.orderNo }}
</view>
<view>
<up-tag size="mini" v-if="i.status == 0" text="待支付" plain></up-tag>
<up-tag size="mini" v-if="i.status == -1" text="已取消" type="warning" plain></up-tag>
<up-tag size="mini" v-if="i.status == 1" text="支付成功" type="success" plain></up-tag>
<up-tag size="mini" v-if="i.status == -2" text="退款" type="error" plain></up-tag>
</view>
</view>
<view class="order_view_info">
<image class="order_view_info_img" :src="i.orderGoods.cover" mode="aspectFit"></image>
<view class="order_view_info_right">
<view class="order_view_info_right_tit">
<view style="display: flex; align-items: center">
<!-- <up-tag size="mini" :text="i.sourceType == 1 ? '商品' : '套餐'" bgColor="#4874e5" borderColor="#4874e5"></up-tag> -->
<view>
{{ i.orderGoods.name }}
</view>
</view>
</view>
<view class="order_view_info_right_num" style="display: flex; align-items: center; justify-content: space-between">数量:{{ i.num }}</view>
<view class="order_view_info_right_mon">
订单金额:
<text style="color: crimson">{{ i.payMoney }}</text>
</view>
</view>
</view>
<view
style="
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1rpx solid rgba(153, 153, 153, 0.5);
margin-top: 15rpx;
padding-top: 15rpx;
"
>
<view style="font-size: 28rpx">{{ i.createdAt }}</view>
<view>
<up-tag size="mini" v-if="i.orderPlatform == 3" text="支付宝" plain></up-tag>
<up-tag size="mini" v-if="i.orderPlatform == 2" text="微信" type="success" plain></up-tag>
<up-tag size="mini" v-if="i.orderPlatform == 1" text="钱包" type="warning" plain></up-tag>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import { useNav } from '@/hooks/useNav.js';
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import { orderPage } from '@/api/api.js';
import { timeFormat } from '@/uni_modules/uview-plus';
const { navTo } = useNav();
const paging = ref(null);
let dataList = ref([]);
let dataFrom = reactive({
status: 1,
businessPayType: '',
sourceType: ''
});
let tabbar = [
{
name: '已支付',
id: 1
},
{
name: '待支付',
id: 0
},
{
name: '已取消',
id: -1
}
];
let purposeType = ref(1);
const swichMenu = (index) => {
dataFrom.status = index;
paging.value.reload();
};
const queryList = (pageNo, pageSize) => {
const params = {
current: pageNo,
pageSize: pageSize,
...dataFrom
};
orderPage(params)
.then((res) => {
paging.value.complete(res);
})
.catch((res) => {
paging.value.complete(false);
});
};
</script>
<style scoped lang="scss">
.order {
&_view {
background: #ffffff;
border-radius: 16rpx;
padding: 25rpx;
margin-bottom: 30rpx;
&_info {
@include flex;
&_img {
width: 208rpx;
height: 208rpx;
margin-right: 15rpx;
border-radius: 10rpx;
}
&_right {
flex: 1;
font-size: 28rpx;
color: #232323;
&_tit {
@include flex($space: space-between);
margin-bottom: 15rpx;
}
&_num {
margin-bottom: 15rpx;
}
&_mon {
margin-bottom: 15rpx;
text {
color: #ff2e24;
}
}
&_time {
}
}
}
&_dd {
@include flex($space: space-between);
font-weight: bold;
font-size: 28rpx;
color: #232323;
margin-bottom: 15rpx;
}
}
}
</style>

View File

@@ -0,0 +1,349 @@
<template>
<view class="u-wrap">
<view style="margin: 30rpx">
<up-swiper :list="['https://zhongshuai-test.oss-cn-beijing.aliyuncs.com/upload/20240919/c6f8c174-19b1-41a3-a0d9-082f0abb5f85.png']" height="320rpx" indicator></up-swiper>
</view>
<view class="u-search-box">
<u-input placeholder="请输入充电桩型号或关键字" border="surround" prefixIcon="search" shape="circle" clearable="true" v-model="keywords"></u-input>
</view>
<view style="display: flex; align-items: center; justify-content: space-between; margin: 0 30rpx 30rpx">
<view
style="font-weight: bold; position: relative"
:style="{
color: purposeType == item.id ? '#333' : '#bbb'
}"
v-for="(item, index) in tabbar"
:key="index"
@click="swichMenu(item.id)"
>
<view style="position: relative;z-index: 9;">{{ item.name }}</view>
<view v-if="purposeType == item.id" style="width: 72rpx; height: 16rpx; background: #b6d0aa; border-radius: 48rpx 48rpx 48rpx 48rpx; position: absolute; bottom: -5rpx; left: 0"></view>
</view>
</view>
<view class="shopList">
<!-- <image class="shopList_img" src="/static/jp.png" mode="widthFix"></image> -->
<view class="shopList_list">
<view class="shopList_list_view" v-for="i in filterGoods(goods)" :key="i" @click="navTo(`/pageInvest/shop/details?id=${i.id}`)">
<image class="shopList_list_view_img" :src="i.cover" mode="aspectFit"></image>
<view class="shopList_list_view_tit">{{ i.name }}</view>
<view class="shopList_list_view_mon">
<view class="shopList_list_view_mon_left">{{ i.currentPrice }} </view>
<!-- <up-tag @click="toShop(i)" text="下单" bgColor="#4874e5" borderColor="#4874e5"></up-tag> -->
<!-- <view class="shopList_list_view_mon_right">下单</view> -->
</view>
</view>
</view>
</view>
<!-- <view class="u-menu-wrap">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop">
<view
v-for="(item, index) in tabbar"
:key="index"
class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']"
:data-current="index"
@tap.stop="swichMenu(index)"
>
<text class="u-line-1">{{ item.name }}</text>
</view>
</scroll-view>
<block v-for="(item, index) in tabbar" :key="index">
<scroll-view scroll-y class="right-box" v-if="current == index">
<view class="page-view">
<view class="class-item">
<view class="item-title">
<text>{{ item.name }}</text>
</view>
<view class="item-container">
<view class="thumb-box" v-for="(item1, index1) in filterGoods(item.foods)" @click="navTo(`/pageInvest/shop/details?id=${item1.id}`)" :key="item1.id">
<image class="item-menu-image" :src="item1.cover" mode="aspectFill"></image>
<view class="item-menu-name">{{ item1.name }}</view>
</view>
</view>
</view>
</view>
</scroll-view>
</block>
</view> -->
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { goodsList, categoryList } from '@/api/api.js';
import { useNav } from '@/hooks/useNav.js';
const { navTo } = useNav();
const keywords = ref('');
let tabbar = ref([]);
let goods = ref([]);
let scrollTop = ref(0);
let current = ref(0);
let menuHeight = ref(0);
let menuItemHeight = ref(0);
let purposeType = ref(null);
// [
// {
// name: '女装',
// foods: [
// {
// name: 'A字裙',
// key: 'A字裙',
// icon: 'https://cdn.uviewui.com/uview/common/classify/1/1.jpg',
// cat: 10
// }
// ]
// }
// ]
onMounted(() => {
categoryList().then((res) => {
tabbar.value = res.map((item, index) => {
return {
...item,
foods: []
};
});
purposeType.value = res[0].id;
goodsList({ categoryId: res[0].id }).then((res) => {
// tabbar.value[0].foods = res;
goods.value = res;
});
});
});
async function swichMenu(index) {
// if (index == current.value) return;
// current.value = index;
purposeType.value = index;
goodsList({ categoryId: index }).then((res) => {
goods.value = res;
});
return;
// 如果为0意味着尚未初始化
if (menuHeight.value == 0 || menuItemHeight.value == 0) {
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
// 将菜单菜单活动item垂直居中
this.scrollTop = index * menuItemHeight.value + menuItemHeight.value / 2 - menuHeight.value / 2;
}
function getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this);
query
.select('.' + elClass)
.fields({ size: true }, (res) => {
// 如果节点尚未生成res值为null循环调用执行
if (!res) {
setTimeout(() => {
this.getElRect(elClass);
}, 10);
return;
}
this[dataVal] = res.height;
})
.exec();
});
}
const filterGoods = (value) => {
if (!value?.length) {
return [];
}
return value.filter((item) => item.name.includes(keywords.value));
};
</script>
<style lang="scss" scoped>
.u-wrap {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
}
.u-search-box {
padding: 18rpx 30rpx;
}
.u-menu-wrap {
flex: 1;
display: flex;
overflow: hidden;
}
.u-search-inner {
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
}
.u-search-text {
font-size: 26rpx;
color: $u-tips-color;
margin-left: 10rpx;
}
.u-tab-view {
width: 200rpx;
height: 100%;
}
.u-tab-item {
height: 80rpx;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #444;
font-weight: 400;
line-height: 1;
}
.u-tab-item-active {
position: relative;
color: #000;
font-size: 30rpx;
font-weight: 600;
background: #fff;
}
.u-tab-item-active::before {
content: '';
position: absolute;
border-left: 4px solid rgba(111, 162, 86, 1);
height: 45rpx;
left: 0;
top: calc(50% - 22.5rpx);
}
.u-tab-view {
height: 100%;
}
.right-box {
background-color: rgb(250, 250, 250);
}
.page-view {
padding: 16rpx;
}
.class-item {
margin-bottom: 30rpx;
background-color: #fff;
padding: 16rpx;
border-radius: 8rpx;
}
.item-title {
font-size: 26rpx;
color: $u-main-color;
font-weight: bold;
}
.item-menu-name {
font-weight: normal;
font-size: 24rpx;
color: $u-main-color;
}
.item-container {
display: flex;
flex-wrap: wrap;
}
.thumb-box {
width: 33.333333%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 20rpx;
}
.item-menu-image {
width: 144rpx;
height: 144rpx;
border-radius: 4rpx 4rpx 4rpx 4rpx;
}
.shopList {
@include flex($direction: column, $space: content);
&_img {
width: 308rpx;
height: 44rpx;
margin-bottom: 50rpx;
}
&_list {
width: 690rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
&_view {
border-radius: 8rpx 8rpx 8rpx 8rpx;
width: 334rpx;
background-color: #fff;
margin-bottom: 30rpx;
padding-bottom: 20rpx;
&_img {
width: 334rpx;
height: 334rpx;
border-radius: 8rpx 8rpx 0rpx 0rpx;
}
&_tit {
padding: 10rpx 20rpx 0;
display: -webkit-box;
-webkit-line-clamp: 2; /* 限制显示的行数 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
font-weight: bold;
font-size: 30rpx;
color: #232323;
}
&_mon {
padding: 0rpx 20rpx;
@include flex($space: space-between);
&_left {
font-weight: bold;
font-size: 30rpx;
color: rgba(239, 38, 38, 1);
}
&_right {
width: 80rpx;
height: 40rpx;
@include flex($space: center);
font-size: 26rpx;
background-color: #4874e5;
color: #fff;
font-weight: bold;
border-radius: 20rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,138 @@
<template>
<view style="padding: 20rpx 30rpx">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view style="display: flex; flex-wrap: wrap; justify-content: space-between; width: 100%">
<view v-for="(item, index) in dataList" :key="index" style="width: 336rpx; background-color: #fff; border-radius: 8rpx 8rpx;margin-bottom: 30rpx;">
<image :src="item.coverImageUrl" style="width: 336rpx; height: 368rpx; border-radius: 8rpx 8rpx 0 0" mode="aspectFill"></image>
<view style="padding: 15rpx 15rpx 0; font-size: 24rpx">{{ item.title }}</view>
<view style="display: flex; align-items: center; padding: 15rpx; border-radius: 0 0 8rpx 8rpx; font-size: 24rpx">
<image :src="item.authorUrl" style="width: 48rpx; height: 48rpx; border-radius: 50%; margin-right: 20rpx"></image>
<view>{{ item.authorName }}</view>
</view>
</view>
</view>
<!-- <custom-waterfalls-flow
ref="waterfallsFlowRef"
:value="dataList"
:column="column"
:columnSpace="1.5"
:seat="2"
@wapperClick="wapperClick"
@imageClick="imageClick"
@loaded="loaded"
>
<view class="item" v-for="(item, index) in dataList" :key="index" :slot="`slot${index}`">
<view class="title">{{ item.title }}</view>
<view class="desc">{{ item.content }}</view>
</view>
</custom-waterfalls-flow> -->
</z-paging>
<view
style="
width: 108rpx;
height: 108rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: fixed;
bottom: 300rpx;
right: 30rpx;
background: #ffffff;
border-radius: 50%;
font-size: 24rpx;
"
@click="navTo('/pages/find/add')"
>
<image src="/static/image/fawen.png" style="width: 48rpx; height: 48rpx"></image>
<view>发文</view>
</view>
</view>
</template>
<script setup>
import { reactive, ref, onMounted } from 'vue';
import { getMerchantSelect } from '@/api/api.js';
import { onLoad } from '@dcloudio/uni-app';
import { useNav } from '@/hooks/useNav.js';
const { navTo } = useNav();
onLoad(() => {});
const paging = ref(null);
const dataList = ref([]);
const queryList = async (pageNo, pageSize) => {
getMerchantSelect({
current: pageNo,
pageSize: pageSize,
category: 'DISCOVERY'
})
.then((res) => {
paging.value.complete(res.records);
uni.hideLoading();
})
.catch((res) => {
paging.value.complete(false);
uni.hideLoading();
});
};
const column = ref(2);
function loaded() {
console.log('加载完成');
}
function wapperClick(item) {
console.log('单项点击事件', item);
}
function imageClick(item) {
console.log('图片点击事件', item);
}
const waterfallsFlowRef = ref(null);
</script>
<style>
page {
background-color: #f2f5f9;
}
</style>
<style lang="scss" scoped>
.handle {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-bottom: 20rpx;
padding: 10rpx;
.btn {
margin: 20rpx 10rpx;
padding: 0 20rpx;
background: #2878ff;
font-size: 28rpx;
color: #fff;
&::after {
border: 0;
}
}
}
.item {
padding: 10rpx 10rpx 20rpx;
background: #fff;
.title {
line-height: 48rpx;
font-size: 28rpx;
color: #222;
}
.desc {
font-size: 24rpx;
color: #666;
}
}
</style>

View File

@@ -0,0 +1,389 @@
<template>
<view>
<z-paging ref="paging" v-model="dataList" @query="queryList">
<view class="search_header p30">
<view style="margin: 30rpx 0 0">
<up-swiper :list="list1" height="320rpx" keyName="imageUrl" indicator></up-swiper>
</view>
</view>
<view style="height: 35rpx"></view>
<view class="p30" style="width: 100%">
<search :top="false" @search="searchChange" />
</view>
<view style="height: 25rpx"></view>
<view style="padding: 0 30rpx">
<view class="order_list" style="position: sticky; top: 0; left: 0">
<view class="order_list_header">
<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>
<image class="filter-btn" src="/static/icon/icon-filter.png" @click="filterBtn"></image>
</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>
<u-popup
:show="popupShow"
mode="top"
:safeAreaInsetBottom="false"
@close="popupClose"
@open="popupOpen"
>
<view class="filter-area">
<view class="filter-label">充电方式</view>
<view class="filter-value">
<view
class="filter-value-item"
v-for="(item, index) in filterData.chargeWay"
:key="index"
:class="{'filter-value-item-active': item.value === query.chargeWay}"
@click="clickChargeWay(item)"
>
{{ item.label }}
</view>
</view>
<view class="filter-label">停车费</view>
<view class="filter-value">
<view
class="filter-value-item"
v-for="(item, index) in filterData.serviceInfo"
:key="index"
:class="{'filter-value-item-active': item.value === query.serviceInfo}"
@click="clickServiceInfo(item)"
>
{{ item.label }}
</view>
</view>
<view class="filter-label">终端功率kw</view>
<view class="filter-value">
<SlideFilter
style="width: 100%;padding: 0 40rpx;"
v-model="query.maxPower"
:option="[0, 20, 40, 80, 120, 240, 360, 480, 720, 960]"
@change="slideFilterChange"
/>
</view>
</view>
</u-popup>
</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 SlideFilter from '@/components/slide-filter/index.vue';
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-空闲较多
chargeWay: "",
serviceInfo: "",
maxPower: "",
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: () => {}
});
};
const popupShow = ref(false);
const filterData = reactive({
chargeWay: [
{ label: "慢充<20kw", value: "1" },
{ label: "快充20~360kw", value: "2" },
{ label: "超充≥360kw", value: "3" },
],
serviceInfo: [
{ label: "停车免费", value: "1" },
{ label: "限时免费", value: "2" },
{ label: "停车收费", value: "3" },
]
})
// 筛选电站
const filterBtn = () => {
popupShow.value = true;
}
const popupClose = () => {
console.log("popupClose");
popupShow.value = false;
}
const popupOpen = () => {
console.log("popupOpen");
}
const clickChargeWay = (item) => {
if(query.chargeWay == item.value){
query.chargeWay = ""
}else{
query.chargeWay = item.value;
}
paging.value.reload();
}
const clickServiceInfo = (item) => {
if(query.serviceInfo == item.value){
query.serviceInfo = ""
}else{
query.serviceInfo = item.value;
}
paging.value.reload();
}
const slideFilterChange = () => {
console.log("query.maxPower", query.maxPower)
paging.value.reload();
}
</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 {
box-sizing: border-box;
view {
box-sizing: border-box;
}
display: flex;
align-items: center;
padding: 15rpx;
margin-bottom: 30rpx;
font-size: 30rpx;
// background-color: #fff;
width: 690rpx;
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: #6FA256;
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: #6FA256;
border-radius: 10rpx;
z-index: 1 !important;
}
}
}
.filter-btn {
width: 72rpx;
height: 72rpx;
}
}
button::after {
all: unset;
}
.filter-area {
padding: 30rpx 30rpx 56rpx;
.filter-label {
font-weight: bold;
font-size: 36rpx;
color: #232323;
margin-bottom: 24rpx;
}
.filter-value {
display: flex;
justify-content: space-between;
margin-bottom: 36rpx;
&-item {
font-weight: bold;
font-size: 24rpx;
color: #232323;
padding: 8rpx 0;
border-radius: 8rpx;
border: 2rpx solid #666666;
width: 220rpx;
text-align: center;
}
&-item-active {
background: #6FA256;
color: #FFFFFF;;
border: 2rpx solid #428A1F;
}
}
}
</style>

View File

@@ -0,0 +1,264 @@
<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"
>
<!-- #ifdef MP-WEIXIN -->
<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>
<!-- #endif -->
</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>
<!-- <tabbar path="/pages/index/index"></tabbar> -->
</view>
</template>
<script setup>
import { ref,onMounted } 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([]);
onMounted(async () => {
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>

View File

@@ -0,0 +1,373 @@
<template>
<view class="mine">
<!-- 头部个人信息 -->
<view class="header">
<view class="user-info" @click="navTo('/pages/mine/sett')">
<up-avatar size="120rpx" :src="user.avatarUrl || user.avatar" />
<view class="user-detail" v-if="user.nickName || user.username">
<text class="nickname">{{ user.nickName || user.username }}</text>
<text class="phone">{{ user.phone || user.mobile }}</text>
</view>
<view class="user-detail" v-else @click="!isInvest ? navTo('/pages/login/login') : navTo('/pageInvest/login/login')">
<text class="nickname">您还未登录</text>
</view>
</view>
<view class="qr-code" v-if="isInvest">
<image @click="lookImg([user.qrcode])" :src="user.qrcode" mode="aspectFit" />
<text>邀请码</text>
</view>
</view>
<!-- 余额积分 -->
<view class="balance-wrap">
<view class="balance-item" @click="toIsInvest">
<text class="amount">{{ user.money2 || '0' }}</text>
<text class="label">余额</text>
</view>
<view v-if="!isInvest" class="balance-item" @click="navTo('/pages/mine/signIn')">
<text class="amount">{{ user.points || '0' }}</text>
<text class="label">积分</text>
</view>
<view v-else class="balance-item" @click="emit('tabChange', { index: 2 })">
<text class="amount">{{ user.deviceNum || '0' }}</text>
<text class="label">充电桩</text>
</view>
</view>
<!-- 我的爱车 -->
<view class="vehicle-section" v-if="!isInvest">
<view class="section-header">
<text style="font-weight: bold">我的爱车</text>
<text class="more" @click="navTo('/pages/mine/car/car')">全部车辆 ></text>
</view>
<view class="car-plate" v-if="user.licensePlate" @click="navTo('/pages/mine/car/car')">
<image style="width: 198rpx; height: 56rpx; position: absolute; top: 0; left: 0" src="/static/image/carNum.png"></image>
<text>{{ user.licensePlate }}</text>
</view>
<view v-else class="add-vehicle" @click="navTo('/pages/mine/car/add')">
<view class="add-btn">
<image src="/static/icon/add.png" mode="aspectFit" />
</view>
<text>添加我的爱车</text>
</view>
<view class="vehicle-status">
<view class="status-item">
<image src="/static/icon/mine/parking.png" mode="aspectFit" />
<text>停车定位</text>
</view>
<view class="status-item">
<image src="/static/icon/mine/charging.png" mode="aspectFit" />
<text>充电状态</text>
</view>
<view class="status-item">
<image src="/static/icon/mine/location.png" mode="aspectFit" />
<text>精确定位</text>
</view>
</view>
</view>
<!-- 投资者功能菜单 -->
<view class="menu-grid" v-if="isInvest">
<view class="menu-item" v-for="(item, index) in menuItemsIsInvest1" :key="index" @click="item.type == 'relTo' ? emit('tabChange', item) : handleMenuClick(item)">
<image :src="item.icon" mode="aspectFit" />
<text>{{ item.name }}</text>
</view>
</view>
<!-- 投资者功能菜单 -->
<view class="menu-grid" v-if="isInvest">
<view class="menu-item" v-for="(item, index) in menuItemsIsInvest2" :key="index" @click="handleMenuClick(item)">
<image :src="item.icon" mode="aspectFit" />
<text>{{ item.name }}</text>
</view>
</view>
<!-- 功能菜单 -->
<view class="menu-grid" v-if="!isInvest">
<view class="menu-item" v-for="(item, index) in menuItems" :key="index" @click="handleMenuClick(item)">
<image :src="item.icon" mode="aspectFit" />
<text>{{ item.name }}</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { userInfo } from '@/api/api.js';
import { useNav } from '@/hooks/useNav.js';
import { lookImg } from '@/utils/fun.js';
const props = defineProps({
user: {
type: Object,
default: {}
},
isInvest: {
type: Boolean,
default: false
}
});
const emit = defineEmits(['tabChange']);
const { navTo, relTo } = useNav();
const menuItemsIsInvest1 = ref([
{ name: '我的订单', icon: '/static/icon/mine/order.png', index: 1, type: 'relTo' },
{ name: '商城', icon: '/static/icon/mine/shop.png', index: 0, type: 'relTo' },
{ name: '我的银行卡', icon: '/static/icon/mine/travel.png', path: '/pages/bank/bank' },
{ name: '切换账号', icon: '/static/icon/mine/switch.png', path: '/pageInvest/login/login' }
]);
const menuItemsIsInvest2 = ref([
{ name: '提现', icon: '/static/icon/tixian.png', path: '/pageInvest/money/withdraw' },
{ name: '客服中心', icon: '/static/icon/mine/service.png', path: '/pages/service/index' },
{ name: '退出登录', icon: '/static/icon/mine/logout.png', path: '/pages/account/logout' },
{ name: '充电模式', icon: '/static/icon/qiehuan.png', path: '/pages/login/login' }
]);
const menuItems = ref([
{ name: '我的订单', icon: '/static/icon/mine/order.png', path: '/pages/order/order' },
{ name: '收藏电站', icon: '/static/icon/mine/station.png', path: '/pages/station/favorite' },
{ name: '客服中心', icon: '/static/icon/mine/service.png', path: '/pages/service/index' },
{ name: '一号多充', icon: '/static/icon/mine/multi.png', path: '/pages/mine/multipleNumbers' },
{ name: '隐私', icon: '/static/icon/mine/privacy.png', path: '/pages/privacy/index' },
{ name: '我的银行卡', icon: '/static/icon/mine/travel.png', path: '/pages/bank/bank' },
{ name: '投资者平台', icon: '/static/icon/mine/switch.png', path: '/pageInvest/login/login' },
{ name: '退出登录', icon: '/static/icon/mine/logout.png', path: '/pages/account/logout' }
]);
const handleMenuClick = (item) => {
if (item.path) {
if (item.path === "/pages/account/logout") {
outLogin()
return
}
navTo(item.path);
return;
}
};
const toIsInvest = () => {
if (props.isInvest) {
navTo('/pageInvest/money/wallet', true);
} else {
}
};
onMounted(async () => {});
onShow(async () => {
isInvest.value = uni.getStorageSync('isInvest') || false;
if (isInvest.value) {
menuItems.value[6].name = '充电模式';
} else {
menuItems.value[6].name = '投资者平台';
}
});
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 lang="scss" scoped>
.mine {
min-height: 100vh;
background-color: #f7f7f7;
.header {
padding: 30rpx;
background: #fff;
display: flex;
justify-content: space-between;
align-items: center;
.user-info {
display: flex;
align-items: center;
gap: 20rpx;
.user-detail {
.nickname {
font-size: 32rpx;
font-weight: 500;
color: #333;
display: block;
margin-bottom: 10rpx;
}
.phone {
font-size: 28rpx;
color: #666;
}
}
}
.qr-code {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
image {
width: 88rpx;
height: 88rpx;
margin-bottom: 6rpx;
}
text {
font-size: 24rpx;
color: #666;
}
}
}
.balance-wrap {
display: flex;
justify-content: space-around;
background: #fff;
padding: 0rpx 0 30rpx;
.balance-item {
text-align: center;
.amount {
font-size: 40rpx;
font-weight: 600;
color: #333;
display: block;
margin-bottom: 8rpx;
}
.label {
font-size: 26rpx;
color: #666;
}
}
}
.vehicle-section {
margin: 20rpx;
background: #fff;
border-radius: 12rpx;
padding: 30rpx;
.section-header {
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
text {
font-size: 30rpx;
color: #333;
}
.more {
color: #666;
font-size: 26rpx;
}
}
.add-vehicle {
display: flex;
align-items: center;
gap: 20rpx;
margin-bottom: 30rpx;
.add-btn {
width: 80rpx;
height: 80rpx;
background: #f5f5f5;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
image {
width: 40rpx;
height: 40rpx;
}
}
text {
font-size: 28rpx;
color: #666;
}
}
.vehicle-status {
display: flex;
justify-content: space-around;
border-top: 1rpx solid #f7f7f7;
padding-top: 20rpx;
.status-item {
display: flex;
align-items: center;
text-align: center;
image {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
text {
font-size: 24rpx;
color: #666;
}
}
}
}
.menu-grid {
margin: 20rpx;
background: #fff;
border-radius: 12rpx;
padding: 30rpx;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 30rpx;
.menu-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 10rpx;
image {
width: 48rpx;
height: 48rpx;
}
text {
font-size: 24rpx;
color: #333;
}
}
}
}
.car-plate {
color: #333;
font-weight: bold;
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 198rpx;
height: 56rpx;
margin: 20rpx;
text {
position: relative;
z-index: 99;
}
}
</style>

View File

@@ -0,0 +1,127 @@
<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>
<!-- <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(() => {
});
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>