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
614cecdd
Commit
614cecdd
authored
Aug 05, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into test
parents
b7c9e9e5
d6b5dfab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
14 deletions
+36
-14
Shower.tsx
src/pages/Shower/Shower.tsx
+1
-1
ShowerAppointment.tsx
src/pages/Shower/ShowerAppointment.tsx
+26
-9
AppointermentCard.tsx
...Shower/components/AppointermentCard/AppointermentCard.tsx
+2
-2
AppointermentEquipment.tsx
...ponents/AppointermentEquipment/AppointermentEquipment.tsx
+7
-2
No files found.
src/pages/Shower/Shower.tsx
View file @
614cecdd
...
@@ -812,7 +812,7 @@ class Shower extends Component {
...
@@ -812,7 +812,7 @@ class Shower extends Component {
});
});
}
}
goAppointShower
()
{
goAppointShower
()
{
Taro
.
navigate
To
({
Taro
.
redirect
To
({
url
:
'/pages/Shower/ShowerAppointment'
,
url
:
'/pages/Shower/ShowerAppointment'
,
});
});
}
}
...
...
src/pages/Shower/ShowerAppointment.tsx
View file @
614cecdd
import
'./ShowerAppointment.scss'
;
import
'./ShowerAppointment.scss'
;
import
{
View
,
Input
,
Text
,
Image
,
ScrollView
}
from
'@tarojs/components'
;
import
{
View
,
Input
,
Text
,
ScrollView
}
from
'@tarojs/components'
;
import
Taro
,
{
useState
,
useReducer
,
useEffect
}
from
'@tarojs/taro'
;
import
Taro
,
{
useState
}
from
'@tarojs/taro'
;
import
AppointermentCard
from
'./components/AppointermentCard/AppointermentCard'
;
import
AppointermentCard
from
'./components/AppointermentCard/AppointermentCard'
;
import
useInputValue
from
'@/hooks/useInputValue'
;
import
useInputValue
from
'@/hooks/useInputValue'
;
import
{
import
{
getAppointmentDevice
,
appointingEquipment
,
appointingEquipment
,
ShowerUseType
,
ShowerUseType
,
OperationMode
,
OperationMode
,
...
@@ -69,8 +68,13 @@ function ShowerAppointment() {
...
@@ -69,8 +68,13 @@ function ShowerAppointment() {
console
.
log
(
err
);
console
.
log
(
err
);
});
});
};
};
const
appointingStart
=
(
deviceCode
:
string
,
operationMode
:
number
)
=>
{
const
appointingStart
=
(
deviceCode
:
string
,
operationMode
:
number
,
location
:
string
,
)
=>
{
const
thresholdValue
=
showerControlConfig
.
thresholdValue
;
const
thresholdValue
=
showerControlConfig
.
thresholdValue
;
if
(
showerControlConfig
.
balances
.
length
)
{
let
aimiItem
=
showerControlConfig
.
balances
.
find
(
let
aimiItem
=
showerControlConfig
.
balances
.
find
(
item
=>
item
.
serviceId
===
'0'
,
item
=>
item
.
serviceId
===
'0'
,
);
);
...
@@ -94,25 +98,38 @@ function ShowerAppointment() {
...
@@ -94,25 +98,38 @@ function ShowerAppointment() {
content
:
text
,
content
:
text
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
appointingEquipmentHandle
(
deviceCode
);
beforeStartCheckHandle
(
deviceCode
,
location
);
}
}
});
});
}
else
{
return
;
appointingEquipmentHandle
(
deviceCode
);
}
}
}
beforeStartCheckHandle
(
deviceCode
,
location
);
};
};
const
goBluetoothShower
=
()
=>
{
const
goBluetoothShower
=
()
=>
{
Taro
.
navigate
To
({
Taro
.
redirect
To
({
url
:
'/pages/Shower/Shower'
,
url
:
'/pages/Shower/Shower'
,
});
});
};
};
const
beforeStartCheckHandle
=
(
deviceCode
:
string
,
location
:
string
)
=>
{
let
minData
=
appointableData
.
duration
/
60
;
let
hourData
=
appointableData
.
punishment
/
3600
;
Taro
.
showModal
({
title
:
'提示'
,
content
:
`确认是否预约
${
deviceCode
}
(
${
location
}
)预约后请在
${
minData
}
分钟内激活设备使用,否则将会在
${
hourData
}
小时内无法预约设备,`
,
}).
then
(
res
=>
{
if
(
res
.
confirm
)
{
appointingEquipmentHandle
(
deviceCode
);
}
});
};
return
(
return
(
<
View
className=
'ShowerAppointment'
>
<
View
className=
'ShowerAppointment'
>
{
showState
==
1
&&
(
{
showState
==
1
&&
(
<
View
className=
'ShowerAppointment-Searchbox'
>
<
View
className=
'ShowerAppointment-Searchbox'
>
<
Input
<
Input
placeholder=
'请输入要
少
选的设备位置'
placeholder=
'请输入要
筛
选的设备位置'
value=
{
search
.
value
}
value=
{
search
.
value
}
onInput=
{
e
=>
search
.
onChange
(
e
)
}
onInput=
{
e
=>
search
.
onChange
(
e
)
}
/>
/>
...
...
src/pages/Shower/components/AppointermentCard/AppointermentCard.tsx
View file @
614cecdd
...
@@ -29,10 +29,10 @@ const AppointermentCard = (props: PageOwnProps) => {
...
@@ -29,10 +29,10 @@ const AppointermentCard = (props: PageOwnProps) => {
</
View
>
</
View
>
<
View
className=
'AppointermentCard-Time'
>
<
View
className=
'AppointermentCard-Time'
>
<
Text
>
预约失效时间:
</
Text
>
<
Text
>
预约失效时间:
</
Text
>
<
Text
>
2019-15-24 12:45:31
</
Text
>
<
Text
>
{
data
.
expireTime
?
data
.
expireTime
:
''
}
</
Text
>
{
/* <Text>{data.expireTime ? data.expireTime : ''}</Text> */
}
{
/* <Text>{data.expireTime ? data.expireTime : ''}</Text> */
}
</
View
>
</
View
>
{
data
.
status
===
5
&&
(
{
(
data
.
status
===
5
||
data
.
status
===
8
)
&&
(
<
Image
className=
'AppointermentCard-Dis-Icon'
src=
{
DisabledIcon
}
/>
<
Image
className=
'AppointermentCard-Dis-Icon'
src=
{
DisabledIcon
}
/>
)
}
)
}
</
View
>
</
View
>
...
...
src/pages/Shower/components/AppointermentEquipment/AppointermentEquipment.tsx
View file @
614cecdd
...
@@ -5,12 +5,17 @@ import DisabledIcon from '@/images/shower/ic_jinyuyue@2x.png';
...
@@ -5,12 +5,17 @@ import DisabledIcon from '@/images/shower/ic_jinyuyue@2x.png';
type
PageOwnProps
=
{
type
PageOwnProps
=
{
data
:
AppointDeviceResponse
;
data
:
AppointDeviceResponse
;
appointingStart
:
(
deviceCode
:
string
,
operationMode
:
number
)
=>
void
;
appointingStart
:
(
deviceCode
:
string
,
operationMode
:
number
,
location
:
string
,
)
=>
void
;
};
};
const
AppointermentEquipment
=
(
props
:
PageOwnProps
)
=>
{
const
AppointermentEquipment
=
(
props
:
PageOwnProps
)
=>
{
const
{
data
,
appointingStart
}
=
props
;
const
{
data
,
appointingStart
}
=
props
;
const
clickHandle
=
()
=>
{
const
clickHandle
=
()
=>
{
appointingStart
&&
appointingStart
(
data
.
code
,
data
.
operationMode
);
appointingStart
&&
appointingStart
(
data
.
code
,
data
.
operationMode
,
data
.
location
);
};
};
return
(
return
(
<
View
<
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