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
e6c34a86
Commit
e6c34a86
authored
Mar 06, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整条码页和公告获取
parent
c53ffc87
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
7 deletions
+36
-7
BarCode.tsx
src/pages/BarCode/BarCode.tsx
+30
-3
Home.tsx
src/pages/Home/Home.tsx
+6
-4
No files found.
src/pages/BarCode/BarCode.tsx
View file @
e6c34a86
...
@@ -30,6 +30,7 @@ type PageDispatchProps = {
...
@@ -30,6 +30,7 @@ type PageDispatchProps = {
type
PageOwnProps
=
{};
type
PageOwnProps
=
{};
type
PageState
=
{
type
PageState
=
{
ScreenBrightness
:
number
;
showPayOrder
:
boolean
;
showPayOrder
:
boolean
;
showBig
:
boolean
;
showBig
:
boolean
;
accounts
:
CustomerBeanAccountVo
[];
accounts
:
CustomerBeanAccountVo
[];
...
@@ -71,6 +72,7 @@ class BarCode extends Component {
...
@@ -71,6 +72,7 @@ class BarCode extends Component {
constructor
(
props
:
PageOwnProps
)
{
constructor
(
props
:
PageOwnProps
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
ScreenBrightness
:
1
,
showPayOrder
:
false
,
showPayOrder
:
false
,
showBig
:
false
,
showBig
:
false
,
accounts
:
[],
accounts
:
[],
...
@@ -137,6 +139,33 @@ class BarCode extends Component {
...
@@ -137,6 +139,33 @@ class BarCode extends Component {
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
err
);
console
.
log
(
err
);
});
});
console
.
log
(
'调整亮度'
);
Taro
.
getScreenBrightness
()
.
then
(({
value
})
=>
{
console
.
log
(
value
);
this
.
setState
({
ScreenBrightness
:
value
,
});
Taro
.
setScreenBrightness
({
value
:
1
,
});
})
.
catch
(
err
=>
{
console
.
log
(
err
);
Taro
.
setScreenBrightness
({
value
:
1
,
});
});
}
componentWillUnmount
()
{
console
.
log
(
'调整亮度'
);
const
{
ScreenBrightness
}
=
this
.
state
;
console
.
log
(
ScreenBrightness
);
Taro
.
setScreenBrightness
({
value
:
ScreenBrightness
,
});
}
}
fetchOrder
(
id
:
number
)
{
fetchOrder
(
id
:
number
)
{
...
@@ -169,9 +198,7 @@ class BarCode extends Component {
...
@@ -169,9 +198,7 @@ class BarCode extends Component {
}
}
drawBarCode
(
showBig
:
boolean
)
{
drawBarCode
(
showBig
:
boolean
)
{
const
{
userinfo
}
=
this
.
props
;
const
{
userinfo
}
=
this
.
props
;
Taro
.
setScreenBrightness
({
value
:
1
,
});
if
(
showBig
)
{
if
(
showBig
)
{
wxbarcode
.
barcode
(
'BarCode'
,
userinfo
.
idBar
,
646
,
188
);
wxbarcode
.
barcode
(
'BarCode'
,
userinfo
.
idBar
,
646
,
188
);
}
else
{
}
else
{
...
...
src/pages/Home/Home.tsx
View file @
e6c34a86
...
@@ -126,9 +126,9 @@ class Home extends Component {
...
@@ -126,9 +126,9 @@ class Home extends Component {
url
:
'/pages/Feedback/Feedback'
,
url
:
'/pages/Feedback/Feedback'
,
});
});
}
}
goAnn
()
{
goAnn
(
id
:
number
)
{
Taro
.
navigateTo
({
Taro
.
navigateTo
({
url
:
'/pages/Announcement/Announcement?sectionId=
896'
,
url
:
'/pages/Announcement/Announcement?sectionId=
'
+
id
,
});
});
}
}
...
@@ -160,7 +160,7 @@ class Home extends Component {
...
@@ -160,7 +160,7 @@ class Home extends Component {
})
})
.
catch
(
console
.
log
);
.
catch
(
console
.
log
);
}
}
formatePhone
=
phone
=>
{
formatePhone
=
(
phone
:
string
)
=>
{
let
newPhone
=
phone
.
replace
(
/
([
0-9
]{3})([
0-9
]{4})([
0-9
]{4})
/
,
'$1****$3'
);
let
newPhone
=
phone
.
replace
(
/
([
0-9
]{3})([
0-9
]{4})([
0-9
]{4})
/
,
'$1****$3'
);
return
newPhone
;
return
newPhone
;
};
};
...
@@ -248,7 +248,9 @@ class Home extends Component {
...
@@ -248,7 +248,9 @@ class Home extends Component {
<
Image
className=
'bg'
src=
{
AnnouncementBg
}
/>
<
Image
className=
'bg'
src=
{
AnnouncementBg
}
/>
<
View
className=
'Home-Announcement-title'
>
<
View
className=
'Home-Announcement-title'
>
<
Text
>
最新公告
</
Text
>
<
Text
>
最新公告
</
Text
>
<
View
className=
'Home-Announcement-more'
onClick=
{
this
.
goAnn
}
>
<
View
className=
'Home-Announcement-more'
onClick=
{
()
=>
this
.
goAnn
(
annItem
.
id
)
}
>
更多
更多
<
Image
className=
'more-icon'
src=
{
MoreIcon
}
/>
<
Image
className=
'more-icon'
src=
{
MoreIcon
}
/>
</
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