Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-school-app
Project
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
姜雷
wx-school-app
Commits
41897cdc
Commit
41897cdc
authored
Jul 31, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加洗浴切换按钮
parent
18f04098
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
Shower.scss
src/pages/Shower/Shower.scss
+14
-0
Shower.tsx
src/pages/Shower/Shower.tsx
+25
-3
No files found.
src/pages/Shower/Shower.scss
View file @
41897cdc
.Shower
{
padding-top
:
126px
;
.showAppoint
{
position
:
absolute
;
box-sizing
:
border-box
;
text-align
:
right
;
right
:
0
;
top
:
30px
;
width
:
60px
;
height
:
160px
;
color
:
#fff
;
background-color
:
#474747
;
padding
:
20px
15px
0
;
line-height
:
30px
;
border-radius
:
16px
0
0
16px
;
}
.equipment-info-box
{
width
:
630px
;
height
:
572px
;
...
...
src/pages/Shower/Shower.tsx
View file @
41897cdc
...
...
@@ -14,6 +14,8 @@ import {
fetchUsingShowerInfo
,
getShowerController
,
OperationMode
,
ControllerResponse
,
ShowerUseType
,
}
from
'@/api/shower'
;
import
{
connect
,
useSelector
}
from
'@tarojs/redux'
;
import
{
Customer
}
from
'@/types/Customer/Customer'
;
...
...
@@ -43,6 +45,7 @@ type DeviceInfo = {
type
PageStateProps
=
{
userinfo
:
Customer
;
bluetoothDevice
:
BluetoothDevice
;
showerControlConfig
:
ControllerResponse
;
};
type
PageDispatchProps
=
{
updateBluetoothDevice
:
(
entity
:
BluetoothDevice
)
=>
void
;
...
...
@@ -56,6 +59,7 @@ type PageState = {
sockedDone
:
boolean
;
deviceDone
:
boolean
;
showerState
:
boolean
;
showAppoint
:
boolean
;
};
const
StopCode
=
1000
;
...
...
@@ -68,9 +72,10 @@ let timer: NodeJS.Timeout | null = null;
let
reConnectting
:
boolean
=
false
;
let
socketTask
:
Taro
.
SocketTask
|
null
=
null
;
@
connect
(
({
userinfo
,
Shower
})
=>
({
({
userinfo
,
Shower
,
showerState
})
=>
({
userinfo
,
bluetoothDevice
:
Shower
,
showerControlConfig
:
showerState
.
controllerConfigs
,
}),
dispatch
=>
({
updateBluetoothDevice
(
data
:
BluetoothDevice
)
{
...
...
@@ -99,15 +104,23 @@ class Shower extends Component {
writeId
:
''
,
readId
:
''
,
},
showAppoint
:
false
,
};
}
onShareAppMessage
=
shareHandle
;
componentWillMount
()
{
// useType;
this
.
openBluetooth
();
this
.
connectDeviceSocket
();
this
.
checkUsingDevice
();
const
{
showerControlConfig
}
=
this
.
props
;
if
(
showerControlConfig
.
useType
===
ShowerUseType
.
mix
)
{
this
.
setState
({
showAppoint
:
true
,
});
}
}
componentWillUnmount
()
{
...
...
@@ -798,12 +811,17 @@ class Shower extends Component {
this
.
closeBluetoothConnection
();
});
}
goAppointShower
()
{
Taro
.
navigateTo
({
url
:
'/pages/Shower/ShowerAppointment'
,
});
}
render
()
{
const
{
bluetoothDevice
:
{
code
,
position
},
}
=
this
.
props
;
const
{
showerState
}
=
this
.
state
;
const
{
showerState
,
showAppoint
}
=
this
.
state
;
const
payOrderState
=
useSelector
(
(
state
:
{
orderState
:
PayOrderState
})
=>
state
.
orderState
.
waitPayOrderState
,
...
...
@@ -812,7 +830,11 @@ class Shower extends Component {
return
(
<
View
className=
'Shower'
>
<
WaitPayOrderComponent
/>
{
showAppoint
&&
(
<
View
className=
'showAppoint'
onClick=
{
this
.
goAppointShower
}
>
预约洗浴
</
View
>
)
}
<
View
className=
{
payOrderState
?
'blur'
:
''
}
>
<
View
className=
'equipment-info-box'
>
<
View
className=
'equipment-info'
>
...
...
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