first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:09:02 +08:00
commit dac42e3b0c
3512 changed files with 181637 additions and 0 deletions

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

@@ -0,0 +1,390 @@
<template>
<view class="earnings p30">
<view class="mine_header" style="margin-bottom: 30rpx">
<!-- <image :src="info.avatar" class="mine_header_img" mode="aspectFill"></image> -->
<view class="mine_header_user">
<view>{{ getInfo.userName }}</view>
<view>{{ getInfo.phone }}</view>
</view>
<view class="wallet_pall_button" style="background-color: #5082ff; color: #fff" @click="outLogin">退出登录</view>
<!-- <image class="mine_header_sett" @click="toEarnings" src="/static/icon/sett.png"></image> -->
</view>
<view class="wallet_pall">
<view class="wallet_pall_view">
<view>{{ getInfo.balance || '0.00' }}</view>
<view>当前收益</view>
</view>
<view class="wallet_pall_button" @click="navTo('/pages/mine/withdraw')">提现</view>
</view>
<!-- 余额提现收支明细订单列表充电桩列表充电站列表统计(今日上周本周30天) -->
<view style="margin: 30rpx 0">
<up-grid :border="false" col="4">
<up-grid-item bgColor="#fff" @click="navTo(`/pages/mine/incomeList`, true)">
<view style="height: 25rpx"></view>
<image src="/static/icon/mx.png" style="width: 56rpx; height: 56rpx" mode="widthFix"></image>
<text style="font-size: 28rpx; color: #333; margin-top: 10rpx">收支明细</text>
<view style="height: 15rpx"></view>
</up-grid-item>
<up-grid-item bgColor="#fff" @click="navTo(`/pages/order/order`, true)">
<view style="height: 25rpx"></view>
<image src="/static/icon/order.png" style="width: 56rpx; height: 56rpx" mode="widthFix"></image>
<text style="font-size: 28rpx; color: #333; margin-top: 10rpx">订单列表</text>
<view style="height: 15rpx"></view>
</up-grid-item>
<up-grid-item bgColor="#fff" @click="navTo(`/pages/mine/piles`, true)">
<view style="height: 25rpx"></view>
<image src="/static/icon/cdz.png" style="width: 56rpx; height: 56rpx" mode="widthFix"></image>
<text style="font-size: 28rpx; color: #333; margin-top: 10rpx">充电桩列表</text>
<view style="height: 15rpx"></view>
</up-grid-item>
<up-grid-item bgColor="#fff" @click="navTo(`/pages/mine/z`, true)">
<view style="height: 25rpx"></view>
<image src="/static/icon/tx.png" style="width: 56rpx; height: 56rpx" mode="widthFix"></image>
<text style="font-size: 28rpx; color: #333; margin-top: 10rpx">提现记录</text>
<view style="height: 15rpx"></view>
</up-grid-item>
<!-- <up-grid-item bgColor="#fff" @click="navTo(`/pages/wallet/withdrawList`, true)">
<view style="height: 25rpx"></view>
<image src="/static/icon/grxx.png" style="width: 56rpx; height: 56rpx" mode="widthFix"></image>
<text style="font-size: 28rpx; color: #333; margin-top: 10rpx">个人信息</text>
<view style="height: 15rpx"></view>
</up-grid-item>
<up-grid-item bgColor="#fff" @click="navTo(`/pages/wallet/withdrawList`, true)">
<view style="height: 25rpx"></view>
<image src="/static/icon/tc.png" style="width: 56rpx; height: 56rpx" mode="widthFix"></image>
<text style="font-size: 28rpx; color: #333; margin-top: 10rpx">退出登录</text>
<view style="height: 15rpx"></view>
</up-grid-item> -->
</up-grid>
</view>
<view style="margin: 30rpx 0; background-color: #fff" v-if="getInfo.point2Give && getInfo.point2Give == 1">
<up-grid :border="false" col="4">
<up-grid-item bgColor="#fff" @click="navTo(`/pages/mine/toUser2`, true)">
<view style="height: 25rpx"></view>
<image src="/static/icon/zhuan.png" style="width: 56rpx; height: 56rpx" mode="widthFix"></image>
<text style="font-size: 28rpx; color: #333; margin-top: 10rpx">转赠增值积分</text>
<view style="height: 15rpx"></view>
</up-grid-item>
</up-grid>
</view>
<view class="mine_block">
<view class="mine_block_tit">
<view class="mine_block_tit_left">充电桩</view>
</view>
<view class="mine_block_view">
<!-- <image mode="widthFix" src="/static/home/zu1.png"></image> -->
<view class="u-flex-y-center u-flex-between u-flex-fill">
<view style="width: 100%">
<view style="color: #3770ae; font-size: 30rpx">{{ devices || 0 }}</view>
<view style="color: #999">我的充电桩数</view>
</view>
</view>
<!-- <view class="u-flex-y-center u-flex-between u-flex-fill">
<view style="width: 100%">
<view style="color: #3770ae; font-size: 30rpx">{{ teamDevices || 0 }}</view>
<view style="color: #999">运营充电桩数</view>
</view>
</view> -->
</view>
</view>
<view class="mine_block" v-for="(item, index) in money_list" :key="index">
<view class="mine_block_tit">
<view class="mine_block_tit_left">{{ item.name }}</view>
</view>
<view class="mine_block_view u-flex-between">
<!-- <image mode="widthFix" src="/static/home/zu2.png"></image> -->
<view class="u-flex-fill">
<view class="u-flex-y-center u-flex-between u-flex-fill" style="margin-bottom: 20rpx">
<view style="width: 50%">
<view style="font-size: 30rpx">
<text style="color: #4874e5">{{ item.data.day_money || 0 }}</text>
</view>
<view style="color: #999">今日{{ item.type }}</view>
</view>
<view style="width: 50%">
<view style="font-size: 30rpx">
<text style="color: #4874e5">{{ item.data.week_money1 || 0 }}</text>
</view>
<view style="color: #999">上周{{ item.type }}</view>
</view>
</view>
<view class="u-flex-y-center u-flex-between u-flex-fill">
<view style="width: 50%">
<view style="font-size: 30rpx">
<text style="color: #4874e5">{{ item.data.week_money0 || 0 }}</text>
</view>
<view style="color: #999">本周{{ item.type }}</view>
</view>
<view style="width: 50%">
<view style="font-size: 30rpx">
<text style="color: #4874e5">{{ item.data.total_money || 0 }}</text>
</view>
<view style="color: #999">30{{ item.type }}</view>
</view>
</view>
</view>
</view>
</view>
<view style="height: 100rpx"></view>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import { timeFormat } from '@/uni_modules/uview-plus';
import { operatorInfo, operatorStats } from '@/api/api.js';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { useNav } from '@/hooks/useNav.js';
import moneyJson from '@/common/money.json';
const { nav, navTo } = useNav();
let getInfo = ref({});
let device = ref({});
let devices = ref(0);
let teamDevices = ref(0);
let wallet = ref(0);
let income = ref(0);
let money_list = ref([
{
name: '收益统计',
type: '收益',
data: {}
}
]);
let num = ref(1);
onShow(async () => {
let _res = await operatorInfo();
getInfo.value = _res;
userStatCou();
});
let userStatCou = async () => {
let _res = await operatorStats();
devices.value = _res.deviceCount;
money_list.value.map((item, index) => {
if (item.type == '收益') {
item.data = {
day_money: _res.balanceToday,
week_money1: _res.balanceLastWeek,
week_money0: _res.balanceThisWeek,
total_money: _res.balance30Days
};
}
});
};
let outLogin = ()=>{
uni.showModal({
title: '提示',
content: '是否确认退出登录?',
success: function (res) {
if (res.confirm) {
uni.clearStorageSync();
store.commit('setToken', '');
uni.reLaunch({
url: '/pages/login/login'
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
</script>
<style scoped lang="scss">
.wallet_pall {
height: 200rpx;
border-radius: 16rpx;
padding: 40rpx;
background: linear-gradient(179deg, #5082ff 0%, #4278ff 100%);
@include flex($space: space-between);
border-bottom: 1rpx solid rgba(153, 153, 153, 0.6);
&_button {
padding: 10rpx 30rpx;
font-size: 28rpx;
color: #333;
background-color: #fff;
border-radius: 30rpx;
}
&_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: #fff;
}
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: #fff;
}
}
&_view {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
view:nth-child(1) {
font-weight: bold;
font-size: 45rpx;
color: #fff;
margin-bottom: 30rpx;
}
view:nth-child(2) {
font-size: 28rpx;
color: #fff;
}
}
}
.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;
}
}
&_right {
font-weight: bold;
font-size: 28rpx;
color: #ff2727;
}
}
.mine_block {
padding: 24rpx;
background-color: #fff;
border-radius: 12rpx 12rpx 12rpx 12rpx;
margin-bottom: 20rpx;
&_tit {
display: flex;
align-items: center;
justify-content: space-between;
&_left {
font-weight: bold;
font-size: 28rpx;
color: #232323;
}
&_right {
display: flex;
align-items: center;
font-size: 24rpx;
color: #cbd73b;
image {
width: 13rpx;
height: 22rpx;
margin-left: 15rpx;
margin-top: 6rpx;
}
}
}
&_view {
width: 100%;
min-height: 120rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid rgba(55, 112, 174, 0.1);
margin-top: 16rpx;
display: flex;
align-items: center;
font-size: 28rpx;
color: #232323;
padding: 20rpx 30rpx;
text-align: center;
image {
width: 48rpx;
height: 48rpx;
margin-right: 25rpx;
}
}
}
.u-flex-y-center {
@include flex;
align-items: center;
}
// 主轴等比间距
.u-flex-between {
justify-content: space-between;
}
// 自动伸缩
.u-flex-fill {
flex: 1 1 auto;
}
.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;
}
}
}
</style>

152
pages/login/getBack.vue Normal file
View File

@@ -0,0 +1,152 @@
<template>
<view class="login">
<view class="orderdetail_header p30">
<view :style="{ height: statusBarHeight }"></view>
<view style="height: 44px; display: flex; align-items: center">
<up-icon name="arrow-left" bold color="#000" @click="back"></up-icon>
</view>
</view>
<image class="login_bei" src="/static/logoB.png"></image>
<statusBar />
<view class="login_logo">
<image class="login_logo_img" src="/static/logo.png"></image>
<view class="login_logo_tit">欢迎来到星动能源</view>
</view>
<view style="margin-top: 150rpx">
<view style="margin-bottom: 30rpx">
<up-input fontSize="30rpx" v-model="dataFrom.userName" placeholder="请输入您的用户名" border="bottom" clearable></up-input>
</view>
<view style="margin-bottom: 30rpx">
<up-input fontSize="30rpx" v-model="dataFrom.password" type="password" placeholder="请输入您的密码" border="bottom" clearable></up-input>
</view>
<view style="margin-bottom: 30rpx">
<up-input fontSize="30rpx" v-model="dataFrom.confirmPasswd" type="password" placeholder="请再次输入您的密码" border="bottom" clearable></up-input>
</view>
<view style="margin-bottom: 30rpx">
<up-input fontSize="30rpx" v-model="dataFrom.phone" placeholder="请输入您的手机号" border="bottom" clearable></up-input>
</view>
<view style="margin-bottom: 30rpx; display: flex; align-items: center">
<up-input fontSize="30rpx" v-model="dataFrom.smsCode" placeholder="请输入验证码" border="bottom" clearable></up-input>
<up-code ref="uCode" @change="codeChange2" keep-running start-text="点我获取验证码"></up-code>
<text @click="getCode2" :text="tips" style="font-size: 28rpx; color: #4874e5">{{ tips }}</text>
</view>
</view>
<view style="display: flex; justify-content: center; margin-top: 80rpx">
<view class="login_btn" @click="submit">确认</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { forgotPassword, smsCode } from '@/api/api.js';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let tips = ref('');
let uCode = ref(null);
let dataFrom = reactive({
userName: '',
password: '',
phone: '',
smsCode: '',
confirmPasswd:""
});
let toLogin = () => {
uni.navigateBack();
};
let codeChange2 = (text) => {
tips.value = text;
};
let getCode2 = () => {
if (!dataFrom.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (uCode.value.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
});
smsCode({
phone: dataFrom.phone
}).then((res) => {
uni.hideLoading();
uni.$u.toast('验证码已发送');
uCode.value.start();
});
} else {
uni.$u.toast('倒计时结束后再发送');
}
};
let submit = async () => {
if (!dataFrom.userName) return uni.showToast({ title: '请输入用户名', icon: 'none' });
if (!dataFrom.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (dataFrom.phone.length != 11) return uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
if (!dataFrom.smsCode) return uni.showToast({ title: '请输入验证码', icon: 'none' });
if (!dataFrom.password) return uni.showToast({ title: '请输入密码', icon: 'none' });
if (!dataFrom.confirmPasswd) return uni.showToast({ title: '请再次输入密码', icon: 'none' });
if (dataFrom.password != dataFrom.confirmPasswd) return uni.showToast({ title: '两次密码输入不一致', icon: 'none' });
let _res = await forgotPassword(dataFrom);
uni.showToast({ title: '修改成功', icon: 'none' });
setTimeout(() => {
uni.navigateBack();
}, 200);
};
let back = () => {
uni.navigateBack();
};
</script>
<style scoped lang="scss">
.login {
padding: 0 60rpx;
&_bei {
position: fixed;
right: 0;
top: 0;
width: 608rpx;
height: 424rpx;
}
&_logo {
margin-top: 150rpx;
&_img {
width: 152rpx;
height: 106rpx;
// background: #e6e6e6;
// box-shadow: 0rpx 0rpx 110rpx 2rpx rgba(115, 192, 76, 0.19);
border-radius: 28rpx 28rpx 28rpx 28rpx;
margin-bottom: 20rpx;
}
&_tit {
font-weight: bold;
font-size: 44rpx;
color: #232323;
}
}
&_btn {
width: 474rpx;
height: 78rpx;
background: #4874e5;
border-radius: 54rpx 54rpx 54rpx 54rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 30rpx;
color: #ffffff;
}
}
.orderdetail_header {
width: 750rpx;
position: fixed;
left: 0;
top: 0;
z-index: 99;
}
</style>

View File

@@ -0,0 +1,160 @@
<template>
<view class="login">
<view class="orderdetail_header p30">
<view :style="{ height: statusBarHeight }"></view>
<view style="height: 44px; display: flex; align-items: center">
<up-icon name="arrow-left" bold color="#000" @click="back"></up-icon>
</view>
</view>
<image class="login_bei" src="/static/logoB.png"></image>
<statusBar />
<view class="login_logo">
<image class="login_logo_img" src="/static/logo.png"></image>
<view class="login_logo_tit">欢迎来到星动能源</view>
</view>
<view style="margin-top: 150rpx">
<view style="margin-bottom: 30rpx">
<up-input fontSize="30rpx" v-model="dataFrom.phone" placeholder="请输入您的手机号" border="bottom" clearable></up-input>
</view>
<view style="margin-bottom: 30rpx; display: flex; align-items: center">
<up-input fontSize="30rpx" v-model="dataFrom.smsCode" placeholder="请输入验证码" border="bottom" clearable></up-input>
<up-code ref="uCode" @change="codeChange2" keep-running start-text="点我获取验证码"></up-code>
<text @click="getCode2" :text="tips" style="font-size: 28rpx; color: #4874e5">{{ tips }}</text>
</view>
</view>
<view style="display: flex; justify-content: center; margin-top: 80rpx">
<view class="login_btn" @click="submit">确认</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { forgotUserName, smsCode } from '@/api/api.js';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let tips = ref('');
let uCode = ref(null);
let dataFrom = reactive({
phone: '',
smsCode: '',
});
let toLogin = () => {
uni.navigateBack();
};
let codeChange2 = (text) => {
tips.value = text;
};
let getCode2 = () => {
if (!dataFrom.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (uCode.value.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
});
smsCode({
phone: dataFrom.phone
}).then((res) => {
uni.hideLoading();
uni.$u.toast('验证码已发送');
uCode.value.start();
});
} else {
uni.$u.toast('倒计时结束后再发送');
}
};
let submit = async () => {
if (!dataFrom.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (dataFrom.phone.length != 11) return uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
if (!dataFrom.smsCode) return uni.showToast({ title: '请输入验证码', icon: 'none' });
let _res = await forgotUserName(dataFrom);
if (_res.userNames.length == 0) {
uni.showModal({
title: '提示',
content: '该手机号还未注册',
showCancel: false,
confirmText: "我知道了"
})
} else {
uni.showModal({
title: '已找回的用户名',
content: _res.userNames.join(','),
showCancel: false,
confirmText: "确认",
success: () => {
uni.setClipboardData({
data: _res.userNames.join(','), //要被复制的内容
success: () => { //复制成功的回调函数
uni.showToast({ //提示
title: '已复制用户名'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
});
}
})
}
};
let back = () => {
uni.navigateBack();
};
</script>
<style scoped lang="scss">
.login {
padding: 0 60rpx;
&_bei {
position: fixed;
right: 0;
top: 0;
width: 608rpx;
height: 424rpx;
}
&_logo {
margin-top: 150rpx;
&_img {
width: 152rpx;
height: 106rpx;
// background: #e6e6e6;
// box-shadow: 0rpx 0rpx 110rpx 2rpx rgba(115, 192, 76, 0.19);
border-radius: 28rpx 28rpx 28rpx 28rpx;
margin-bottom: 20rpx;
}
&_tit {
font-weight: bold;
font-size: 44rpx;
color: #232323;
}
}
&_btn {
width: 474rpx;
height: 78rpx;
background: #4874e5;
border-radius: 54rpx 54rpx 54rpx 54rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 30rpx;
color: #ffffff;
}
}
.orderdetail_header {
width: 750rpx;
position: fixed;
left: 0;
top: 0;
z-index: 99;
}
</style>

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

@@ -0,0 +1,148 @@
<template>
<view class="login">
<view class="orderdetail_header p30">
<view :style="{ height: statusBarHeight }"></view>
<view style="height: 44px; display: flex; align-items: center">
<up-icon name="arrow-left" bold color="#000" @click="back"></up-icon>
</view>
</view>
<image class="login_bei" src="/static/logoB.png"></image>
<statusBar />
<view class="login_logo">
<!-- <image class="login_logo_img" src="/static/logo.png"></image> -->
<view class="login_logo_tit">欢迎来到充电桩运营系统</view>
</view>
<view style="margin-top: 150rpx">
<view style="margin-bottom: 50rpx">
<up-input fontSize="30rpx" v-model="dataFrom.userName" placeholder="请输入您的用户名" border="bottom" clearable></up-input>
</view>
<view>
<up-input fontSize="30rpx" v-model="dataFrom.password" type="password" placeholder="请输入您的密码" border="bottom" clearable></up-input>
</view>
<!-- <view style="display: flex; align-items: center">
<up-input fontSize="30rpx" v-model="dataFrom.captcha" placeholder="请输入验证码" border="bottom" clearable></up-input>
<image @click="getCaptcha" :src="captchaImg" style="width: 154rpx; height: 66rpx"></image>
</view> -->
</view>
<view style="font-size: 28rpx; color: #666; margin-top: 20rpx; display: flex; align-items: center; justify-content: space-between">
<view>
忘记账号
<text style="color: #4874e5" @click="getBackAccout">找回用户名</text>
</view>
<view>
<text style="color: #4874e5" @click="toGetBack">忘记密码</text>
</view>
</view>
<view style="display: flex; justify-content: center; margin-top: 80rpx">
<view class="login_btn" @click="login">登录</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { loginApi, captchaApi, saveOpenIdByWxCode, saveOpenIdByZfbCode } from '@/api/api.js';
import { onLoad } from '@dcloudio/uni-app';
import store from '@/store/index.js';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let captchaImg = ref('');
let dataFrom = reactive({
userName: '',
password: '',
});
let back = () => {
uni.navigateBack();
};
let toRegister = () => {
uni.navigateTo({
url: '/pages/login/register'
});
};
let getBackAccout = () => {
uni.navigateTo({
url: './getBackAccout'
});
};
let toGetBack = () => {
uni.navigateTo({
url: '/pages/login/getBack'
});
};
let login = async () => {
try {
let _res = await loginApi(dataFrom);
uni.setStorageSync('token', _res.token);
uni.setStorageSync('user', _res);
store.commit('setToken', _res.token);
uni.showToast({ title: '登录成功', icon: 'none' });
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
});
}, 200);
} catch (err) {
console.log(err);
// getCaptcha();
}
};
</script>
<style scoped lang="scss">
.login {
padding: 0 60rpx;
&_bei {
position: fixed;
right: 0;
top: 0;
width: 608rpx;
height: 424rpx;
}
&_logo {
margin-top: 150rpx;
&_img {
width: 152rpx;
height: 106rpx;
// background: #e6e6e6;
// box-shadow: 0rpx 0rpx 110rpx 2rpx rgba(115, 192, 76, 0.19);
border-radius: 28rpx 28rpx 28rpx 28rpx;
margin-bottom: 20rpx;
}
&_tit {
font-weight: bold;
font-size: 44rpx;
color: #232323;
}
}
&_btn {
width: 474rpx;
height: 78rpx;
background: #4874e5;
border-radius: 54rpx 54rpx 54rpx 54rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 30rpx;
color: #ffffff;
}
}
.orderdetail_header {
width: 750rpx;
position: fixed;
left: 0;
top: 0;
z-index: 99;
}
</style>

190
pages/login/register.vue Normal file
View File

@@ -0,0 +1,190 @@
<template>
<view class="login">
<view class="orderdetail_header p30">
<view :style="{ height: statusBarHeight }"></view>
<view style="height: 44px; display: flex; align-items: center">
<up-icon name="arrow-left" bold color="#000" @click="back"></up-icon>
</view>
</view>
<image class="login_bei" src="/static/logoB.png"></image>
<view style="padding: 0 60rpx">
<statusBar />
<view class="login_logo">
<image class="login_logo_img" src="/static/logo.png"></image>
<view class="login_logo_tit">欢迎来到星动能源</view>
</view>
<view style="margin-top: 100rpx">
<view>
<up-input fontSize="30rpx" v-model="dataFrom.userName" placeholder="请输入您的用户名" border="bottom" clearable></up-input>
</view>
<view style="font-size: 26rpx; color: #ff9900; margin: 10rpx 0 10rpx; padding-left: 9px">用户名由字母或数字组成长度6-32</view>
<view style="margin-bottom: 30rpx">
<up-input fontSize="30rpx" v-model="dataFrom.phone" placeholder="请输入您的手机号" border="bottom" clearable></up-input>
</view>
<view style="margin-bottom: 30rpx; display: flex; align-items: center">
<up-input fontSize="30rpx" v-model="dataFrom.smsCode" placeholder="请输入验证码" border="bottom" clearable></up-input>
<up-code ref="uCode" @change="codeChange2" keep-running start-text="点我获取验证码"></up-code>
<text @click="getCode2" :text="tips" style="font-size: 28rpx; color: #4874e5">{{ tips }}</text>
</view>
<view style="margin-bottom: 30rpx">
<up-input fontSize="30rpx" v-model="dataFrom.shareCode" placeholder="请输入您的邀请码" border="bottom" clearable></up-input>
</view>
<view>
<up-input fontSize="30rpx" v-model="dataFrom.passwd" type="password" placeholder="请输入您的密码" border="bottom" clearable></up-input>
</view>
<view style="font-size: 26rpx; color: #ff9900; margin: 10rpx 0 10rpx; padding-left: 9px">密码必须包含字母数字长度8-32</view>
<view style="margin-bottom: 30rpx">
<up-input fontSize="30rpx" v-model="dataFrom.confirmPasswd" type="password" placeholder="请再次输入您的密码" border="bottom" clearable></up-input>
</view>
</view>
<view style="font-size: 28rpx; color: #666; margin-top: 20rpx">
已有账号
<text style="color: #4874e5" @click="toLogin">立即登录</text>
</view>
<view style="display: flex; justify-content: center; margin-top: 80rpx">
<view class="login_btn" @click="submit">注册</view>
</view>
</view>
<view style="display: flex; flex-wrap: wrap; justify-content: center; margin-top: 20rpx; font-size: 26rpx; align-items: center">
<up-checkbox @change="changeChex" :customStyle="{ marginRight: '15rpx', marginBotton: 0 }"></up-checkbox>
已阅读并同意
<navigator url="/pages/agreement/agreement?id=9" style="color: #4874e5">用户注册服务协议</navigator>
<navigator url="/pages/agreement/agreement?id=10" style="color: #4874e5">隐私政策</navigator>
</view>
<view style="height: 150rpx"></view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { registerApi, smsCode } from '@/api/api.js';
import { onLoad } from '@dcloudio/uni-app';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let tips = ref('');
let uCode = ref(null);
let passwd = ref('');
let dataFrom = reactive({
userName: '',
passwd: '',
shareCode: '',
phone: '',
platform: 1,
smsCode: '',
confirmPasswd: ''
});
let xieyi = ref(false);
onLoad(() => {
const invite_code = uni.getStorageSync('invite_code');
if (invite_code) {
dataFrom.shareCode = invite_code;
}
});
let changeChex = (e) => {
xieyi.value = e;
};
let toLogin = () => {
uni.navigateBack();
};
let codeChange2 = (text) => {
tips.value = text;
};
let getCode2 = () => {
if (!dataFrom.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (uCode.value.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
});
smsCode({
phone: dataFrom.phone
}).then((res) => {
uni.hideLoading();
uni.$u.toast('验证码已发送');
uCode.value.start();
});
} else {
uni.$u.toast('倒计时结束后再发送');
}
};
let submit = async () => {
if (!xieyi.value) return uni.showToast({ title: '请先阅读并勾选隐私政策和用户注册服务协议', icon: 'none' });
if (!dataFrom.userName) return uni.showToast({ title: '请输入用户名', icon: 'none' });
if (!dataFrom.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (dataFrom.phone.length != 11) return uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
if (!dataFrom.smsCode) return uni.showToast({ title: '请输入验证码', icon: 'none' });
if (!dataFrom.shareCode) return uni.showToast({ title: '请输入邀请码', icon: 'none' });
if (!dataFrom.passwd) return uni.showToast({ title: '请输入密码', icon: 'none' });
if (!dataFrom.confirmPasswd) return uni.showToast({ title: '请再次输入密码', icon: 'none' });
if (dataFrom.passwd != dataFrom.confirmPasswd) return uni.showToast({ title: '两次密码输入不一致', icon: 'none' });
let _res = await registerApi(dataFrom);
uni.showToast({ title: '注册成功', icon: 'none' });
setTimeout(() => {
uni.navigateBack();
}, 200);
};
let back = () => {
uni.navigateBack();
};
</script>
<style scoped lang="scss">
.login {
&_bei {
position: fixed;
right: 0;
top: 0;
width: 608rpx;
height: 424rpx;
}
&_logo {
margin-top: 150rpx;
&_img {
width: 152rpx;
height: 106rpx;
// background: #e6e6e6;
// box-shadow: 0rpx 0rpx 110rpx 2rpx rgba(115, 192, 76, 0.19);
border-radius: 28rpx 28rpx 28rpx 28rpx;
margin-bottom: 20rpx;
}
&_tit {
font-weight: bold;
font-size: 44rpx;
color: #232323;
}
}
&_btn {
width: 474rpx;
height: 78rpx;
background: #4874e5;
border-radius: 54rpx 54rpx 54rpx 54rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 30rpx;
color: #ffffff;
}
}
.orderdetail_header {
width: 750rpx;
position: fixed;
left: 0;
top: 0;
z-index: 99;
}
</style>

137
pages/mine/addBankCard.vue Normal file
View File

@@ -0,0 +1,137 @@
<template>
<view class="addBankCard p30">
<view style="height: 30rpx"></view>
<view>
<view class="addBankCard_input_tit">请输入{{ enterprise.type == 1 ? '姓名' : '企业名称' }}</view>
<view class="addBankCard_input">
<up-input :border="false" placeholder="请输入" v-model="enterprise.name"></up-input>
</view>
<!-- <view v-if="enterprise.type == 2">
<view class="addBankCard_input_tit">请输入纳税人识别号</view>
<view class="addBankCard_input">
<up-input :border="false" placeholder="请输入" v-model="enterprise.taxNo"></up-input>
</view>
</view> -->
<view v-if="enterprise.type == 1">
<view class="addBankCard_input_tit">请输入手机号</view>
<view class="addBankCard_input">
<up-input :border="false" placeholder="请输入" v-model="enterprise.phone"></up-input>
</view>
</view>
<view v-if="enterprise.type == 1">
<view class="addBankCard_input_tit">请输入身份证号</view>
<view class="addBankCard_input">
<up-input :border="false" placeholder="请输入" v-model="enterprise.idCard"></up-input>
</view>
</view>
<!--
<view class="addBankCard_input_tit">请输入开户行名称</view>
<view class="addBankCard_input">
<up-input :border="false" placeholder="请输入" v-model="enterprise.bankName"></up-input>
</view> -->
<view class="addBankCard_input_tit" v-if="enterprise.type == 2">请输入开户行</view>
<view class="addBankCard_input" v-if="enterprise.type == 2">
<up-input :border="false" placeholder="请输入" v-model="enterprise.subbranchName"></up-input>
</view>
<view class="addBankCard_input_tit">请输入银行卡卡号</view>
<view class="addBankCard_input">
<up-input :border="false" placeholder="请输入" v-model="enterprise.bankCard"></up-input>
</view>
</view>
<view style="margin: 30rpx 0">
<view style="font-size: 28rpx; color: coral">请仔细核对信息填写错误会导致提现失败</view>
</view>
<view style="display: flex; justify-content: center">
<view class="addBankCard_btn" @click="addBank">确定</view>
</view>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { addUsersAccountInfo, smsCode } from '@/api/api.js';
let tips = ref('');
let uCode = ref(null);
let codeChange2 = (text) => {
tips.value = text;
};
let enterprise = reactive({
type: 1
});
onLoad((options) => {
enterprise.type = options.type;
});
let getCode2 = () => {
if (!enterprise.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (uCode.value.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
});
smsCode({
phone: enterprise.phone
}).then((res) => {
uni.hideLoading();
uni.$u.toast('验证码已发送');
uCode.value.start();
});
} else {
uni.$u.toast('倒计时结束后再发送');
}
};
let addBank = async () => {
if (enterprise.type == 2) {
enterprise.taxNo = '';
enterprise.bankName = ''
}else{
enterprise.bankName = ''
}
let _res = await addUsersAccountInfo(enterprise);
uni.showToast({ title: '添加成功', icon: 'none' });
setTimeout(() => {
uni.navigateBack();
}, 1500);
};
</script>
<style scoped lang="scss">
.addBankCard {
// @include flex();
&_input {
width: 690rpx;
height: 70rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
@include flex;
margin-bottom: 30rpx;
padding: 0 30rpx;
&_tit {
width: 100%;
font-weight: bold;
font-size: 26rpx;
color: #232323;
margin-bottom: 20rpx;
}
}
&_btn {
width: 488rpx;
height: 86rpx;
background: #4874e5;
border-radius: 44rpx 44rpx 44rpx 44rpx;
@include flex($space: center);
font-weight: bold;
font-size: 28rpx;
color: #ffffff;
}
}
</style>

126
pages/mine/bankCard.vue Normal file
View File

@@ -0,0 +1,126 @@
<template>
<view class="bankCard">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<view class="p30">
<view class="bankCard_add" @click="addBank">
<up-icon name="plus" color="#333" size="28"></up-icon>
<view style="font-size: 26rpx; color: #333; margin-top: 15rpx">添加银行卡</view>
</view>
</view>
<view style="height: 30rpx"></view>
<view v-for="(item, index) in dataList" :key="index" @click="bankSele(item)">
<view class="p30">
<view style="background-color: #ffffff; border-radius: 12rpx; padding: 20rpx; margin-bottom: 20rpx">
<view class="u-flex u-flex-y-center" style="font-size: 28rpx">
<view>
<u-tag :text="item.type == 1 ? '个人' : '企业'" size="mini" :type="item.type == 1 ? 'success' : 'error'" plain plainFill></u-tag>
</view>
<view style="width: 30rpx"></view>
<view style="font-size: 26rpx">{{ item.name }}</view>
<view style="width: 30rpx"></view>
<view style="font-size: 26rpx">{{ item.phone || '' }}</view>
</view>
<view style="height: 20rpx"></view>
<view style="color: #232323">
<!-- <view style="font-size: 28rpx">开户行{{ item.bankName }}</view>
<view style="height: 10rpx"></view> -->
<view style="font-size: 28rpx" v-if="item.type == 2">开户行{{ item.subbranchName }}</view>
<view style="height: 10rpx"></view>
<view style="font-size: 28rpx">银行卡号{{ item.bankCard }}</view>
<view style="height: 10rpx"></view>
<!-- <view style="font-size: 28rpx" v-if="item.type == 2 && item.taxNo">纳税人识别号{{ item.taxNo}}</view>
<view style="height: 10rpx"></view> -->
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import { getUsersAccountInfo } from '@/api/api.js';
import { onShow, onLoad } from '@dcloudio/uni-app';
const paging = ref(null);
let dataList = ref([]);
let numiNDE = ref(1);
let type = ref('');
onShow(() => {
if (numiNDE.value != 1) {
paging.value.reload();
}
numiNDE.value++;
});
onLoad((options) => {
type.value = options.type;
});
let addBank = () => {
uni.showActionSheet({
itemList: ['个人', '企业'],
success: (res) => {
if(res.tapIndex + 1 == 0){
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
}else{
uni.navigateTo({
url: `/pages/mine/addBankCard?type=${res.tapIndex + 1}`
});
}
},
fail: function (res) {
console.log(res.errMsg);
}
});
};
const queryList = (pageNo, pageSize) => {
const params = {
current: pageNo,
pageSize: pageSize
};
getUsersAccountInfo(params)
.then((res) => {
paging.value.complete(res);
})
.catch((res) => {
paging.value.complete(false);
});
};
function maskCardNumber(cardNumber) {
if (!cardNumber || typeof cardNumber !== 'string') {
throw new Error('Invalid card number');
}
const sanitizedNumber = cardNumber.replace(/\D/g, '');
if (sanitizedNumber.length < 4) {
throw new Error('Card number is too short');
}
const lastFourDigits = sanitizedNumber.slice(-4);
const maskedNumber = '*'.repeat(sanitizedNumber.length - 4) + lastFourDigits;
return maskedNumber;
}
let bankSele = (e) => {
if (type.value) {
uni.$emit('bank', e);
uni.navigateBack();
}
};
</script>
<style scoped lang="scss">
.bankCard {
&_add {
width: 690rpx;
height: 174rpx;
background: #eeeeee;
border-radius: 16rpx 16rpx 16rpx 16rpx;
@include flex($direction: column, $space: center);
margin-top: 30rpx;
}
}
</style>

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

@@ -0,0 +1,163 @@
<template>
<view class="earnings p30">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view 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: 130rpx">
<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 { getUsersPointRecord } from '@/api/api.js';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { useNav } from '@/hooks/useNav.js';
import moneyJson from '@/common/money.json';
let range = computed(() => {
return moneyJson.map((item, index) => {
return {
text: item.name,
value: item.id
};
});
});
const changeSele = (e) => {
paging.value.reload();
};
const { nav, navTo } = useNav();
let getInfo = ref({});
const paging = ref(null);
let dataList = ref([]);
let dataFrom = reactive({
type: ''
});
let isPagingRefNotFound = () => {
return !paging.value;
};
let result = (e) => {
console.log(e);
};
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,
...dataFrom
};
getUsersPointRecord(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>

176
pages/mine/piles.vue Normal file
View File

@@ -0,0 +1,176 @@
<template>
<view class="p30 piles">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<!-- <view class="piles_card">
<view class="piles_card_title">充电桩汇总</view>
<view class="piles_card_view">
<view>
<text>{{ count.installCount || 0 }}</text>
<text>已安装</text>
</view>
<view>
<text>{{ count.installNotCount || 0 }}</text>
<text>未安装数量</text>
</view>
</view>
</view>
<up-subsection :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">
<view class="piles_list_title">电站名称{{ i.stationName || '-' }}</view>
<view class="piles_list_view">
<view>设备号</view>
<view>{{ i.deviceNo }}</view>
</view>
<view class="piles_list_view">
<view>设备功率</view>
<view>{{ i.deviceType }}KW</view>
</view>
<view class="piles_list_view">
<view>设备类型</view>
<view>{{ i.deviceTypeName }}</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>
</z-paging>
</view>
</template>
<script setup>
import { getDeviceInfo, getDeviceCount } from '@/api/api.js';
import { 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({});
// onLoad(async () => {
// count.value = await getDeviceCount();
// });
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,
...dataFrom
};
getDeviceInfo(params)
.then((res) => {
paging.value.complete(res);
})
.catch((res) => {
paging.value.complete(false);
});
};
const list = ref([
{
name: '已安装',
id: 1
},
{
name: '待安装',
id: 0
}
]);
const current = ref(0);
const upChange = (e) => {
current.value = e;
dataFrom.deviceStatus = list.value[e].id;
paging.value.reload();
};
</script>
<style scoped lang="scss">
.piles {
&_card {
width: 690rpx;
height: 192rpx;
background: linear-gradient(179deg, #4874e5 0%, #3864d6 100%);
border-radius: 8rpx 8rpx 0rpx 0rpx;
padding: 30rpx;
&_title {
font-weight: bold;
font-size: 28rpx;
color: #ffffff;
margin-bottom: 20rpx;
}
&_view {
padding: 0 150rpx;
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>

251
pages/mine/withdraw.vue Normal file
View File

@@ -0,0 +1,251 @@
<template>
<view class="withdraw p30">
<!-- #ifdef MP-ALIPAY -->
<view style="height: 30rpx;"></view>
<!-- #endif -->
<view class="withdraw_k" @click="toNav">
<view class="withdraw_k_tit">提现到</view>
<view class="withdraw_k_input">请选择银行卡</view>
<image class="withdraw_k_img" src="/static/icon/xia.png"></image>
</view>
<view v-if="bank">
<view style="background-color: #ffffff; border-radius: 12rpx; padding: 20rpx; margin-bottom: 20rpx">
<view class="u-flex u-flex-y-center" style="font-size: 28rpx">
<view>
<u-tag :text="bank.type == 1 ? '个人' : '企业'" size="mini" :type="bank.type == 1 ? 'success' : 'error'" plain plainFill></u-tag>
</view>
<view style="width: 30rpx"></view>
<view style="font-size: 26rpx">{{ bank.name }}</view>
<view style="width: 30rpx"></view>
<view style="font-size: 26rpx">{{ bank.phone || '' }}</view>
</view>
<view style="height: 20rpx"></view>
<view style="color: #232323">
<!-- <view style="font-size: 28rpx">开户行{{ bank.bankName }}</view>
<view style="height: 10rpx"></view> -->
<view style="font-size: 28rpx" v-if="bank.type == 2">开户行{{ bank.subbranchName }}</view>
<view style="height: 10rpx"></view>
<view style="font-size: 28rpx">银行卡号{{ bank.bankCard }}</view>
<view style="height: 10rpx"></view>
<!-- <view style="font-size: 28rpx" v-if="bank.type == 2">纳税人识别号{{ bank.taxNo ? maskCardNumber(bank.taxNo) : '' }}</view>
<view style="height: 10rpx"></view> -->
</view>
</view>
</view>
<view class="withdraw_mon">
<view class="withdraw_mon_tit">提现金额</view>
<view class="withdraw_mon_input">
<view class="withdraw_mon_input_fu"></view>
<view>
<up-input fontSize="36rpx" placeholder="请输入金额" :border="false" v-model="dataFrom.amount"></up-input>
</view>
<view class="withdraw_mon_input_note" @click="dataFrom.amount = getInfo.balance">全部提现</view>
</view>
<view>
<up-input :border="false" disabled v-model="getInfo.phone"></up-input>
</view>
<view class="withdraw_mon_input">
<up-input placeholder="请输入验证码" :border="false" v-model="dataFrom.smsCode"></up-input>
<view style="width: 250rpx">
<up-code ref="uCode" @change="codeChange2" keep-running start-text="点我获取验证码"></up-code>
<up-button @click="getCode" color="#4874e5">{{ tips }}</up-button>
</view>
</view>
<view class="withdraw_mon_note">可提现金额{{ getInfo.balance }}</view>
</view>
<!-- <view class="withdraw_note">
<view class="withdraw_note_tit" style="font-weight: bold; font-size: 26rpx">提现规则</view>
<view class="withdraw_note_s">1.每月1号1121号可提现到账时间T+1</view>
<view class="withdraw_note_s">2.提现年龄是18-65</view>
<view class="withdraw_note_s">3.提现银行卡是常用的一类银行否则会有限额</view>
<view class="withdraw_note_s">4.一月不能超{{ appConfig.monthQuota }}如遇超出 提现后管理人员会联系您</view>
<view class="withdraw_note_s">5.提现次数不限公户无限额无手续费</view>
</view> -->
<view style="height: 50rpx"></view>
<view style="display: flex; justify-content: center; margin-top: 80rpx">
<view class="affirm_btn" @click="payOrder">立即提现</view>
</view>
<view style="height: 50rpx"></view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { operatorInfo, getAppConfig, smsCode, userExtract } from '@/api/api.js';
import { onLoad, onShow } from '@dcloudio/uni-app';
let value = ref();
let getInfo = ref({});
let tips = ref('');
let uCode = ref(null);
let dataFrom = reactive({
amount: '',
smsCode: '',
accountId: ''
});
let bank = ref();
onLoad(async () => {
let _res = await operatorInfo();
getInfo.value = _res;
uni.$on('bank', (e) => {
bank.value = e;
dataFrom.accountId = e.id;
console.log(e);
});
});
let toNav = () => {
uni.navigateTo({
url: '/pages/mine/bankCard?type=xz'
});
};
let codeChange2 = (text) => {
tips.value = text;
};
let getCode = () => {
console.log(123456);
if (!getInfo.value.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (uCode.value.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
});
smsCode({
phone: getInfo.value.phone
}).then((res) => {
uni.hideLoading();
uni.$u.toast('验证码已发送');
uCode.value.start();
});
} else {
uni.$u.toast('倒计时结束后再发送');
}
};
function maskCardNumber(cardNumber) {
if (!cardNumber || typeof cardNumber !== 'string') {
throw new Error('Invalid card number');
}
const sanitizedNumber = cardNumber.replace(/\D/g, '');
if (sanitizedNumber.length < 4) {
throw new Error('Card number is too short');
}
const lastFourDigits = sanitizedNumber.slice(-4);
const maskedNumber = '*'.repeat(sanitizedNumber.length - 4) + lastFourDigits;
return maskedNumber;
}
let payOrder = async () => {
if (Number(getInfo.value.balance) < Number(dataFrom.amount)) return uni.showToast({ title: '可提现金额不足', icon: 'none' });
if (!dataFrom.accountId) return uni.showToast({ title: '请先选择提现银行卡', icon: 'none' });
if (!dataFrom.amount) return uni.showToast({ title: '请输入提现金额', icon: 'none' });
if (!dataFrom.smsCode) return uni.showToast({ title: '请输入验证码', icon: 'none' });
let _res = await userExtract(dataFrom);
uni.showModal({
title: '提示',
content: '提交成功',
showCancel: false,
success() {
uni.navigateBack();
}
});
};
</script>
<style scoped lang="scss">
.withdraw {
&_k {
width: 100%;
height: 74rpx;
padding: 0 20rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
&_tit {
font-weight: bold;
font-size: 24rpx;
color: #232323;
margin-right: 100rpx;
}
&_input {
flex: 1;
text-align: right;
font-size: 28rpx;
}
&_img {
width: 44rpx;
height: 44rpx;
}
}
&_mon {
padding: 20rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
&_tit {
font-weight: bold;
font-size: 24rpx;
color: #232323;
}
&_input {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #cccccc;
padding: 15rpx 0;
margin-bottom: 20rpx;
&_fu {
font-weight: bold;
font-size: 66rpx;
color: #232323;
}
&_note {
font-weight: bold;
font-size: 24rpx;
color: #ff7777;
}
}
&_note {
font-weight: 400;
font-size: 24rpx;
color: #232323;
margin-bottom: 10rpx;
}
}
&_note {
margin-top: 30rpx;
padding: 0 15rpx;
view {
margin-bottom: 15rpx;
font-weight: 400;
font-size: 26rpx;
color: #232323;
line-height: 40rpx;
}
}
}
.affirm_btn {
width: 650rpx;
height: 78rpx;
background: #4874e5;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 24rpx;
color: #ffffff;
}
</style>

156
pages/mine/z.vue Normal file
View File

@@ -0,0 +1,156 @@
<template>
<view class="earnings p30">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
<view class="wallet_list_left">
<view>{{ item.type == 1 ? '提现人' : '提现公司' }}{{ item.name }}</view>
<!-- <view>银行名称{{ item.bankName }}</view> -->
<view v-if="item.type != 1">支行名称{{ item.subbranchName }}</view>
<view>银行卡号{{ item.bankCard }}</view>
<view>提现时间{{ timeFormat(new Date(item.createTime).getTime(), 'yyyy-mm-dd hh:MM:ss') }}</view>
<view>处理时间{{ item.completeTime ? timeFormat(new Date(item.completeTime).getTime(), 'yyyy-mm-dd hh:MM:ss') : '-' }}</view>
<view>处理结果{{ item.handleMessage || '-' }}</view>
</view>
<view class="wallet_list_right" style="display: flex; flex-direction: column; align-items: flex-end;height: 320rpx;">
<view style="margin-bottom: 100rpx">
<view></view>
<up-tag v-if="item.status == 0" size="mini" text="申请中" type="warning" plain plainFill></up-tag>
<up-tag v-if="item.status == 1" size="mini" type="success" text="提现成功" plain plainFill></up-tag>
<up-tag v-if="item.status == -1" size="mini" type="error" text="失败" plain plainFill></up-tag>
</view>
<view>{{ item.amount }}</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { reactive, ref } from 'vue';
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import { timeFormat } from '@/uni_modules/uview-plus';
import { userExtractList } from '@/api/api.js';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { useNav } from '@/hooks/useNav.js';
import moneyJson from '@/common/money.json';
const { nav, navTo } = useNav();
let getInfo = ref({});
const paging = ref(null);
let dataList = ref([]);
let isPagingRefNotFound = () => {
return !paging.value;
};
function maskCardNumber(cardNumber) {
if (!cardNumber || typeof cardNumber !== 'string') {
throw new Error('Invalid card number');
}
const sanitizedNumber = cardNumber.replace(/\D/g, '');
if (sanitizedNumber.length < 4) {
throw new Error('Card number is too short');
}
const lastFourDigits = sanitizedNumber.slice(-4);
const maskedNumber = '*'.repeat(sanitizedNumber.length - 4) + lastFourDigits;
return maskedNumber;
}
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
};
userExtractList(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;
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 {
font-size: 28rpx;
color: #232323;
margin-bottom: 10rpx;
}
}
&_right {
font-weight: bold;
font-size: 28rpx;
color: #ff2727;
}
}
</style>

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

@@ -0,0 +1,209 @@
<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.deviceNo }}</view>
</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>