Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
软件工程实践2022年春W班
穿梭在银河的火箭队
FZUStudyRoom
提交
fd7f77e0
F
FZUStudyRoom
项目概览
软件工程实践2022年春W班
/
穿梭在银河的火箭队
/
FZUStudyRoom
通知
12
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
FZUStudyRoom
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fd7f77e0
编写于
4月 28, 2022
作者:
ItbGcthate
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
304_addOnlineStudyHome
上级
ade7e757
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
84 addition
and
16 deletion
+84
-16
component/2-PlayerPKHome/index.js
component/2-PlayerPKHome/index.js
+48
-0
component/OnlineStudy/index.js
component/OnlineStudy/index.js
+2
-5
component/OnlineStudyHome/index.js
component/OnlineStudyHome/index.js
+34
-11
未找到文件。
component/2-PlayerPKHome/index.js
0 → 100644
浏览文件 @
fd7f77e0
import
React
,
{
Component
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Dimensions
}
from
'
react-native
'
;
import
{
Button
}
from
'
react-native-elements
'
;
const
{
width
,
height
}
=
Dimensions
.
get
(
'
window
'
);
class
TwoPlayerPKHome
extends
Component
{
constructor
()
{
super
();
}
render
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{
styles
.
text
}
>
Study自习模块
<
/Text
>
<
Button
buttonStyle
=
{
styles
.
buttonStyle
}
containerStyle
=
{
styles
.
button_containerStyle
}
title
=
"
button
"
/>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
backgroundColor
:
'
#F2E2CE
'
,
//opacity: 0.5,
flex
:
1
,
},
text
:
{
fontSize
:
50
,
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
},
buttonStyle
:
{
backgroundColor
:
'
#BF7636
'
,
borderRadius
:
3
,
},
button_containerStyle
:
{
width
:
parseInt
(
width
)
/
2
,
marginHorizontal
:
parseInt
(
width
)
/
4
,
marginVertical
:
parseInt
(
width
)
/
4
,
},
});
export
default
TwoPlayerPKHome
;
component/OnlineStudy/index.js
浏览文件 @
fd7f77e0
...
...
@@ -3,6 +3,7 @@ import {View, Text, StyleSheet, Dimensions} from 'react-native';
import
{
createNativeStackNavigator
}
from
'
@react-navigation/native-stack
'
;
import
{
NavigationContainer
}
from
'
@react-navigation/native
'
;
import
OnlineStudyHome
from
'
../OnlineStudyHome
'
;
import
TwoPlayerPKHome
from
'
../2-PlayerPKHome
'
;
const
{
width
,
height
}
=
Dimensions
.
get
(
'
window
'
);
...
...
@@ -11,11 +12,6 @@ class OnlineStudy extends Component {
super
();
}
onlineMode
=
event
=>
{
alert
(
'
is pressed
'
);
this
.
props
.
navigation
.
navigate
(
'
OnlineStudy
'
);
};
render
()
{
const
Stack
=
createNativeStackNavigator
();
...
...
@@ -34,6 +30,7 @@ class OnlineStudy extends Component {
},
}}
>
<
Stack
.
Screen
name
=
"
联网自习
"
component
=
{
OnlineStudyHome
}
/
>
<
Stack
.
Screen
name
=
"
双人PK
"
component
=
{
TwoPlayerPKHome
}
/
>
<
/Stack.Navigator
>
<
/NavigationContainer
>
);
...
...
component/OnlineStudyHome/index.js
浏览文件 @
fd7f77e0
import
React
,
{
Component
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Dimensions
,
Image
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Dimensions
,
Image
,
TouchableHighlight
,
Pressable
,
}
from
'
react-native
'
;
const
{
width
,
height
}
=
Dimensions
.
get
(
'
window
'
);
...
...
@@ -8,11 +16,31 @@ class OnlineStudyHome extends Component {
super
();
}
twoPlayerPK
=
()
=>
{
this
.
props
.
navigation
.
navigate
(
'
双人PK
'
);
};
render
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
Image
source
=
{
require
(
'
./img/scene1.png
'
)}
style
=
{
styles
.
image
}
/
>
<
Image
source
=
{
require
(
'
./img/scene2.png
'
)}
style
=
{
styles
.
image
}
/
>
<
Pressable
android_ripple
=
{{
color
:
'
#BF7636
'
,
foreground
:
true
,
}}
onPress
=
{
this
.
twoPlayerPK
}
style
=
{
styles
.
button
}
>
<
Image
source
=
{
require
(
'
./img/scene1.png
'
)}
style
=
{
styles
.
image
}
/
>
<
/Pressable
>
<
Pressable
android_ripple
=
{{
color
:
'
#BF7636
'
,
foreground
:
true
,
}}
onPress
=
{
this
.
twoPlayerPK
}
style
=
{
styles
.
button
}
>
<
Image
source
=
{
require
(
'
./img/scene2.png
'
)}
style
=
{
styles
.
image
}
/
>
<
/Pressable
>
<
/View
>
);
}
...
...
@@ -29,14 +57,9 @@ const styles = StyleSheet.create({
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
},
buttonStyle
:
{
backgroundColor
:
'
#BF7636
'
,
borderRadius
:
3
,
},
button_containerStyle
:
{
width
:
parseInt
(
width
)
/
2
,
marginHorizontal
:
parseInt
(
width
)
/
4
,
marginVertical
:
parseInt
(
width
)
/
4
,
button
:
{
flex
:
0.5
,
borderRadius
:
50
,
},
image
:
{
width
:
null
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录