|
@@ -1,163 +1,164 @@
|
|
<template>
|
|
<template>
|
|
<view v-if="cabinetInfo.dev_id" class="main-view">
|
|
<view v-if="cabinetInfo.dev_id" class="main-view">
|
|
- <view class="content">
|
|
|
|
- <swiper v-if="shop_image.length!=0" class="swiper" :indicator-dots="true" :autoplay="true" :interval="2000"
|
|
|
|
- indicator-color="rgba(0, 0, 0, 0.3)" indicator-active-color="#000000" :duration="1000" circular>
|
|
|
|
- <swiper-item class="swiper-item" v-for="(item,index) in shop_image" :key="index">
|
|
|
|
- <img class="swiper-item-img" :src="item" />
|
|
|
|
- </swiper-item>
|
|
|
|
- </swiper>
|
|
|
|
- <img v-else class="bg-img" src="https://qiniu.bms16.com/FhRnr7rADHHsOFfpWO4duD15SgIt" alt="">
|
|
|
|
- </view>
|
|
|
|
- <view class="cabinet-detail">
|
|
|
|
- <view class="cabinet-name-view flex-row flex-between">
|
|
|
|
- <view class="cabinet-name">{{cabinetInfo.cabinet_name}}</view>
|
|
|
|
- <!-- <view class="distance">{{cabinetInfo.distance}}km</view> -->
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <view v-if="tagList.length==0" class="no_battery">
|
|
|
|
- 无可用电池
|
|
|
|
|
|
+ <view class="content">
|
|
|
|
+ <swiper v-if="shop_image.length!=0" class="swiper" :indicator-dots="true" :autoplay="true" :interval="2000"
|
|
|
|
+ indicator-color="rgba(0, 0, 0, 0.3)" indicator-active-color="#000000" :duration="1000" circular>
|
|
|
|
+ <swiper-item class="swiper-item" v-for="(item,index) in shop_image" :key="index">
|
|
|
|
+ <img class="swiper-item-img" :src="item" />
|
|
|
|
+ </swiper-item>
|
|
|
|
+ </swiper>
|
|
|
|
+ <img v-else class="bg-img" src="https://qiniu.bms16.com/FhRnr7rADHHsOFfpWO4duD15SgIt" alt="">
|
|
</view>
|
|
</view>
|
|
- <view class="flex-row" style="justify-content: center;">
|
|
|
|
- <view class="icon-box flex-row">
|
|
|
|
- <view v-for="(item, index) in tagList" class="item-tag flex-row">
|
|
|
|
- <text class="tag_name">
|
|
|
|
- {{item.main_tag_name ? (item.main_tag_name) : ''}}{{item.child_tag_name ? '/' + item.child_tag_name : ''}}·
|
|
|
|
- </text>
|
|
|
|
- <text class="tag_num">{{'x' + item.num}}</text>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <view class="cabinet-detail">
|
|
|
|
+ <view class="cabinet-name-view flex-row flex-between">
|
|
|
|
+ <view class="cabinet-name">{{cabinetInfo.cabinet_name}}</view>
|
|
|
|
+ <!-- <view class="distance">{{cabinetInfo.distance}}km</view> -->
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <view class="flex-row flex-between">
|
|
|
|
- <view :class="isWorkTimer ? 'left_grid_2' : 'left_grid_1'">
|
|
|
|
- <view class="flex-row">
|
|
|
|
- <img class="icon_grid"
|
|
|
|
- :src="!isWorkTimer ? 'https://zxappfile.bms16.com/zx_admin/cab_timer.png' : 'https://zxappfile.bms16.com/zx_admin/cab_timer_work.png'">
|
|
|
|
- <view :class="isWorkTimer ? 'grid_text_1' : 'grid_text_rest' ">{{isWorkTimer ? '营业中' : '已休息'}}
|
|
|
|
|
|
+
|
|
|
|
+ <!-- <view v-if="tagList.length==0" class="no_battery">
|
|
|
|
+ 无可用电池
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex-row" style="justify-content: center;">
|
|
|
|
+ <view class="icon-box flex-row">
|
|
|
|
+ <view v-for="(item, index) in tagList" class="item-tag flex-row">
|
|
|
|
+ <text class="tag_name">
|
|
|
|
+ {{item.main_tag_name ? (item.main_tag_name) : ''}}{{item.child_tag_name ? '/' + item.child_tag_name : ''}}·
|
|
|
|
+ </text>
|
|
|
|
+ <text class="tag_num">{{'x' + item.num}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="grid_text_2">
|
|
|
|
- {{cabinetInfo.work_begin_time!=null?cabinetInfo.work_begin_time:'00:00'}}-{{cabinetInfo.work_end_time!=null?cabinetInfo.work_end_time:'23:59'}}
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view @tap="navToCabinet" class="right_grid flex-between">
|
|
|
|
- <view>
|
|
|
|
- <view class="cab_distance">
|
|
|
|
- 直线距您{{cabinetInfo.distance>1?(cabinetInfo.distance+'千米'):(cabinetInfo.distance*1000+'米')}}
|
|
|
|
|
|
+ </view> -->
|
|
|
|
+
|
|
|
|
+ <view class="flex-row flex-between">
|
|
|
|
+ <view :class="isWorkTimer ? 'left_grid_2' : 'left_grid_1'">
|
|
|
|
+ <view class="flex-row">
|
|
|
|
+ <img class="icon_grid"
|
|
|
|
+ :src="!isWorkTimer ? 'https://zxappfile.bms16.com/zx_admin/cab_timer.png' : 'https://zxappfile.bms16.com/zx_admin/cab_timer_work.png'">
|
|
|
|
+ <view :class="isWorkTimer ? 'grid_text_1' : 'grid_text_rest' ">{{isWorkTimer ? '营业中' : '已休息'}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="grid_text_2">
|
|
|
|
+ {{cabinetInfo.work_begin_time!=null?cabinetInfo.work_begin_time:'00:00'}}-{{cabinetInfo.work_end_time!=null?cabinetInfo.work_end_time:'23:59'}}
|
|
</view>
|
|
</view>
|
|
- <view class="cab_address">{{cabinetInfo.address}}</view>
|
|
|
|
</view>
|
|
</view>
|
|
- <view>
|
|
|
|
- <img class="icon_grid_1" src="https://zxappfile.bms16.com/zx_admin/cab_nav.png">
|
|
|
|
- <view class="grid_nav">导航</view>
|
|
|
|
|
|
+ <view @tap="navToCabinet" class="right_grid flex-between">
|
|
|
|
+ <view>
|
|
|
|
+ <view class="cab_distance">
|
|
|
|
+ 直线距您{{cabinetInfo.distance>1?(cabinetInfo.distance+'千米'):(cabinetInfo.distance*1000+'米')}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="cab_address">{{cabinetInfo.address}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view>
|
|
|
|
+ <img class="icon_grid_1" src="https://zxappfile.bms16.com/zx_admin/cab_nav.png">
|
|
|
|
+ <view class="grid_nav">导航</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="battery-list-view">
|
|
|
|
- <view class="battery-title flex-row flex-between">
|
|
|
|
- <text class="blod-text">格口详情</text>
|
|
|
|
- <text class="cabinet-ref">电柜编号:<text class="cabinet-ref-text"> {{cabinetInfo.dev_id}}</text></text>
|
|
|
|
- </view>
|
|
|
|
- <view class="battery-list-main flex-row flex-start">
|
|
|
|
- <view class="battery-list" v-for="(item, index) in batteryList" :key="item.unique">
|
|
|
|
- <block v-if="item.isReservation">
|
|
|
|
- <view class="battery-list-g">
|
|
|
|
- <view class="namber-view flex-row">
|
|
|
|
- <view class="namber namber-g">
|
|
|
|
- {{item.box_sn}}
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <view class="status-img-view flex-row">
|
|
|
|
- <img class="status-img" src="https://zxappfile.bms16.com/zx_admin/reservation.png"
|
|
|
|
- alt="">
|
|
|
|
- </view>
|
|
|
|
- <view class="tip-text tip-text-g1">已预约</view>
|
|
|
|
- </view>
|
|
|
|
- </block>
|
|
|
|
- <!-- 没有预约-->
|
|
|
|
- <block v-else>
|
|
|
|
- <!-- 空仓或者仓门不可用-->
|
|
|
|
- <view v-if="!item.cabinet_battery_sn||(item.fault_reason&&item.fault_reason.length>0)"
|
|
|
|
- :class="(item.fault_reason&&item.fault_reason.length>0)?'battery-list-s':'battery-list-g'">
|
|
|
|
- <!-- <view class="namber-view flex-row">
|
|
|
|
- <view
|
|
|
|
- :class="(item.fault_reason&&item.fault_reason.length>0)?'namber namber-s':'namber namber-g'">
|
|
|
|
- {{item.box_sn}}
|
|
|
|
- </view>
|
|
|
|
- </view> -->
|
|
|
|
-
|
|
|
|
- <view class="namber-view flex-row flex-between">
|
|
|
|
- <view
|
|
|
|
- :class="(item.fault_reason&&item.fault_reason.length>0)?'namber namber-s':'namber namber-g'">
|
|
|
|
- {{item.box_sn}}
|
|
|
|
|
|
+ <view class="battery-list-view">
|
|
|
|
+ <view class="battery-title flex-row flex-between">
|
|
|
|
+ <text class="blod-text">格口详情</text>
|
|
|
|
+ <text class="cabinet-ref">电柜编号:<text class="cabinet-ref-text"> {{cabinetInfo.dev_id}}</text></text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="battery-list-main flex-row flex-start">
|
|
|
|
+ <view class="battery-list" v-for="(item, index) in batteryList" :key="item.unique">
|
|
|
|
+ <!-- <block v-if="item.isReservation">
|
|
|
|
+ <view class="battery-list-g">
|
|
|
|
+ <view class="namber-view flex-row">
|
|
|
|
+ <view class="namber namber-g">
|
|
|
|
+ {{item.box_sn}}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="item.tag_info.length !== 0" class="tag_type_n">
|
|
|
|
- {{item.tag_info[0].main_tag_name ? (item.tag_info[0].main_tag_name) : ''}}{{item.tag_info[0].child_tag_name ? '/' + item.tag_info[0].child_tag_name : ''}}
|
|
|
|
|
|
+
|
|
|
|
+ <view class="status-img-view flex-row">
|
|
|
|
+ <img class="status-img" src="https://zxappfile.bms16.com/zx_admin/reservation.png"
|
|
|
|
+ alt="">
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="tip-text tip-text-g1">已预约</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
- <view class="status-img-view flex-row">
|
|
|
|
- <img v-if="!item.cabinet_battery_sn&&!(item.fault_reason&&item.fault_reason.length>0)"
|
|
|
|
- class="status-img" src="https://qiniu.bms16.com/FtOgmvwtoUCVzEyxIau6-6i0hjLt"
|
|
|
|
- alt="">
|
|
|
|
- <img v-if="item.fault_reason&&item.fault_reason.length>0" class="status-img"
|
|
|
|
- src="https://qiniu.bms16.com/FmMGYfe7eRSQvM8zeKEVeSmzbArd" alt="">
|
|
|
|
- </view>
|
|
|
|
- <!-- <view class="battery-ref">124513215</view> -->
|
|
|
|
- <view v-if="!item.cabinet_battery_sn&&!(item.fault_reason&&item.fault_reason.length>0)"
|
|
|
|
- class="tip-text tip-text-g">空仓</view>
|
|
|
|
- <view v-if="item.fault_reason&&item.fault_reason.length>0" class="tip-text tip-text-u">
|
|
|
|
- {{item.fault_reason[0]}}
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <!-- 满电或者电量未满 -->
|
|
|
|
- <view v-else :class="(item.is_full_soc==1)?'battery-list-b':'battery-list-o'">
|
|
|
|
- <view class="namber-view flex-row flex-between">
|
|
|
|
- <view :class="(item.is_full_soc==1)?'namber namber-b':'namber namber-o'">{{item.box_sn}}
|
|
|
|
|
|
+ </block> -->
|
|
|
|
+ <!-- 没有预约-->
|
|
|
|
+ <!-- <block v-else> -->
|
|
|
|
+ <!-- 空仓或者仓门不可用-->
|
|
|
|
+ <view v-if="!item.cabinet_battery_sn||(item.fault_reason&&item.fault_reason.length>0)"
|
|
|
|
+ :class="(item.fault_reason&&item.fault_reason.length>0)?'battery-list-s':'battery-list-g'">
|
|
|
|
+ <!-- <view class="namber-view flex-row">
|
|
|
|
+ <view
|
|
|
|
+ :class="(item.fault_reason&&item.fault_reason.length>0)?'namber namber-s':'namber namber-g'">
|
|
|
|
+ {{item.box_sn}}
|
|
|
|
+ </view>
|
|
|
|
+ </view> -->
|
|
|
|
+
|
|
|
|
+ <view class="namber-view flex-row flex-between">
|
|
|
|
+ <view
|
|
|
|
+ :class="(item.fault_reason&&item.fault_reason.length>0)?'namber namber-s':'namber namber-g'">
|
|
|
|
+ {{item.box_sn}}
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="item.tag_info && item.tag_info.length !== 0" class="tag_type_n">
|
|
|
|
+ {{item.tag_info[0].main_tag_name ? (item.tag_info[0].main_tag_name) : ''}}{{item.tag_info[0].child_tag_name ? '/' + item.tag_info[0].child_tag_name : ''}}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="item.tag_info.length !== 0" class="tag_type">
|
|
|
|
- {{item.tag_info[0].main_tag_name ? (item.tag_info[0].main_tag_name) : ''}}{{item.tag_info[0].child_tag_name ? '/' + item.tag_info[0].child_tag_name : ''}}
|
|
|
|
|
|
+
|
|
|
|
+ <view class="status-img-view flex-row">
|
|
|
|
+ <img v-if="!item.cabinet_battery_sn&&!(item.fault_reason&&item.fault_reason.length>0)"
|
|
|
|
+ class="status-img" src="https://qiniu.bms16.com/FtOgmvwtoUCVzEyxIau6-6i0hjLt"
|
|
|
|
+ alt="">
|
|
|
|
+ <img v-if="item.fault_reason&&item.fault_reason.length>0" class="status-img"
|
|
|
|
+ src="https://qiniu.bms16.com/FmMGYfe7eRSQvM8zeKEVeSmzbArd" alt="">
|
|
|
|
+ </view>
|
|
|
|
+ <!-- <view class="battery-ref">124513215</view> -->
|
|
|
|
+ <view v-if="!item.cabinet_battery_sn&&!(item.fault_reason&&item.fault_reason.length>0)"
|
|
|
|
+ class="tip-text tip-text-g">空仓</view>
|
|
|
|
+ <view v-if="item.fault_reason&&item.fault_reason.length>0" class="tip-text tip-text-u">
|
|
|
|
+ {{item.fault_reason[0]}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="status-img-view flex-row">
|
|
|
|
- <view v-if="item.cabinet_battery_sn" class="progress-bar-view">
|
|
|
|
- <progressView :soc="item.soc" :status="item.is_full_soc"></progressView>
|
|
|
|
|
|
+ <!-- 满电或者电量未满 -->
|
|
|
|
+ <view v-else :class="(item.is_full_soc==1)?'battery-list-b':'battery-list-o'">
|
|
|
|
+ <view class="namber-view flex-row flex-between">
|
|
|
|
+ <view :class="(item.is_full_soc==1)?'namber namber-b':'namber namber-o'">{{item.box_sn}}
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="item.tag_info && item.tag_info.length !== 0" class="tag_type">
|
|
|
|
+ {{item.tag_info[0].main_tag_name ? (item.tag_info[0].main_tag_name) : ''}}{{item.tag_info[0].child_tag_name ? '/' + item.tag_info[0].child_tag_name : ''}}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="item.cabinet_battery_sn" class="battery-number">
|
|
|
|
- {{item.battery_sn}}
|
|
|
|
- <!-- 0168 8256 9608 -->
|
|
|
|
|
|
+ <view class="status-img-view flex-row">
|
|
|
|
+ <view v-if="item.cabinet_battery_sn" class="progress-bar-view">
|
|
|
|
+ <progressView :soc="item.soc" :status="item.is_full_soc"></progressView>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="item.cabinet_battery_sn" class="battery-number">
|
|
|
|
+ {{item.battery_sn}}
|
|
|
|
+ <!-- 0168 8256 9608 -->
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view v-if="item.is_full_soc==1" class="tip-text tip-text-b">电池可用</view>
|
|
|
|
+ <view v-else class="tip-text tip-text-o">待充满</view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="item.is_full_soc==1" class="tip-text tip-text-b">电池可用</view>
|
|
|
|
- <view v-else class="tip-text tip-text-o">待充满</view>
|
|
|
|
- </view>
|
|
|
|
- </block>
|
|
|
|
|
|
+ <!-- </block> -->
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <scanBtn :dev_id="dev_id" :cab_info="cabinetInfo" @refreshCabinet="refreshCabinet"
|
|
|
|
+ @popPackageModel="clickPopPackageModel" ref="scanRef"></scanBtn>
|
|
|
|
+
|
|
|
|
+ <view v-if="isModelCenter" class="model_center">
|
|
|
|
+ <image class="pack_model" src="https://zxappfile.bms16.com/zx_client/buy_pack_model.png" />
|
|
|
|
+ <view v-if="packType==0" class="pack_model_text">您还未购买换电套餐,需先完成购买后再扫码领取电池</view>
|
|
|
|
+ <view v-if="packType==2" class="pack_model_text">您还未完成押金授权,现在前往押金授权?</view>
|
|
|
|
+ <view v-if="packType==0" class="look_package" @tap="clickLookPackage">查看套餐</view>
|
|
|
|
+ <view v-if="packType==2" class="look_package" @tap="clickMyPackage">去押金认证</view>
|
|
|
|
+ <view class="line_view"></view>
|
|
|
|
+ <image @tap="clickClosePackage" class="close_package"
|
|
|
|
+ src="https://zxappfile.bms16.com/zx_client/close_package.png"></image>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <scanBtn :dev_id="dev_id" :cab_info="cabinetInfo" @refreshCabinet="refreshCabinet"
|
|
|
|
- @popPackageModel="clickPopPackageModel" ref="scanRef"></scanBtn>
|
|
|
|
-
|
|
|
|
- <view v-if="isModelCenter" class="model_center">
|
|
|
|
- <image class="pack_model" src="https://zxappfile.bms16.com/zx_client/buy_pack_model.png" />
|
|
|
|
- <view v-if="packType==0" class="pack_model_text">您还未购买换电套餐,需先完成购买后再扫码领取电池</view>
|
|
|
|
- <view v-if="packType==2" class="pack_model_text">您还未完成押金授权,现在前往押金授权?</view>
|
|
|
|
- <view v-if="packType==0" class="look_package" @tap="clickLookPackage">查看套餐</view>
|
|
|
|
- <view v-if="packType==2" class="look_package" @tap="clickMyPackage">去押金认证</view>
|
|
|
|
- <view class="line_view"></view>
|
|
|
|
- <image @tap="clickClosePackage" class="close_package"
|
|
|
|
- src="https://zxappfile.bms16.com/zx_client/close_package.png"></image>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import progressView from '@/component/progressView/progressView';
|
|
|
|
- const http = require('../../common/http.js');
|
|
|
|
- const config = require('../../common/config.js');
|
|
|
|
|
|
+ import { getLocation, msg,strJoin } from '../../utils/util.js';
|
|
|
|
+import progressView from '@/component/progressView/progressView';
|
|
|
|
+ const http = require('../../common/request.js');
|
|
|
|
+ const config = require('../../common/config_gyq.js');
|
|
const common = require('../../common/common.js');
|
|
const common = require('../../common/common.js');
|
|
var user = require('../../common/user.js');
|
|
var user = require('../../common/user.js');
|
|
var bluetooth = require('../../common/bluetooth.js');
|
|
var bluetooth = require('../../common/bluetooth.js');
|
|
@@ -172,6 +173,8 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ dev_id: '',
|
|
|
|
+ listData:{},
|
|
isWorkTimer: true,
|
|
isWorkTimer: true,
|
|
tagList: [],
|
|
tagList: [],
|
|
batteryList: [], //电池列表
|
|
batteryList: [], //电池列表
|
|
@@ -182,7 +185,6 @@
|
|
myLocation: {},
|
|
myLocation: {},
|
|
reservation_info: [],
|
|
reservation_info: [],
|
|
cabinetInfo: {}, //机柜详情
|
|
cabinetInfo: {}, //机柜详情
|
|
- dev_id: '',
|
|
|
|
num: 0,
|
|
num: 0,
|
|
is_scan: 0,
|
|
is_scan: 0,
|
|
fre_price: 0,
|
|
fre_price: 0,
|
|
@@ -205,6 +207,7 @@
|
|
*/
|
|
*/
|
|
onLoad: function(options) {
|
|
onLoad: function(options) {
|
|
this.notShow = options.notShow?options.notShow:1
|
|
this.notShow = options.notShow?options.notShow:1
|
|
|
|
+ this.dev_id = options.dev_id
|
|
const storedLocation = uni.getStorageSync('user_current_location');
|
|
const storedLocation = uni.getStorageSync('user_current_location');
|
|
const car_list = uni.getStorageSync('user_car_list') || null
|
|
const car_list = uni.getStorageSync('user_car_list') || null
|
|
this.license_plate_number = car_list ? car_list.plate_number : ''
|
|
this.license_plate_number = car_list ? car_list.plate_number : ''
|
|
@@ -226,6 +229,7 @@
|
|
this.getLocationAndSave();
|
|
this.getLocationAndSave();
|
|
}
|
|
}
|
|
bluetooth.initBluetooth()
|
|
bluetooth.initBluetooth()
|
|
|
|
+
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
* 生命周期函数--监听页面显示
|
|
@@ -234,7 +238,6 @@
|
|
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
clickLookPackage() {
|
|
clickLookPackage() {
|
|
wx.switchTab({
|
|
wx.switchTab({
|
|
url: '/pages/packageCenter/packageCenter'
|
|
url: '/pages/packageCenter/packageCenter'
|
|
@@ -296,57 +299,54 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
- loadCabinetDetail() {
|
|
|
|
|
|
+ async loadCabinetDetail() {
|
|
//获取机柜信息
|
|
//获取机柜信息
|
|
const that = this
|
|
const that = this
|
|
- const pData = {
|
|
|
|
|
|
+ var _can_num = 0
|
|
|
|
+ let resp = await http.postApi(config.API_CABINET_INFO, {
|
|
|
|
+ dev_id:this.dev_id,
|
|
longitude: this.myLocation.longitude,
|
|
longitude: this.myLocation.longitude,
|
|
latitude: this.myLocation.latitude,
|
|
latitude: this.myLocation.latitude,
|
|
- dev_id: this.dev_id,
|
|
|
|
- service: "reservation"
|
|
|
|
- }
|
|
|
|
- var _can_num = 0
|
|
|
|
- http.postApi(config.API_NEAR_SHOP_CABINET_INFO, pData, (resp) => {
|
|
|
|
- if (resp.data.code === 200) {
|
|
|
|
- const _batteryList = resp.data.data.boxList
|
|
|
|
- // 计算可用电池数
|
|
|
|
- for (let i = 0; i < _batteryList.length; i++) {
|
|
|
|
- if (_batteryList[i].cabinet_battery_sn && (!(_batteryList[i].fault_reason &&
|
|
|
|
- _batteryList[i].fault_reason.length > 0))) {
|
|
|
|
- _can_num = _can_num + 1
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+ if (resp.data.code === 200) {
|
|
|
|
+ const _batteryList = resp.data.data.boxList
|
|
|
|
+ // 计算可用电池数
|
|
|
|
+ for (let i = 0; i < _batteryList.length; i++) {
|
|
|
|
+ if (_batteryList[i].cabinet_battery_sn && (!(_batteryList[i].fault_reason &&
|
|
|
|
+ _batteryList[i].fault_reason.length > 0))) {
|
|
|
|
+ _can_num = _can_num + 1
|
|
}
|
|
}
|
|
-
|
|
|
|
- var cabinetInfo = resp.data.data.cabinetInfo
|
|
|
|
- cabinetInfo.work_begin_time = cabinetInfo.work_begin_time == null ? '00:00' : cabinetInfo
|
|
|
|
- .work_begin_time
|
|
|
|
- cabinetInfo.work_end_time = cabinetInfo.work_end_time == null ? '00:00' : cabinetInfo
|
|
|
|
- .work_end_time
|
|
|
|
- const isWorkTimer = cabinetDetailImpl.isWithinTimeRange(cabinetInfo.work_begin_time,
|
|
|
|
- cabinetInfo.work_end_time)
|
|
|
|
- var reservation_List = resp.data.data.cabinetInfo.reservation_info
|
|
|
|
- var box_list = resp.data.data.boxList
|
|
|
|
- box_list = cabinetDetailImpl.getBoxReservation(box_list, reservation_List)
|
|
|
|
- console.log(box_list, "box_list")
|
|
|
|
- that.setData({
|
|
|
|
- reservation_info: reservation_List,
|
|
|
|
- isWorkTimer: isWorkTimer,
|
|
|
|
- tagList: resp.data.data.tagList,
|
|
|
|
- cabinetInfo: cabinetInfo,
|
|
|
|
- batteryList: box_list,
|
|
|
|
- online_status: cabinetInfo.online_status,
|
|
|
|
- can_battery_num: _can_num,
|
|
|
|
- shop_image: JSON.parse(cabinetInfo.imgs.split(',')) || []
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- common.simpleToast(resp.data.msg)
|
|
|
|
- setTimeout(() => {
|
|
|
|
- uni.switchTab({
|
|
|
|
- url: '/pages/index/index'
|
|
|
|
- });
|
|
|
|
- }, 1500)
|
|
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ var cabinetInfo = resp.data.data.cabinetInfo
|
|
|
|
+ cabinetInfo.work_begin_time = cabinetInfo.work_begin_time == null ? '00:00' : cabinetInfo
|
|
|
|
+ .work_begin_time
|
|
|
|
+ cabinetInfo.work_end_time = cabinetInfo.work_end_time == null ? '00:00' : cabinetInfo
|
|
|
|
+ .work_end_time
|
|
|
|
+ const isWorkTimer = cabinetDetailImpl.isWithinTimeRange(cabinetInfo.work_begin_time,
|
|
|
|
+ cabinetInfo.work_end_time)
|
|
|
|
+ var reservation_List = resp.data.data.cabinetInfo.reservation_info
|
|
|
|
+ var box_list = resp.data.data.boxList
|
|
|
|
+ // box_list = cabinetDetailImpl.getBoxReservation(box_list, reservation_List)
|
|
|
|
+ console.log(box_list, "box_list")
|
|
|
|
+ that.setData({
|
|
|
|
+ reservation_info: reservation_List,
|
|
|
|
+ isWorkTimer: isWorkTimer,
|
|
|
|
+ tagList: resp.data.data.tagList,
|
|
|
|
+ cabinetInfo: cabinetInfo,
|
|
|
|
+ batteryList: box_list,
|
|
|
|
+ online_status: cabinetInfo.online_status,
|
|
|
|
+ can_battery_num: _can_num,
|
|
|
|
+ shop_image: JSON.parse(cabinetInfo.imgs.split(',')) || []
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ common.simpleToast(resp.data.msg)
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: '/pages/index/index'
|
|
|
|
+ });
|
|
|
|
+ }, 1500)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
refreshCabinet() {
|
|
refreshCabinet() {
|