第一次提交
This commit is contained in:
112
ChargingStation/pages/collect/AntiCorruptionLayer.js
Normal file
112
ChargingStation/pages/collect/AntiCorruptionLayer.js
Normal file
@@ -0,0 +1,112 @@
|
||||
let page = [{
|
||||
outputField: 'list',
|
||||
field: 'data',
|
||||
type: 'object',
|
||||
defaultValue: [],
|
||||
childField: [{
|
||||
outputField: 'stationLng',
|
||||
field: 'stationLng',
|
||||
type: 'number',
|
||||
defaultValue: 116.38,
|
||||
},{
|
||||
outputField: 'stationLat',
|
||||
field: 'stationLat',
|
||||
type: 'number',
|
||||
defaultValue: 39.90,
|
||||
},{
|
||||
outputField: 'id',
|
||||
field: 'id',
|
||||
type: 'string',
|
||||
defaultValue: '暂无数据',
|
||||
},{
|
||||
outputField: 'fastChargingIdleRatio',
|
||||
field: 'fastChargingIdleRatio',
|
||||
type: 'string',
|
||||
defaultValue: '暂无数据',
|
||||
},{
|
||||
outputField: 'slowChargingIdleRatio',
|
||||
field: 'slowChargingIdleRatio',
|
||||
type: 'string',
|
||||
defaultValue: '暂无数据',
|
||||
},{
|
||||
outputField: 'otherIdleRatio',
|
||||
field: 'otherIdleRatio',
|
||||
type: 'string',
|
||||
defaultValue: '暂无数据',
|
||||
},{
|
||||
outputField: 'name',
|
||||
field: 'stationName',
|
||||
type: 'string',
|
||||
defaultValue: '暂无数据',
|
||||
},{
|
||||
outputField: 'address',
|
||||
field: 'address',
|
||||
type: 'string',
|
||||
defaultValue: '山东省潍坊市奎文区金马路119号',
|
||||
}, {
|
||||
outputField: 'tags',
|
||||
field: 'tags',
|
||||
type: 'object',
|
||||
defaultValue: [],
|
||||
childField:[
|
||||
{
|
||||
outputField: 'label',
|
||||
field: 'label',
|
||||
type: 'string',
|
||||
defaultValue: '标签',
|
||||
},
|
||||
{
|
||||
outputField: 'color',
|
||||
field: 'color',
|
||||
type: 'string',
|
||||
defaultValue: '#6EA29BCC',
|
||||
}
|
||||
]
|
||||
},{
|
||||
outputField: 'distance',
|
||||
field: 'distance',
|
||||
type: 'number',
|
||||
defaultValue: 3.8,
|
||||
}, {
|
||||
outputField: 'unitPrice',
|
||||
field: 'totalFee',
|
||||
type: 'number',
|
||||
defaultValue: 0.6,
|
||||
}, {
|
||||
outputField: 'parkFee',
|
||||
field: 'parkFee',
|
||||
type: 'string',
|
||||
defaultValue: '免费停车',
|
||||
}, {
|
||||
outputField: 'quickChargeNumber',
|
||||
field: 'quickChargeNumber',
|
||||
type: 'number',
|
||||
defaultValue: 2,
|
||||
}, {
|
||||
outputField: 'usingQuickChargeNumber',
|
||||
field: 'usingQuickChargeNumber',
|
||||
type: 'number',
|
||||
defaultValue: 1,
|
||||
}, {
|
||||
outputField: 'trickleChargeNumber',
|
||||
field: 'trickleChargeNumber',
|
||||
type: 'number',
|
||||
defaultValue: 2,
|
||||
}, {
|
||||
outputField: 'usingTrickleChargeNumber',
|
||||
field: 'usingTrickleChargeNumber',
|
||||
type: 'number',
|
||||
defaultValue: 1,
|
||||
}, {
|
||||
outputField: 'otherChargingNumber',
|
||||
field: 'trickleChargeNumber',
|
||||
type: 'number',
|
||||
defaultValue: 2,
|
||||
}, {
|
||||
outputField: 'usingOtherChargingNumber',
|
||||
field: 'usingOtherChargingNumber',
|
||||
type: 'number',
|
||||
defaultValue: 1,
|
||||
}]
|
||||
}]
|
||||
export { page }
|
||||
34
ChargingStation/pages/collect/index.scss
Normal file
34
ChargingStation/pages/collect/index.scss
Normal file
@@ -0,0 +1,34 @@
|
||||
.periodPrice_body {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
padding: 0 30rpx;
|
||||
::-webkit-scrollbar {width: 0;height: 0;background-color: transparent;}
|
||||
.periodPrice_item {
|
||||
// height: 154rpx;
|
||||
width: 100%;
|
||||
border-bottom: solid 1px #ededed;
|
||||
padding: 46rpx 0;
|
||||
box-sizing: border-box;
|
||||
.blue{
|
||||
color: #476FFA;
|
||||
}
|
||||
.periodPrice_item_bottom {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.periodPrice_item_top {
|
||||
margin-bottom: 14rpx;
|
||||
.periodPrice_item_top_value {
|
||||
font-weight: 600;
|
||||
color: #121836;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.periodPrice_item_top_label {
|
||||
font-size: 28rpx;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
123
ChargingStation/pages/collect/index.vue
Normal file
123
ChargingStation/pages/collect/index.vue
Normal file
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<view class="periodPrice_body">
|
||||
<scroll-view v-if="viewData.list&&viewData.list.length" style="height: 100%;" scroll-y="true" @scrolltolower='scrolltolower'>
|
||||
<station-item :data="item" :key="index" v-for="(item,index) in viewData.list"></station-item>
|
||||
</scroll-view>
|
||||
<image class="qx" v-else src="@/static/qs.png" mode=""></image>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import station from '@/api/station.js'
|
||||
import {page} from "./AntiCorruptionLayer.js"
|
||||
import stationItem from "@/components/stationItem/stationItem.vue"
|
||||
export default {
|
||||
components: {
|
||||
stationItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// uni.getStorageSync('location').longitude
|
||||
pageData: {
|
||||
currentPage: 1,
|
||||
stationName: '',
|
||||
stationLng: uni.getStorageSync('location').longitude||116.38,
|
||||
stationLat: uni.getStorageSync('location').latitude||39.90,
|
||||
sortType: ''
|
||||
},
|
||||
viewData:null,
|
||||
}
|
||||
},
|
||||
onLoad(e) {},
|
||||
created() {
|
||||
},
|
||||
onShow() {
|
||||
this.pageData.currentPage = 1
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
difSource(e) {
|
||||
switch (e) {
|
||||
case 'XXCD':
|
||||
return {
|
||||
label: '星星充电',
|
||||
color: '#E48011CC'
|
||||
}
|
||||
case 'QT':
|
||||
return {
|
||||
label: '其他',
|
||||
color: '#121836CC'
|
||||
}
|
||||
case 'KD':
|
||||
return {
|
||||
label: '快电',
|
||||
color: '#FF5F0FCC'
|
||||
}
|
||||
case 'TLD':
|
||||
return {
|
||||
label: '特来电',
|
||||
color: '#7AA0F4CC'
|
||||
}
|
||||
case 'YKC':
|
||||
return {
|
||||
label: '云快充',
|
||||
color: '#00A7EBCC'
|
||||
}
|
||||
case 'ZGGD':
|
||||
return {
|
||||
label: '中国国电',
|
||||
color: '#27AB3BCC'
|
||||
}
|
||||
}
|
||||
},
|
||||
difTags(res) {
|
||||
res.data.forEach((item, index) => {
|
||||
item['tags'] = ['maxCurrent', 'createSource'].map((tag, tagIndex) => {
|
||||
let result = {}
|
||||
switch (tag) {
|
||||
case 'maxCurrent':
|
||||
result = {
|
||||
label: `最大${item[tag]}A`,
|
||||
color: '#6EA29BCC'
|
||||
}
|
||||
break;
|
||||
case 'createSource':
|
||||
let source = this.difSource(item[tag]);
|
||||
result = {
|
||||
...source
|
||||
}
|
||||
break;
|
||||
}
|
||||
return result
|
||||
});
|
||||
if (index == 0) item['tags'].unshift({
|
||||
label: '距离最近',
|
||||
color: '#36658DFF'
|
||||
})
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
station.getCollectStations(this.pageData).then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.difTags(res);
|
||||
if (this.pageData.currentPage !== 1) {
|
||||
let data = new this.tool.Anticorrosive(res, page);
|
||||
this.viewData.list = this.viewData.list.concat(data.list)
|
||||
} else {
|
||||
this.viewData = new this.tool.Anticorrosive(res, page);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
scrolltolower() {
|
||||
uni.showToast({
|
||||
title: '到底了',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import 'index.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user