Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bms
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
iambtr
bms
Commits
87116914
Commit
87116914
authored
May 19, 2020
by
王榕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改电池健康度
parent
1b0f1c7d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
16 deletions
+104
-16
batteryHeath.js
pages/batteryHeath/batteryHeath.js
+35
-5
batteryHeath.wxml
pages/batteryHeath/batteryHeath.wxml
+10
-0
batteryHeath.wxss
pages/batteryHeath/batteryHeath.wxss
+30
-0
user_index.wxml
pages/user_index/user_index.wxml
+17
-7
user_index.wxss
pages/user_index/user_index.wxss
+12
-4
No files found.
pages/batteryHeath/batteryHeath.js
View file @
87116914
...
@@ -58,11 +58,11 @@ Page({
...
@@ -58,11 +58,11 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
getCarDetail
()
//
this.getCarDetail()
clearInterval
(
timer
)
//
clearInterval(timer)
setInterval
(()
=>
{
//
setInterval(() => {
this
.
getCarDetail
()
//
this.getCarDetail()
},
4000
)
//
}, 4000)
},
},
drawProgressbg
:
function
()
{
drawProgressbg
:
function
()
{
...
@@ -125,6 +125,36 @@ Page({
...
@@ -125,6 +125,36 @@ Page({
onUnload
:
function
()
{
onUnload
:
function
()
{
clearInterval
(
timer
)
clearInterval
(
timer
)
},
},
openBattery
(){
api
.
post
(
'device/base/lockAndUnLock?state=1'
,
{
state
:
1
},
true
)
.
then
(
res
=>
{
// alertTip('开锁成功')
// this.setData({
// 'ui.lockState': 1,
// })
toastTip
(
'发送指令成功'
)
})
.
catch
(
err
=>
{
alertTip
(
err
)
})
},
closeBattery
(){
api
.
post
(
'device/base/lockAndUnLock?state=1'
,
{
state
:
1
},
true
)
.
then
(
res
=>
{
// alertTip('开锁成功')
// this.setData({
// 'ui.lockState': 1,
// })
toastTip
(
'发送指令成功'
)
})
.
catch
(
err
=>
{
alertTip
(
err
)
})
},
getCarDetail
()
{
getCarDetail
()
{
api
.
get
(
'device/base/deviceDetailNew'
,
{},
true
)
api
.
get
(
'device/base/deviceDetailNew'
,
{},
true
)
.
then
(
res
=>
{
.
then
(
res
=>
{
...
...
pages/batteryHeath/batteryHeath.wxml
View file @
87116914
...
@@ -49,6 +49,16 @@
...
@@ -49,6 +49,16 @@
</view>
</view>
</view>
</view>
<view class="sep-dot"></view>
<view class="sep-dot"></view>
<view class="btn-body">
<view bindtap="openBattery">
<image src="http://ruiju.oss-cn-hangzhou.aliyuncs.com/jindun/batteryOpen.png"></image>
<text>启动电池</text>
</view>
<view bindtap="closeBattery">
<image src="http://ruiju.oss-cn-hangzhou.aliyuncs.com/jindun/batteryClose.png"></image>
<text>关闭电池</text>
</view>
</view>
<view class="info-body">
<view class="info-body">
<view class="info-title">单节电压
<view class="info-title">单节电压
<text>(单位:V)</text>
<text>(单位:V)</text>
...
...
pages/batteryHeath/batteryHeath.wxss
View file @
87116914
...
@@ -129,4 +129,33 @@
...
@@ -129,4 +129,33 @@
}
}
.vos-item text:nth-of-type(2){
.vos-item text:nth-of-type(2){
color: #587699;
color: #587699;
}
.btn-body{
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 40rpx;
}
.btn-body >view{
border: 1rpx solid #004482;
background-color: #5876992a;
border-radius: 8rpx;
height: 123rpx;
width: 340rpx;
display: flex;
align-items: center;
justify-content: center;
}
.btn-body >view:active{
opacity: 0.8;
}
.btn-body >view image{
width: 62rpx;
height: 62rpx;
margin-right: 20rpx;
}
.btn-body >view text{
font-size: 28rpx;
font-weight: bold;
color: #E5E5E5;
}
}
\ No newline at end of file
pages/user_index/user_index.wxml
View file @
87116914
...
@@ -5,19 +5,27 @@
...
@@ -5,19 +5,27 @@
<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="{{auth&&hasBattery}}">{{bmsVolt}}V</text>
<text>
<block wx:if="{{auth&&hasBattery}}">{{bmsVolt}}V</block>
</text>
<text>电压</text>
<text>电压</text>
</view>
</view>
<view class="ia ab it">
<view class="ia ab it">
<text wx:if="{{auth&&hasBattery}}">{{bmsCurrent}}A</text>
<text>
<block wx:if="{{auth&&hasBattery}}">{{bmsCurrent}}A</block>
</text>
<text>电流</text>
<text>电流</text>
</view>
</view>
<view class="is ab it">
<view class="is ab it">
<text wx:if="{{auth&&hasBattery}}">{{bmsState}}</text>
<text>
<block wx:if="{{auth&&hasBattery}}">{{bmsState}}</block>
</text>
<text>状态</text>
<text>状态</text>
</view>
</view>
<view class="ix ab it">
<view class="ix ab it">
<text wx:if="{{auth&&hasBattery}}">{{bmsCycles}}次</text>
<text>
<block wx:if="{{auth&&hasBattery}}">{{bmsCycles}}次</block>
</text>
<text>电池循环</text>
<text>电池循环</text>
</view>
</view>
<view class="ic ab">
<view class="ic ab">
...
@@ -27,7 +35,9 @@
...
@@ -27,7 +35,9 @@
</block>
</block>
<block wx:else>
<block wx:else>
<text wx:if="{{hasBattery}}">剩余电量</text>
<text wx:if="{{hasBattery}}">剩余电量</text>
<view wx:if="{{!hasBattery}}" class="no-battery">您还未绑定电池</view>
<view wx:if="{{!hasBattery}}" class="no-battery">
<image src="http://ruiju.oss-cn-hangzhou.aliyuncs.com/jindun/defaultAvator.png"></image>
</view>
<view wx:if="{{hasBattery}}">
<view wx:if="{{hasBattery}}">
{{bmsSoc}}
{{bmsSoc}}
<text>%</text>
<text>%</text>
...
@@ -74,8 +84,8 @@
...
@@ -74,8 +84,8 @@
<text>良好的电池使用习惯可以延长电池寿命</text>
<text>良好的电池使用习惯可以延长电池寿命</text>
</view>
</view>
<view class="b-right">
<view class="b-right">
<text>{{batteryDeatil.health}}</text>
<
!-- <
text>{{batteryDeatil.health}}</text>
<text>分</text>
<text>分</text>
-->
</view>
</view>
</view>
</view>
</view>
</view>
...
...
pages/user_index/user_index.wxss
View file @
87116914
...
@@ -36,6 +36,11 @@ page {
...
@@ -36,6 +36,11 @@ page {
height: 200rpx;
height: 200rpx;
font-size: 12px !important;
font-size: 12px !important;
}
}
.no-battery image{
width: 200rpx;
height: 200rpx;
border-radius: 50%;
}
.bind-btn{
.bind-btn{
display: flex;
display: flex;
justify-content: center;
justify-content: center;
...
@@ -157,25 +162,28 @@ page {
...
@@ -157,25 +162,28 @@ page {
color: #587699;
color: #587699;
margin-top: 2px;
margin-top: 2px;
}
}
.it>text:first-child {
font-size: 30rpx;
}
.iv {
.iv {
left: 84rpx;
left: 84rpx;
top: 1
40
rpx;
top: 1
32
rpx;
}
}
.ia {
.ia {
left: 110rpx;
left: 110rpx;
top: 2
50
rpx;
top: 2
42
rpx;
}
}
.ix {
.ix {
left: 536rpx;
left: 536rpx;
top: 2
50
rpx;
top: 2
42
rpx;
}
}
.is {
.is {
left: 590rpx;
left: 590rpx;
top: 1
40
rpx;
top: 1
32
rpx;
}
}
.ic {
.ic {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment