|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<ax-body :blank="0">
|
|
<ax-body :blank="0">
|
|
|
<view class="site-body">
|
|
<view class="site-body">
|
|
|
- <view class="top-banner" v-if="stationDetail.pictures">
|
|
|
|
|
|
|
+ <view class="top-banner" v-if="stationDetail.pictures && stationDetail.pictures.length > 0">
|
|
|
<swiper class="banner-swiper" circular :autoplay="true" interval="3000" duration="500"
|
|
<swiper class="banner-swiper" circular :autoplay="true" interval="3000" duration="500"
|
|
|
@change="swiperChange">
|
|
@change="swiperChange">
|
|
|
<swiper-item class="banner-swiper-item" v-for="item in stationDetail.pictures">
|
|
<swiper-item class="banner-swiper-item" v-for="item in stationDetail.pictures">
|
|
@@ -10,12 +10,13 @@
|
|
|
</swiper>
|
|
</swiper>
|
|
|
<view class="swiper-current">{{ bannerIndex }}/{{ stationDetail.pictures.length }}</view>
|
|
<view class="swiper-current">{{ bannerIndex }}/{{ stationDetail.pictures.length }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="site-content" :style="{ top: `${stationDetail.pictures ? '320rpx' : '0'}` }">
|
|
|
|
|
|
|
+ <view class="site-content"
|
|
|
|
|
+ :style="{ top: `${stationDetail.pictures && stationDetail.pictures.length > 0 ? '320rpx' : '0'}` }">
|
|
|
<view class="top-site-info">
|
|
<view class="top-site-info">
|
|
|
<view class="site-title">{{ stationDetail.stationName }}</view>
|
|
<view class="site-title">{{ stationDetail.stationName }}</view>
|
|
|
<view class="site-text">
|
|
<view class="site-text">
|
|
|
<image src="@/static/img/site-icon03.png" class="icon"></image>
|
|
<image src="@/static/img/site-icon03.png" class="icon"></image>
|
|
|
- <view class="item-text">{{ stationDetail.tips }}</view>
|
|
|
|
|
|
|
+ <view class="item-text">{{ stationDetail.tips || '--' }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="site-location">
|
|
<view class="site-location">
|
|
@@ -123,7 +124,7 @@
|
|
|
<view v-if="filteredConnectorList.length === 0" class="not-data">暂无设备</view>
|
|
<view v-if="filteredConnectorList.length === 0" class="not-data">暂无设备</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="site-list-card">
|
|
|
|
|
|
|
+ <view class="site-list-card" v-if="stationDetail.customerServiceHotline">
|
|
|
<view class="cost-info-title">
|
|
<view class="cost-info-title">
|
|
|
<view class="title-name">电站信息</view>
|
|
<view class="title-name">电站信息</view>
|
|
|
<view class="check-info">
|
|
<view class="check-info">
|
|
@@ -247,7 +248,13 @@ export default {
|
|
|
longitude: location.split(",")[0] || 0,
|
|
longitude: location.split(",")[0] || 0,
|
|
|
latitude: location.split(",")[1] || 0
|
|
latitude: location.split(",")[1] || 0
|
|
|
}, {}).then(res => {
|
|
}, {}).then(res => {
|
|
|
- res.data.pictures = JSON.parse(res.data.pictures)
|
|
|
|
|
|
|
+ let pictures = res.data.pictures;
|
|
|
|
|
+ if (typeof pictures === 'string') {
|
|
|
|
|
+ pictures = JSON.parse(pictures) || [];
|
|
|
|
|
+ } else if (!Array.isArray(pictures)) {
|
|
|
|
|
+ pictures = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ res.data.pictures = pictures;
|
|
|
const countMapping = {
|
|
const countMapping = {
|
|
|
'空闲': res.data.idleCount,
|
|
'空闲': res.data.idleCount,
|
|
|
'占用': res.data.occupiedCount,
|
|
'占用': res.data.occupiedCount,
|
|
@@ -257,6 +264,7 @@ export default {
|
|
|
item.total = countMapping[item.text] || 0;
|
|
item.total = countMapping[item.text] || 0;
|
|
|
});
|
|
});
|
|
|
this.stationDetail = res.data
|
|
this.stationDetail = res.data
|
|
|
|
|
+ console.log(this.stationDetail.pictures, '数据');
|
|
|
// 初始化默认显示空闲状态的前3个设备
|
|
// 初始化默认显示空闲状态的前3个设备
|
|
|
this.siteSelectIndex = 0;
|
|
this.siteSelectIndex = 0;
|
|
|
this.filteredConnectorList = this.stationDetail.connectorList
|
|
this.filteredConnectorList = this.stationDetail.connectorList
|