Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bh_face_counter
Overview
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
黄天晨
bh_face_counter
Commits
75151180
Commit
75151180
authored
Apr 24, 2024
by
黄日华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收银程序横屏兼容
parent
b447f4dc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
HomeLayout.js
src/components/HomeLayout.js
+2
-3
AuthPage.js
src/pages/AuthPage.js
+3
-2
CounterMixins.js
src/pages/CounterMixins.js
+1
-0
No files found.
src/components/HomeLayout.js
View file @
75151180
...
...
@@ -2,6 +2,7 @@ import React, {Component} from 'react';
import
{
Dimensions
,
Image
,
Text
,
View
}
from
'react-native'
;
import
{
appName
}
from
'../utils/config'
;
import
{
setSpText
,
scaleSize
}
from
'../utils/screen'
;
const
{
width
,
height
}
=
Dimensions
.
get
(
'window'
);
class
HomeLayout
extends
Component
{
render
()
{
...
...
@@ -30,7 +31,7 @@ const LandscapeStyles = {
top
:
0
,
paddingLeft
:
scaleSize
(
50
),
flexDirection
:
'row'
,
height
:
scaleSize
(
110
),
// 修改了这里
height
:
scaleSize
(
width
>
height
?
height
*
0.12
:
height
*
0.2
),
// 修改了这里
width
:
'100%'
,
position
:
'absolute'
,
backgroundColor
:
'white'
,
...
...
@@ -85,8 +86,6 @@ const portraitStyles = {
},
};
const
{
width
,
height
}
=
Dimensions
.
get
(
'window'
);
const
isLandscape
=
width
>
height
;
const
styles
=
isLandscape
?
LandscapeStyles
:
portraitStyles
;
...
...
src/pages/AuthPage.js
View file @
75151180
...
...
@@ -7,6 +7,7 @@ import {counterLogin} from '../utils/authLogin';
import
config
from
'../utils/config'
;
import
HomeLayout
from
'../components/HomeLayout'
;
import
{
setSpText
,
scaleSize
}
from
'../utils/screen'
;
const
{
width
,
height
}
=
Dimensions
.
get
(
'window'
);
class
AuthPage
extends
Component
{
state
=
{
...
...
@@ -14,7 +15,6 @@ class AuthPage extends Component {
};
async
componentDidMount
()
{
const
{
width
,
height
}
=
Dimensions
.
get
(
'window'
);
this
.
setState
({
isLandscape
:
width
>
height
});
this
.
socket
=
io
(
axios
.
defaults
.
baseURL
);
this
.
socket
.
on
(
'storeAuth'
,
this
.
handleLogin
);
...
...
@@ -34,11 +34,12 @@ class AuthPage extends Component {
render
()
{
const
{
socket
,
isLandscape
}
=
this
.
state
;
console
.
warn
(
width
,
height
);
return
(
<
HomeLayout
>
<
View
style
=
{
styles
.
qrcode
}
>
<
QRCode
size
=
{
isLandscape
?
scaleSize
(
320
)
:
scaleSize
(
700
)}
size
=
{
isLandscape
?
scaleSize
(
height
*
0.35
)
:
scaleSize
(
700
)}
logo
=
{
require
(
'../assets/logo.png'
)}
backgroundColor
=
"white"
value
=
{
`
${
config
.
qrHost
}
/#/store-auth-
${
socket
}
`
}
...
...
src/pages/CounterMixins.js
View file @
75151180
...
...
@@ -804,6 +804,7 @@ const CounterMixins = ComposeComponent => {
return
;
}
barcode
=
barcode
||
this
.
barcode
;
console
.
warn
(
barcode
);
if
(
isNaN
(
barcode
.
substring
(
0
,
4
)))
{
const
msg
=
'请遮住条码旁边的二维码,再重新扫条码'
;
this
.
setState
({
voiceModal
:
true
,
voiceTitle
:
msg
});
...
...
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