|
@@ -3,11 +3,13 @@
|
|
<u-navbar title="充电价格详情"></u-navbar>
|
|
<u-navbar title="充电价格详情"></u-navbar>
|
|
<view class="main">
|
|
<view class="main">
|
|
<view class="tabs-box">
|
|
<view class="tabs-box">
|
|
- <u-tabs inactive-color="#888888" active-color="#101010" :list="list" :is-scroll="false"
|
|
|
|
- :current="current" @change="change"></u-tabs>
|
|
|
|
|
|
+ <u-tabs itemStyle="width:300px" inactive-color="#888888" active-color="#101010" :list="list" :is-scroll="true"
|
|
|
|
+ :style="{
|
|
|
|
+ width: '650rpx',
|
|
|
|
+ }" :current="current" @change="change"></u-tabs>
|
|
</view>
|
|
</view>
|
|
<view class="line-box"><u-line color="#999999" /></view>
|
|
<view class="line-box"><u-line color="#999999" /></view>
|
|
- <view class="time-frame" v-for="(item,index) in list[current].items" :key="index">
|
|
|
|
|
|
+ <view class="time-frame" v-for="(item,index) in items" :key="index">
|
|
<view class="time-items">
|
|
<view class="time-items">
|
|
<view class="time-price">
|
|
<view class="time-price">
|
|
<view class="time">
|
|
<view class="time">
|
|
@@ -36,44 +38,64 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- list: [{
|
|
|
|
- name: '直流快充',
|
|
|
|
-/* items:[
|
|
|
|
- {time:'00:00-07:00',single_price:1.0,service_price:0.25,price:1.25},
|
|
|
|
- {time:'07:00-09:00',single_price:1.0,service_price:0.25,price:1.25},
|
|
|
|
- {time:'09:00-15:00',single_price:1.0,service_price:0.25,price:1.25},
|
|
|
|
- {time:'15:00-20:00',single_price:1.0,service_price:0.25,price:1.25},
|
|
|
|
- {time:'20:00-22:00',single_price:1.0,service_price:0.25,price:1.25},
|
|
|
|
- {time:'22:00-23:00',single_price:1.0,service_price:0.25,price:1.25},
|
|
|
|
- {time:'23:00-23:59',single_price:1.0,service_price:0.25,price:1.25},
|
|
|
|
- ]*/
|
|
|
|
|
|
+ list: [
|
|
|
|
+ {
|
|
|
|
+ name: '直流快充',
|
|
}, {
|
|
}, {
|
|
- name: '交流慢充',
|
|
|
|
-/* items:[
|
|
|
|
- {time:'00:00-07:00',single_price:0.5,service_price:0.25,price:0.75},
|
|
|
|
- {time:'07:00-09:00',single_price:0.7,service_price:0.25,price:1.00},
|
|
|
|
- {time:'09:00-15:00',single_price:0.7,service_price:0.25,price:1.00},
|
|
|
|
- {time:'15:00-20:00',single_price:0.7,service_price:0.25,price:1.00},
|
|
|
|
- {time:'20:00-22:00',single_price:0.6,service_price:0.25,price:0.90},
|
|
|
|
- {time:'22:00-23:00',single_price:0.5,service_price:0.25,price:0.75},
|
|
|
|
- {time:'23:00-23:59',single_price:0.5,service_price:0.25,price:0.75},
|
|
|
|
- ]*/
|
|
|
|
- }],
|
|
|
|
|
|
+ name: '交流慢充',
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ items:[],
|
|
current: 0
|
|
current: 0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(op){
|
|
onLoad(op){
|
|
- _self = this;
|
|
|
|
- api.getPriceDetails(op).then(function(res){
|
|
|
|
|
|
+ _self = this;
|
|
|
|
+ if(op!=null && op.stationId!=null){
|
|
|
|
+ console.log('stationId'+JSON.stringify(op.stationId))
|
|
|
|
+ let data = {stationId:op.stationId};
|
|
|
|
+ api.getChargingStationPrice(data).then(function(res){
|
|
|
|
+// console.log('data'+JSON.stringify(res))
|
|
|
|
+ if(res.result){
|
|
|
|
+ let data = res.data;
|
|
|
|
+ if(data.prices){
|
|
|
|
+ console.log('data'+JSON.stringify(data.prices))
|
|
|
|
+
|
|
|
|
+ _self.list = [];
|
|
|
|
+ for(let i = 0;i< data.prices.length;i++){
|
|
|
|
+ let _item = data.prices[i];
|
|
|
|
+ let item = {name:data.prices[i].name,items:[]};
|
|
|
|
+ for(let j = 0;j<_item.priceList.length;j++){
|
|
|
|
+ let _subitem = _item.priceList[j];
|
|
|
|
+ console.log('priceList'+JSON.stringify(_subitem))
|
|
|
|
+
|
|
|
|
+ let subitem = {time:'00:00-07:00',single_price:0.5,service_price:0.25,price:0.75};
|
|
|
|
+ subitem.time = _subitem.startTime + '-'+_subitem.endTime;
|
|
|
|
+ subitem.single_price = _subitem.electricityPrice;
|
|
|
|
+ subitem.service_price = _subitem.servicePrice;
|
|
|
|
+ subitem.price = _subitem.costPrice;
|
|
|
|
+ item.items.push(subitem);
|
|
|
|
+ }
|
|
|
|
+ _self.list.push(item);
|
|
|
|
+ }
|
|
|
|
+ console.log('站点价格详情'+JSON.stringify(_self.list));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+/* api.getPriceDetails(op).then(function(res){
|
|
_self.list = res;
|
|
_self.list = res;
|
|
},function(err){
|
|
},function(err){
|
|
|
|
|
|
}
|
|
}
|
|
- );
|
|
|
|
|
|
+ );*/
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
change(index) {
|
|
change(index) {
|
|
this.current = index;
|
|
this.current = index;
|
|
|
|
+ this.items = this.list[index].items;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|