Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yanshouyi-Minipro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
xinzhedeai
yanshouyi-Minipro
Commits
c5661756
Commit
c5661756
authored
Jan 06, 2025
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
蓝牙通信信息
parent
2acd14a6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
507 deletions
+43
-507
mixin.js
common/mixin.js
+23
-89
util.js
common/util.js
+5
-2
manifest.json
manifest.json
+2
-2
blueSearch.vue
pages/home/blueSearch.vue
+3
-2
blueTest.vue
pages/home/blueTest.vue
+0
-351
home.vue
pages/home/home.vue
+9
-60
login.vue
pages/user/login.vue
+1
-1
No files found.
common/mixin.js
View file @
c5661756
...
@@ -170,7 +170,7 @@ const blueToothMixin = {
...
@@ -170,7 +170,7 @@ const blueToothMixin = {
}
}
},
},
async
stopLink
(
opt
)
{
async
stopLink
(
opt
)
{
await
blueToother
.
closeBLEConnection
(
this
.
deviceId
)
await
blueToother
.
closeBLEConnection
(
storager
.
get
(
'
deviceInfo
'
)
.
deviceId
)
await
blueToother
.
closeBluetoothAdapter
()
await
blueToother
.
closeBluetoothAdapter
()
// uni.closeBLEConnection({
// uni.closeBLEConnection({
// deviceId: this.deviceId,
// deviceId: this.deviceId,
...
@@ -208,16 +208,16 @@ const blueToothMixin = {
...
@@ -208,16 +208,16 @@ const blueToothMixin = {
`onBLEConnectionStateChange=>蓝牙设备
${
res
.
deviceId
}
连接状态改变=>
${
res
.
connected
}
`
`onBLEConnectionStateChange=>蓝牙设备
${
res
.
deviceId
}
连接状态改变=>
${
res
.
connected
}
`
)
)
// 如果是非主动离开页面导致断开链接则不显示链接蓝牙弹框
// 如果是非主动离开页面导致断开链接则不显示链接蓝牙弹框
if
(
!
res
.
connected
&&
!
this
.
leavePageFlag
)
{
//
if (!res.connected && !this.leavePageFlag) {
showCustomModal
({
//
showCustomModal({
content
:
'
当前连接已断开,是否重新连接?
'
,
//
content: '当前连接已断开,是否重新连接?',
showCancel
:
true
,
//
showCancel: true,
success
:
()
=>
{
//
success: ()=>{
uni
.
hideLoading
()
//
uni.hideLoading()
this
.
initLink
()
//
this.initLink()
}
//
}
})
//
})
}
//
}
})
})
}
}
...
@@ -300,7 +300,8 @@ const blueToothMixin = {
...
@@ -300,7 +300,8 @@ const blueToothMixin = {
this
.
readyRec
=
true
;
this
.
readyRec
=
true
;
uni
.
hideLoading
()
uni
.
hideLoading
()
this
.
gosend
(
'
POWER
'
)
// this.gosend('POWER')
await
blueToother
.
writeBLECharacteristicValue
(
'
GETDATA
'
)
/**
/**
* 024-12-27新增逻辑:
* 024-12-27新增逻辑:
* 1、蓝牙连接成功后弹窗,点击确认调转页面
* 1、蓝牙连接成功后弹窗,点击确认调转页面
...
@@ -365,7 +366,7 @@ const blueToothMixin = {
...
@@ -365,7 +366,7 @@ const blueToothMixin = {
* notify: 设备可以向客户端(如手机或电脑)主动发送更新的数据
* notify: 设备可以向客户端(如手机或电脑)主动发送更新的数据
* indicate: 相比notify多了确认机制。
* indicate: 相比notify多了确认机制。
*/
*/
if
(
item
.
properties
.
notify
||
item
.
properties
.
indicate
)
{
if
(
item
.
properties
.
notify
)
{
// console.log('[Notify]', item.uuid);
// console.log('[Notify]', item.uuid);
if
(
this
.
rxdu
==
item
.
uuid
)
{
if
(
this
.
rxdu
==
item
.
uuid
)
{
commonStateCodeDeal
(
2
,
commonStateCodeDeal
(
2
,
...
@@ -402,19 +403,7 @@ const blueToothMixin = {
...
@@ -402,19 +403,7 @@ const blueToothMixin = {
console
.
log
(
'
recStr*****
'
,
recStr
)
console
.
log
(
'
recStr*****
'
,
recStr
)
if
(
recStr
===
'
HEART
'
){
// 心跳监测
if
(
recStr
===
'
HEART
'
){
// 心跳监测
var
temp4heart
=
new
Uint8Array
(
stringToBytes
(
'
HEART
'
));
blueToother
.
writeBLECharacteristicValue
(
'
HEART
'
)
uni
.
writeBLECharacteristicValue
({
deviceId
:
storager
.
get
(
'
deviceInfo
'
).
deviceId
,
serviceId
:
'
0000FFE0-0000-1000-8000-00805F9B34FB
'
,
characteristicId
:
'
0000FFE1-0000-1000-8000-00805F9B34FB
'
,
value
:
temp4heart
.
buffer
,
success
:
(
res
)
=>
{
console
.
log
(
'
writeBLECharacteristicValue-successHEART:res=>
'
,
res
)
},
fail
:
(
res
)
=>
{
console
.
log
(
'
writeBLECharacteristicValue-failHEART:res=>
'
,
res
)
},
});
return
return
}
}
if
(
recStr
.
indexOf
(
'
HEART_OK
'
)
>
-
1
){
// 处理掉测量深度对象值粘包后拼接的HEART字符串
if
(
recStr
.
indexOf
(
'
HEART_OK
'
)
>
-
1
){
// 处理掉测量深度对象值粘包后拼接的HEART字符串
...
@@ -423,7 +412,7 @@ const blueToothMixin = {
...
@@ -423,7 +412,7 @@ const blueToothMixin = {
if
(
recStr
.
indexOf
(
'
HEART
'
)
>
-
1
){
// 处理掉测量深度对象值粘包后拼接的HEART字符串
if
(
recStr
.
indexOf
(
'
HEART
'
)
>
-
1
){
// 处理掉测量深度对象值粘包后拼接的HEART字符串
recStr
=
recStr
.
split
(
'
HEART
'
)[
0
]
recStr
=
recStr
.
split
(
'
HEART
'
)[
0
]
}
}
// 设置
测试
值:
// 设置
电量
值:
const
recBlueResData
=
JSON
.
parse
(
recStr
)
const
recBlueResData
=
JSON
.
parse
(
recStr
)
// console.log('设备检测值:', recBlueResData.angle)
// console.log('设备检测值:', recBlueResData.angle)
if
(
recBlueResData
.
power1
){
if
(
recBlueResData
.
power1
){
...
@@ -434,27 +423,19 @@ const blueToothMixin = {
...
@@ -434,27 +423,19 @@ const blueToothMixin = {
})
})
commonStateCodeDeal
(
2
,
'
监听到设备反馈信息->电量
'
+
JSON
.
stringify
(
recBlueResData
))
commonStateCodeDeal
(
2
,
'
监听到设备反馈信息->电量
'
+
JSON
.
stringify
(
recBlueResData
))
}
}
// 设置测试值:
if
(
recBlueResData
.
ks
){
if
(
recBlueResData
.
ks
){
const
temp4ks
=
recBlueResData
.
ks
/
1000
const
temp4ss
=
recBlueResData
.
ss
/
1000
this
.
$store
.
commit
(
'
setMeasureVal
'
,
{
this
.
$store
.
commit
(
'
setMeasureVal
'
,
{
actualDepth
:
recBlueResData
.
ks
,
actualDepth
:
parseFloat
(
temp4ks
.
toFixed
(
3
)),
// 默认回传单位为mm
actualWaterLevel
:
recBlueResData
.
ss
,
actualWaterLevel
:
parseFloat
(
temp4ss
.
toFixed
(
3
))
,
})
})
commonStateCodeDeal
(
2
,
'
监听到设备反馈信息->测量深度
'
+
JSON
.
stringify
(
recBlueResData
))
commonStateCodeDeal
(
2
,
'
监听到设备反馈信息->测量深度
'
+
JSON
.
stringify
(
recBlueResData
))
// 接收到监测深度值,回复主机DATAOK
// 接收到监测深度值,回复主机DATAOK
var
temp4dataok
=
new
Uint8Array
(
stringToBytes
(
'
DATAOK
'
));
blueToother
.
writeBLECharacteristicValue
(
'
DATAOK
'
)
uni
.
writeBLECharacteristicValue
({
deviceId
:
storager
.
get
(
'
deviceInfo
'
).
deviceId
,
serviceId
:
'
0000FFE0-0000-1000-8000-00805F9B34FB
'
,
characteristicId
:
'
0000FFE1-0000-1000-8000-00805F9B34FB
'
,
value
:
temp4dataok
.
buffer
,
success
:
(
res
)
=>
{
console
.
log
(
'
writeBLECharacteristicValue-successHEART:res=>
'
,
res
)
},
fail
:
(
res
)
=>
{
console
.
log
(
'
writeBLECharacteristicValue-failHEART:res=>
'
,
res
)
},
});
}
}
});
});
}
else
{
}
else
{
...
@@ -468,53 +449,6 @@ const blueToothMixin = {
...
@@ -468,53 +449,6 @@ const blueToothMixin = {
},
},
async
gosend
(
text
)
{
var
that
=
this
;
if
(
text
===
'
START
'
)
{
if
(
this
.
btnLoading
)
{
// 如果正在测量,不允许操作
return
}
this
.
btnLoading
=
true
// 设置标志为 true,表示正在加载
}
var
hex
=
text
;
//要发送的数据 有参数则直接发没有则获取输入框的值。
var
buffer1
;
//string发送
var
strbuf
=
new
Uint8Array
(
stringToBytes
(
hex
));
// console.log('strtobyte ', strbuf);
buffer1
=
strbuf
.
buffer
;
if
(
buffer1
==
null
)
{
this
.
pageLoadText
=
'
发送指令内容为空
'
commonStateCodeDeal
(
2
,
'
gosend -> 发送指定内容为空
'
)
this
.
setNavBarTitle
(
'
发送指令内容为空
'
)
return
;
}
// const txlen = buffer1.byteLength;
console
.
log
(
'
this.deviceId
'
,
this
.
deviceId
)
uni
.
writeBLECharacteristicValue
({
deviceId
:
that
.
_deviceId
,
serviceId
:
that
.
_serviceId
,
characteristicId
:
that
.
_characteristicId
,
value
:
buffer1
,
success
:
(
res
)
=>
{
if
(
text
===
'
STOP
'
)
{
// 停止测量保存数据
// showCustomToast({
// title: '已停止测量',
// })
this
.
btnLoading
=
false
}
},
fail
:
(
res
)
=>
{
commonStateCodeDeal
(
res
.
errCode
||
res
,
'
gosend -> writeBLECharacteristicValue
'
,
this
)
},
});
},
},
},
}
}
...
...
common/util.js
View file @
c5661756
...
@@ -61,8 +61,11 @@ var commonStateCodeDeal = async (code, msg, contextThis) => {
...
@@ -61,8 +61,11 @@ var commonStateCodeDeal = async (code, msg, contextThis) => {
// showCustomToast({
// showCustomToast({
// title: '连接失败'
// title: '连接失败'
// })
// })
contextThis
.
stopLink
()
contextThis
.
setConnected
(
false
)
contextThis
.
setNavBarTitle
(
'
连接失败-10003【请检查蓝牙是否正确连接】
'
)
contextThis
.
setNavBarTitle
(
'
连接失败-10003【请检查蓝牙是否正确连接】
'
)
popuper
.
hideLoading
()
popuper
.
hideLoading
()
}
else
if
(
code
===
10004
)
{
}
else
if
(
code
===
10004
)
{
// showCustomToast({
// showCustomToast({
// title: '没有找到指定服务'
// title: '没有找到指定服务'
...
@@ -354,10 +357,10 @@ var blueToother = {
...
@@ -354,10 +357,10 @@ var blueToother = {
characteristicId
:
this
.
characteristicId_WRITE
,
characteristicId
:
this
.
characteristicId_WRITE
,
value
:
buffer1
,
value
:
buffer1
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
log
(
'
writeBLECharacteristicValue-success:res1=>
'
,
res
)
console
.
log
(
'
writeBLECharacteristicValue-success:res1=>
'
+
value
,
res
)
},
},
fail
:
(
res
)
=>
{
fail
:
(
res
)
=>
{
console
.
log
(
'
writeBLECharacteristicValue-fail:res1=>
'
,
res
)
console
.
log
(
'
writeBLECharacteristicValue-fail:res1=>
'
+
value
,
res
)
// commonStateCodeDeal(res.errCode || res, 'gosend -> writeBLECharacteristicValue',
// commonStateCodeDeal(res.errCode || res, 'gosend -> writeBLECharacteristicValue',
// this)
// this)
},
},
...
...
manifest.json
View file @
c5661756
{
{
"name"
:
"露天炮孔
验收
仪"
,
"name"
:
"露天炮孔
测孔
仪"
,
"appid"
:
"__UNI__672B793"
,
"appid"
:
"__UNI__672B793"
,
"description"
:
"露天炮孔
验收
仪"
,
"description"
:
"露天炮孔
测孔
仪"
,
"versionName"
:
"1.0.0"
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
"transformPx"
:
false
,
...
...
pages/home/blueSearch.vue
View file @
c5661756
...
@@ -35,7 +35,8 @@
...
@@ -35,7 +35,8 @@
commonStateCodeDeal
,
commonStateCodeDeal
,
popuper
,
popuper
,
storager
,
storager
,
pager
pager
,
blueToother
,
}
from
"
../../common/util.js
"
}
from
"
../../common/util.js
"
import
CustomNavbar
from
'
@/pages/component/CustomNavbar.vue
'
;
import
CustomNavbar
from
'
@/pages/component/CustomNavbar.vue
'
;
import
{
import
{
...
@@ -190,7 +191,7 @@
...
@@ -190,7 +191,7 @@
this
.
stopBluetoothDevicesDiscovery
();
this
.
stopBluetoothDevicesDiscovery
();
uni
.
setStorageSync
(
'
deviceInfo
'
,
deviceInfo
)
uni
.
setStorageSync
(
'
deviceInfo
'
,
deviceInfo
)
console
.
log
(
'
*****开始连接蓝牙
'
);
console
.
log
(
'
*****开始连接蓝牙
'
);
this
.
startLink
()
this
.
startLink
()
// uni.reLaunch({
// uni.reLaunch({
// url: '/pages/home/home'
// url: '/pages/home/home'
// });
// });
...
...
pages/home/blueTest.vue
deleted
100644 → 0
View file @
2acd14a6
<
template
>
<view
class=
"pageWrapper"
>
<CustomNavbar
:title=
"navBarTitle"
goBackUrl=
"/pages/home/home"
@
gobackDeal=
"gobackDeal"
>
</CustomNavbar>
<!--
<text
id=
"v5"
class=
"devices_summary"
>
{{
deviceadd
}}
</text>
-->
<!-- test使用 start -->
<!--
<view
class=
"layout_horizontal"
id=
"v1"
>
<button
class=
"button_sp"
hover-class=
"button_sp2"
style=
"flex: 1"
@
tap=
"goclear"
>
清屏
</button>
<button
class=
"button_sp"
style=
"flex: 1"
>
{{
connectState
}}
</button>
<button
class=
"button_sp"
hover-class=
"button_sp2"
style=
"flex: 1"
@
tap=
"gotoback"
>
返回
</button>
</view>
<view
class=
"layout_horizontal"
id=
"v2"
>
<button
class=
"button_sp"
hover-class=
"button_sp2"
style=
"flex: 1"
@
tap=
"godisconnect"
>
{{
reconnect
}}
</button>
</view>
<scroll-view
class=
"container"
:style=
"'height: 300px'"
:scroll-y=
"true"
>
<view
style=
"display: flex"
>
<view
class=
"note_itemtext"
>
{{
recdata
}}
</view>
</view>
</scroll-view>
-->
<!-- test使用 end -->
<view
class=
"body-wrapper"
>
<view
class=
"logo-wrapper"
>
<image
src=
"/static/image/home/product.png"
alt=
""
/>
</view>
<uni-row
class=
"demo-uni-row mb-10"
>
<uni-col
:span=
"6"
class=
"_title "
>
<view>
实测孔深
</view>
</uni-col>
<uni-col
:span=
"16"
>
<view
class=
"_content"
>
{{
form
[
'
realTestHoleDepth
'
]
||
'
-
'
}}
</view>
</uni-col>
</uni-row>
<uni-row
class=
"demo-uni-row mb-10"
>
<uni-col
:span=
"6"
class=
"_title"
>
<view>
实测倾角
</view>
</uni-col>
<uni-col
:span=
"16"
>
<view
class=
"_content angle"
>
<view>
{{
form
[
'
realTestInclination
'
]
||
'
-
'
}}
</view>
</view>
</uni-col>
</uni-row>
<!--
<uni-row
class=
"demo-uni-row mb-10"
>
<uni-col
:span=
"6"
class=
"_title"
>
<view>
实测时间
</view>
</uni-col>
<uni-col
:span=
"16"
>
<view
class=
"_content unaffix"
>
<view>
{{
form
[
'
realTestTime
'
]
||
'
-
'
}}
</view>
</view>
</uni-col>
</uni-row>
-->
</view>
<!--
<uni-row
class=
"demo-uni-row mb-10"
>
<uni-col
:span=
"6"
class=
"_title"
>
<view
class=
""
@
tap=
"gosend('POWER')"
>
显示电量
</view>
</uni-col>
<uni-col
:span=
"6"
class=
"_title"
>
<view
class=
""
@
tap=
"gosend('START')"
>
开始测量
</view>
</uni-col>
<uni-col
:span=
"6"
>
<view
class=
"_title"
>
<view
class=
""
@
tap=
"gosend('STOP')"
>
结束测量
</view>
</view>
</uni-col>
</uni-row>
-->
<view
class=
"footer-wrapper"
v-show=
"connected"
>
<view
class=
"funcBtn"
:class=
"
{loading: btnLoading}" @tap="gosend('START')">
{{
btnLoading
?
'
测量中
'
:
'
开始测量
'
}}
</view>
<view
class=
"funcBtn end"
@
tap=
"gosend('STOP')"
>
结束测量
</view>
</view>
<view
class=
""
v-show=
"!connected"
style=
"text-align: center; color: darkgray; margin-top:20rpx;"
>
{{
pageLoadText
}}
</view>
</view>
</
template
>
<
script
>
import
CustomNavbar
from
'
@/pages/component/CustomNavbar.vue
'
;
import
{
blueToothMixin
}
from
'
../../common/mixin.js
'
export
default
{
mixins
:
[
blueToothMixin
],
components
:
{
CustomNavbar
,
},
data
()
{
return
{
navBarTitle
:
'
中深孔验收仪设备通讯测试
'
,
redirectUrl
:
'
/pages/home/blueSearch?refer=blueTest
'
,
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
uni
.
hideLoading
()
this
.
initLink
()
},
methods
:
{
}
};
</
script
>
<
style
lang=
"scss"
>
.pageWrapper
{
width
:
100vw
;
height
:
calc
(
100vh-44rpx
);
padding-top
:
44rpx
;
background
:
linear-gradient
(
180deg
,
#007AFF
0%
,
#419AFF
16%
,
#EFF1F4
43%
);
}
.body-wrapper
{
margin
:
0
auto
;
width
:
690rpx
;
height
:
70vh
;
padding-top
:
20rpx
;
padding-left
:
15rpx
;
padding-right
:
15rpx
;
background
:
#FFFFFF
;
border-radius
:
10rpx
;
}
.logo-wrapper
{
display
:
flex
;
justify-content
:
center
;
image
{
width
:
366rpx
;
height
:
432rpx
;
margin
:
0
auto
;
}
}
.mb-10
{
margin-bottom
:
10rpx
;
}
._title
{
// border: 1px solid lightgray;
height
:
70rpx
;
text-align
:
center
;
line-height
:
70rpx
;
margin-right
:
10rpx
;
font-size
:
29rpx
;
color
:
#000000
;
font-weight
:
bold
;
}
._content
{
// border: 1px solid lightgray;
height
:
70rpx
;
line-height
:
70rpx
;
padding-left
:
20rpx
;
// position: relative;
&
:after
{
content
:
'm'
;
width
:
70rpx
;
height
:
70rpx
;
// border-left: 1px solid lightgray;
position
:
absolute
;
right
:
0
;
top
:
0
;
text-align
:
center
;
line-height
:
70rpx
;
font-size
:
29rpx
;
color
:
#000000
;
}
}
.funcBtn
{
width
:
280rpx
;
height
:
70rpx
;
line-height
:
70rpx
;
background
:
#007AFF
;
border-radius
:
35rpx
;
text-align
:
center
;
font-size
:
29rpx
;
color
:
#FFFFFF
;
border
:
2px
solid
#007AFF
;
&
.end
{
background
:
#FFFFFF
;;
color
:
#007AFF
;
}
&
.loading
{
opacity
:
0
.5
;
}
}
.footer-wrapper
{
display
:
flex
;
justify-content
:
space-around
;
margin-top
:
50rpx
;
}
.angle
{
&
:after
{
content
:
'°'
;
}
}
.unaffix
{
&
:after
{
display
:
none
;
}
}
/**
* 蓝牙连接互动相关
*/
page
{
color
:
#333
;
}
.button_sp
{
margin-left
:
5px
;
margin-right
:
5px
;
margin-top
:
5px
;
background-color
:
#10b7ff
;
color
:
#fff
;
font-size
:
15px
;
}
.button_sp2
{
margin-left
:
5px
;
margin-right
:
5px
;
margin-top
:
5px
;
background-color
:
#757575
;
color
:
#fff
;
}
.flex-wrp
{
height
:
auto
;
display
:
flex
;
background-color
:
#ffffff
;
}
.flex-wrp2
{
margin-left
:
5px
;
margin-right
:
5px
;
margin-top
:
8px
;
font-size
:
12px
;
}
/*横向布局 */
.layout_horizontal
{
display
:
flex
;
/*row 横向 column 列表 */
flex-direction
:
row
;
}
/*纵向布局 */
.layout_vertical
{
height
:
100rpx
;
display
:
flex
;
/*row 横向 column 列表 */
flex-direction
:
column
;
}
/*划线 */
.line
{
background-color
:
blue
;
height
:
5px
;
width
:
100%
;
}
.div
{
background-color
:
white
;
height
:
10px
;
width
:
10px
;
}
.flex-view-item
{
color
:
#eee
;
margin-left
:
5px
;
margin-top
:
1px
;
margin-bottom
:
1px
;
font-size
:
13px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.container
{
background-color
:
#fff
;
background-size
:
cover
;
width
:
98%
;
margin-left
:
0
.7%
;
justify-content
:
center
;
border-radius
:
3px
;
border
:
1px
solid
#111
;
white-space
:
normal
;
}
.txt-light
{
color
:
#0b0d0d
;
font-size
:
13px
;
margin-left
:
3px
;
white-space
:
pre-line
;
display
:
block
;
width
:
100%
;
}
.note_itemtext
{
display
:
-
webkit-box
;
font-size
:
26rpx
;
color
:
#000000
;
line-height
:
40rpx
;
word-break
:
break-all
;
-webkit-box-orient
:
vertical
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.blank
{
height
:
150rpx
;
}
.devices_summary
{
margin-top
:
5px
;
font-size
:
16px
;
color
:
#222
;
align-items
:
center
;
justify-content
:
center
;
display
:
flex
;
}
.show-btn
{
margin-top
:
100rpx
;
color
:
#22cc22
;
}
</
style
>
\ No newline at end of file
pages/home/home.vue
View file @
c5661756
...
@@ -3,11 +3,9 @@
...
@@ -3,11 +3,9 @@
<view
class=
"body-wrapper"
>
<view
class=
"body-wrapper"
>
<view
class=
"logo-wrapper"
>
<view
class=
"logo-wrapper"
>
<image
class=
"logoImg"
src=
"/static/image/home/logo.png"
alt=
""
/>
<image
class=
"logoImg"
src=
"/static/image/home/logo.png"
alt=
""
/>
<h3>
露天炮孔测孔仪
</h3>
<h3>
露天炮孔验收仪
</h3>
<!--
<button
@
click=
"gosend"
>
获取电量
{{
actualWaterLevel
}}
</button>
-->
</view>
</view>
<view
class=
"link-info-wrapper"
@
click=
"gosend('GETDATA')"
>
<view
class=
"link-info-wrapper"
>
<image
class=
"bg"
src=
"../../static/image/paokong/home-title-bg.png"
mode=
""
></image>
<image
class=
"bg"
src=
"../../static/image/paokong/home-title-bg.png"
mode=
""
></image>
<div
class=
"left"
>
<div
class=
"left"
>
<image
:src=
"`/static/image/paokong/$
{connected?'linkY':'linkN'}.png`" mode="">
</image>
<image
:src=
"`/static/image/paokong/$
{connected?'linkY':'linkN'}.png`" mode="">
</image>
...
@@ -19,15 +17,15 @@
...
@@ -19,15 +17,15 @@
<div
class=
"top"
>
<div
class=
"top"
>
<h2>
设备电量
</h2>
<h2>
设备电量
</h2>
<p>
<p>
小球
<image
src=
"/static/image/paokong/qiu-dl.png"
>
{{
power1
||
'
-
'
}}
%
小球
<image
src=
"/static/image/paokong/qiu-dl.png"
>
{{
connected
&&
power1
||
'
-
'
}}
%
仪器
<image
src=
"/static/image/paokong/shebei-dl.png"
>
{{
power2
||
'
-
'
}}
%
仪器
<image
src=
"/static/image/paokong/shebei-dl.png"
>
{{
connected
&&
power2
||
'
-
'
}}
%
</p>
</p>
</div>
</div>
<div
class=
"bottom"
>
<div
class=
"bottom"
>
<h2>
设备参数
</h2>
<h2>
设备参数
</h2>
<p>
设备名称:露天炮孔
验收
仪
</p>
<p>
设备名称:露天炮孔
测孔
仪
</p>
<p>
设备型号:M
YSM-OH-01
</p>
<p>
设备型号:M
SYS-OH-02
</p>
<p>
设备ID:
{{
qiuId
||
'
-
'
}}
</p>
<p>
设备ID:
{{
connected
&&
qiuId
||
'
-
'
}}
</p>
</div>
</div>
</div>
</div>
...
@@ -35,42 +33,22 @@
...
@@ -35,42 +33,22 @@
<p
class=
"list-item"
@
click=
"uploadExcel"
>
<p
class=
"list-item"
@
click=
"uploadExcel"
>
<image
src=
"/static/image/paokong/impexp.png"
alt=
""
/>
<image
src=
"/static/image/paokong/impexp.png"
alt=
""
/>
<span>
炮孔设计数据导入
</span>
<span>
炮孔设计数据导入
</span>
<!--
<button
size=
"mini"
class=
"funcBtn"
type=
"primary"
@
click=
"navTo('import')"
>
导入导出
</button>
-->
</p>
</p>
<p
class=
"list-item"
@
click=
"navTo('link')"
>
<p
class=
"list-item"
@
click=
"navTo('link')"
>
<image
src=
"/static/image/paokong/link.png"
alt=
""
/>
<image
src=
"/static/image/paokong/link.png"
alt=
""
/>
<span>
连接露天炮孔验收仪
</span>
<span>
连接露天炮孔测孔仪
</span>
<!--
<button
size=
"mini"
class=
"funcBtn"
type=
"primary"
>
连接
</button>
-->
</p>
</p>
<!--
<p
class=
"list-item"
>
<image
src=
"/static/image/paokong/measure.png"
alt=
""
/>
<span>
设备测试
</span>
<button
size=
"mini"
class=
"funcBtn"
type=
"primary"
@
click=
"navTo('measureTest')"
>
测量
</button>
</p>
-->
<p
class=
"list-item"
@
click=
"navTo('measure')"
>
<p
class=
"list-item"
@
click=
"navTo('measure')"
>
<image
src=
"/static/image/paokong/measure.png"
alt=
""
/>
<image
src=
"/static/image/paokong/measure.png"
alt=
""
/>
<span>
炮孔测量
</span>
<span>
炮孔测量
</span>
<!--
<button
size=
"mini"
class=
"funcBtn"
type=
"primary"
@
click=
"navTo('measure')"
>
测量
</button>
-->
</p>
</p>
<p
class=
"list-item"
@
click=
"exportExcel"
>
<p
class=
"list-item"
@
click=
"exportExcel"
>
<image
src=
"/static/image/paokong/impexp.png"
alt=
""
/>
<image
src=
"/static/image/paokong/impexp.png"
alt=
""
/>
<span>
炮孔测量数据导出
</span>
<span>
炮孔测量数据导出
</span>
<!--
<button
size=
"mini"
class=
"funcBtn"
type=
"primary"
@
click=
"navTo('export')"
>
导出
</button>
-->
</p>
</p>
<p
class=
"list-item"
@
click=
"navTo('operateLog')"
>
<!--
<p
class=
"list-item"
@
click=
"navTo('operateLog')"
>
<image
src=
"/static/image/paokong/operatelog.png"
alt=
""
/>
<image
src=
"/static/image/paokong/operatelog.png"
alt=
""
/>
<span>
操作日志
</span>
<span>
操作日志
</span>
<!--
<button
size=
"mini"
class=
"funcBtn"
type=
"primary"
@
click=
"navTo('export')"
>
导出
</button>
-->
</p>
<!--
<p
class=
"list-item"
>
<image
src=
"/static/image/home/5.png"
alt=
""
/>
<span>
导入数据预览
</span>
<button
size=
"mini"
class=
"funcBtn"
type=
"primary"
@
click=
"navTo('importFileDataPreview')"
>
进入
</button>
</p>
<p
class=
"list-item"
>
<image
src=
"/static/image/home/5.png"
alt=
""
/>
<span>
炮孔测量
</span>
<button
size=
"mini"
class=
"funcBtn"
type=
"primary"
@
click=
"navTo('paokongceliang')"
>
进入
</button>
</p>
-->
</p>
-->
<view
class=
"footer"
>
<view
class=
"footer"
>
<span>
<span>
...
@@ -119,9 +97,6 @@
...
@@ -119,9 +97,6 @@
uni
.
hideLoading
()
uni
.
hideLoading
()
},
},
mounted
()
{
mounted
()
{
console
.
log
(
'
this.$store.state.actualWaterLevel
'
,
this
.
$store
.
state
.
actualWaterLevel
)
const
deviceInfo
=
uni
.
getStorageSync
(
'
deviceInfo
'
)
const
deviceInfo
=
uni
.
getStorageSync
(
'
deviceInfo
'
)
if
(
deviceInfo
)
{
// 获取蓝牙设备型号id
if
(
deviceInfo
)
{
// 获取蓝牙设备型号id
this
.
deviceInfo
=
deviceInfo
this
.
deviceInfo
=
deviceInfo
...
@@ -214,32 +189,6 @@
...
@@ -214,32 +189,6 @@
})
})
}
}
},
},
gosend
(
text
)
{
blueToother
.
writeBLECharacteristicValue
(
text
)
// this.$store.commit('setMeasureVal', {
// actualDepth: 'xxx', // 孔深
// actualWaterLevel: '666' // 水深
// })
// var strbuf = new Uint8Array(stringToBytes('GETDATA'));
// var buffer1 = strbuf.buffer;
// setTimeout(() => {
// uni.writeBLECharacteristicValue({
// // deviceId: 'C8:47:80:52:93:A2',
// deviceId: storager.get('deviceInfo').deviceId,
// serviceId: '0000FFE0-0000-1000-8000-00805F9B34FB',
// characteristicId: '0000FFE1-0000-1000-8000-00805F9B34FB',
// value: buffer1,
// success: (res) => {
// console.log('writeBLECharacteristicValue-success:res=>', res)
// },
// fail: (res) => {
// console.log('writeBLECharacteristicValue-fail:res=>', res)
// // commonStateCodeDeal(res.errCode || res, 'gosend -> writeBLECharacteristicValue',
// // this)
// },
// });
// }, 1000)
},
navTo
(
flag
)
{
navTo
(
flag
)
{
if
(
flag
===
'
export
'
)
{
if
(
flag
===
'
export
'
)
{
this
.
exportData2Excel
()
this
.
exportData2Excel
()
...
...
pages/user/login.vue
View file @
c5661756
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<view
class=
"authModal"
>
<view
class=
"authModal"
>
<view
class=
'header'
>
<view
class=
'header'
>
<image
src=
'../../static/image/paokong/login-icon.png'
></image>
<image
src=
'../../static/image/paokong/login-icon.png'
></image>
<view
class=
"title"
>
露天炮孔
验收
仪
</view>
<view
class=
"title"
>
露天炮孔
测孔
仪
</view>
</view>
</view>
<view
class=
'content'
v-if=
"!hasToken"
>
<view
class=
'content'
v-if=
"!hasToken"
>
<view
class=
"title"
>
手机号
</view>
<view
class=
"title"
>
手机号
</view>
...
...
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