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
b7c9e9e5
Commit
b7c9e9e5
authored
Jul 31, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into test
parents
b6e72412
41897cdc
Show 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 @
b7c9e9e5
.Shower
{
.Shower
{
padding-top
:
126px
;
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
{
.equipment-info-box
{
width
:
630px
;
width
:
630px
;
height
:
572px
;
height
:
572px
;
...
...
src/pages/Shower/Shower.tsx
View file @
b7c9e9e5
...
@@ -14,6 +14,8 @@ import {
...
@@ -14,6 +14,8 @@ import {
fetchUsingShowerInfo
,
fetchUsingShowerInfo
,
getShowerController
,
getShowerController
,
OperationMode
,
OperationMode
,
ControllerResponse
,
ShowerUseType
,
}
from
'@/api/shower'
;
}
from
'@/api/shower'
;
import
{
connect
,
useSelector
}
from
'@tarojs/redux'
;
import
{
connect
,
useSelector
}
from
'@tarojs/redux'
;
import
{
Customer
}
from
'@/types/Customer/Customer'
;
import
{
Customer
}
from
'@/types/Customer/Customer'
;
...
@@ -43,6 +45,7 @@ type DeviceInfo = {
...
@@ -43,6 +45,7 @@ type DeviceInfo = {
type
PageStateProps
=
{
type
PageStateProps
=
{
userinfo
:
Customer
;
userinfo
:
Customer
;
bluetoothDevice
:
BluetoothDevice
;
bluetoothDevice
:
BluetoothDevice
;
showerControlConfig
:
ControllerResponse
;
};
};
type
PageDispatchProps
=
{
type
PageDispatchProps
=
{
updateBluetoothDevice
:
(
entity
:
BluetoothDevice
)
=>
void
;
updateBluetoothDevice
:
(
entity
:
BluetoothDevice
)
=>
void
;
...
@@ -56,6 +59,7 @@ type PageState = {
...
@@ -56,6 +59,7 @@ type PageState = {
sockedDone
:
boolean
;
sockedDone
:
boolean
;
deviceDone
:
boolean
;
deviceDone
:
boolean
;
showerState
:
boolean
;
showerState
:
boolean
;
showAppoint
:
boolean
;
};
};
const
StopCode
=
1000
;
const
StopCode
=
1000
;
...
@@ -68,9 +72,10 @@ let timer: NodeJS.Timeout | null = null;
...
@@ -68,9 +72,10 @@ let timer: NodeJS.Timeout | null = null;
let
reConnectting
:
boolean
=
false
;
let
reConnectting
:
boolean
=
false
;
let
socketTask
:
Taro
.
SocketTask
|
null
=
null
;
let
socketTask
:
Taro
.
SocketTask
|
null
=
null
;
@
connect
(
@
connect
(
({
userinfo
,
Shower
})
=>
({
({
userinfo
,
Shower
,
showerState
})
=>
({
userinfo
,
userinfo
,
bluetoothDevice
:
Shower
,
bluetoothDevice
:
Shower
,
showerControlConfig
:
showerState
.
controllerConfigs
,
}),
}),
dispatch
=>
({
dispatch
=>
({
updateBluetoothDevice
(
data
:
BluetoothDevice
)
{
updateBluetoothDevice
(
data
:
BluetoothDevice
)
{
...
@@ -99,15 +104,23 @@ class Shower extends Component {
...
@@ -99,15 +104,23 @@ class Shower extends Component {
writeId
:
''
,
writeId
:
''
,
readId
:
''
,
readId
:
''
,
},
},
showAppoint
:
false
,
};
};
}
}
onShareAppMessage
=
shareHandle
;
onShareAppMessage
=
shareHandle
;
componentWillMount
()
{
componentWillMount
()
{
// useType;
this
.
openBluetooth
();
this
.
openBluetooth
();
this
.
connectDeviceSocket
();
this
.
connectDeviceSocket
();
this
.
checkUsingDevice
();
this
.
checkUsingDevice
();
const
{
showerControlConfig
}
=
this
.
props
;
if
(
showerControlConfig
.
useType
===
ShowerUseType
.
mix
)
{
this
.
setState
({
showAppoint
:
true
,
});
}
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
...
@@ -798,12 +811,17 @@ class Shower extends Component {
...
@@ -798,12 +811,17 @@ class Shower extends Component {
this
.
closeBluetoothConnection
();
this
.
closeBluetoothConnection
();
});
});
}
}
goAppointShower
()
{
Taro
.
navigateTo
({
url
:
'/pages/Shower/ShowerAppointment'
,
});
}
render
()
{
render
()
{
const
{
const
{
bluetoothDevice
:
{
code
,
position
},
bluetoothDevice
:
{
code
,
position
},
}
=
this
.
props
;
}
=
this
.
props
;
const
{
showerState
}
=
this
.
state
;
const
{
showerState
,
showAppoint
}
=
this
.
state
;
const
payOrderState
=
useSelector
(
const
payOrderState
=
useSelector
(
(
state
:
{
orderState
:
PayOrderState
})
=>
(
state
:
{
orderState
:
PayOrderState
})
=>
state
.
orderState
.
waitPayOrderState
,
state
.
orderState
.
waitPayOrderState
,
...
@@ -812,7 +830,11 @@ class Shower extends Component {
...
@@ -812,7 +830,11 @@ class Shower extends Component {
return
(
return
(
<
View
className=
'Shower'
>
<
View
className=
'Shower'
>
<
WaitPayOrderComponent
/>
<
WaitPayOrderComponent
/>
{
showAppoint
&&
(
<
View
className=
'showAppoint'
onClick=
{
this
.
goAppointShower
}
>
预约洗浴
</
View
>
)
}
<
View
className=
{
payOrderState
?
'blur'
:
''
}
>
<
View
className=
{
payOrderState
?
'blur'
:
''
}
>
<
View
className=
'equipment-info-box'
>
<
View
className=
'equipment-info-box'
>
<
View
className=
'equipment-info'
>
<
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