first commit
This commit is contained in:
21
pages/agreement/agreement.vue
Normal file
21
pages/agreement/agreement.vue
Normal file
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<view class="p30">
|
||||
<mp-html :content="info.protocolContent" />
|
||||
<view style="height: 100rpx;"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { selectProtocolInfo } from '@/api/api.js';
|
||||
|
||||
let info = ref({});
|
||||
|
||||
onLoad(async (options) => {
|
||||
let _res = await selectProtocolInfo({ id: options.id });
|
||||
info.value = _res;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
137
pages/bank/addBankCard.vue
Normal file
137
pages/bank/addBankCard.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<view class="addBankCard p30">
|
||||
<view style="height: 30rpx"></view>
|
||||
<view>
|
||||
<view class="addBankCard_input_tit">请输入{{ enterprise.role == 1 ? '姓名' : '企业名称' }}:</view>
|
||||
<view class="addBankCard_input">
|
||||
<up-input :border="false" placeholder="请输入" v-model="enterprise.realname"></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.role == 1">
|
||||
<view class="addBankCard_input_tit">请输入手机号:</view>
|
||||
<view class="addBankCard_input">
|
||||
<up-input :border="false" placeholder="请输入" v-model="enterprise.mobile"></up-input>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="enterprise.role == 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.role == 2">请输入开户行:</view>
|
||||
<view class="addBankCard_input" v-if="enterprise.role == 2">
|
||||
<up-input :border="false" placeholder="请输入" v-model="enterprise.subname"></up-input>
|
||||
</view>
|
||||
<view class="addBankCard_input_tit">请输入银行卡卡号:</view>
|
||||
<view class="addBankCard_input">
|
||||
<up-input :border="false" placeholder="请输入" v-model="enterprise.num"></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({
|
||||
role: 1
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
enterprise.role = options.role;
|
||||
});
|
||||
|
||||
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>
|
||||
127
pages/bank/bank.vue
Normal file
127
pages/bank/bank.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<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.role == 1 ? '个人' : '企业'" size="mini" :type="item.role == 1 ? 'success' : 'error'" plain plainFill></u-tag>
|
||||
</view>
|
||||
<view style="width: 30rpx"></view>
|
||||
<view style="font-size: 26rpx">{{ item.realname }}</view>
|
||||
<view style="width: 30rpx"></view>
|
||||
<view style="font-size: 26rpx">{{ item.mobile || '' }}</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.role == 2">开户行:{{ item.subname }}</view>
|
||||
<view style="height: 10rpx"></view>
|
||||
<view style="font-size: 28rpx">银行卡号:{{ item.num }}</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 role = ref('');
|
||||
const 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/bank/addBankCard?role=${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>
|
||||
199
pages/find/add.vue
Normal file
199
pages/find/add.vue
Normal file
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<view class="findAdd">
|
||||
<view class="findAdd_info">
|
||||
<view style="display: flex; align-items: center; border-bottom: 1rpx solid #eee; padding-bottom: 25rpx">
|
||||
<view style="margin-right: 25rpx; font-size: 30rpx">标题</view>
|
||||
<view style="flex: 1">
|
||||
<up-input height="200" border="none" v-model="formData.title" placeholder="请输入标题"></up-input>
|
||||
</view>
|
||||
</view>
|
||||
<up-textarea height="200" border="none" :maxlength="-1" v-model="formData.content" placeholder="请输入您想要发布的图文"></up-textarea>
|
||||
<up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="9"></up-upload>
|
||||
<view style="font-size: 24rpx; font-weight: bold; margin: 25rpx 0">#添加话题</view>
|
||||
<view class="findAdd_info_list">
|
||||
<view
|
||||
v-for="(item, index) in formData.topic"
|
||||
:key="index"
|
||||
class="findAdd_info_list_view"
|
||||
:style="{
|
||||
backgroundColor: item.color
|
||||
}"
|
||||
>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
|
||||
<view class="findAdd_info_list_view" style="background-color: rgba(111, 162, 86, 0.1)" @click="addTopic">
|
||||
<up-icon name="plus" size="10"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button class="confirm-button" @click="submit">发布</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { articleAdd, articleDetails, articleUpdate } from '@/api/api.js';
|
||||
import { uploadFiles } from '@/utils/fun.js';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
let formData = ref({
|
||||
title: '',
|
||||
content: '',
|
||||
topic: [],
|
||||
detailsImageUrl: '',
|
||||
category: 'DISCOVERY',
|
||||
isPublished: 1
|
||||
});
|
||||
|
||||
const fileList1 = ref([]);
|
||||
|
||||
onLoad((options) => {
|
||||
if(options.id){
|
||||
getDetail(options.id);
|
||||
}
|
||||
});
|
||||
|
||||
const getDetail = async (id) => {
|
||||
let _res = await articleDetails({ id });
|
||||
formData.value = _res;
|
||||
if(_res.detailsImageUrl){
|
||||
const imagesUrlArr = _res.detailsImageUrl.split(",")
|
||||
fileList1.value = imagesUrlArr.map(item => ({url:item}))
|
||||
}
|
||||
};
|
||||
|
||||
const submit = () => {
|
||||
formData.value.detailsImageUrl = fileList1.value
|
||||
.map((item, index) => {
|
||||
return item.url;
|
||||
})
|
||||
.join(',');
|
||||
formData.value.coverImageUrl = fileList1.value[0].url;
|
||||
const apiFun = {
|
||||
add: articleAdd,
|
||||
edit: articleUpdate
|
||||
}
|
||||
apiFun[formData.value.id ? "edit" : "add"](formData.value).then((res) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '发布成功',
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateBack();
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const addTopic = () => {
|
||||
uni.showModal({
|
||||
title: '添加话题',
|
||||
editable: true,
|
||||
placeholderText: '请输入话题',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
formData.value.topic.push({
|
||||
color: getRandomLightColor(),
|
||||
name: res.content
|
||||
});
|
||||
console.log(res);
|
||||
} else if (res.cancel) {
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const lightColors = [
|
||||
'rgba(210, 180, 222, 0.1)',
|
||||
'rgba(173, 216, 230, 0.1)',
|
||||
'rgba(255, 182, 193, 0.1)',
|
||||
'rgba(152, 251, 152, 0.1)',
|
||||
'rgba(240, 230, 140, 0.1)',
|
||||
'rgba(216, 191, 216, 0.1)',
|
||||
'rgba(175, 238, 238, 0.1)',
|
||||
'rgba(255, 160, 122, 0.1)',
|
||||
'rgba(221, 160, 221, 0.1)',
|
||||
'rgba(144, 238, 144, 0.1)'
|
||||
];
|
||||
|
||||
// 从数组中随机返回一个颜色的函数
|
||||
function getRandomLightColor() {
|
||||
const randomIndex = Math.floor(Math.random() * lightColors.length);
|
||||
return lightColors[randomIndex];
|
||||
}
|
||||
|
||||
// 删除图片
|
||||
const deletePic = (event) => {
|
||||
fileList1.value.splice(event.index, 1);
|
||||
};
|
||||
|
||||
// 新增图片
|
||||
const afterRead = async (event) => {
|
||||
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = fileList1.value.length;
|
||||
lists.map((item) => {
|
||||
fileList1.value.push({
|
||||
...item,
|
||||
status: 'uploading',
|
||||
message: '上传中'
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await uploadFiles(lists[i].url);
|
||||
let item = fileList1.value[fileListLen];
|
||||
fileList1.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: 'success',
|
||||
message: '',
|
||||
url: result
|
||||
});
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.findAdd {
|
||||
padding: 25rpx;
|
||||
&_info {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
padding: 36rpx;
|
||||
|
||||
&_list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
&_view {
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 8rpx 30rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
min-width: 132rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.confirm-button {
|
||||
width: 488rpx;
|
||||
height: 86rpx;
|
||||
background: #6fa256;
|
||||
border-radius: 44rpx 44rpx 44rpx 44rpx;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 332rpx;
|
||||
}
|
||||
</style>
|
||||
120
pages/find/detail.vue
Normal file
120
pages/find/detail.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<view class="detail-container">
|
||||
<view class="top-area">
|
||||
<view class="picture">
|
||||
<up-avatar size="60rpx" :src="detailData.authorUrl" />
|
||||
</view>
|
||||
<view class="info">
|
||||
<view>
|
||||
{{ detailData.authorName }}
|
||||
</view>
|
||||
<view class="time">
|
||||
{{ detailData.publishTime }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="look">
|
||||
<image src="/static/icon/icon-eye.png"></image>{{ detailData.pageView }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="title">
|
||||
{{ detailData.title }}
|
||||
</view>
|
||||
<view class="content">
|
||||
{{ detailData.content }}
|
||||
</view>
|
||||
<view class="img-area" v-for="(item, index) in detailData?.detailsImageUrl?.split(',')" :key="index">
|
||||
<image mode="widthFix" :src="item"></image>
|
||||
</view>
|
||||
<view class="tags-area">
|
||||
<view
|
||||
class="tag-item"
|
||||
v-for="(item, index) in detailData?.topic"
|
||||
:key="index"
|
||||
:style="{
|
||||
backgroundColor: item.color
|
||||
}"
|
||||
>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { articleDetails } from '@/api/api.js';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
|
||||
const detailData = ref()
|
||||
|
||||
onLoad((options) => {
|
||||
getDetail(options.id);
|
||||
});
|
||||
|
||||
const getDetail = async (id) => {
|
||||
let _res = await articleDetails({ id });
|
||||
detailData.value = _res;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.detail-container {
|
||||
padding: 28rpx 30rpx;
|
||||
.top-area {
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
.info {
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
.look {
|
||||
margin-left: 36rpx;
|
||||
padding-top: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.title {
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #232323;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.content {
|
||||
margin-top: 24rpx;
|
||||
font-weight: bold;
|
||||
font-size: 20rpx;
|
||||
color: #232323;
|
||||
}
|
||||
.img-area {
|
||||
margin-top: 24rpx;
|
||||
image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.tags-area {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 36rpx;
|
||||
.tag-item {
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
background: #6FA256;
|
||||
border-radius: 24rpx;
|
||||
font-weight: bold;
|
||||
font-size: 20rpx;
|
||||
color: #000;
|
||||
padding: 0 28rpx;
|
||||
margin-right: 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
122
pages/find/find.vue
Normal file
122
pages/find/find.vue
Normal file
@@ -0,0 +1,122 @@
|
||||
<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">
|
||||
<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>
|
||||
</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>
|
||||
186
pages/find/myArticle.vue
Normal file
186
pages/find/myArticle.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<!-- 我的文章 -->
|
||||
<view class="my-article">
|
||||
<view class="top">
|
||||
<view class="picture">
|
||||
<up-avatar size="180rpx" :src="info.avatar" />
|
||||
</view>
|
||||
<view class="nickname">
|
||||
{{ info.nickName }}
|
||||
</view>
|
||||
<view class="btn-area" @click="toPublish">
|
||||
<image src="/static/icon/publish-article.png"></image>
|
||||
<view class="btn-text">发文</view>
|
||||
</view>
|
||||
</view>
|
||||
<z-paging ref="paging" v-model="listData" use-page-scroll @query="queryList">
|
||||
<view class="list-area">
|
||||
<view class="list-item" v-for="(item, index) in listData" :key="index" @click="goDetail(item)">
|
||||
<view class="list-item-img">
|
||||
<image :src="item.coverImageUrl"></image>
|
||||
</view>
|
||||
<view class="list-item-btm">
|
||||
<view class="list-title">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
<view class="list-btn-area">
|
||||
<view class="bottom-btn" @click.stop="goDelete(item)">
|
||||
<image src="/static/icon/icon-delete.png"></image>
|
||||
<text class="btn-text">删除</text>
|
||||
</view>
|
||||
<view class="bottom-btn ml16" @click.stop="goEdit(item)">
|
||||
<image src="/static/icon/icon-eidt.png"></image>
|
||||
<text class="btn-text">编辑</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { getUserArticleList, userInfo, articleDelete } from '@/api/api.js';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
|
||||
const info = ref({});
|
||||
const paging = ref(null);
|
||||
const listData = ref()
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await userInfo();
|
||||
info.value = res;
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
paging.value && paging.value.reload();
|
||||
})
|
||||
|
||||
const queryList = async (pageNo, pageSize) => {
|
||||
getUserArticleList()
|
||||
.then((res) => {
|
||||
paging.value.complete(res);
|
||||
uni.hideLoading();
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
uni.hideLoading();
|
||||
});
|
||||
};
|
||||
|
||||
const toPublish = () => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/find/add`
|
||||
});
|
||||
}
|
||||
|
||||
const goDelete = item => {
|
||||
articleDelete([Number(item.id)])
|
||||
.then((res) => {
|
||||
paging.value.reload();
|
||||
});
|
||||
}
|
||||
|
||||
const goEdit = item => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/find/add?id=${item.id}`
|
||||
});
|
||||
}
|
||||
|
||||
const goDetail = item => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/find/detail?id=${item.id}`
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.my-article {
|
||||
.top {
|
||||
height: 342rpx;
|
||||
background: #FFFFFF;
|
||||
position: relative;
|
||||
.picture {
|
||||
padding-top: 40rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.nickname {
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #232323;
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.btn-area {
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
right: 40rpx;
|
||||
padding: 0 12rpx;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.btn-text {
|
||||
font-weight: bold;
|
||||
font-size: 20rpx;
|
||||
color: #232323;
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-area {
|
||||
padding: 28rpx 30rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
.list-item {
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
width: 336rpx;
|
||||
margin-bottom: 24rpx;
|
||||
&-img {
|
||||
height: 370rpx;
|
||||
background: #fff;
|
||||
border-radius: 8rpx 8rpx 0 0;
|
||||
image {
|
||||
width: 336rpx;
|
||||
height: 370rpx;
|
||||
}
|
||||
}
|
||||
&-btm {
|
||||
height: 120rpx;
|
||||
padding: 12rpx;
|
||||
.list-title {
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.list-btn-area {
|
||||
margin-top: 36rpx;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #666666;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
.bottom-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.ml16 {
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
184
pages/home/components/Invest/facility.vue
Normal file
184
pages/home/components/Invest/facility.vue
Normal 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>
|
||||
182
pages/home/components/Invest/order.vue
Normal file
182
pages/home/components/Invest/order.vue
Normal 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>
|
||||
349
pages/home/components/Invest/shop.vue
Normal file
349
pages/home/components/Invest/shop.vue
Normal 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>
|
||||
138
pages/home/components/user/find.vue
Normal file
138
pages/home/components/user/find.vue
Normal 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>
|
||||
389
pages/home/components/user/home.vue
Normal file
389
pages/home/components/user/home.vue
Normal 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>
|
||||
264
pages/home/components/user/index.vue
Normal file
264
pages/home/components/user/index.vue
Normal 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>
|
||||
373
pages/home/components/user/mine.vue
Normal file
373
pages/home/components/user/mine.vue
Normal 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>
|
||||
127
pages/home/components/user/sweep.vue
Normal file
127
pages/home/components/user/sweep.vue
Normal 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>
|
||||
445
pages/home/detail.vue
Normal file
445
pages/home/detail.vue
Normal file
@@ -0,0 +1,445 @@
|
||||
<template>
|
||||
<view class="orderdetail">
|
||||
<!-- <statusBar /> -->
|
||||
|
||||
<view class="orderdetail_header p30" :style="{ backgroundColor: headerBg ? '#FFF' : '' }">
|
||||
<view :style="{ height: statusBarHeight }"></view>
|
||||
<view style="height: 44px; display: flex; align-items: center" @click="">
|
||||
<up-icon name="arrow-left" bold color="#000" @click="back"></up-icon>
|
||||
<view @click="back" style="margin-left: 25rpx; transition: all 0.5s" :style="{ opacity: headerBg ? 1 : 0 }">电站详情</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<up-swiper :list="info.pictures" height="530rpx"></up-swiper>
|
||||
<view class="p30" style="margin-top: -80rpx">
|
||||
<orderList
|
||||
:info="{
|
||||
...info,
|
||||
priceAmount: fullCost.totalAmount
|
||||
}"
|
||||
type="info"
|
||||
></orderList>
|
||||
<view style="height: 30rpx"></view>
|
||||
|
||||
<view class="orderdetail_info" style="margin-bottom: 30rpx">
|
||||
<view class="orderdetail_info_title">
|
||||
<view>费用信息</view>
|
||||
<view style="display: flex; align-items: center" @click="showJf = true">
|
||||
价格详情
|
||||
<view style="margin-left: 30rpx">
|
||||
<up-icon color="#333" size="28rpx" name="arrow-right"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="max-width: 420rpx">
|
||||
<up-tag size="mini" :text="`当前计费时间段:${fullCost.startTime}-${fullCost.endTime}`" plain plainFill></up-tag>
|
||||
</view>
|
||||
<view class="orderdetail_info_fy">
|
||||
<view class="orderdetail_info_fy_left">电站价格</view>
|
||||
<view class="orderdetail_info_fy_right">
|
||||
{{ fullCost.totalAmount }}
|
||||
<text style="font-weight: 500; font-size: 24rpx; color: #333; margin-left: 15rpx">元/度</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="orderdetail_info" style="margin-bottom: 30rpx">
|
||||
<view>
|
||||
<view class="orderdetail_info_title">终端明细</view>
|
||||
</view>
|
||||
<view class="orderdetail_info_zd" style="position: relative" @click="showZd">
|
||||
<view class="orderdetail_info_zd_zdbg"></view>
|
||||
<image
|
||||
src="/static/icon/eleclist-terminal.png"
|
||||
style="transform: rotateY(180deg); position: absolute; left: 0; bottom: 0; width: 100rpx; height: 100rpx"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
|
||||
<view>交流</view>
|
||||
<view style="display: flex; align-items: center">
|
||||
{{ info.gunCount - info.gunUseCount }}
|
||||
<text style="font-size: 28rpx; opacity: 0.9; margin-left: 10rpx">空闲</text>
|
||||
<text style="font-size: 24rpx; opacity: 0.8">/{{ info.gunCount }}总</text>
|
||||
<view style="margin-left: 30rpx">
|
||||
<up-icon color="#fff" size="28rpx" name="arrow-right"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="orderdetail_info">
|
||||
<view class="orderdetail_info_title">基本信息</view>
|
||||
<view class="orderdetail_info_view">
|
||||
<view class="orderdetail_info_view_left">服务提供方</view>
|
||||
<view class="orderdetail_info_view_right" @click="lookImg([info.licenseImage])">
|
||||
{{ info.merchantName }}
|
||||
<image src="/static/icon/9you.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="orderdetail_info_view">
|
||||
<view class="orderdetail_info_view_left" style="color: #232323">{{ info.merchantName }}</view>
|
||||
</view> -->
|
||||
<view class="orderdetail_info_view">
|
||||
<view class="orderdetail_info_view_left">营业时间</view>
|
||||
<view class="orderdetail_info_view_right" @click="lookImg([info.licenseImage])">
|
||||
{{ info.busineHours }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="orderdetail_info_view">
|
||||
<view class="orderdetail_info_view_left" style="margin-right: 30rpx">
|
||||
{{ info.busineHours }}
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="orderdetail_info_xian"></view>
|
||||
<view class="orderdetail_info_view">
|
||||
<view class="orderdetail_info_view_left">发票服务</view>
|
||||
<view class="orderdetail_info_view_right">{{ info.invoice }}</view>
|
||||
</view>
|
||||
<view class="orderdetail_info_view">
|
||||
<view class="orderdetail_info_view_left">备注信息</view>
|
||||
<view class="orderdetail_info_view_right">{{ info.remarks || '' }}</view>
|
||||
</view>
|
||||
<view class="orderdetail_info_view">
|
||||
<view class="orderdetail_info_view_left">服务提供方</view>
|
||||
<view class="orderdetail_info_view_right" @click="call(info.stationTel)" style="color: #6FA256; font-weight: bold">{{ info.stationTel }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderdetail_btn p30">
|
||||
<view class="orderdetail_btn_left">
|
||||
{{ fullCost.totalAmount }}
|
||||
<text>元/度</text>
|
||||
</view>
|
||||
<view class="orderdetail_btn_right" @click="toRecharge">扫码充电</view>
|
||||
</view>
|
||||
<view style="height: 150rpx"></view>
|
||||
<up-popup :show="show" @close="show = false" closeable round="10">
|
||||
<view class="orderdetail_info" style="padding-top: 50rpx">
|
||||
<view class="orderdetail_info_zd" style="position: relative" @click="show = true">
|
||||
<view class="orderdetail_info_zd_zdbg"></view>
|
||||
<image
|
||||
src="/static/icon/eleclist-terminal.png"
|
||||
style="transform: rotateY(180deg); position: absolute; left: 0; bottom: 0; width: 100rpx; height: 100rpx"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
|
||||
<view>交流</view>
|
||||
<view style="display: flex; align-items: center">
|
||||
{{ info.gunCount - info.gunUseCount }}
|
||||
<text style="font-size: 28rpx; opacity: 0.9; margin-left: 10rpx">空闲</text>
|
||||
<text style="font-size: 24rpx; opacity: 0.8">/{{ info.gunCount }}总</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gun">
|
||||
<z-paging ref="paging" :fixed="false" :loading-more-enabled="false" v-model="dataList" @query="queryList" height="600rpx;" :auto="false" show-refresher-when-reload>
|
||||
<view class="gun_list" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="gun_list_left">
|
||||
<view class="gun_list_left_view1">
|
||||
<up-tag v-if="item.realtimeStatus == 1" size="mini" type="error" text="故障" plain plainFill></up-tag>
|
||||
<up-tag v-else-if="item.realtimeStatus == 2" size="mini" type="success" text="空闲" plain plainFill></up-tag>
|
||||
<up-tag v-else-if="item.realtimeStatus == 3" size="mini" type="warning" text="充电中" plain plainFill></up-tag>
|
||||
<up-tag v-else size="mini" type="error" text="离线" plain plainFill></up-tag>
|
||||
<view style="margin-left: 15rpx"><up-tag v-if="item.insertStatus == 1" size="mini" text="已插枪" plain plainFill></up-tag></view>
|
||||
|
||||
<view style="margin-left: 15rpx">{{ item.gunName }}</view>
|
||||
</view>
|
||||
<view class="gun_list_left_view">{{ item.deviceNo }}</view>
|
||||
<view class="gun_list_left_view">
|
||||
<view>最高功率:{{ item.maxPower }}KW</view>
|
||||
<view style="margin-left: 30rpx">电压:{{ item.maxVoltage }}V</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<up-button @click="startCd(item)" v-if="item.realtimeStatus == 2" shape="circle" type="success" :plain="true" text="启动充电"></up-button>
|
||||
<up-button
|
||||
v-if="item.realtimeStatus == 1 || item.realtimeStatus == 0"
|
||||
shape="circle"
|
||||
type="error"
|
||||
:plain="true"
|
||||
text="报故障"
|
||||
openType="contact"
|
||||
></up-button>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
</up-popup>
|
||||
<up-popup :show="showJf" @close="showJf = false" closeable round="10">
|
||||
<view style="font-size: 36rpx; font-weight: bold; padding: 30rpx">价格详情</view>
|
||||
<view style="padding: 30rpx; padding-top: 0">
|
||||
<scroll-view scroll-y="true" style="height: 800rpx">
|
||||
<view v-for="(item, index) in info.priceList" :key="index" style="margin-bottom: 30rpx; position: relative; position: relative">
|
||||
<view
|
||||
style="
|
||||
height: 80rpx;
|
||||
background: linear-gradient(to right, rgba(72, 121, 230, 1), rgba(72, 121, 230, 0.4));
|
||||
border-radius: 15rpx;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
padding-top: 10rpx;
|
||||
padding-left: 30rpx;
|
||||
"
|
||||
>
|
||||
<text v-if="item.isCurrent == 1" style="margin-right: 30rpx">当前计费时间段</text>
|
||||
{{ item.startTime }}-{{ item.endTime }}
|
||||
</view>
|
||||
<view style="border: 1rpx solid #6FA256; border-radius: 15rpx; padding: 30rpx; margin-top: -30rpx; background-color: #fff; font-size: 28rpx">
|
||||
<view style="display: flex; justify-content: space-between; margin-bottom: 15rpx">
|
||||
<view>电费</view>
|
||||
<view>{{ item.electricityRate }}元/度</view>
|
||||
</view>
|
||||
<view style="display: flex; justify-content: space-between; margin-bottom: 15rpx">
|
||||
<view>服务费</view>
|
||||
<view>{{ item.serviceFeeRate }}元/度</view>
|
||||
</view>
|
||||
<view style="border-top: 1rpx solid #eee; margin-bottom: 15rpx"></view>
|
||||
<view style="display: flex; justify-content: space-between">
|
||||
<view>总计</view>
|
||||
<view>{{ item.totalAmount }}元/度</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { infoAroundApi, listByStationId, startCharging } from '@/api/api.js';
|
||||
import { onLoad, onPageScroll } from '@dcloudio/uni-app';
|
||||
import { lookImg, call, urlQuery } from '@/utils/fun.js';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
const { nav, navTo } = useNav();
|
||||
|
||||
const headerBg = ref(false);
|
||||
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||
let info = reactive({});
|
||||
let show = ref(false);
|
||||
const dataList = ref([]);
|
||||
const paging = ref(null);
|
||||
let showJf = ref(false);
|
||||
|
||||
const fullCost = computed(() => {
|
||||
let data = info?.priceList?.find((val) => val.isCurrent == 1);
|
||||
return data || {};
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
getInfo(options.id, options.distance);
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (e.scrollTop > uni.getSystemInfoSync().statusBarHeight + 44) {
|
||||
headerBg.value = true;
|
||||
} else {
|
||||
headerBg.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
const getInfo = async (e, distance) => {
|
||||
let _res = await infoAroundApi({ id: e });
|
||||
_res.distance = distance;
|
||||
Object.assign(info, _res);
|
||||
};
|
||||
|
||||
// 使用 ref 创建响应式引用
|
||||
const list3 = ref(['https://cdn.uviewui.com/uview/swiper/swiper3.png', 'https://cdn.uviewui.com/uview/swiper/swiper2.png', 'https://cdn.uviewui.com/uview/swiper/swiper1.png']);
|
||||
|
||||
let toRecharge = () => {
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
let query = urlQuery(res.result);
|
||||
if (!query.num) {
|
||||
uni.showToast({
|
||||
title: '请扫描正确的设备码',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
navTo(`/pages/home/star?id=${query.num}`);
|
||||
}
|
||||
// navTo(`/pages/home/star?id=${res.result}`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const back = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
const queryList = async () => {
|
||||
listByStationId({ stationId: info.id })
|
||||
.then((res) => {
|
||||
paging.value.complete(res);
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
|
||||
const showZd = () => {
|
||||
show.value = true;
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
const startCd = async (e) => {
|
||||
uni.navigateTo({
|
||||
url: './star?id=' + e.deviceGunNo
|
||||
});
|
||||
|
||||
// let _res = startCharging({
|
||||
// deviceNo: e.deviceNo,
|
||||
// gunNo: e.gunNo
|
||||
// });
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.orderdetail {
|
||||
padding-bottom: 150rpx;
|
||||
|
||||
&_header {
|
||||
width: 750rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 99;
|
||||
transition: all 0.5s;
|
||||
}
|
||||
|
||||
&_info {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 25rpx;
|
||||
box-shadow: 0rpx -6rpx 8rpx 2rpx rgba(66, 115, 229, 0.05);
|
||||
&_title {
|
||||
font-size: 32rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 30rpx;
|
||||
@include flex($space: space-between);
|
||||
}
|
||||
|
||||
&_fy {
|
||||
background: linear-gradient(to right, rgba(111, 162, 86, 0.4), rgba(72, 121, 230, 0));
|
||||
border-radius: 15rpx;
|
||||
padding: 40rpx 20rpx 40rpx 40rpx;
|
||||
color: #fff;
|
||||
margin-top: 30rpx;
|
||||
@include flex;
|
||||
&_left {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
font-style: italic;
|
||||
color: #6FA256;
|
||||
}
|
||||
&_right {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
color: #6FA256;
|
||||
margin-left: 30rpx;
|
||||
@include flex;
|
||||
}
|
||||
}
|
||||
|
||||
&_zd {
|
||||
border-radius: 15rpx;
|
||||
padding: 40rpx 20rpx 40rpx 130rpx;
|
||||
background-color: #6FA256;
|
||||
color: #fff;
|
||||
@include flex($space: space-between);
|
||||
&_zdbg {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 100%);
|
||||
}
|
||||
}
|
||||
|
||||
&_view {
|
||||
@include flex($space: space-between);
|
||||
margin-bottom: 30rpx;
|
||||
&_left {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #232323;
|
||||
}
|
||||
&_right {
|
||||
@include flex;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #232323;
|
||||
image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
&_xian {
|
||||
width: 100%;
|
||||
border: 2rpx solid #707070;
|
||||
margin-bottom: 30rpx;
|
||||
opacity: 0.06;
|
||||
}
|
||||
}
|
||||
&_btn {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 40rpx;
|
||||
@include flex($space: space-between);
|
||||
view {
|
||||
@include flex($space: center);
|
||||
width: 330rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 46rpx 46rpx 46rpx 46rpx;
|
||||
}
|
||||
&_left {
|
||||
background-color: #e5eaf4;
|
||||
color: #6FA256;
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
&_right {
|
||||
background: #6FA256;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.gun {
|
||||
height: 600rpx;
|
||||
&_list {
|
||||
@include flex($space: space-between);
|
||||
padding: 30rpx;
|
||||
|
||||
&_left {
|
||||
flex: 1;
|
||||
&_view {
|
||||
font-size: 24rpx;
|
||||
color: #b0b2b6;
|
||||
margin-bottom: 10rpx;
|
||||
@include flex;
|
||||
}
|
||||
&_view1 {
|
||||
@include flex;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep .u-popup__content__close--top-right {
|
||||
top: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
261
pages/home/home - 副本.vue
Normal file
261
pages/home/home - 副本.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<view>
|
||||
<z-paging ref="paging" v-model="dataList" use-page-scroll @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>
|
||||
</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>
|
||||
<cc-myTabbar :tabBarShow="0"></cc-myTabbar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad, onShow, onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { aroundAreaApi, bannerList } from '@/api/api.js';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
const { nav, navTo } = useNav();
|
||||
|
||||
const dataList = ref([]);
|
||||
const paging = ref(null);
|
||||
const query = reactive({
|
||||
lon: '',
|
||||
lat: '',
|
||||
orderByType: 1, //1-最近;2-空闲较多
|
||||
keyWord: ''
|
||||
});
|
||||
|
||||
const list1 = ref([]);
|
||||
|
||||
onLoad(async () => {
|
||||
let _res = await bannerList();
|
||||
list1.value = _res;
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
});
|
||||
|
||||
let toKft = (e) => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '4008005326' //仅为示例
|
||||
});
|
||||
};
|
||||
|
||||
const queryList = async () => {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
try {
|
||||
if (!query.lon && !query.lat) {
|
||||
const { longitude: lon, latitude: lat } = await uni.getLocation();
|
||||
query.lon = lon;
|
||||
query.lat = lat;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
console.log(query);
|
||||
aroundAreaApi(query)
|
||||
.then((res) => {
|
||||
console.log(res, 'list');
|
||||
paging.value.complete(res);
|
||||
uni.hideLoading();
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
uni.hideLoading();
|
||||
});
|
||||
};
|
||||
|
||||
let tabChange = (e) => {
|
||||
query.orderByType = e;
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
let isPagingRefNotFound = () => {
|
||||
return !paging.value;
|
||||
};
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.reload().catch(() => {});
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.updatePageScrollTop(e.scrollTop);
|
||||
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.pageReachBottom();
|
||||
});
|
||||
|
||||
const toOrder = () => {
|
||||
uni.switchTab({
|
||||
url: '/pages/order/order'
|
||||
});
|
||||
};
|
||||
|
||||
let searchChange = (e) => {
|
||||
query.keyWord = e;
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
let showMode = () => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '暂未开放',
|
||||
showCancel: false,
|
||||
confirmText: '确认',
|
||||
success: () => {}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
/* background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%); */
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.search_header {
|
||||
position: relative;
|
||||
&_blur {
|
||||
width: 100%;
|
||||
height: 185rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #dbe6ff;
|
||||
opacity: 0.8;
|
||||
filter: blur(50px);
|
||||
/* #ifdef MP-ALIPAY */
|
||||
z-index: 0;
|
||||
/* #endif */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
z-index: -1;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
&_grid {
|
||||
// margin: 35rpx 0;
|
||||
margin-top: 25rpx;
|
||||
border-radius: 15rpx;
|
||||
@include flex($space: space-between);
|
||||
&_view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 126rpx;
|
||||
font-size: 26rpx;
|
||||
// background: #ffffff;
|
||||
// border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
image {
|
||||
width: 99rpx;
|
||||
height: 99rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order_list {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
button::after {
|
||||
all: unset;
|
||||
}
|
||||
</style>
|
||||
75
pages/home/home.vue
Normal file
75
pages/home/home.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="isInvest">
|
||||
<view>
|
||||
<pageG v-if="tabBarShow == 0" :user="user" ref="pageG" />
|
||||
</view>
|
||||
<view>
|
||||
<pageH v-if="tabBarShow == 1" :user="user" ref="pageH" />
|
||||
</view>
|
||||
<view>
|
||||
<pageI v-if="tabBarShow == 2" :user="user" ref="pageI" />
|
||||
</view>
|
||||
<view>
|
||||
<pageF v-if="tabBarShow == 3" :user="user" :isInvest="isInvest" @tabChange="tabChange" ref="pageF" />
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view>
|
||||
<pageA v-if="tabBarShow == 0" :user="user" ref="pageA" />
|
||||
</view>
|
||||
<view>
|
||||
<pageB v-if="tabBarShow == 1" :user="user" ref="pageB" />
|
||||
</view>
|
||||
<view>
|
||||
<pageC v-if="tabBarShow == 2" :user="user" ref="pageC" />
|
||||
</view>
|
||||
<view>
|
||||
<pageE v-if="tabBarShow == 3" :user="user" ref="pageE" />
|
||||
</view>
|
||||
<view>
|
||||
<pageF v-if="tabBarShow == 4" :user="user" :isInvest="isInvest" @tabChange="tabChange" ref="pageF" />
|
||||
</view>
|
||||
</view>
|
||||
<cc-myTabbar ref="myTabbar" :tabbar="tabbar" :tabBarShow="tabBarShow" @tabChange="tabChange"></cc-myTabbar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { userHook } from '@/hooks/userInfo.js';
|
||||
import { getUrlParam } from '@/utils/fun.js';
|
||||
|
||||
import pageA from '@/pages/home/components/user/home.vue';
|
||||
import pageB from '@/pages/home/components/user/index.vue';
|
||||
import pageC from '@/pages/home/components/user/sweep.vue';
|
||||
import pageE from '@/pages/home/components/user/find.vue';
|
||||
import pageF from '@/pages/home/components/user/mine.vue';
|
||||
import pageG from '@/pages/home/components/Invest/shop.vue';
|
||||
import pageH from '@/pages/home/components/Invest/order.vue';
|
||||
import pageI from '@/pages/home/components/Invest/facility.vue';
|
||||
|
||||
const { isInvest, user, tabbar } = userHook();
|
||||
let tabBarShow = ref(0);
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.q) {
|
||||
const q = decodeURIComponent(options.q);
|
||||
const query = getUrlParam(q);
|
||||
if (query.code) {
|
||||
uni.setStorageSync('invite_code', query.code);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.tabBarShow) {
|
||||
tabBarShow.value = options.tabBarShow;
|
||||
}
|
||||
});
|
||||
|
||||
const tabChange = (e) => {
|
||||
tabBarShow.value = e.index;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
561
pages/home/star.vue
Normal file
561
pages/home/star.vue
Normal file
@@ -0,0 +1,561 @@
|
||||
<template>
|
||||
<view class="p30">
|
||||
<!-- <view class="star_pile" style="margin-bottom: 30rpx"></view> -->
|
||||
<view class="orderdetail_info" style="margin-bottom: 30rpx">
|
||||
<view class="orderdetail_info_title">
|
||||
<view>{{ info.stationName }}</view>
|
||||
</view>
|
||||
<view style="font-size: 26rpx; margin-bottom: 15rpx; display: flex; align-items: center">
|
||||
<view style="opacity: 0.7">枪号:{{ info.gunName }}</view>
|
||||
<image style="width: 40rpx; height: 40rpx; margin-left: 15rpx" src="/static/icon/copy.png" @click="copy(info.gunName)" mode="widthFix"></image>
|
||||
</view>
|
||||
<view style="font-size: 26rpx; margin-bottom: 15rpx; opacity: 0.7">停车收费说明:{{ info.occupyCostInfo }}</view>
|
||||
<view style="font-size: 26rpx; opacity: 0.7">占用收费说明:{{ info.parkCostInfo }}</view>
|
||||
</view>
|
||||
<view class="orderdetail_info" style="margin-bottom: 30rpx">
|
||||
<view class="orderdetail_info_title">
|
||||
<view>费用信息</view>
|
||||
</view>
|
||||
<view style="max-width: 420rpx">
|
||||
<up-tag size="mini" :text="`当前计费时间段:${currentPrice.startTime}-${currentPrice.endTime}`" plain plainFill></up-tag>
|
||||
</view>
|
||||
<view class="orderdetail_info_fy">
|
||||
<view class="orderdetail_info_fy_left">电站价格</view>
|
||||
<view class="orderdetail_info_fy_right">
|
||||
{{ currentPrice.totalAmount }}
|
||||
<text style="font-weight: 500; font-size: 24rpx; color: #333; margin-left: 15rpx">元/度</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderdetail_info" style="margin-bottom: 30rpx">
|
||||
<view class="orderdetail_info_title">
|
||||
<view style="display: flex; align-items: center">
|
||||
<view>支付方式</view>
|
||||
<!-- -->
|
||||
<view style="margin-left: 15rpx">
|
||||
<up-tag v-if="store.state.insertStatus == 1" size="mini" text="已插枪" plain plainFill></up-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center">
|
||||
<up-button type="primary" size="small" :plain="true" text="余额充值" @click="navTo('/pages/money/recharge')"></up-button>
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 30rpx; margin-bottom: 30rpx">
|
||||
<!-- @click="payTo" -->
|
||||
<!-- <view>支付方式</view> -->
|
||||
<!-- <view>{{ payType == 1 ? '余额付款' : payType == 2 ? '电卡支付' : payType == 3 ? '预付款' : '请选择' }}</view> -->
|
||||
|
||||
<view>
|
||||
<view
|
||||
class="flex-acsb"
|
||||
style="padding: 15rpx 30rpx; border-radius: 10rpx"
|
||||
v-for="(item, index) in payList"
|
||||
:key="index"
|
||||
:style="{
|
||||
border: item.id == payType ? '1rpx solid #4879e6' : ''
|
||||
}"
|
||||
@click="payType = item.id"
|
||||
>
|
||||
<view style="display: flex; align-items: center">
|
||||
<image :src="`/static/icon/lie${item.id}.png`" style="width: 50rpx; height: 50rpx; margin-right: 25rpx"></image>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view v-if="item.id == 1" style="font-size: 28rpx; opacity: 0.7">可用余额:{{ infoUser.balance || 0 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderdetail_info" style="margin-bottom: 30rpx">
|
||||
<view class="orderdetail_info_yf">
|
||||
<view class="orderdetail_info_yf_left">
|
||||
<view class="orderdetail_info_yf_left_tit">
|
||||
<view style="margin-right: 30rpx">预付费</view>
|
||||
<up-tag size="mini" :text="`余额原路退款`" plain plainFill></up-tag>
|
||||
</view>
|
||||
<!-- <view>{{ dataForm.money }} 元</view> -->
|
||||
<view class="orderdetail_info_yf_left_mon">
|
||||
<!-- 预付金额: -->
|
||||
<view
|
||||
@click="
|
||||
dataForm.money = 30;
|
||||
inputBorder = false;
|
||||
"
|
||||
:style="{ border: `1rpx solid ${dataForm.money == 30 && !inputBorder ? '#4879e6' : '#c5c5c5'}` }"
|
||||
>
|
||||
30
|
||||
</view>
|
||||
<view
|
||||
@click="
|
||||
dataForm.money = 50;
|
||||
inputBorder = false;
|
||||
"
|
||||
:style="{ border: `1rpx solid ${dataForm.money == 50 && !inputBorder ? '#4879e6' : '#c5c5c5'}` }"
|
||||
>
|
||||
50
|
||||
</view>
|
||||
<view
|
||||
@click="
|
||||
dataForm.money = 100;
|
||||
inputBorder = false;
|
||||
"
|
||||
:style="{ border: `1rpx solid ${dataForm.money == 100 && !inputBorder ? '#4879e6' : '#c5c5c5'}` }"
|
||||
>
|
||||
100
|
||||
</view>
|
||||
<view @click="inputClik" :style="{ border: `1rpx solid ${inputBorder ? '#4879e6' : '#c5c5c5'}` }">
|
||||
<input adjust-position v-if="inputBorder" focus type="number" v-model="dataForm.money" placeholder="自定义" />
|
||||
<text v-else>自定义</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="orderdetail_info_yf_right" @click="openDialog">预付金额</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="orderdetail_info" style="margin-bottom: 30rpx" v-if="payType == 2">
|
||||
<view>
|
||||
<view class="flex-acsb" style="font-size: 30rpx; margin-bottom: 20rpx">
|
||||
<view>当前可用电卡</view>
|
||||
</view>
|
||||
<view @click="userCardId = item.id" style="margin-bottom: 30rpx; position: relative" class="mt30 wallet_list" v-for="(item, index) in userCard" :key="index">
|
||||
<view v-if="userCardId == item.id" style="position: absolute; top: 0; left: 0; background-color: #e45656; border-radius: 0 0 20rpx 0">
|
||||
<up-icon name="checkbox-mark" color="#fff"></up-icon>
|
||||
</view>
|
||||
|
||||
<view style="color: #fff">
|
||||
<view style="font-weight: bold; font-size: 30rpx; margin-bottom: 18rpx">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view style="font-size: 28rpx; color: #eee">卡号:{{ item.cardNo }}</view>
|
||||
</view>
|
||||
<view style="display: flex; flex-direction: column; align-items: center; color: #fff; font-weight: bold; font-size: 26rpx">
|
||||
<view style="font-size: 36rpx; margin-bottom: 10rpx">{{ item.balance }}</view>
|
||||
<view style="font-weight: 500">余额</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="height: 500rpx"></view>
|
||||
<view class="orderdetail_btn p30" style="background-color: #fff">
|
||||
<view class="orderdetail_btn_left">
|
||||
{{ currentPrice.totalAmount }}
|
||||
<text>元/度 免费停车</text>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<up-button v-if="!payType" :customStyle="{ height: '80rpx', width: '230rpx' }" disabled color="#4879e6" text="请选择支付方式" shape="circle"></up-button>
|
||||
<up-button v-if="payType == 1" :customStyle="{ height: '80rpx', width: '280rpx' }" @click="toRecharge" color="#4879e6" shape="circle" text="启动充电"></up-button>
|
||||
<up-button
|
||||
v-if="payType == 3"
|
||||
:customStyle="{ height: '80rpx', width: '280rpx' }"
|
||||
@click="toRechargeYuFu"
|
||||
color="#4879e6"
|
||||
shape="circle"
|
||||
:text="`预付${dataForm.money}元,启动充电`"
|
||||
></up-button>
|
||||
<!-- :text="`预付${dataForm.money}元,启动充电`" -->
|
||||
<up-button
|
||||
v-if="payType == 2"
|
||||
:customStyle="{ height: '80rpx', width: '280rpx' }"
|
||||
:disabled="!userCardId"
|
||||
color="#4879e6"
|
||||
:text="userCardId ? '启动充电' : '请选择电卡'"
|
||||
shape="circle"
|
||||
@click="toRechargeCard"
|
||||
></up-button>
|
||||
</view>
|
||||
|
||||
<!-- <view v-if="!payType" class="orderdetail_btn_right" style="opacity: 0.5;">请选择支付方式</view> -->
|
||||
<!-- <view v-if="payType == 1" class="orderdetail_btn_right" @click="toRecharge">预付{{ dataForm.money }}元,启动充电</view> -->
|
||||
<!-- <view v-if="payType == 2" class="orderdetail_btn_right" @click="toRecharge">电卡支付,启动充电</view> -->
|
||||
</view>
|
||||
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
ref="inputClose"
|
||||
mode="input"
|
||||
title="请输入预付金额"
|
||||
:value="dataForm.money"
|
||||
placeholder="请输入内容"
|
||||
@confirm="dialogInputConfirm"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { gunInfo, infoAroundApi, startChargingByWallet, userCardUsableList, startChargingByCard, ordersInfo, startChargingByAdaPay, userInfo } from '@/api/api.js';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import store from '@/store/index.js';
|
||||
import { copy } from '@/utils/fun.js';
|
||||
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
const { navTo } = useNav();
|
||||
|
||||
const inputDialog = ref(null);
|
||||
let info = reactive({});
|
||||
let infoUser = reactive({});
|
||||
|
||||
let inputBorder = ref(false);
|
||||
let currentPrice = ref({});
|
||||
let id = ref('');
|
||||
let userCard = ref([]);
|
||||
let userCardId = ref(null);
|
||||
let payType = ref(1);
|
||||
let dataForm = reactive({
|
||||
money: 30
|
||||
});
|
||||
|
||||
let payList = reactive([
|
||||
{
|
||||
id: 1,
|
||||
name: '余额支付'
|
||||
}
|
||||
]);
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.q) {
|
||||
let search = decodeURIComponent(options.q);
|
||||
search = search.split('?')[1];
|
||||
const pairs = search ? search.split('&') : [];
|
||||
const query = {};
|
||||
for (let i = 0; i < pairs.length; ++i) {
|
||||
const [key, value] = pairs[i].split('=');
|
||||
query[key] = query[key] || decodeURIComponent(value);
|
||||
}
|
||||
if (query.num) {
|
||||
id.value = query.num;
|
||||
infoDate(query.num);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.id) {
|
||||
id.value = options.id;
|
||||
infoDate(options.id);
|
||||
}
|
||||
});
|
||||
|
||||
onShow(async () => {
|
||||
if (uni.getStorageSync('token') && id.value) {
|
||||
infoDate(id.value);
|
||||
let _res = await userInfo();
|
||||
infoUser.value = _res;
|
||||
}
|
||||
});
|
||||
|
||||
let getUserCard = async (e) => {
|
||||
let _res = await userCardUsableList({ stationId: e });
|
||||
userCard.value = _res;
|
||||
if (_res.length == 0) {
|
||||
payType.value = 1;
|
||||
} else {
|
||||
payType.value = 2;
|
||||
userCardId.value = _res[0].id;
|
||||
if (!payList.find((val) => val.name == '电卡支付')) {
|
||||
payList.push({
|
||||
id: 2,
|
||||
name: '电卡支付'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let inputClik = () => {
|
||||
inputBorder.value = true;
|
||||
dataForm.money = dataForm.money == 30 || dataForm.money == 50 || dataForm.money == 100 ? '' : dataForm.money;
|
||||
};
|
||||
|
||||
let infoDate = async (e) => {
|
||||
let _res = await gunInfo({ deviceNo: e });
|
||||
info = _res;
|
||||
getUserCard(_res.stationId);
|
||||
currentPrice.value = _res.currentPrice;
|
||||
console.log(_res.deviceNo, '_res.deviceNo');
|
||||
console.log(_res.gunNo, '_res.gunNo');
|
||||
|
||||
store.commit('setInsertStatus', _res.insertStatus);
|
||||
uni.sendSocketMessage({
|
||||
data: JSON.stringify({
|
||||
command: 'sub',
|
||||
deviceNo: _res.deviceNo,
|
||||
gunNo: _res.gunNo
|
||||
}),
|
||||
success: (res) => {
|
||||
console.log('发送成功');
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err);
|
||||
console.log('发送失败');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
let dialogInputConfirm = (e) => {
|
||||
dataForm.money = e;
|
||||
};
|
||||
|
||||
let openDialog = () => {
|
||||
console.log(12345);
|
||||
inputDialog.value.open();
|
||||
};
|
||||
|
||||
let toRechargeCard = async () => {
|
||||
uni.showLoading({
|
||||
title: '启动充电中...',
|
||||
mask: true
|
||||
});
|
||||
let _res = await startChargingByCard({
|
||||
deviceNo: info.deviceNo,
|
||||
gunNo: info.gunNo,
|
||||
amount: dataForm.money,
|
||||
userCardId: userCardId.value
|
||||
});
|
||||
};
|
||||
|
||||
let toRechargeYuFu = async () => {
|
||||
uni.showLoading({
|
||||
title: '启动充电中...',
|
||||
mask: true
|
||||
});
|
||||
let _res = await startChargingByAdaPay({
|
||||
deviceNo: info.deviceNo,
|
||||
gunNo: info.gunNo,
|
||||
amount: dataForm.money
|
||||
});
|
||||
let data = _res.payInfo;
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: data.timeStamp,
|
||||
nonceStr: data.nonceStr,
|
||||
package: data.package,
|
||||
signType: data.signType,
|
||||
paySign: data.paySign,
|
||||
success: function (r) {
|
||||
store.commit('setTransactionNo', _res.transactionNo);
|
||||
store.commit('setSokStatus', 0);
|
||||
timeMap(_res);
|
||||
},
|
||||
fail: function (err) {
|
||||
uni.showToast({
|
||||
title: '已取消支付',
|
||||
icon: 'none'
|
||||
});
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
// store.commit('setTransactionNo', _res.transactionNo);
|
||||
// store.commit('setSokStatus', 0);
|
||||
// timeMap(_res);
|
||||
// uni.navigateTo({
|
||||
// url: `/pageOrder/recharge/recharge?transactionNo=${_res.transactionNo}&type=order`
|
||||
// });
|
||||
};
|
||||
|
||||
let toRecharge = async () => {
|
||||
uni.showLoading({
|
||||
title: '启动充电中...',
|
||||
mask: true
|
||||
});
|
||||
let _res = await startChargingByWallet({
|
||||
deviceNo: info.deviceNo,
|
||||
gunNo: info.gunNo,
|
||||
amount: dataForm.money
|
||||
});
|
||||
store.commit('setTransactionNo', _res.transactionNo);
|
||||
store.commit('setSokStatus', 0);
|
||||
timeMap(_res);
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: `/pageOrder/recharge/recharge?transactionNo=${_res.transactionNo}&type=order`
|
||||
// });
|
||||
// uni.navigateTo({
|
||||
// url: `/pageOrder/recharge/recharge?transactionNo=${_res.transactionNo}`
|
||||
// });
|
||||
// console.log(_res);
|
||||
};
|
||||
|
||||
const timeMap = (_res) => {
|
||||
var time = setInterval(async () => {
|
||||
if (store.state.sokStatus != 1) {
|
||||
let _data = await ordersInfo({
|
||||
transactionNo: _res.transactionNo
|
||||
});
|
||||
store.commit('setDataObj', _data);
|
||||
if (_data.status == 3) {
|
||||
uni.hideLoading();
|
||||
uni.navigateTo({
|
||||
url: `/pageOrder/recharge/recharge?transactionNo=${_res.transactionNo}&type=order`
|
||||
});
|
||||
clearTimeout(time);
|
||||
store.commit('setSokStatus', 0);
|
||||
}
|
||||
if (_data.status == -1) {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '启动失败,请重试',
|
||||
showCancel: false,
|
||||
confirmText: '确认',
|
||||
success: () => {}
|
||||
});
|
||||
clearTimeout(time);
|
||||
store.commit('setSokStatus', 0);
|
||||
}
|
||||
if (_data.status == -2) {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '启动超时,请重试',
|
||||
showCancel: false,
|
||||
confirmText: '确认',
|
||||
success: () => {}
|
||||
});
|
||||
clearTimeout(time);
|
||||
store.commit('setSokStatus', 0);
|
||||
}
|
||||
}
|
||||
}, 5000);
|
||||
};
|
||||
|
||||
const payTo = () => {
|
||||
let itemList = ['余额付款'];
|
||||
if (userCard.value.length != 0) {
|
||||
itemList.push('电卡支付');
|
||||
}
|
||||
// itemList.push('预付款');
|
||||
uni.showActionSheet({
|
||||
itemList: itemList,
|
||||
success: function (res) {
|
||||
// if (itemList[1] == '预付款' && res.tapIndex == 1) {
|
||||
// payType.value = 3;
|
||||
// } else {
|
||||
// payType.value = res.tapIndex + 1;
|
||||
// }
|
||||
|
||||
payType.value = res.tapIndex + 1;
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log(res.errMsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.star_pile {
|
||||
width: 100%;
|
||||
box-shadow: 0rpx -6rpx 8rpx 2rpx rgba(66, 115, 229, 0.05);
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.orderdetail_info {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 25rpx;
|
||||
box-shadow: 0rpx -6rpx 8rpx 2rpx rgba(66, 115, 229, 0.05);
|
||||
&_title {
|
||||
font-size: 32rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 30rpx;
|
||||
@include flex($space: space-between);
|
||||
}
|
||||
|
||||
&_fy {
|
||||
background: linear-gradient(to right, rgba(72, 121, 230, 0.4), rgba(72, 121, 230, 0));
|
||||
border-radius: 15rpx;
|
||||
padding: 40rpx 20rpx 40rpx 40rpx;
|
||||
color: #fff;
|
||||
margin-top: 30rpx;
|
||||
@include flex;
|
||||
&_left {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
font-style: italic;
|
||||
color: #4879e6;
|
||||
}
|
||||
&_right {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
color: #4879e6;
|
||||
margin-left: 30rpx;
|
||||
@include flex;
|
||||
}
|
||||
}
|
||||
|
||||
&_yf {
|
||||
@include flex($space: space-between);
|
||||
&_left {
|
||||
flex: 1;
|
||||
// view {
|
||||
// @include flex;
|
||||
// }
|
||||
|
||||
&_tit {
|
||||
font-size: 28rpx;
|
||||
color: rgba(51, 51, 51, 0.8);
|
||||
margin-bottom: 20rpx;
|
||||
@include flex;
|
||||
}
|
||||
&_mon {
|
||||
font-size: 30rpx;
|
||||
@include flex($space: space-between);
|
||||
view {
|
||||
// width: 22%;
|
||||
padding: 15rpx 35rpx;
|
||||
border: 1rpx solid #c5c5c5;
|
||||
margin-right: 15rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
input {
|
||||
width: 100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
&_right {
|
||||
padding: 15rpx 30rpx;
|
||||
color: #1779ff;
|
||||
border: 1rpx solid #1779ff;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.orderdetail_btn {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0rpx;
|
||||
padding: 30rpx;
|
||||
@include flex($space: space-between);
|
||||
&_left {
|
||||
// background-color: #e5eaf4;
|
||||
color: #333;
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
text {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
&_right {
|
||||
background: #1779ff;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.wallet_list {
|
||||
border-radius: 15rpx;
|
||||
background-color: #4879e6;
|
||||
padding: 20rpx 50rpx 20rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
234
pages/index/components/Invest/shop.vue
Normal file
234
pages/index/components/Invest/shop.vue
Normal file
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<view class="u-wrap">
|
||||
<view class="u-search-box">
|
||||
<view class="u-search-inner">
|
||||
<up-icon name="search" color="#909399" :size="28"></up-icon>
|
||||
<text class="u-search-text">请输入您需要的商品名称</text>
|
||||
</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 item.foods" :key="index1">
|
||||
<image class="item-menu-image" :src="item1.cover" mode=""></image>
|
||||
<view class="item-menu-name">{{ item1.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { goodsList, categoryList } from '@/api/api.js';
|
||||
let tabbar = ref([]);
|
||||
let scrollTop = ref(0);
|
||||
let current = ref(0);
|
||||
let menuHeight = ref(0);
|
||||
let menuItemHeight = ref(0);
|
||||
// [
|
||||
// {
|
||||
// name: '女装',
|
||||
// foods: [
|
||||
// {
|
||||
// name: 'A字裙',
|
||||
// key: 'A字裙',
|
||||
// icon: 'https://cdn.uviewui.com/uview/common/classify/1/1.jpg',
|
||||
// cat: 10
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
|
||||
onLoad(() => {
|
||||
categoryList().then((res) => {
|
||||
tabbar.value = res.map((item, index) => {
|
||||
return {
|
||||
...item,
|
||||
foods: []
|
||||
};
|
||||
});
|
||||
goodsList({ categoryId: res[0].id }).then((res) => {
|
||||
tabbar.value[0].foods = res;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
async function swichMenu(index) {
|
||||
if (index == current.value) return;
|
||||
current.value = index;
|
||||
goodsList({ categoryId: tabbar.value[index].id }).then((res) => {
|
||||
tabbar.value[index].foods = res;
|
||||
});
|
||||
|
||||
// 如果为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();
|
||||
});
|
||||
}
|
||||
</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: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
</style>
|
||||
140
pages/index/components/user/find.vue
Normal file
140
pages/index/components/user/find.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<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">
|
||||
<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>
|
||||
<cc-myTabbar :tabBarShow="3"></cc-myTabbar>
|
||||
|
||||
<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>
|
||||
261
pages/index/components/user/home.vue
Normal file
261
pages/index/components/user/home.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<view>
|
||||
<z-paging ref="paging" v-model="dataList" use-page-scroll @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>
|
||||
</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>
|
||||
<cc-myTabbar :tabBarShow="0"></cc-myTabbar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad, onShow, onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { aroundAreaApi, bannerList } from '@/api/api.js';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
const { nav, navTo } = useNav();
|
||||
|
||||
const dataList = ref([]);
|
||||
const paging = ref(null);
|
||||
const query = reactive({
|
||||
lon: '',
|
||||
lat: '',
|
||||
orderByType: 1, //1-最近;2-空闲较多
|
||||
keyWord: ''
|
||||
});
|
||||
|
||||
const list1 = ref([]);
|
||||
|
||||
onLoad(async () => {
|
||||
let _res = await bannerList();
|
||||
list1.value = _res;
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
});
|
||||
|
||||
let toKft = (e) => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '4008005326' //仅为示例
|
||||
});
|
||||
};
|
||||
|
||||
const queryList = async () => {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
try {
|
||||
if (!query.lon && !query.lat) {
|
||||
const { longitude: lon, latitude: lat } = await uni.getLocation();
|
||||
query.lon = lon;
|
||||
query.lat = lat;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
console.log(query);
|
||||
aroundAreaApi(query)
|
||||
.then((res) => {
|
||||
console.log(res, 'list');
|
||||
paging.value.complete(res);
|
||||
uni.hideLoading();
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
uni.hideLoading();
|
||||
});
|
||||
};
|
||||
|
||||
let tabChange = (e) => {
|
||||
query.orderByType = e;
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
let isPagingRefNotFound = () => {
|
||||
return !paging.value;
|
||||
};
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.reload().catch(() => {});
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.updatePageScrollTop(e.scrollTop);
|
||||
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.pageReachBottom();
|
||||
});
|
||||
|
||||
const toOrder = () => {
|
||||
uni.switchTab({
|
||||
url: '/pages/order/order'
|
||||
});
|
||||
};
|
||||
|
||||
let searchChange = (e) => {
|
||||
query.keyWord = e;
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
let showMode = () => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '暂未开放',
|
||||
showCancel: false,
|
||||
confirmText: '确认',
|
||||
success: () => {}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
/* background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%); */
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.search_header {
|
||||
position: relative;
|
||||
&_blur {
|
||||
width: 100%;
|
||||
height: 185rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #dbe6ff;
|
||||
opacity: 0.8;
|
||||
filter: blur(50px);
|
||||
/* #ifdef MP-ALIPAY */
|
||||
z-index: 0;
|
||||
/* #endif */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
z-index: -1;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
&_grid {
|
||||
// margin: 35rpx 0;
|
||||
margin-top: 25rpx;
|
||||
border-radius: 15rpx;
|
||||
@include flex($space: space-between);
|
||||
&_view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 126rpx;
|
||||
font-size: 26rpx;
|
||||
// background: #ffffff;
|
||||
// border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
image {
|
||||
width: 99rpx;
|
||||
height: 99rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order_list {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
button::after {
|
||||
all: unset;
|
||||
}
|
||||
</style>
|
||||
265
pages/index/components/user/index.vue
Normal file
265
pages/index/components/user/index.vue
Normal file
@@ -0,0 +1,265 @@
|
||||
<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>
|
||||
<cc-myTabbar :tabBarShow="1"></cc-myTabbar>
|
||||
<!-- <tabbar path="/pages/index/index"></tabbar> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { aroundAreaMap, infoAroundApi } from '@/api/api.js';
|
||||
|
||||
let longitude = ref(113.675688);
|
||||
let latitude = ref(34.75527700365562);
|
||||
let mapContext = ref(null);
|
||||
let mapBox = ref(false);
|
||||
let mapLocationRef = ref();
|
||||
|
||||
let infoDz = ref([]);
|
||||
|
||||
let markList = ref([]);
|
||||
|
||||
onLoad(async () => {
|
||||
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>
|
||||
321
pages/index/components/user/mine.vue
Normal file
321
pages/index/components/user/mine.vue
Normal file
@@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<view class="mine">
|
||||
<!-- 头部个人信息 -->
|
||||
<view class="header">
|
||||
<view class="user-info" @click="navTo('/pages/mine/sett')">
|
||||
<up-avatar size="120rpx" :src="user.avatar" />
|
||||
<view class="user-detail">
|
||||
<text class="nickname">{{ user.nickName || user.username }}</text>
|
||||
<text class="phone">{{ user.phone || user.mobile }}</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="">
|
||||
<text class="amount">{{ user.balance || '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="navTo('/pageInvest/facility/facility')">
|
||||
<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 menuItemsIsInvest" :key="index" @click="handleMenuClick(item)">
|
||||
<image :src="item.icon" mode="aspectFit" />
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 功能菜单 -->
|
||||
<view class="menu-grid">
|
||||
<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>
|
||||
|
||||
<cc-myTabbar :tabBarShow="4" />
|
||||
</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 { userHook } from '@/hooks/userInfo.js';
|
||||
import { lookImg} from '@/utils/fun.js';
|
||||
|
||||
|
||||
const { navTo } = useNav();
|
||||
const { user, isInvest } = userHook();
|
||||
|
||||
const menuItemsIsInvest = ref([
|
||||
{ name: '我的订单', icon: '/static/icon/mine/order.png', path: '/pages/order/order' },
|
||||
{ name: '商城', icon: '/static/icon/mine/shop.png', path: '/pageInvest/shop/shop' },
|
||||
{ name: '我的银行卡', icon: '/static/icon/mine/travel.png', path: '/pages/bank/bank' },
|
||||
{ name: '切换账号', icon: '/static/icon/mine/switch.png', path: '/pageInvest/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) {
|
||||
navTo(item.path);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
});
|
||||
|
||||
onShow(async () => {
|
||||
isInvest.value = uni.getStorageSync('isInvest') || false;
|
||||
if (isInvest.value) {
|
||||
menuItems.value[6].name = '充电模式';
|
||||
} else {
|
||||
menuItems.value[6].name = '投资者平台';
|
||||
}
|
||||
});
|
||||
</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>
|
||||
130
pages/index/components/user/sweep.vue
Normal file
130
pages/index/components/user/sweep.vue
Normal file
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<view class="sweep">
|
||||
<statusBar />
|
||||
<view class="sweep_note">
|
||||
<view class="sweep_note_view">
|
||||
<view class="sweep_note_view_img">
|
||||
<image src="/static/image/djk.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view>插上</view>
|
||||
<view>充电枪</view>
|
||||
</view>
|
||||
<view class="sweep_note_view">
|
||||
<view class="sweep_note_view_img">
|
||||
<image src="/static/image/djs.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view>点击</view>
|
||||
<view>扫码充电</view>
|
||||
</view>
|
||||
<view class="sweep_note_view">
|
||||
<view class="sweep_note_view_img">
|
||||
<image src="/static/image/cs.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view>点击</view>
|
||||
<view>开始充电</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="sweep_scan" style="margin-top: 300rpx">
|
||||
<up-input placeholder="请输入充电枪编号" type="number" border="surround" v-model="value"></up-input>
|
||||
<view style="width: 100rpx">
|
||||
<up-button type="primary" text="确定" @click="toCd"></up-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="sweep_scan" style="margin-top: 150rpx">
|
||||
<up-button @click="scan" type="primary" shape="circle" text="扫码充电"></up-button>
|
||||
</view>
|
||||
|
||||
<cc-myTabbar :tabBarShow="2"></cc-myTabbar>
|
||||
|
||||
<!-- <tabbar path="/pages/sweep/sweep" /> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
import { urlQuery } from '@/utils/fun.js';
|
||||
const { nav, navTo } = useNav();
|
||||
|
||||
let value = ref('');
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
});
|
||||
|
||||
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>
|
||||
268
pages/index/index - 副本.vue
Normal file
268
pages/index/index - 副本.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<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>
|
||||
<cc-myTabbar :tabBarShow="1"></cc-myTabbar>
|
||||
<!-- <tabbar path="/pages/index/index"></tabbar> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { aroundAreaMap, infoAroundApi } from '@/api/api.js';
|
||||
|
||||
let longitude = ref(113.675688);
|
||||
let latitude = ref(34.75527700365562);
|
||||
let mapContext = ref(null);
|
||||
let mapBox = ref(false);
|
||||
let mapLocationRef = ref();
|
||||
|
||||
let infoDz = ref([]);
|
||||
|
||||
let markList = ref([]);
|
||||
|
||||
onLoad(async () => {
|
||||
// #ifndef MP-WEIXIN
|
||||
uni.hideTabBar();
|
||||
// #endif
|
||||
mapContext.value = uni.createMapContext('map');
|
||||
const { longitude: lon, latitude: lat } = await uni.getLocation({
|
||||
type: 'gcj02' // 根据实际需要选择坐标系
|
||||
});
|
||||
latitude.value = lat;
|
||||
longitude.value = lon;
|
||||
getInfo();
|
||||
setTimeout(() => {
|
||||
mapLocation();
|
||||
}, 300);
|
||||
});
|
||||
|
||||
let getInfo = async () => {
|
||||
let _res = await aroundAreaMap({
|
||||
orderByType: 1,
|
||||
lat: latitude.value,
|
||||
lon: longitude.value
|
||||
});
|
||||
|
||||
let list = _res.map((item, index) => {
|
||||
return {
|
||||
id: item.id,
|
||||
longitude: item.location.lng,
|
||||
latitude: item.location.lat,
|
||||
iconPath: '/static/icon/marker-pointer.png',
|
||||
width: 20,
|
||||
height: 23,
|
||||
content: '2',
|
||||
gunUseCount: item.gunUseCount,
|
||||
gunCount: item.gunCount,
|
||||
distance: item.distance,
|
||||
customCallout: {
|
||||
display: 'ALWAYS', // 显示方式
|
||||
anchorX: 0, // 锚点X轴
|
||||
anchorY: -10 // 锚点Y轴
|
||||
}
|
||||
};
|
||||
});
|
||||
list.unshift({
|
||||
longitude: longitude.value,
|
||||
latitude: latitude.value,
|
||||
iconPath: '/static/icon/my-location-default.png',
|
||||
width: 45,
|
||||
height: 45,
|
||||
id: -1
|
||||
});
|
||||
markList.value = list;
|
||||
};
|
||||
|
||||
const mapLocation = () => {
|
||||
const log = longitude.value;
|
||||
const lat = latitude.value;
|
||||
mapContext.value.moveToLocation({
|
||||
longitude: log,
|
||||
latitude: lat
|
||||
});
|
||||
};
|
||||
|
||||
// 地图缩放移动触发
|
||||
const regionchange = (e) => {
|
||||
// 地图移动手松开结束触发type:end
|
||||
if (e.type == 'end') {
|
||||
console.log(e);
|
||||
console.log(e.detail.scale);
|
||||
mapBox.value = false;
|
||||
mapLocationRefStep(false);
|
||||
}
|
||||
};
|
||||
|
||||
// marker点击事件
|
||||
const markerClick = async (e) => {
|
||||
console.log(e, 'eeeeeee');
|
||||
|
||||
if (e.markerId == -1) {
|
||||
return;
|
||||
}
|
||||
uni.showLoading();
|
||||
let _res = await infoAroundApi({
|
||||
id: e.markerId
|
||||
});
|
||||
|
||||
let markerInfo = markList.value.find((val) => val.id == e.markerId);
|
||||
let data = _res?.priceList?.find((val) => val.isCurrent == 1);
|
||||
|
||||
infoDz.value = {
|
||||
..._res,
|
||||
distance: markerInfo.distance,
|
||||
priceAmount: data.totalAmount
|
||||
};
|
||||
|
||||
console.log(infoDz, 'infoDzinfoDz');
|
||||
// infoDz.value.priceAmount = data.totalAmount;
|
||||
// infoDz.value.distance = data.distance;
|
||||
uni.hideLoading();
|
||||
mapBox.value = true;
|
||||
mapLocationRefStep(true);
|
||||
};
|
||||
|
||||
const mapLocationRefStep = (type) => {
|
||||
if (type) {
|
||||
mapLocationRef.value.step(
|
||||
{
|
||||
translateY: '-200rpx'
|
||||
},
|
||||
{
|
||||
timingFunction: 'ease-in',
|
||||
duration: 100
|
||||
}
|
||||
);
|
||||
} else {
|
||||
mapLocationRef.value.step(
|
||||
{
|
||||
translateY: '0rpx'
|
||||
},
|
||||
{
|
||||
timingFunction: 'ease',
|
||||
duration: 500
|
||||
}
|
||||
);
|
||||
}
|
||||
mapLocationRef.value.run();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.map_content {
|
||||
width: 750rpx;
|
||||
height: 100vh;
|
||||
/* #ifdef MP-ALIPAY */
|
||||
height: calc(100vh - 100upx);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.map-location {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
left: 30rpx;
|
||||
bottom: 570rpx;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 5px 11px rgba(0, 0, 0, 0.2);
|
||||
|
||||
image {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.callout {
|
||||
box-sizing: border-box;
|
||||
background: rgba(15, 75, 203, 0.26);
|
||||
border-radius: 15rpx 15rpx 15rpx 0;
|
||||
padding: 10rpx 15rpx;
|
||||
@include flex($direction: column);
|
||||
&_item {
|
||||
@include flex;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
box-sizing: border-box;
|
||||
&_img {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
&_item:nth-child(1) {
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.recharge {
|
||||
width: 690rpx;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
position: fixed;
|
||||
left: 30rpx;
|
||||
bottom: 250rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-shadow: 0 5px 11px rgba(0, 0, 0, 0.2);
|
||||
|
||||
&_title {
|
||||
font-size: 36rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
&_con {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.map_box {
|
||||
width: 690rpx;
|
||||
position: fixed;
|
||||
left: 30rpx;
|
||||
bottom: 230rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
||||
49
pages/index/index.vue
Normal file
49
pages/index/index.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="!isInvest"></view>
|
||||
<view v-else>
|
||||
<view>
|
||||
<pageA ref="pageA" />
|
||||
</view>
|
||||
<view>
|
||||
<pageB ref="pageB" />
|
||||
</view>
|
||||
<view>
|
||||
<pageC ref="pageC" />
|
||||
</view>
|
||||
<view>
|
||||
<pageE ref="pageE" />
|
||||
</view>
|
||||
<view>
|
||||
<pageF ref="pageF" />
|
||||
</view>
|
||||
</view>
|
||||
<cc-myTabbar ref="myTabbar" :tabBarShow="1" @tabChange="tabChange"></cc-myTabbar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { userHook } from '@/hooks/userInfo.js';
|
||||
|
||||
import pageA from '@/pages/index/components/user/home.vue';
|
||||
import pageB from '@/pages/index/components/user/index.vue';
|
||||
import pageC from '@/pages/index/components/user/sweep.vue';
|
||||
import pageE from '@/pages/index/components/user/find.vue';
|
||||
import pageF from '@/pages/index/components/user/mine.vue';
|
||||
|
||||
const { isInvest } = userHook();
|
||||
let tabBarShow = ref(1);
|
||||
|
||||
onLoad(() => {
|
||||
console.log(12354);
|
||||
tabChange();
|
||||
});
|
||||
|
||||
const tabChange = (e) => {
|
||||
console.log('-----------');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
166
pages/login/login.vue
Normal file
166
pages/login/login.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="head">
|
||||
<image src="/static/image/login26_bg.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="title">
|
||||
<text class="name">Hello!</text>
|
||||
<text class="sub-name">欢迎登录电小芮</text>
|
||||
</view>
|
||||
<view class="form-box">
|
||||
<button class="login-btn" :disabled="!aloneChecked" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">一键注册登录</button>
|
||||
<view class="tip-link" style="display: flex; align-items: center">
|
||||
<up-checkbox shape="circle" name="agree" usedAlone @change="change"></up-checkbox>
|
||||
我已阅读并同意
|
||||
<text @click="toNav('/pages/agreement/agreement?id=9')">用户协议</text>
|
||||
和
|
||||
<text @click="toNav('/pages/agreement/agreement?id=10')">隐私政策</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { login } from '@/common/js/user.js';
|
||||
|
||||
let aloneChecked = ref(false);
|
||||
|
||||
let getPhoneNumber = async (e) => {
|
||||
if (!aloneChecked.value) {
|
||||
return uni.showToast({
|
||||
title: '请先阅读并同意用户协议和隐私政策',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
try {
|
||||
login(e, 2);
|
||||
// let token = uni.getStorageSync('token');
|
||||
|
||||
// if (!token) {
|
||||
// login(e, 2);
|
||||
// } else {
|
||||
// login();
|
||||
// uni.navigateBack();
|
||||
// }
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const toNav = (e) => {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
});
|
||||
};
|
||||
|
||||
const change = (e) => {
|
||||
aloneChecked.value = e;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #e9edf6;
|
||||
}
|
||||
|
||||
.head {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 30vh;
|
||||
z-index: -1;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
padding-left: 80rpx;
|
||||
padding-top: 100rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
height: 30vh;
|
||||
|
||||
.name {
|
||||
font-size: 70rpx;
|
||||
line-height: 100rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sub-name {
|
||||
line-height: 80rpx;
|
||||
font-size: 45rpx;
|
||||
letter-spacing: 8rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.form-box {
|
||||
padding: 0rpx 80rpx;
|
||||
|
||||
.row-input {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
margin: 50rpx 0rpx;
|
||||
|
||||
image {
|
||||
margin: 0 25rpx;
|
||||
flex-shrink: 0;
|
||||
width: 31rpx;
|
||||
height: 35rpx;
|
||||
}
|
||||
|
||||
input {
|
||||
font-size: 30rpx;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-link {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 250rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 90rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: #819682;
|
||||
color: #f4f4f4;
|
||||
font-size: 30rpx;
|
||||
letter-spacing: 5rpx;
|
||||
box-shadow: 0rpx 5rpx 20rpx #94ac95;
|
||||
}
|
||||
|
||||
.tip-link {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
letter-spacing: 3rpx;
|
||||
line-height: 150rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
text {
|
||||
color: #57a2ee;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
100
pages/mine/car/add.vue
Normal file
100
pages/mine/car/add.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="container_block">
|
||||
<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>
|
||||
<car-number-input @numberInputResult="numberInputResult"></car-number-input>
|
||||
<view style="color: #6fa256; font-size: 24rpx; margin-top: 40rpx">绑定车牌后,在指定充电站可享减免停车费或免费停车</view>
|
||||
</view>
|
||||
<button class="confirm-button" @click="submit">确定</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { carAdd } from '@/api/api.js';
|
||||
|
||||
let formData = ref({
|
||||
licensePlate: '',
|
||||
isDefault: 0
|
||||
});
|
||||
|
||||
const numberInputResult = (e) => {
|
||||
formData.value.licensePlate = e;
|
||||
};
|
||||
|
||||
const submit = () => {
|
||||
carAdd(formData.value).then((res) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '添加成功',
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateBack();
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
padding: 30rpx;
|
||||
|
||||
&_block {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
padding: 28rpx 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-button {
|
||||
width: 488rpx;
|
||||
height: 86rpx;
|
||||
background: #6fa256;
|
||||
border-radius: 44rpx 44rpx 44rpx 44rpx;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 332rpx;
|
||||
}
|
||||
|
||||
.vehicle-status {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-bottom: 25rpx;
|
||||
.status-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
image {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
text {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
144
pages/mine/car/car.vue
Normal file
144
pages/mine/car/car.vue
Normal file
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<view class="car-list">
|
||||
<view class="car-item" v-for="(car, index) in cars" :key="index">
|
||||
<view class="car-number">
|
||||
<view>NO{{ index + 1 }}.</view>
|
||||
<image @click="delCar(car)" src="/static/image/cardel.png" style="width: 40rpx; height: 40rpx"></image>
|
||||
</view>
|
||||
<view class="car-info">
|
||||
<view>
|
||||
<view class="car-default">
|
||||
<view>默认车辆</view>
|
||||
</view>
|
||||
|
||||
<view class="car-plate">
|
||||
<image style="width: 198rpx; height: 56rpx; position: absolute; top: 0; left: 0" src="/static/image/carNum.png"></image>
|
||||
<text>{{ car.licensePlate }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<image :src="car.image" class="car-image" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="add-car">
|
||||
<view class="add-car-jia">+</view>
|
||||
<view @click="navTo('/pages/mine/car/add')">添加我的爱车</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
import { carList, carDel } from '@/api/api.js';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
const { navTo } = useNav();
|
||||
const cars = ref([]);
|
||||
|
||||
onLoad(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
const getList = () => {
|
||||
carList().then((res) => {
|
||||
cars.value = res.map((item, index) => {
|
||||
return {
|
||||
...item,
|
||||
image: '/static/image/car-image.png'
|
||||
};
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const delCar = (item) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否删除该车辆信息?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
carDel(item.id).then((res) => {
|
||||
getList();
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.car-list {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.car-item {
|
||||
width: 100%;
|
||||
padding: 24rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
margin-bottom: 20rpx;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: space-between;
|
||||
}
|
||||
.car-number {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-weight: bold;
|
||||
}
|
||||
.car-info {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.car-default {
|
||||
font-size: 26rpx;
|
||||
margin-bottom: 45rpx;
|
||||
}
|
||||
|
||||
.car-plate {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 198rpx;
|
||||
height: 56rpx;
|
||||
text {
|
||||
position: relative;
|
||||
z-index: 99;
|
||||
}
|
||||
}
|
||||
.car-image {
|
||||
width: 336rpx;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.add-car {
|
||||
width: 690rpx;
|
||||
height: 176rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #232323;
|
||||
}
|
||||
.add-car-jia {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
background: rgba(111, 162, 86, 0.1);
|
||||
border-radius: 50%;
|
||||
font-weight: 500;
|
||||
color: rgba(111, 162, 86, 1);
|
||||
font-size: 70rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
margin-right: 25rpx;
|
||||
}
|
||||
</style>
|
||||
96
pages/mine/card.vue
Normal file
96
pages/mine/card.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<view class="earnings p30">
|
||||
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
|
||||
<view style="margin-bottom: 30rpx" @click="toCrud(item)" class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
|
||||
<view style="color: #fff">
|
||||
<view style="font-weight: bold; font-size: 32rpx; margin-bottom: 18rpx">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view style="margin-bottom: 12rpx; font-size: 28rpx; color: #eee">
|
||||
卡号:{{ item.cardNo }}
|
||||
</view>
|
||||
<view style="margin-bottom: 12rpx; font-size: 28rpx; color: #eee">
|
||||
电站:{{ item.stationName }}
|
||||
</view>
|
||||
<view style="font-size: 28rpx; color: #eee">
|
||||
商户:{{ item.merchantName }}
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex; flex-direction: column; align-items: center; color: #fff; font-weight: bold; font-size: 26rpx">
|
||||
<view style="font-size: 55rpx; margin-bottom: 30rpx">{{ item.balance }}</view>
|
||||
<view style="font-weight: 500">余额</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, computed } from 'vue';
|
||||
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { timeFormat } from '@/uni_modules/uview-plus';
|
||||
import { userCardList } from '@/api/api.js';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
|
||||
const changeSele = (e) => {
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
const { nav, navTo } = useNav();
|
||||
let getInfo = ref({});
|
||||
const paging = ref(null);
|
||||
let dataList = ref([]);
|
||||
|
||||
let isPagingRefNotFound = () => {
|
||||
return !paging.value;
|
||||
};
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.reload().catch(() => {});
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.updatePageScrollTop(e.scrollTop);
|
||||
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.pageReachBottom();
|
||||
});
|
||||
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
current: pageNo,
|
||||
pageSize: pageSize
|
||||
};
|
||||
|
||||
userCardList(params)
|
||||
.then((res) => {
|
||||
paging.value.complete(res);
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
|
||||
let toCrud = ()=>{
|
||||
uni.navigateTo({
|
||||
url:'./cardList?id=' + e.id
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wallet_list {
|
||||
border-radius: 15rpx;
|
||||
background-color: #4879e6;
|
||||
padding: 35rpx 50rpx 35rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
151
pages/mine/cardList.vue
Normal file
151
pages/mine/cardList.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<view class="earnings p30">
|
||||
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
|
||||
<view style="margin-bottom: 30rpx" class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="wallet_list_left">
|
||||
<view>{{ item.recordName || '-' }}</view>
|
||||
<view>{{ item.createTime }}</view>
|
||||
</view>
|
||||
<view class="wallet_list_right" style="display: flex; flex-direction: column; align-items: flex-end">
|
||||
<!-- <view style="margin-bottom: 10rpx; width: 75rpx">
|
||||
<view></view>
|
||||
<up-tag v-if="item.pointType == 2" size="mini" text="余额" type="warning" plain plainFill></up-tag>
|
||||
<up-tag v-if="item.pointType == 1" size="mini" text="收益" plain plainFill></up-tag>
|
||||
</view> -->
|
||||
<view>{{ item.amount }}元</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, computed } from 'vue';
|
||||
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { timeFormat } from '@/uni_modules/uview-plus';
|
||||
import { userCardRecord } from '@/api/api.js';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
|
||||
let id = ref('');
|
||||
|
||||
const changeSele = (e) => {
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
const { nav, navTo } = useNav();
|
||||
let getInfo = ref({});
|
||||
const paging = ref(null);
|
||||
let dataList = ref([]);
|
||||
|
||||
let isPagingRefNotFound = () => {
|
||||
return !paging.value;
|
||||
};
|
||||
|
||||
onLoad((options) => {
|
||||
id.value = options.id;
|
||||
});
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.reload().catch(() => {});
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.updatePageScrollTop(e.scrollTop);
|
||||
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.pageReachBottom();
|
||||
});
|
||||
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
current: pageNo,
|
||||
pageSize: pageSize,
|
||||
id: id.value
|
||||
};
|
||||
|
||||
userCardRecord(params)
|
||||
.then((res) => {
|
||||
paging.value.complete(res);
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wallet_pall {
|
||||
width: 690rpx;
|
||||
height: 272rpx;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 40rpx;
|
||||
background: #ffffff;
|
||||
&_header {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
&_ye {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 70%;
|
||||
view:nth-child(1) {
|
||||
font-weight: bold;
|
||||
font-size: 68rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
width: 128rpx;
|
||||
height: 58rpx;
|
||||
background: rgba(0, 46, 164, 0.07);
|
||||
border-radius: 32rpx 32rpx 32rpx 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wallet_list {
|
||||
width: 690rpx;
|
||||
// height: 120rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
padding: 15rpx 30rpx;
|
||||
@include flex($space: space-between);
|
||||
&_left {
|
||||
view:nth-child(1) {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
view:nth-child(3) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
view:nth-child(4) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
}
|
||||
&_right {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #ff2727;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
18
pages/mine/earnings.vue
Normal file
18
pages/mine/earnings.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<view class="earnings">
|
||||
<up-cell-group>
|
||||
<up-cell icon="integral-fill" title="会员等级" value="新版本"></up-cell>
|
||||
</up-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
225
pages/mine/incomeList.vue
Normal file
225
pages/mine/incomeList.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="balance-section text-center">
|
||||
<view class="grey-text mb12">总余额(元)</view>
|
||||
<view class="amount">{{ info.balance || 0 }}</view>
|
||||
<view class="details">
|
||||
<view class="detail-item right-border">
|
||||
<view class="grey-text mb12">可提取金额</view>
|
||||
<view class="text-40-bold">{{ userInfo.balance || 0 }}</view>
|
||||
</view>
|
||||
<view class="detail-item">
|
||||
<view class="grey-text mb12">冻结金额</view>
|
||||
<view class="text-40-bold">0</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="transaction-section">
|
||||
<view class="transaction-date">
|
||||
<picker mode="date" :value="date" fields="month" @change="bindDateChange">
|
||||
<text>{{ date }}</text>
|
||||
<image src="/static/icon/xai.png"></image>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="text-24-bold mx-24">充值¥{{ statistics.inMoney }} 提现/支出人民币{{ statistics.outMoney }}</view>
|
||||
<z-paging ref="paging" v-model="recordData" use-page-scroll @query="queryList">
|
||||
<view class="transaction-list">
|
||||
<view class="transaction-item" v-for="(item, index) in recordData" :key="index">
|
||||
<text class="text-24-bold" :class="[getItemColor(item.sourceType)]">
|
||||
{{item.recordName}}{{item.amount}}
|
||||
</text>
|
||||
<view class="line"></view>
|
||||
<text class="text-24-bold">{{item.createTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
|
||||
<view class="button-section">
|
||||
<!-- <button class="withdraw-button">提现</button> -->
|
||||
<button class="recharge-button" @click="navTo('/pages/money/recharge')">充值</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { userInfo, walletRecord } from '@/api/api.js';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
const { navTo } = useNav();
|
||||
|
||||
const info = ref({});
|
||||
const date = ref()
|
||||
const statistics = reactive({
|
||||
outMoney: 0,
|
||||
inMoney: 0,
|
||||
})
|
||||
const paging = ref()
|
||||
|
||||
const currentDate = new Date();
|
||||
const year = currentDate.getFullYear();
|
||||
const month = currentDate.getMonth() + 1;
|
||||
date.value = year + "-" + (month < 10 ? "0" + month : month);
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await userInfo();
|
||||
info.value = res;
|
||||
});
|
||||
|
||||
const recordData = ref()
|
||||
const getItemColor = v => {
|
||||
if (v == 11) {
|
||||
return "text-green-dark"
|
||||
} else if(v == 21) {
|
||||
return "text-red"
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
const queryList = async (pageNo, pageSize) => {
|
||||
walletRecord({
|
||||
current: pageNo,
|
||||
pageSize,
|
||||
time: date.value
|
||||
})
|
||||
.then((res) => {
|
||||
statistics.inMoney = res.inMoney;
|
||||
statistics.outMoney = res.outMoney;
|
||||
paging.value.complete(res.record);
|
||||
uni.hideLoading();
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
uni.hideLoading();
|
||||
});
|
||||
};
|
||||
const bindDateChange = e => {
|
||||
date.value = e.detail.value;
|
||||
paging.value.reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
// padding: 36rpx 30rpx;
|
||||
.balance-section {
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx;
|
||||
margin: 36rpx 30rpx;
|
||||
padding: 36rpx 48rpx;
|
||||
.grey-text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
.amount {
|
||||
font-weight: bold;
|
||||
font-size: 54rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
.details {
|
||||
border-top: 2rpx solid #EEEEEE;
|
||||
padding-top: 20rpx;
|
||||
display: flex;
|
||||
.detail-item {
|
||||
width: 50%;
|
||||
}
|
||||
.right-border {
|
||||
border-right: 2rpx solid #EEEEEE;
|
||||
}
|
||||
}
|
||||
}
|
||||
.text-40-bold {
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #232323;
|
||||
}
|
||||
.text-24-bold {
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
.mb12 {
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
.transaction-section {
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx;
|
||||
margin: 36rpx 30rpx;
|
||||
.transaction-date {
|
||||
font-family: DIN, DIN;
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #232323;
|
||||
padding: 24rpx 24rpx 14rpx;
|
||||
image {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-left: 18rpx;
|
||||
}
|
||||
}
|
||||
.mx-24 {
|
||||
margin-left: 24rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.transaction-list {
|
||||
padding: 36rpx 24rpx;
|
||||
.transaction-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 24rpx;
|
||||
.line {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
border-top: 2rpx dashed #999999;
|
||||
margin: 0 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.text-green-dark {
|
||||
color: #6FA256;
|
||||
}
|
||||
.text-green-bright {
|
||||
color: #3BCF73;
|
||||
}
|
||||
.text-red {
|
||||
color: #FF2C2C;
|
||||
}
|
||||
.button-section {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
left: 0;
|
||||
bottom: 76rpx;
|
||||
.withdraw-button, .recharge-button {
|
||||
width: 330rpx;
|
||||
height: 92rpx;
|
||||
line-height: 92rpx;
|
||||
border-radius: 46rpx;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
margin: 0;
|
||||
border-width: 0;
|
||||
}
|
||||
.withdraw-button::after, .recharge-button::after {
|
||||
border-width: 0;
|
||||
}
|
||||
.withdraw-button {
|
||||
background: #eaf1e7;
|
||||
color: #77B658;
|
||||
}
|
||||
.recharge-button {
|
||||
background: #77B658;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
322
pages/mine/mine.vue
Normal file
322
pages/mine/mine.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<view class="mine">
|
||||
<!-- 头部个人信息 -->
|
||||
<view class="header">
|
||||
<view class="user-info" @click="navTo('/pages/mine/sett')">
|
||||
<up-avatar size="120rpx" :src="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>
|
||||
<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="">
|
||||
<text class="amount">{{ user.balance || '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="navTo('/pageInvest/facility/facility')">
|
||||
<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 menuItemsIsInvest" :key="index" @click="handleMenuClick(item)">
|
||||
<image :src="item.icon" mode="aspectFit" />
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 功能菜单 -->
|
||||
<view class="menu-grid">
|
||||
<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>
|
||||
|
||||
<cc-myTabbar :tabBarShow="4" />
|
||||
</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 { userHook } from '@/hooks/userInfo.js';
|
||||
import { lookImg } from '@/utils/fun.js';
|
||||
|
||||
const { navTo } = useNav();
|
||||
const { user, isInvest } = userHook();
|
||||
|
||||
const menuItemsIsInvest = ref([
|
||||
{ name: '我的订单', icon: '/static/icon/mine/order.png', path: '/pages/order/order' },
|
||||
{ name: '商城', icon: '/static/icon/mine/shop.png', path: '/pageInvest/shop/shop' },
|
||||
{ name: '我的银行卡', icon: '/static/icon/mine/travel.png', path: '/pages/bank/bank' },
|
||||
{ name: '切换账号', icon: '/static/icon/mine/switch.png', path: '/pageInvest/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) {
|
||||
navTo(item.path);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {});
|
||||
|
||||
onShow(async () => {
|
||||
isInvest.value = uni.getStorageSync('isInvest') || false;
|
||||
if (isInvest.value) {
|
||||
menuItems.value[6].name = '充电模式';
|
||||
} else {
|
||||
menuItems.value[6].name = '投资者平台';
|
||||
}
|
||||
});
|
||||
</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>
|
||||
41
pages/mine/multipleNumbers.vue
Normal file
41
pages/mine/multipleNumbers.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<view class="p30" style="padding: 30rpx">
|
||||
<view class="multipleNumbers_1">
|
||||
<view class="multipleNumbers_1_info" style="width: 330rpx">
|
||||
<view style="font-weight: bold; font-size: 40rpx; color: #232323; margin-bottom: 36rpx">开通一号多充</view>
|
||||
<view style="font-weight: 400; font-size: 24rpx; color: #333333; text-align: left">
|
||||
开通后,可以让您使用同一个 账号,同时给多辆车进行充电。 你可以按需调整同时充电的数量
|
||||
</view>
|
||||
</view>
|
||||
<image style="width: 330rpx" mode="widthFix" src="/static/image/Multiple_numbers.png"></image>
|
||||
</view>
|
||||
<view style="height: 30rpx"></view>
|
||||
<view class="multipleNumbers_1">
|
||||
<view style="font-weight: bold; font-size: 32rpx; color: #232323">开通一号多充</view>
|
||||
<view style="display: flex; align-items: center">
|
||||
<view>1</view>
|
||||
<image src="/static/icon/youjin.png" style="width: 28rpx; margin-left: 15rpx" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.multipleNumbers_1 {
|
||||
background: #ffffff;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
padding: 25rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
84
pages/mine/sett.vue
Normal file
84
pages/mine/sett.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<view class="p30">
|
||||
<view style="background-color: #fff; border-radius: 15rpx">
|
||||
<up-cell-group :border="false">
|
||||
<button style="all: unset" open-type="chooseAvatar" @chooseavatar="chooseAvatar">
|
||||
<up-cell title="头像" :isLink="true" size="min">
|
||||
<template #value>
|
||||
<up-avatar :src="user.avatarUrl || user.avatar"></up-avatar>
|
||||
</template>
|
||||
</up-cell>
|
||||
</button>
|
||||
<up-cell title="昵称" :isLink="true" size="min" @click="upNickName">
|
||||
<template #value>
|
||||
<text class="u-slot-value">{{ user.nickname || user.nickName }}</text>
|
||||
</template>
|
||||
</up-cell>
|
||||
<up-cell title="手机号" size="min" :border="false">
|
||||
<template #value>
|
||||
<text class="u-slot-value">{{ user.mobile || user.phone || '-' }}</text>
|
||||
</template>
|
||||
</up-cell>
|
||||
</up-cell-group>
|
||||
</view>
|
||||
<view style="height: 100rpx"></view>
|
||||
<up-button type="error" text="退出登录" @click="outLogin"></up-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { investUserModify, updateNickName, updateAvatar } from '@/api/api.js';
|
||||
import { ref } from 'vue';
|
||||
import { uploadFiles } from '@/utils/fun.js';
|
||||
import { userHook } from '@/hooks/userInfo.js';
|
||||
const { user, isInvest, fetchUserData } = userHook();
|
||||
|
||||
const chooseAvatar = async (e) => {
|
||||
let img = await uploadFiles(e.detail.avatarUrl);
|
||||
console.log(img);
|
||||
isInvest.value ? await investUserModify({ ...user, avatarUrl: img }) : await updateAvatar({ avatar: img });
|
||||
fetchUserData();
|
||||
};
|
||||
|
||||
const upNickName = () => {
|
||||
uni.showModal({
|
||||
title: '修改昵称',
|
||||
content: user.nickname || user.nickName || "",
|
||||
editable: true,
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
isInvest.value ? await investUserModify({ ...user, nickname: res.content }) : await updateNickName({ nickName: res.content });
|
||||
fetchUserData()
|
||||
console.log(res);
|
||||
console.log('用户点击确定');
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const outLogin = () => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认退出登录?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.clearStorageSync();
|
||||
uni.reLaunch({
|
||||
url: '/pages/home/home'
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
button::after {
|
||||
all: unset;
|
||||
}
|
||||
</style>
|
||||
109
pages/mine/signIn.vue
Normal file
109
pages/mine/signIn.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<view>
|
||||
<gb-qiandao
|
||||
:days="dayInfo.day"
|
||||
:taskList="dayInfo.taskStatusParams"
|
||||
:completeDay="dayInfo.day"
|
||||
:dayList="dayList"
|
||||
:taskStatus="dayInfo.isSignInToday"
|
||||
@receiveMoney="receiveMoney"
|
||||
@listTab="listTab"
|
||||
></gb-qiandao>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { findSignInRecord, signIn, shareMiniProgram } from '@/api/api.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 签到天数
|
||||
days: 0,
|
||||
// 签到任务第一个
|
||||
play_number: 0,
|
||||
// 签到任务第二个
|
||||
search_number: 0,
|
||||
// 签到任务第三个
|
||||
full_ad: 0,
|
||||
// 已完成天数
|
||||
completeDay: 0,
|
||||
// 签到状态 0.代表未签到 1.代表已签到
|
||||
taskStatus: 0,
|
||||
// 签到规则
|
||||
rule: '这里是签到规则,你可以任意编辑',
|
||||
// 签到任务奖励数组
|
||||
dayList: [1, 1, 2, 3, 5, 6, 7],
|
||||
// 签到任务
|
||||
taskList: [
|
||||
{
|
||||
title: '试玩游戏',
|
||||
img: '../../static/yx.png',
|
||||
number: 1,
|
||||
dec: '完成游戏赚相关游戏'
|
||||
},
|
||||
{
|
||||
title: '试玩应用',
|
||||
img: '../../static/zl.png',
|
||||
number: 1,
|
||||
dec: '完成应用赚相关任务'
|
||||
},
|
||||
{
|
||||
title: '观看广告',
|
||||
img: '../../static/kgg.png',
|
||||
number: 10,
|
||||
dec: '观看广告赚相关广告'
|
||||
}
|
||||
],
|
||||
dayInfo: {}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
// 获取用户签到得相关信息,自己写接口获取即可
|
||||
getData() {
|
||||
findSignInRecord().then((res) => {
|
||||
this.dayInfo = res;
|
||||
});
|
||||
},
|
||||
// 签到并领取奖励
|
||||
receiveMoney() {
|
||||
signIn().then((res) => {
|
||||
uni.showToast({
|
||||
title: '签到成功',
|
||||
icon: 'none',
|
||||
position: 'bottom'
|
||||
});
|
||||
this.getData();
|
||||
});
|
||||
},
|
||||
|
||||
// 签到任务完成
|
||||
listTab(i) {
|
||||
if (i == 0) {
|
||||
uni.showToast({
|
||||
title: '跳转第一个任务',
|
||||
icon: 'none',
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
if (i == 1) {
|
||||
uni.showToast({
|
||||
title: '跳转第二个任务',
|
||||
icon: 'none',
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
if (i == 2) {
|
||||
shareMiniProgram().then((res) => {
|
||||
this.getData();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
341
pages/money/recharge.vue
Normal file
341
pages/money/recharge.vue
Normal file
@@ -0,0 +1,341 @@
|
||||
<template>
|
||||
<view class="buy">
|
||||
<view class="title">
|
||||
<!-- <image src="../../static/image/travel/matching/buy.png"></image> -->
|
||||
<text class="text">当前余额:</text>
|
||||
<text class="num">{{info.balance}}</text>
|
||||
</view>
|
||||
<view class="number">
|
||||
<view class="list">
|
||||
<view :class="num == index ? 'item real' : 'item'" v-for="(item, index) in list" :key="index" @click="pick(item, index)">
|
||||
<view class="card">
|
||||
<view class="top">
|
||||
<text>{{ item.number }}</text>
|
||||
</view>
|
||||
<!-- <text class="money">{{ item.money }}元</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view :class="num == 'input' ? 'item real' : 'item'" @click="pick('input', 'input')">
|
||||
<view class="card">
|
||||
<view class="top" style="padding: 0 15rpx; text-align: center">
|
||||
<input @change="inputChange" placeholder="其他面额" style="font-weight: bold; color: #666666" v-model="moneyNum" type="number" />
|
||||
</view>
|
||||
<!-- <text class="money">{{ item.money }}元</text> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip">
|
||||
<text class="titl">温馨提示</text>
|
||||
<view>
|
||||
<text>1、本次充值金额尽可用于充电消费</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>2、若充值时若使用了第三方优惠抵扣时,该笔金额不支持直接退款</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="position: fixed; bottom: 0; left: 0; width: 750rpx">
|
||||
<view style="display: flex; align-items: center; justify-content: center; font-size: 26rpx; background-color: rgba(72, 121, 230, 0.3); padding: 15rpx 0">
|
||||
<up-checkbox shape="circle" name="agree" usedAlone @change="change"></up-checkbox>
|
||||
我已阅读并同意《
|
||||
<text style="color: #4879e6">云充电用户充值协议</text>
|
||||
》
|
||||
</view>
|
||||
<view style="display: flex; align-items: center; justify-content: space-between; padding: 20rpx 30rpx">
|
||||
<view style="font-size: 40rpx; font-weight: bold">
|
||||
{{ money }}
|
||||
<text style="font-size: 26rpx; font-weight: 500">元</text>
|
||||
</view>
|
||||
<view style="width: 220rpx">
|
||||
<up-button @click="toUp" color="#4879e6" text="充值" shape="circle" :disabled="!aloneChecked"></up-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { jqbPay,userInfo,adaPay } from '@/api/api.js';
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app';
|
||||
let info = ref({});
|
||||
let money = ref(30);
|
||||
let moneyNum = ref('');
|
||||
let num = ref(0);
|
||||
let aloneChecked = ref(false);
|
||||
let list = ref([
|
||||
{
|
||||
number: '¥30',
|
||||
money: '30'
|
||||
},
|
||||
{
|
||||
number: '¥50',
|
||||
money: '50'
|
||||
},
|
||||
{
|
||||
number: '¥80',
|
||||
money: '80'
|
||||
},
|
||||
{
|
||||
number: '¥100',
|
||||
money: '100'
|
||||
},
|
||||
{
|
||||
number: '¥200',
|
||||
money: '200'
|
||||
},
|
||||
{
|
||||
number: '¥300',
|
||||
money: '300'
|
||||
},
|
||||
{
|
||||
number: '¥400',
|
||||
money: '400'
|
||||
},
|
||||
{
|
||||
number: '¥500',
|
||||
money: '500'
|
||||
}
|
||||
]);
|
||||
|
||||
const pick = (item, index) => {
|
||||
if (item != 'input') {
|
||||
money.value = item.money;
|
||||
moneyNum.value = '';
|
||||
}
|
||||
num.value = index;
|
||||
};
|
||||
|
||||
const change = (e) => {
|
||||
aloneChecked.value = e;
|
||||
console.log(e);
|
||||
};
|
||||
|
||||
const toUp = () => {
|
||||
adaPay({
|
||||
amount: money.value
|
||||
}).then((res) => {
|
||||
let data = res;
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: data.timeStamp,
|
||||
nonceStr: data.nonceStr,
|
||||
package: data.package,
|
||||
signType: data.signType,
|
||||
paySign: data.paySign,
|
||||
success: function (r) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '充值成功',
|
||||
showCancel: false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateBack();
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// jqbPay({
|
||||
// amount: money.value
|
||||
// }).then((res) => {
|
||||
// let data = JSON.parse(res.payData);
|
||||
// uni.requestPayment({
|
||||
// provider: 'wxpay',
|
||||
// timeStamp: data.timeStamp,
|
||||
// nonceStr: data.nonceStr,
|
||||
// package: data.package,
|
||||
// signType: data.signType,
|
||||
// paySign: data.paySign,
|
||||
// success: function (r) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '充值成功',
|
||||
// showCancel: false,
|
||||
// success: function (res) {
|
||||
// if (res.confirm) {
|
||||
// uni.navigateBack();
|
||||
// } else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// fail: function (err) {
|
||||
// console.log('fail:' + JSON.stringify(err));
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
};
|
||||
|
||||
|
||||
onShow(async () => {
|
||||
let _res = await userInfo();
|
||||
info.value = _res;
|
||||
});
|
||||
|
||||
const inputChange = (e) => {
|
||||
money.value = e.detail.value;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.buy {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0 20rpx 50rpx;
|
||||
background-color: #ffffff;
|
||||
> image {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
> text {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.num {
|
||||
color: #ff4141;
|
||||
}
|
||||
}
|
||||
.number {
|
||||
width: 100%;
|
||||
background-color: #ffffff;
|
||||
margin-top: 18rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
padding: 38rpx 40rpx 0rpx 40rpx;
|
||||
.item {
|
||||
width: 194rpx;
|
||||
height: 194rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(0, 0, 0, 0.1);
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 44rpx;
|
||||
display: flex;
|
||||
.card {
|
||||
width: 194rpx;
|
||||
height: 194rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
> text {
|
||||
font-size: 32rpx;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #666666;
|
||||
line-height: 44rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
> image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
}
|
||||
.money {
|
||||
font-size: 24rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
}
|
||||
.recommend {
|
||||
width: 112rpx;
|
||||
height: 36rpx;
|
||||
background: #f3f2ea;
|
||||
border-radius: 8rpx 0rpx 8rpx 0rpx;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
margin-top: -18rpx;
|
||||
> text {
|
||||
font-size: 20rpx;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.real {
|
||||
border: 2rpx solid #f88700;
|
||||
background-color: rgba(248, 135, 0, 0.1);
|
||||
}
|
||||
&:after {
|
||||
content: '';
|
||||
width: 194rpx;
|
||||
}
|
||||
}
|
||||
.sure {
|
||||
width: 582rpx;
|
||||
height: 80rpx;
|
||||
background: #ff6a5f;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
> text {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #ffffff;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.tip {
|
||||
background: #ffffff;
|
||||
padding: 40rpx;
|
||||
padding-top: 0;
|
||||
.titl {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #666666;
|
||||
line-height: 40rpx;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
> view {
|
||||
> text {
|
||||
font-size: 22rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999999;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
&:nth-child(2) {
|
||||
> text:nth-child(2) {
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
&:nth-child(5) {
|
||||
> text:nth-child(2) {
|
||||
color: #ff6a5f;
|
||||
font-weight: 600;
|
||||
border-bottom: 2rpx solid #ff6a5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
362
pages/order/detail.vue
Normal file
362
pages/order/detail.vue
Normal file
@@ -0,0 +1,362 @@
|
||||
<template>
|
||||
<view class="order-detail-container">
|
||||
<!-- <statusBar /> -->
|
||||
<view class="top-area">
|
||||
<view class="order-state">
|
||||
<view class="state-left">
|
||||
{{ detailData.status < 2 ? "待支付" : detailData.status < 5 ? "进行中" : detailData.status == 5 ? "已完成" : "" }}
|
||||
<text class="pay-type">{{ getPayName(detailData.orderPlatform) }}</text>
|
||||
</view>
|
||||
<!-- view>
|
||||
<button class="pay-btn" @click="goPay(detailData)">去支付</button>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="number-area">
|
||||
<view class="number-area-item">
|
||||
<view>
|
||||
订单编号
|
||||
</view>
|
||||
<view class="number-value">
|
||||
{{ detailData.orderNo }}
|
||||
<image class="copy-img" src="/static/icon/icon-copy.png" @click="copy(detailData.orderNo)"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="number-area-item">
|
||||
<view>
|
||||
充电桩编号
|
||||
</view>
|
||||
<view class="number-value">
|
||||
{{ detailData.gunNo }}
|
||||
<image class="copy-img" src="/static/icon/icon-copy.png" @click="copy(detailData.gunNo)"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="info-item-title">
|
||||
充电信息
|
||||
</view>
|
||||
<view class="flex-space-between">
|
||||
<view class="text-one">
|
||||
{{ detailData.startTime?.substring(5, 10)?.replace("-", "月") }}日
|
||||
</view>
|
||||
<view class="text-one">
|
||||
{{ detailData.endTime?.substring(5, 10)?.replace("-", "月") }}日
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-space-between mb16 item-flex-end">
|
||||
<view class="text-one">
|
||||
{{ detailData.startTime?.substring(11, 19) }}
|
||||
</view>
|
||||
<view class="time-area">
|
||||
<view class="use-time">
|
||||
{{ detailData.useTime }}分钟
|
||||
</view>
|
||||
<view class="arrow-line"></view>
|
||||
</view>
|
||||
<view class="text-one">
|
||||
{{ detailData.endTime?.substring(11, 19) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-space-between">
|
||||
<view class="text-two">
|
||||
开始充电
|
||||
</view>
|
||||
<view class="text-two">
|
||||
结束充电
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="flex-space-between item-center">
|
||||
<view class="text-one">
|
||||
合计充电量
|
||||
</view>
|
||||
<view>
|
||||
<text class="text-three">{{ detailData.useDegree }}</text>
|
||||
<text class="text-one"> 度</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="info-item-title">
|
||||
费用信息
|
||||
</view>
|
||||
<view class="flex-space-between">
|
||||
<view class="text-one">
|
||||
订单总额
|
||||
</view>
|
||||
<view class="text-one">
|
||||
{{ detailData.actuallyAmount }}元
|
||||
</view>
|
||||
</view>
|
||||
<view class="money-detail">
|
||||
<view class="money-detail-box">
|
||||
<view>
|
||||
电费
|
||||
<text class="text-one mx16">{{ detailData.electricityAmount }}</text>
|
||||
元
|
||||
</view>
|
||||
<view>
|
||||
服务费
|
||||
<text class="text-one mx16">{{ detailData.serviceAmount }}</text>
|
||||
元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-space-between mb16">
|
||||
<view class="text-two">
|
||||
支付金额
|
||||
</view>
|
||||
<view class="text-one">
|
||||
{{ detailData.actuallyAmount }}元
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-space-between">
|
||||
<view class="text-two">
|
||||
{{ detailData.payTime }}
|
||||
</view>
|
||||
<view class="text-two">
|
||||
{{ getPayName(detailData.orderPlatform) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="flex-space-between item-center">
|
||||
<view class="text-one">
|
||||
实付金额
|
||||
</view>
|
||||
<view>
|
||||
<text class="text-three">{{ detailData.actuallyAmount }}</text>
|
||||
<text class="text-one"> 元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="info-item-title">
|
||||
终端信息
|
||||
</view>
|
||||
<!-- <view class="flex-space-between mb16">
|
||||
<view class="text-two">
|
||||
辅助电源
|
||||
</view>
|
||||
<view class="text-two text-bold">
|
||||
12/24v
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="flex-space-between mb16">
|
||||
<view class="text-two">
|
||||
充电站
|
||||
</view>
|
||||
<view class="text-two text-bold">
|
||||
{{ detailData.stationName }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-space-between">
|
||||
<view class="text-two">
|
||||
终端名称
|
||||
</view>
|
||||
<view class="text-two text-bold">
|
||||
{{ detailData.deviceNo }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { copy } from '@/utils/fun.js';
|
||||
import { ordersInfo } from '@/api/api.js';
|
||||
|
||||
const detailData = ref();
|
||||
|
||||
onLoad((options) => {
|
||||
getDetail(options.transactionNo);
|
||||
});
|
||||
|
||||
const getDetail = async (transactionNo) => {
|
||||
console.log("------transactionNo-----", transactionNo)
|
||||
let _res = await ordersInfo({ transactionNo });
|
||||
detailData.value = _res;
|
||||
};
|
||||
|
||||
const getPayName = v => {
|
||||
if(v == 1){
|
||||
return "微信支付"
|
||||
}else if(v == 2){
|
||||
return "支付宝支付"
|
||||
}else{
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
const goPay = () => {
|
||||
console.log("去支付")
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.order-detail-container {
|
||||
.top-area {
|
||||
background: linear-gradient( 180deg, #FFFFFF 0%, #F7F7F7 100%);
|
||||
padding: 24rpx 30rpx 36rpx;
|
||||
.order-state {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.state-left {
|
||||
font-weight: bold;
|
||||
font-size: 44rpx;
|
||||
color: #232323;
|
||||
.pay-type {
|
||||
width: 120rpx;
|
||||
height: 38rpx;
|
||||
background: rgba(111,162,86, 0.1);
|
||||
border-radius: 8rpx;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #6FA256;
|
||||
padding: 6rpx 12rpx;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
.pay-btn {
|
||||
width: 156rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
background: #6FA256;
|
||||
border-radius: 26rpx;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.number-area {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 36rpx;
|
||||
&-item {
|
||||
width: 50%;
|
||||
font-family: DIN, DIN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
.number-value {
|
||||
margin-top: 16rpx;
|
||||
.copy-img {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info-item {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin: 0 30rpx 36rpx;
|
||||
.info-item-title {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
.time-area {
|
||||
flex: 1;
|
||||
margin: 0 18rpx;
|
||||
.use-time {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #3BCF73;
|
||||
text-align: center;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
.arrow-line {
|
||||
border-top: 2rpx dashed #999999;
|
||||
padding-top: 6rpx;
|
||||
position: relative;
|
||||
}
|
||||
.arrow-line::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
right: 4rpx;
|
||||
top: 0;
|
||||
transform: translateY(-60%) rotate(-50deg);
|
||||
border-right: 2rpx dashed #999999;
|
||||
}
|
||||
}
|
||||
.money-detail {
|
||||
padding: 24rpx 24rpx 0;
|
||||
margin-bottom: 24rpx;
|
||||
&-box {
|
||||
background: rgba(111, 162, 86, 0.1);
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #6FA256;
|
||||
padding: 14rpx 30rpx;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
&-box::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: 20rpx;
|
||||
transform: translateY(-75%);
|
||||
border-top: 20rpx solid transparent;
|
||||
border-bottom: 20rpx solid rgba(111, 162, 86, 0.1);
|
||||
border-left: 18rpx solid transparent;
|
||||
border-right: 18rpx solid transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
.flex-space-between {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.item-flex-end {
|
||||
align-items: flex-end;
|
||||
}
|
||||
.item-center {
|
||||
align-items: center;
|
||||
}
|
||||
.mb16 {
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.mx16 {
|
||||
margin-left: 16rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.text-one {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #232323;
|
||||
}
|
||||
.text-two {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.text-three {
|
||||
font-family: DIN, DIN;
|
||||
font-weight: bold;
|
||||
font-size: 44rpx;
|
||||
color: #232323;
|
||||
}
|
||||
.text-bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
.line {
|
||||
height: 0rpx;
|
||||
border-bottom: 2rpx solid #EEEEEE;
|
||||
margin: 24rpx 0 26rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
200
pages/order/order.vue
Normal file
200
pages/order/order.vue
Normal file
@@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<view class="order">
|
||||
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
|
||||
<view>
|
||||
<statusBar />
|
||||
<view class="p30">
|
||||
<view class="order_header">
|
||||
<view
|
||||
class="order_header_view"
|
||||
@click="chanStatus(item.type)"
|
||||
v-for="(item, index) in status_list"
|
||||
:key="index"
|
||||
:class="status == item.type ? 'order_header_active' : ''"
|
||||
>
|
||||
{{ item.name }}
|
||||
<view class="order_header_xian" v-if="item.type == status"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="p30">
|
||||
<view class="order_list" v-for="(item, index) in dataList" :key="index" @click="toLink(item)">
|
||||
<view class="order_list_header">订单编号:{{ item.orderNo }}</view>
|
||||
<view class="order_list_view">
|
||||
<view>充电时间</view>
|
||||
<view>{{ item.startTime }}</view>
|
||||
</view>
|
||||
<view class="order_list_view">
|
||||
<view>结束时间</view>
|
||||
<view>{{ item.endTime }}</view>
|
||||
</view>
|
||||
<view class="order_list_view">
|
||||
<view>充电电量</view>
|
||||
<view>{{ item.useDegree }}度</view>
|
||||
</view>
|
||||
<view class="order_list_view">
|
||||
<view>服务费</view>
|
||||
<view>{{ item.serviceAmount }}元</view>
|
||||
</view>
|
||||
<view class="order_list_view">
|
||||
<view>电费</view>
|
||||
<view>{{ item.electricityAmount }}元</view>
|
||||
</view>
|
||||
<view class="order_list_view">
|
||||
<view>预付金额</view>
|
||||
<view>{{ item.preAmount }}元</view>
|
||||
</view>
|
||||
<view class="order_list_total">实付金额:{{ item.actuallyAmount }}元</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onPullDownRefresh, onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app';
|
||||
import { ordersList } from '@/api/api.js';
|
||||
|
||||
const paging = ref(null);
|
||||
let dataList = ref([]);
|
||||
|
||||
let list = ref([]);
|
||||
let status = ref(1);
|
||||
let status_list = ref([
|
||||
{
|
||||
name: '全部',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '进行中',
|
||||
type: 1
|
||||
},
|
||||
{
|
||||
name: '已完成',
|
||||
type: 2
|
||||
},
|
||||
{
|
||||
name: '待支付',
|
||||
type: 3
|
||||
}
|
||||
]);
|
||||
|
||||
let chanStatus = (e) => {
|
||||
status.value = e;
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
onLoad(async () => {
|
||||
|
||||
});
|
||||
|
||||
let toLink = (e) => {
|
||||
// 1-订单初始化;2-启动充电中;3-正在充电;4-充电结束中;5:交易记录确认;-1-启动失败;-2-启动超时
|
||||
if (e.status == 2 || e.status == 3 || e.status == 4) {
|
||||
uni.navigateTo({
|
||||
url: `/pageOrder/recharge/recharge?transactionNo=${e.transactionNo}&type=order`
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
let isPagingRefNotFound = () => {
|
||||
return !paging.value;
|
||||
};
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.reload().catch(() => {});
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.updatePageScrollTop(e.scrollTop);
|
||||
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.pageReachBottom();
|
||||
});
|
||||
|
||||
const upChange = (e) => {
|
||||
console.log(dataFrom);
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
current: pageNo,
|
||||
pageSize: pageSize,
|
||||
type: status.value
|
||||
};
|
||||
|
||||
ordersList(params)
|
||||
.then((res) => {
|
||||
paging.value.complete(res);
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order {
|
||||
&_header {
|
||||
@include flex($space: space-between);
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #232323;
|
||||
border-bottom: 4rpx solid #e9ecf2;
|
||||
&_view {
|
||||
padding: 15rpx 0;
|
||||
position: relative;
|
||||
view {
|
||||
position: absolute;
|
||||
left: calc(50% - 49rpx);
|
||||
bottom: -4rpx;
|
||||
width: 98rpx;
|
||||
height: 8rpx;
|
||||
background: #4879e6;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
}
|
||||
}
|
||||
&_active {
|
||||
color: #4879e6;
|
||||
}
|
||||
}
|
||||
|
||||
&_list {
|
||||
padding: 25rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
margin-top: 30rpx;
|
||||
&_header {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: #4879e6;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 2rpx solid #ebebeb;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
&_view {
|
||||
@include flex($space: space-between);
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
&_total {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #4879e6;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
77
pages/protocol/buy.vue
Normal file
77
pages/protocol/buy.vue
Normal file
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<view class="xkl-com-bg">
|
||||
<view style="height: 20rpx"></view>
|
||||
<view style="font-size: 34rpx; font-weight: 700; text-align: center">充电桩购销合同</view>
|
||||
<view style="height: 20rpx"></view>
|
||||
<view style="line-height: 46rpx">
|
||||
<view>买方:用户名:{{ shopinfo.username }} 手机号:{{ shopinfo.mobile }}</view>
|
||||
<view>卖方:电小芮(河南)新能源科技有限公司</view>
|
||||
<view>合同签订地点: 河南郑州</view>
|
||||
<view style="text-indent: 2em">
|
||||
根据《中华人民共和国民法典》及相关法律、法规,甲乙双方本着平等、自愿、公平、互惠互利和诚实守信的原则,为满足甲方的需求,就充电桩买卖事宜协商一致订立本合同,以资共同遵守:
|
||||
</view>
|
||||
<view style="text-indent: 2em">一、购买标的、方式</view>
|
||||
<view style="text-indent: 2em">
|
||||
本协议项下的买卖标的物为乙方公司销售的充电桩,甲方自行在乙方开发或告知的网站上进行独立购买,自行选择型号和数量,并全款支付合同订立购买充电桩数的总价。
|
||||
</view>
|
||||
<view style="text-indent: 2em">二、品名、型号、数量、金额、总价</view>
|
||||
|
||||
<view style="text-indent: 2em">三、交货方式</view>
|
||||
<view style="text-indent: 2em">甲方购买的充电桩经第三方公司安装结束后,由甲方在后台系统上电子签署《收到货物确认单》,甲方签署后,视为乙方交付本合同项下的充电桩。</view>
|
||||
<view style="text-indent: 2em">四、付款方式:由甲方在购买时一次性支付。</view>
|
||||
<view style="text-indent: 2em">五、双方权利及义务</view>
|
||||
<view style="text-indent: 2em">1、甲方的权利及义务</view>
|
||||
<view style="text-indent: 2em">甲方应在选定型号后及时支付款项。</view>
|
||||
<view style="text-indent: 2em">2、乙方的权利及义务</view>
|
||||
<view style="text-indent: 2em">乙方应保证所售充电桩的质量及技术标准符合国家的最低标准要求。</view>
|
||||
<view style="text-indent: 2em">六、产品质保</view>
|
||||
<view style="text-indent: 2em">
|
||||
质保期五年,在质保期内,乙方应积极履行质保义务,出现质量问题,乙方应免费及时更换维修合格产品及配件,乙方未尽到质保义务时,须承担所有维修费用。质保期自甲方所购充电桩安装结束并由甲方签署到货确认函后第二日起算。
|
||||
</view>
|
||||
<view style="text-indent: 2em">七、违约责任</view>
|
||||
<view style="text-indent: 2em">1、甲方在购买充电桩后,不能因任何除产品质量有缺陷外的原因要求解除本合同及退款。</view>
|
||||
<view style="text-indent: 2em">2、乙方充电桩存在质量问题,由乙方协调各方进行免费更换维修。</view>
|
||||
<view style="text-indent: 2em">八、解决合同纠纷方式</view>
|
||||
<view style="text-indent: 2em">本合同在履行过程中发生争议,由双方当事人协商解决;协商或调解不成的,可依法在乙方所在地人民法院起诉。</view>
|
||||
<view style="text-indent: 2em">九、其他</view>
|
||||
<view style="text-indent: 2em">本合同一式两份,甲乙双方各执一份,自双方签字盖章之日起生效。</view>
|
||||
</view>
|
||||
<view v-if="!hide">
|
||||
<view style="height: 50rpx"></view>
|
||||
<u-button type="primary" @click="submit(1)">我已阅读并同意《充电桩购销合同》</u-button>
|
||||
<view style="height: 50rpx"></view>
|
||||
<u-button @click="submit(0)">取消</u-button>
|
||||
</view>
|
||||
<view style="height: 100rpx"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let self;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shopinfo: {
|
||||
username: '',
|
||||
mobile: ''
|
||||
},
|
||||
hide: ''
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.shopinfo = uni.getStorageSync('user');
|
||||
},
|
||||
methods: {
|
||||
submit(e) {
|
||||
if (e) {
|
||||
uni.$emit('buy', 1);
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
130
pages/protocol/trusteeship.vue
Normal file
130
pages/protocol/trusteeship.vue
Normal file
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<view class="xkl-com-bg">
|
||||
<view style="height: 20rpx"></view>
|
||||
<view style="font-size: 34rpx; font-weight: 700; text-align: center">充电桩托管协议</view>
|
||||
<view style="height: 20rpx"></view>
|
||||
<view style="line-height: 46rpx">
|
||||
<view>甲方(运营方):电小芮(河南)新能源科技有限公司</view>
|
||||
<view>乙方(投资方):用户名:{{ shopinfo.username }} 手机号:{{ shopinfo.mobile }}</view>
|
||||
<view>合同签订地点: 河南郑州</view>
|
||||
<view style="text-indent: 2em">
|
||||
鉴于:乙方购买了电小芮(河南)新能源科技有限公司 个充电桩端口,乙方因工作及地域 等原因无法亲自管理自己的充电桩,现为节省乙方精力,提高充电桩的运营效率,
|
||||
甲乙双方本着平等、自愿、互利的原则,根据《中华人民共和国民法典》及相关 法律法规的规定,就乙方购买的新能源汽车充电桩运营相关事宜协商一致,签订 本协议。
|
||||
</view>
|
||||
<view style="text-indent: 2em">一、项目概况:</view>
|
||||
<view style="text-indent: 2em">1、项目名称:</view>
|
||||
<view style="text-indent: 2em">2、项目地址:电小芮(河南)新能源科技有限公司后台系统自动显示) </view>
|
||||
<view style="text-indent: 2em">3、合作期限: 5 年,自站点正式竣工投运日开始计算。</view>
|
||||
<view style="text-indent: 2em">4、项目规模:计划投建___个充电专用车位,在60天之内完成。</view>
|
||||
<view style="text-indent: 2em">二、合作内容:</view>
|
||||
<view style="text-indent: 2em">1、甲方承担充电桩的选址、场地协调、规划设计、项目备案、终端服务、 客户引流等</view>
|
||||
<view style="text-indent: 2em">三、合作方式</view>
|
||||
<view style="text-indent: 2em">
|
||||
1、 甲方负责安装及运营:充电桩交由甲方主导运营,甲方通过运营平台向 充电用户收取充电费用(电费+充电服务费等)。甲方提供运营平台系统给乙方查
|
||||
阅及对账,甲方将所有站点时时赚取利润按双方约定分红比例每月定期支付给乙 方。
|
||||
</view>
|
||||
<view style="text-indent: 2em">2、利润核算方式:利润 = 当月平台收益 - 当月缴纳电费 - 公共开支(如 平台活动、保险、消防设施、税票等)</view>
|
||||
<view style="text-indent: 2em">
|
||||
3、电费缴纳方式:电价选用下列第 种方式申报缴纳:(1)甲方独立申报/ 改造新能源专用电,与国家电网申请独立电表,执行新能源专用电,乙方将变压
|
||||
器户头过户至甲方,由甲方单独与国家电网结算;(2)乙方配合协调甲方在充电 桩上端加装独立计量电表,以甲方每月进行对独立计量电表缴费;
|
||||
</view>
|
||||
<view style="text-indent: 2em">4、甲方享有该项目利润的 50 %,乙方享有该项目利润的 50 %。</view>
|
||||
<view style="text-indent: 2em">
|
||||
充电桩运营:充电费用是指甲方向新能源汽车充电客户统一收取的充电费用, 由“充电电费 ”和“充电服务费 ”两部分组成,运营决策权归甲方所有,乙方不 参与运营。
|
||||
</view>
|
||||
<view style="text-indent: 2em">四、支付方式</view>
|
||||
<view style="text-indent: 2em">1 、充电服务费甲、乙双方分红结算,每周由乙方在甲方系统上自动提取收 益。</view>
|
||||
<view style="text-indent: 2em">2、 乙方按确认的分成收益金额向甲方开具财务凭证,甲方在收到乙方的财 务凭证后 日内向乙方支付上述费用;</view>
|
||||
|
||||
<view style="text-indent: 2em">乙方账户信息: 开户名称: 帐 号: 开 户 行:</view>
|
||||
<view style="text-indent: 2em">五、甲乙双方的权利和义务</view>
|
||||
<view style="text-indent: 2em">1、 建设运营期内,甲方在该项目场地内的消防和用电安全,应当符合国家 法律法规要求,并采取必要的保障措施确保项目的安全运营。</view>
|
||||
<view style="text-indent: 2em">
|
||||
2、 甲方应在协议期内协调好本协议充电场站所在土地、房屋、电力基础设 施的所有权或使用权无纠纷,并确保场地租赁期限符合本协议要求,充分满足项
|
||||
目建设、运营的需要。若甲方故意隐瞒或无法保证协议期内充电设施的正常运营, 造成的损失由甲方承担(不可抗力因素除外)。因甲方与产权方之间不能继续场
|
||||
地租赁协议导致本协议未能正常履行完毕的,甲方应协调产权人将此协议继续履 行。
|
||||
</view>
|
||||
<view style="text-indent: 2em">3、甲方有义务对充电桩的日常充电站的卫生清洁,不允许非充电车辆占用 新能源车位,提供较好的充电场站运营环境。</view>
|
||||
<!-- <view style="text-indent: 2em">
|
||||
4、乙方若对预期收益不满,可在充电桩安装落地收益产生后两年内向甲方提补贴申请(总收益已超过投资收益2倍不可申请),甲方受理后,会在安装收益产生满两年时通过股票定增融资,同意以乙方购买价两倍减去全部收益来回购,充电桩的所有权与收益权归甲方所有。
|
||||
</view>
|
||||
<view style="text-indent: 2em">5、乙方有权调自己的充电桩经营数据。</view> -->
|
||||
<view style="text-indent: 2em">
|
||||
4、乙方在充电站开始建设后或运营中提出位置更改并经甲方同意的,因更 改产生的相关费用由乙方承担。在协议期限内,若因不可抗力、场地整体重新规
|
||||
划导致该充电桩场地改造,影响到该项目正常运营,甲方不承担相关运营损失, 但有关充电站改造费用由甲方承担。因法律法规变动、政府规划、城市更新需要
|
||||
而须调整或终止该项目的情况,甲方须需提前一个月书面知会并协调相关单位保 障乙方的利益。
|
||||
</view>
|
||||
<view style="text-indent: 2em">六、违约责任</view>
|
||||
<view style="text-indent: 2em">
|
||||
1、合作期限内,双方应按照协议约定各自履行相应的义务,因任何一方原 因无法保证该项目正常运营,且在守约方书面催告后仍未处理/仍不纠正的,逾 期 7
|
||||
日时,守约方有权单方面解除协议。
|
||||
</view>
|
||||
<view style="text-indent: 2em">
|
||||
2、本协议生效后,各方均应全面履行本协议约定的义务。任何一方不履行 或不完全履行本协议约定义务的,应当承担相应的违约责任,并赔偿由此给守约 方造成的损失。
|
||||
</view>
|
||||
<view style="text-indent: 2em">七、其他</view>
|
||||
<view style="text-indent: 2em">
|
||||
保密条款:1、甲乙双方应对在本协议洽谈和项目合作过程中获取的对方的 保密信息及对方关联方的保密信息(包括但不限于商业秘密、财务资料、经营方
|
||||
式、技术资料等)以及双方合作内容相关的一切信息应予保密并采取必要的保密 措施;2、甲乙双方应严格保密双方的合作内容以及协议模式等信息,不得向任
|
||||
何第三方透露;3、未经一方事先书面同意,另一方不得将任何该等信息披露给 任何第三方,或者自行复制保存等;4、甲乙双方应严格遵循上述保密条款,若
|
||||
违约方违反上述约定给守约方造成损失的,违约方应就守约方由此遭受的损失承 担损失赔偿责任。
|
||||
</view>
|
||||
<view style="text-indent: 2em">
|
||||
风险约定:本协议项下的充电桩营运场所所有权为甲方,场所内发生的第三 方人员及车辆的所有者责任、交通事故等意外损害等,均按法律规定处理。
|
||||
</view>
|
||||
<view style="text-indent: 2em">
|
||||
不可抗力:本协议履行过程中, 如一方因发生无法预见又无法避免的事件 而不能全部或部分履行协议,可以根据不可抗力的影响减免相应责任,但须在不 可抗力因素发生后 48
|
||||
小时内通知对方,并采取措施避免损失的扩大。
|
||||
</view>
|
||||
<view style="text-indent: 2em">
|
||||
订立本协议所依据的法律、法规或所依据的客观情况发生重大变化,致使本 协议无法履行的,经甲、乙双方协商一致,可以变更本协议有关内容,但均应以 书面方式盖章确认。
|
||||
</view>
|
||||
<view style="text-indent: 2em">八、适用法律及争议解决:</view>
|
||||
<view style="text-indent: 2em">
|
||||
在履行本协议过程中,若发生争议,双方应本着友好互让的原则协商解决,
|
||||
未能协商一致,可向甲方所在地人民法院提起诉讼解决。当任何争议发生时或该争议处于协商或提交诉讼解决时,除争议事项外,双方应继续享有本协议规定的其它权利,履行本协议规定的其它义务。
|
||||
</view>
|
||||
<view style="text-indent: 2em">本协议一式四份,甲乙双方各执贰份, 自双方盖章后生效。</view>
|
||||
<view style="text-indent: 2em">
|
||||
本协议附件为本协议有效组成部分,与本协议具有同等法律效力。本协议未 尽事宜由甲、乙双方友好协商后,以书面形式加以补充,补充协议具有同等的法 律效力。
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!hide">
|
||||
<view style="height: 50rpx"></view>
|
||||
<u-button type="primary" @click="submit(1)">我已阅读并同意《充电桩托管协议》</u-button>
|
||||
<view style="height: 50rpx"></view>
|
||||
<u-button @click="submit(0)">取消</u-button>
|
||||
</view>
|
||||
<view style="height: 100rpx"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let self;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shopinfo: {
|
||||
username: '',
|
||||
mobile: ''
|
||||
},
|
||||
hide: ''
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.shopinfo = uni.getStorageSync('user');
|
||||
},
|
||||
methods: {
|
||||
submit(e) {
|
||||
if (e) {
|
||||
uni.$emit('trusteeship', 1);
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
130
pages/sweep/sweep.vue
Normal file
130
pages/sweep/sweep.vue
Normal file
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<view class="sweep">
|
||||
<statusBar />
|
||||
<view class="sweep_note">
|
||||
<view class="sweep_note_view">
|
||||
<view class="sweep_note_view_img">
|
||||
<image src="/static/image/djk.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view>插上</view>
|
||||
<view>充电枪</view>
|
||||
</view>
|
||||
<view class="sweep_note_view">
|
||||
<view class="sweep_note_view_img">
|
||||
<image src="/static/image/djs.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view>点击</view>
|
||||
<view>扫码充电</view>
|
||||
</view>
|
||||
<view class="sweep_note_view">
|
||||
<view class="sweep_note_view_img">
|
||||
<image src="/static/image/cs.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view>点击</view>
|
||||
<view>开始充电</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="sweep_scan" style="margin-top: 300rpx">
|
||||
<up-input placeholder="请输入充电枪编号" type="number" border="surround" v-model="value"></up-input>
|
||||
<view style="width: 100rpx">
|
||||
<up-button type="primary" text="确定" @click="toCd"></up-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="sweep_scan" style="margin-top: 150rpx">
|
||||
<up-button @click="scan" type="primary" shape="circle" text="扫码充电"></up-button>
|
||||
</view>
|
||||
|
||||
<cc-myTabbar :tabBarShow="2"></cc-myTabbar>
|
||||
|
||||
<!-- <tabbar path="/pages/sweep/sweep" /> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
import { urlQuery } from '@/utils/fun.js';
|
||||
const { nav, navTo } = useNav();
|
||||
|
||||
let value = ref('');
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
});
|
||||
|
||||
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>
|
||||
Reference in New Issue
Block a user