Commit 2ce1960b by 王榕

电池接口接入

parent a416261c
<view> <view>
<view class="custom_nav" style="height:{{navbarHeight}}px;"> <cover-view class="custom_nav" style="height:{{navbarHeight}}px;">
<view class="custom_nav_box" style="height:{{navbarHeight}}px;"> <cover-view class="custom_nav_box" style="height:{{navbarHeight}}px;">
<view class="custom_nav_bar" style="top:{{statusBarHeight}}px; height:{{cusnavH}}px;"> <cover-view class="custom_nav_bar" style="top:{{statusBarHeight}}px; height:{{cusnavH}}px;">
<block wx:if="{{isSearch}}"> <block wx:if="{{isSearch}}">
<input class="navSearch" style="height:{{navbarBtn.height-2}}px;line-height:{{navbarBtn.height-4}}px; top:{{navbarBtn.top+1}}px; left:{{navbarBtn.right}}px; border-radius:{{navbarBtn.height/2}}px;" maxlength="10" bindinput="bindKeyInput" placeholder="输入文字搜索" <input class="navSearch" style="height:{{navbarBtn.height-2}}px;line-height:{{navbarBtn.height-4}}px; top:{{navbarBtn.top+1}}px; left:{{navbarBtn.right}}px; border-radius:{{navbarBtn.height/2}}px;" maxlength="10" bindinput="bindKeyInput" placeholder="输入文字搜索"
/> />
</block> </block>
<block wx:else> <block wx:else>
<view class="custom_nav_icon {{!haveBack||'borderLine'}}" style="height:{{navbarBtn.height}}px;line-height:{{navbarBtn.height-2}}px; top:{{navbarBtn.top}}px; left:{{navbarBtn.right}}px; border-radius:{{navbarBtn.height/2}}px;"> <cover-view class="custom_nav_icon {{!haveBack||'borderLine'}}" style="height:{{navbarBtn.height}}px;line-height:{{navbarBtn.height-2}}px; top:{{navbarBtn.top}}px; left:{{navbarBtn.right}}px; border-radius:{{navbarBtn.height/2}}px;">
<view wx:if="{{haveBack}}" class="icon-back" bindtap='_goBack'> <cover-view wx:if="{{haveBack}}" class="icon-back" bindtap='_goBack'>
<image src='./back.png' mode='aspectFill' class='back-pre'></image> <cover-image src='./back.png' mode='aspectFill' class='back-pre'></cover-image>
</view> </cover-view>
<view wx:if="{{haveBack}}" class='navbar-v-line'></view> <cover-view wx:if="{{haveBack}}" class='navbar-v-line'></cover-view>
<view class="icon-home"> <cover-view class="icon-home">
<view class="home_a" catchtap="_clickLeftIcon"> <cover-view class="home_a" catchtap="_clickLeftIcon">
<image src='{{more?moreIcon:homeIcon}}' mode='aspectFill' class='back-home'></image> <cover-image src='{{more?moreIcon:homeIcon}}' mode='aspectFill' class='back-home'></cover-image>
</view> </cover-view>
</view> </cover-view>
</view> </cover-view>
<view class="nav_title" style="height:{{cusnavH}}px; line-height:{{cusnavH}}px;"> <cover-view class="nav_title" style="height:{{cusnavH}}px; line-height:{{cusnavH}}px;">
{{vTitle}} {{vTitle}}
</view> </cover-view>
</block> </block>
</view> </cover-view>
</view> </cover-view>
</view> </cover-view>
<!-- <view style="height:{{navbarHeight}}rpx;"></view> --> <!-- <view style="height:{{navbarHeight}}rpx;"></view> -->
<slot /> <slot />
</view> </view>
\ No newline at end of file
// const type = 'dev' const type = 'dev'
const type = 'pro' // const type = 'pro'
var config = { var config = {
dev: { dev: {
appid: 'wxb517dae1188a1900', appid: 'wxb517dae1188a1900',
api: 'http://192.168.0.102:9995/app/', api: 'http://47.92.207.93:8084/app/',
wss: 'wss://app.doomore.cn/websocket/app/api/', wss: 'wss://app.doomore.cn/websocket/app/api/',
payapi: 'http://192.168.0.102:9995/pay/', payapi: 'http://47.92.207.93:8084/pay/',
rapi: 'https://app.doomore.cn/repair/app/',//repair rapi: 'http://47.92.207.93:8084/app/',//repair
version: 'v1.0.00', version: 'v1.0.00',
imgPath: '/static/image/' imgPath: '/static/image/'
}, },
......
...@@ -773,9 +773,21 @@ function getPx(rpx) { ...@@ -773,9 +773,21 @@ function getPx(rpx) {
function getRpx(px) { function getRpx(px) {
return px * 750 / windowWidth return px * 750 / windowWidth
} }
function arrTarrs(num, arr) { // 一维数组转换为二维数组
const iconsArr = []; // 声明数组
arr.forEach((item, index) => {
const page = Math.floor(index / num); // 计算该元素为第几个素组内
if (!iconsArr[page]) { // 判断是否存在
iconsArr[page] = [];
}
iconsArr[page].push(item);
});
return iconsArr;
}
module.exports = { module.exports = {
formatTime, formatTime,
imgName, imgName,
arrTarrs,
api, api,
getUserInfo, getUserInfo,
wxLogin, wxLogin,
......
...@@ -13,134 +13,56 @@ const { ...@@ -13,134 +13,56 @@ const {
userLocation, userLocation,
getRgbColor, getRgbColor,
getPx, getPx,
arrTarrs,
wxscan wxscan
} = require('../../lib/util.js') } = require('../../lib/util.js')
const moment = require('../../lib/moment.js') const moment = require('../../lib/moment.js')
let cmd = null let cmd = null
let app = getApp() let app = getApp()
let timer
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
vos: [ gprsImei: '',
[{ bmsVer: '',
index: '01', bmsVolt: '',
vo: '3.544' bmsCurrent: '',
}, { bmsState: '',
index: '01', bmsCycles: '',
vo: '3.544' bmsSoc: '',
}, { gpsSnr: '',
index: '01', gpsLocate: '',
vo: '3.544' updateTime: '',
}, { cellVolt: [
index: '01', [
vo: '3.544' // {
}], // index: '01',
[{ // vo: '3.544'
index: '01', // }
vo: '3.544' ],
}, { ],
index: '01', bmsTempetrue: [
vo: '3.544' [
}, { // {
index: '01', // index: '01',
vo: '3.544' // vo: '3.544'
}, { // }
index: '01', ],
vo: '3.544'
}],
[{
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}],
[{
index: '01',
vo: '3.544'
}, {
index: '01',
msg:true,
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}]
], ],
tms: [
[{
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}],
[{
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}],
[{
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}],
[{
index: '01',
vo: '3.544'
}, {
index: '01',
msg: true,
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}, {
index: '01',
vo: '3.544'
}]
]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function(options) {
this.getCarDetail()
clearInterval(timer)
setInterval(() => {
this.getCarDetail()
}, 4000)
}, },
drawProgressbg: function() { drawProgressbg: function() {
...@@ -201,27 +123,91 @@ Page({ ...@@ -201,27 +123,91 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function() { onUnload: function() {
clearInterval(timer)
}, },
getCarDetail() {
/** api.get('device/base/deviceDetailNew', {}, true)
* 页面相关事件处理函数--监听用户下拉动作 .then(res => {
*/ let {
onPullDownRefresh: function() { data,
model: {
deviceBmsInfo
}
} = res
let carData = {
...data,
...deviceBmsInfo
}
this.setUI2(carData)
})
.catch(err => {
console.error(1, err)
})
}, },
// 轮询设置
/** setUI2(data) {
* 页面上拉触底事件的处理函数 console.log(data)
*/ let {
onReachBottom: function() { gprsImei,
bmsVer,
bmsVolt,
bmsCurrent,
bmsState,
bmsCycles,
bmsSoc,
gpsSnr,
gpsLocate,
cellVolt,
bmsTempetrue,
updateTime
} = data
if (bmsState == 1) {
bmsState = '开锁'
} else {
bmsState = '关锁'
}
cellVolt = JSON.parse(cellVolt)
bmsTempetrue = JSON.parse(bmsTempetrue)
if (cellVolt && cellVolt.length) {
cellVolt = arrTarrs(4,cellVolt.map((elt,i) => {
return {
index:i,
vo:elt
}
}))
} else {
cellVolt = [
[]
]
}
if (bmsTempetrue && bmsTempetrue.length) {
bmsTempetrue = arrTarrs(4, bmsTempetrue.map((elt, i) => {
return {
index: i,
vo: elt
}
}))
} else {
cellVolt = [
[]
]
}
this.setData({
gprsImei,
bmsVer,
bmsVolt,
bmsCurrent,
bmsState,
bmsCycles,
bmsSoc,
updateTime,
gpsSnr,
cellVolt,
bmsTempetrue,
batteryDeatil: data
})
this.drawCircle(bmsSoc);
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
}) })
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<canvas class="cvs progress_bg" canvas-id="canvasProgressbg"> </canvas> <canvas class="cvs progress_bg" canvas-id="canvasProgressbg"> </canvas>
<canvas class="cvs progress_canvas" canvas-id="canvasProgress"> </canvas> <canvas class="cvs progress_canvas" canvas-id="canvasProgress"> </canvas>
<view class="content"> <view class="content">
<view class="power">65 <view class="power">{{bmsSoc}}
<text>%</text> <text>%</text>
</view> </view>
<view class="bar"></view> <view class="bar"></view>
...@@ -13,36 +13,36 @@ ...@@ -13,36 +13,36 @@
</view> </view>
<view class="b-right"> <view class="b-right">
<view class="b-right-top"> <view class="b-right-top">
<view>ABCDEF1234567890</view> <view>{{batteryDeatil.bmsSn}}</view>
<view class="error">警告!电池异常 3345</view> <view class="error" wx:if="{{batteryDeatil.bmsErrCode}}">警告!电池异常 {{batteryDeatil.bmsErrCode}}</view>
</view> </view>
<view class="b-right-bottom"> <view class="b-right-bottom">
<view class="b-right-line1"> <view class="b-right-line1">
<view class="col-item"> <view class="col-item">
<text>电压</text> <text>电压</text>
<text>5.0V</text> <text>{{bmsVolt}}V</text>
</view> </view>
<view class="col-item"> <view class="col-item">
<text>电流</text> <text>电流</text>
<text>1.0A</text> <text>{{bmsCurrent}}A</text>
</view> </view>
<view class="col-item"> <view class="col-item">
<text>状态</text> <text>状态</text>
<text>充电中</text> <text>{{bmsState}}</text>
</view> </view>
<view class="col-item"> <view class="col-item">
<text>电池循环</text> <text>电池循环</text>
<text>1次</text> <text>{{bmsCycles}}次</text>
</view> </view>
</view> </view>
<view class="b-right-line2"> <view class="b-right-line2">
<view class="col-item"> <view class="col-item">
<text>电池版本</text> <text>电池版本</text>
<text>ver33333</text> <text>{{bmsVer}}</text>
</view> </view>
<view class="col-item"> <view class="col-item">
<text>IMEI</text> <text>IMEI</text>
<text>232321312312313221</text> <text>{{gprsImei}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<text>(单位:V)</text> <text>(单位:V)</text>
</view> </view>
<view class="info-content"> <view class="info-content">
<view wx:for="{{vos}}" wx:key="{{index}}" class="vos-row"> <view wx:for="{{cellVolt}}" wx:key="{{index}}" class="vos-row">
<view wx:for="{{item}}" wx:key="{{vItem.index}}" wx:for-item="vItem" class="vos-item"> <view wx:for="{{item}}" wx:key="{{vItem.index}}" wx:for-item="vItem" class="vos-item">
<text>{{vItem.index}}</text> <text>{{vItem.index}}</text>
<text class="num {{vItem.msg?'error':''}}">{{vItem.vo}}</text> <text class="num {{vItem.msg?'error':''}}">{{vItem.vo}}</text>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<text>(单位:℃)</text> <text>(单位:℃)</text>
</view> </view>
<view class="info-content"> <view class="info-content">
<view wx:for="{{vos}}" wx:key="{{index}}" class="vos-row"> <view wx:for="{{bmsTempetrue}}" wx:key="{{index}}" class="vos-row">
<view wx:for="{{item}}" wx:key="{{vItem.index}}" wx:for-item="vItem" class="vos-item"> <view wx:for="{{item}}" wx:key="{{vItem.index}}" wx:for-item="vItem" class="vos-item">
<text>{{vItem.index}}</text> <text>{{vItem.index}}</text>
<text class="num {{vItem.msg?'error':''}}">{{vItem.vo}}</text> <text class="num {{vItem.msg?'error':''}}">{{vItem.vo}}</text>
......
...@@ -82,6 +82,12 @@ ...@@ -82,6 +82,12 @@
justify-content: space-between; justify-content: space-between;
margin-top: 16rpx; margin-top: 16rpx;
} }
.b-right-line1 .col-item{
flex: 0 0 25%;
}
.b-right-line2 .col-item{
flex: 1;
}
.col-item text:nth-of-type(1){ .col-item text:nth-of-type(1){
color: #587699; color: #587699;
margin-right: 10rpx; margin-right: 10rpx;
...@@ -109,11 +115,17 @@ ...@@ -109,11 +115,17 @@
font-size: 20rpx; font-size: 20rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.info-body .vos-item{
flex: 1;
display: flex;
}
.vos-item text:nth-of-type(1){ .vos-item text:nth-of-type(1){
padding: 3px 6px; padding: 3px 6px;
background-color: #587699; background-color: #587699;
border-radius: 3px; border-radius: 3px;
margin-right: 14rpx; margin-right: 14rpx;
text-align: center;
min-width: 24rpx;
} }
.vos-item text:nth-of-type(2){ .vos-item text:nth-of-type(2){
color: #587699; color: #587699;
......
<view class='map'> <view class='map'>
<!-- <view class='map-top'> <map class="map" id='carMap' scale='13' markers='{{locMap.markers}}' polyline='{{polyline}}' show-location longitude='{{locMap.longitude}}' latitude='{{locMap.latitude}}'>
<view class='top'>{{ui.deviceAdress}}</view>
<view class='bottom'>
<text decode='{{true}}'>GPS:{{ui.GPS}} &nbsp; GSM:{{ui.GSM}}</text>
<text>定位时间:{{ui.gps_time}}</text>
</view>
</view> -->
<map id='carMap' scale='13' markers='{{ui.locMap.markers}}' show-location bindmarkertap='markersTap' longitude='{{ui.locMap.longitude}}' latitude='{{ui.locMap.latitude}}'>
<cover-view wx:if='{{deviceLocError}}' class='out-line'>当前设备定位异常</cover-view> <cover-view wx:if='{{deviceLocError}}' class='out-line'>当前设备定位异常</cover-view>
<!-- </cover-view> --> <!-- </cover-view> -->
</map> </map>
<view> <view>
<view class="map-bottom"> <view class="map-bottom">
<view class="map-bottom-right"> <view class="map-bottom-right">
<view>当前位置:{{ui.deviceAdress}}</view> <view>当前位置:{{batteryDeatil.address}}</view>
<view>最后上报:{{ui.gps_time}}</view> <view>最后上报:{{batteryDeatil.time}}</view>
<view>信号强度:GPS <text class="error">{{ui.GPS}}</text> GSM {{ui.GSM}}</view> <view>信号强度:GPS
<text class="{{batteryDeatil.gpsSnr?'':'error'}}">{{batteryDeatil.gpsSnr}}</text> GSM
<text class="{{batteryDeatil.gsmSnr?'':'error'}}">{{batteryDeatil.gsmSnr}}</text>
</view>
</view> </view>
<view class="abtn detail-btn" bindtap="chooseTime">查看轨迹</view> <picker mode="multiSelector" bindchange="bindTimeChange" bindcolumnchange="bindTimeColumnChange" value="{{multiIndex}}" range="{{multiArray}}">
</view> <view class="abtn detail-btn" bindtap="chooseTime">查看轨迹</view>
</picker>
</view> </view>
<!-- <view class='map-bottom'> </view>
<!-- <view class='map-bottom'>
<view catchtap='showMyLoc'> <view catchtap='showMyLoc'>
<image src='{{imgToloc}}'></image> <image src='{{imgToloc}}'></image>
<text>我的位置</text> <text>我的位置</text>
......
...@@ -3,6 +3,7 @@ const { api, formatTime, imgName, wxLogin, payApi, alertTip, useTime, changeTime ...@@ -3,6 +3,7 @@ const { api, formatTime, imgName, wxLogin, payApi, alertTip, useTime, changeTime
Page({ Page({
data: { data: {
price:'30.0', price:'30.0',
restDay:'',
payType: 'rent',//deposit rent payType: 'rent',//deposit rent
success:true,// success:true,//
orderNumber:'', orderNumber:'',
...@@ -15,7 +16,11 @@ Page({ ...@@ -15,7 +16,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options)
this.setData({
endRentTime: options.serverEndDate,
restDay: options.day,
})
}, },
//判断是否未支付定单或者押金 个租 //判断是否未支付定单或者押金 个租
getRentRecord() { getRentRecord() {
......
<view class="con"> <view class="con">
<view class="battery-tip"> <view class="battery-tip">
<text>该电池的物联网服务剩余</text> <text>该电池的物联网服务剩余</text>
<text>33</text> <text>{{restDay}}</text>
<text>天</text> <text>天</text>
</view> </view>
<view class="time-body"> <view class="time-body">
<view class="bar"></view> <view class="bar"></view>
<view class="time">截止到 2020-12-12</view> <view class="time">截止到 {{endRentTime}}</view>
<view class="bar"></view> <view class="bar"></view>
</view> </view>
<text class="tip"> <text class="tip">
......
...@@ -242,24 +242,7 @@ Page({ ...@@ -242,24 +242,7 @@ Page({
logAfter(res) { logAfter(res) {
wx.setStorageSync('user', res.data) wx.setStorageSync('user', res.data)
//有车 //有车
this.getCarList() wx.navigateBack()
.then(hasCar => {
if (hasCar) {
//有使用的车辆 跳到用车
wx.switchTab({
url: '/pages/user_index/user_index',
})
return
} else {
//没车绑定车辆
wx.redirectTo({
url: '/pages/device_bind/device_bind',
})
}
})
.catch(err => {
alertTip(err.toString())
})
}, },
loginBycode() { loginBycode() {
let body = { let body = {
......
...@@ -176,14 +176,11 @@ Page({ ...@@ -176,14 +176,11 @@ Page({
}) })
}, },
onPullDownRefresh() {
this.getCarList()
},
changeCar(vcuNo) { changeCar(vcuNo) {
confirmTip(`确定切换设备为${vcuNo}`, () => { confirmTip(`确定切换设备为${vcuNo}`, () => {
api.post('device/changeDevice', { api.post('device/changeDevice', {
vcuNo vcuNo
}) })
.then(res => { .then(res => {
const user = wx.getStorageSync('user') const user = wx.getStorageSync('user')
user.userMapp.nowVcuNo = vcuNo user.userMapp.nowVcuNo = vcuNo
...@@ -201,6 +198,10 @@ Page({ ...@@ -201,6 +198,10 @@ Page({
}) })
}) })
}, },
onPullDownRefresh() {
this.getCarList()
},
unbindCar(vcuNo) { unbindCar(vcuNo) {
let that = this let that = this
wx.showModal({ wx.showModal({
......
...@@ -5,77 +5,83 @@ ...@@ -5,77 +5,83 @@
<canvas class="cvs progress_canvas" canvas-id="canvasProgress"> </canvas> <canvas class="cvs progress_canvas" canvas-id="canvasProgress"> </canvas>
<view class="progress_text"> <view class="progress_text">
<view class="iv ab it"> <view class="iv ab it">
<text wx:if="{{hasBattery}}">5.0V</text> <text wx:if="{{auth&&hasBattery}}">{{bmsVolt}}V</text>
<text>电压</text> <text>电压</text>
</view> </view>
<view class="ia ab it"> <view class="ia ab it">
<text wx:if="{{hasBattery}}">1.0A</text> <text wx:if="{{auth&&hasBattery}}">{{bmsCurrent}}A</text>
<text>电流</text> <text>电流</text>
</view> </view>
<view class="is ab it"> <view class="is ab it">
<text wx:if="{{hasBattery}}">充电中</text> <text wx:if="{{auth&&hasBattery}}">{{bmsState}}</text>
<text>状态</text> <text>状态</text>
</view> </view>
<view class="ix ab it"> <view class="ix ab it">
<text wx:if="{{hasBattery}}">1次</text> <text wx:if="{{auth&&hasBattery}}">{{bmsCycles}}次</text>
<text>电池循环</text> <text>电池循环</text>
</view> </view>
<view class="ic ab"> <view class="ic ab">
<view class="power-content"> <view class="power-content">
<text wx:if="{{hasBattery}}">剩余电量</text> <block wx:if="{{!auth}}">
<view wx:if="{{!hasBattery}}" class="no-battery">您还未绑定电池</view> <view class="no-battery">您还未登录哦</view>
<view wx:if="{{hasBattery}}"> </block>
65 <block wx:else>
<text>%</text> <text wx:if="{{hasBattery}}">剩余电量</text>
</view> <view wx:if="{{!hasBattery}}" class="no-battery">您还未绑定电池</view>
<view wx:if="{{hasBattery}}">
{{bmsSoc}}
<text>%</text>
</view>
</block>
</view> </view>
<view class="sep-bar"></view> <view class="sep-bar"></view>
<view class="bms-no" wx:if="{{hasBattery}}">ABCDEF1234567890</view> <view class="bms-no" wx:if="{{auth&&hasBattery}}">{{gprsImei}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="pg" wx:if="{{hasBattery}}"> <view class="pg" wx:if="{{auth&&hasBattery}}">
<view class="vip-box abtn" catchtap="showBuying"> <view class="vip-box abtn" catchtap="showBuying">
<view>物联网卡服务截止到 2020-12-12</view> <view>物联网卡服务截止到 {{serverEndDate}}</view>
<view class="v-t2"> <view class="v-t2">
<view> <view>
<text>剩余</text> <text>剩余</text>
<text class="day">33</text> <text class="day">{{batteryDeatil.restDay}}</text>
<text>天</text> <text>天</text>
</view> </view>
<text>VIP续费</text> <text>VIP续费</text>
</view> </view>
</view> </view>
</view> </view>
<view class="pg" wx:if="{{hasBattery}}"> <view class="pg" wx:if="{{auth&&hasBattery}}">
<map class="map" id='carMap' scale='13' markers='{{ui.locMap.markers}}' show-location longitude='{{ui.locMap.longitude}}' latitude='{{ui.locMap.latitude}}'> <map class="map" id='carMap' scale='13' markers='{{locMap.markers}}' show-location longitude='{{locMap.longitude}}' latitude='{{locMap.latitude}}'>
<cover-view class="cover" bindtap="seeMap"> <cover-view class="cover" bindtap="seeMap">
<cover-view class="c-top"> <cover-view class="c-top">
<cover-view>GPS |||||</cover-view> <cover-view>GPS {{gpsSnr}}</cover-view>
<cover-view>GSM |||||</cover-view> <cover-view>GSM {{batteryDeatil.gsmSnr}}</cover-view>
</cover-view> </cover-view>
<cover-view class="c-bottom"> <cover-view class="c-bottom">
<cover-view>浙江省杭州市余杭区</cover-view> <cover-view>{{batteryDeatil.address}}</cover-view>
<cover-view>2020-10-22 12:22:33</cover-view> <cover-view>{{updateTime}}</cover-view>
</cover-view> </cover-view>
</cover-view> </cover-view>
</map> </map>
</view> </view>
<view class="pg" wx:if="{{hasBattery}}"> <view class="pg" wx:if="{{auth&&hasBattery}}">
<view class="battery-box abtn" bindtap="toHeath"> <view class="battery-box abtn" bindtap="toHeath">
<view class="b-left"> <view class="b-left">
<text>电池健康度</text> <text>电池健康度</text>
<text>良好的电池使用习惯可以延长电池寿命</text> <text>良好的电池使用习惯可以延长电池寿命</text>
</view> </view>
<view class="b-right"> <view class="b-right">
<text>80</text> <text>{{batteryDeatil.health}}</text>
<text>分</text> <text>分</text>
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{!hasBattery}}" class="bind-btn"> <view wx:if="{{!auth&&hasBattery}}" class="bind-btn">
<view class="btn" catchtap="bindBattery">立即扫码绑定</view> <view wx:if="{{!auth}}" catchtap="reLogin">立即登录</view>
<view class="btn" catchtap="bindBattery" wx:else>立即扫码绑定</view>
</view> </view>
<i-modal visible="{{ lockAction }}" title="{{targetStatus===0?'关锁中。。':'开锁中。。'}}" show-ok="{{false}}" show-cancel="{{false}}"> <i-modal visible="{{ lockAction }}" title="{{targetStatus===0?'关锁中。。':'开锁中。。'}}" show-ok="{{false}}" show-cancel="{{false}}">
<view style='padding:0 10rpx;'> <view style='padding:0 10rpx;'>
...@@ -86,10 +92,26 @@ ...@@ -86,10 +92,26 @@
<cover-view class="my-cover {{myModel?'my-model':''}}" style="top:{{navHeight}}px" bindtap="showMy"> <cover-view class="my-cover {{myModel?'my-model':''}}" style="top:{{navHeight}}px" bindtap="showMy">
<cover-view class="my-body" catchtap="nullfunc"> <cover-view class="my-body" catchtap="nullfunc">
<cover-view class="my-avator"> <cover-view class="my-avator">
<cover-image class="avator" src="{{user.avatarUrl}}"></cover-image> <block wx:if="{{user.avatarUrl}}">
<cover-image class="avator" src="{{user.avatarUrl||'./defaultAvator.png'}}"></cover-image>
</block>
<block wx:else>
<open-data class="avator" type="userAvatarUrl"></open-data>
</block>
<cover-view class="my-right"> <cover-view class="my-right">
<cover-view class="nickname">{{user.nickname}}</cover-view> <block wx:if="{{auth}}">
<cover-view catchtap="bindBattery" class="bind-btn abtn">绑定电池</cover-view> <block wx:if="{{user.nickname}}">
<cover-view class="nickname">{{user.nickname}}</cover-view>
</block>
<block wx:else>
<open-data class="nickname" type="userNickName"></open-data>
</block>
<cover-view catchtap="bindBattery" class="bind-btn abtn">绑定电池</cover-view>
</block>
<block wx:else>
<cover-view class="nickname" bindtap="reLogin">点击登录</cover-view>
</block>
</cover-view> </cover-view>
</cover-view> </cover-view>
<!-- <cover-view catchtap="bindBattery" class="bind-btn2"></cover-view> --> <!-- <cover-view catchtap="bindBattery" class="bind-btn2"></cover-view> -->
...@@ -99,14 +121,10 @@ ...@@ -99,14 +121,10 @@
</cover-view> </cover-view>
<cover-view>绑定电池</cover-view> <cover-view>绑定电池</cover-view>
</cover-view> --> </cover-view> -->
<cover-view class="battery-list"> <cover-view class="battery-list" wx:if="{{batteryList.length}}">
<cover-view class="battery-item"> <cover-view class="battery-item" wx:for="{{batteryList}}" wx:key="{{item.id}}" bindtap="changeCar" data-id="{{item.id}}" data-deviceNo="{{item.deviceNo}}">
<cover-view class="battery-no">ABCDEF1234567890</cover-view> <cover-view class="battery-no">{{item.gprsImei}}</cover-view>
<cover-view>33%</cover-view> <cover-view>{{item.bmsSoc||'0'}}%</cover-view>
</cover-view>
<cover-view class="battery-item">
<cover-view class="battery-no">ABCDEF1234567890</cover-view>
<cover-view>33%</cover-view>
</cover-view> </cover-view>
</cover-view> </cover-view>
......
...@@ -41,7 +41,7 @@ page { ...@@ -41,7 +41,7 @@ page {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: #fff; color: #fff;
padding-top: 200rpx; /* padding-top: 200rpx; */
} }
.bind-btn >view{ .bind-btn >view{
padding: 4px 20px; padding: 4px 20px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment