Skip to content

Commit d578ccf

Browse files
committed
关于项目页面完成
1 parent dd65b51 commit d578ccf

File tree

13 files changed

+147
-170
lines changed

13 files changed

+147
-170
lines changed

App.js

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ function Tab(params) {
8888
screen: createStackNavigator({ publish: Publish }),
8989
navigationOptions: ({ navigation }) => ({
9090
tabBarLabel: '发布',
91-
// tabBarOnPress: ({defaultHandler, navigation}) => {
92-
// // console.log(defaultHandler);
93-
// // jundeLogin(defaultHandler, navigation)
91+
tabBarOnPress: ({defaultHandler, navigation}) => {
92+
// console.log(defaultHandler);
93+
jundeLogin(defaultHandler, navigation)
9494

95-
// },
95+
},
9696
tabBarIcon: ({ focused, tintColor }) => (
9797
<Image style={{tintColor, width: 25, height: 25 }} source={ require('./src/assets/publish.png')}></Image>
9898

@@ -129,12 +129,13 @@ function Tab(params) {
129129
screen: createStackNavigator({ Info: Info }),
130130
// paths: 'people/:name',
131131
navigationOptions: ({ navigation }) => ({
132-
tabBarLabel: '关于',
133-
tabBarOnPress: ({defaultHandler, navigation}) => {
134-
// console.log(defaultHandler);
135-
jundeLogin(defaultHandler, navigation)
132+
title: '关于',
133+
tabBarVisible: false,
134+
// tabBarOnPress: ({defaultHandler, navigation}) => {
135+
// // console.log(defaultHandler);
136+
// jundeLogin(defaultHandler, navigation)
136137

137-
},
138+
// },
138139
tabBarIcon: ({ focused, tintColor }) => (
139140
<Image style={{tintColor, width: 25, height: 25 }} source={ require('./src/assets/info.png') }></Image>
140141

@@ -187,13 +188,7 @@ function AppNavigator(store) {
187188
},
188189
Detail: {
189190
screen: Detail
190-
},
191-
// onTransitionStart: (start) => {
192-
// console.log(strat);
193-
194-
// },
195-
// Web: { screen: WebScene },
196-
// GroupPurchase: { screen: GroupPurchaseScene },
191+
}
197192
},
198193
{
199194
defaultNavigationOptions: {

android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ android {
138138
}
139139

140140
dependencies {
141+
implementation project(':react-native-webview')
141142
implementation project(':@react-native-community_async-storage')
142143
implementation project(':react-native-gesture-handler')
143144
implementation fileTree(dir: "libs", include: ["*.jar"])

android/app/src/main/java/com/cnode/MainApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Application;
44

55
import com.facebook.react.ReactApplication;
6+
import com.reactnativecommunity.webview.RNCWebViewPackage;
67
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
78
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
89
import com.facebook.react.ReactNativeHost;
@@ -25,6 +26,7 @@ public boolean getUseDeveloperSupport() {
2526
protected List<ReactPackage> getPackages() {
2627
return Arrays.<ReactPackage>asList(
2728
new MainReactPackage(),
29+
new RNCWebViewPackage(),
2830
new AsyncStoragePackage(),
2931
new RNGestureHandlerPackage()
3032
);

android/settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
rootProject.name = 'cnode'
2+
include ':react-native-webview'
3+
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
24
include ':@react-native-community_async-storage'
35
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
46
include ':react-native-gesture-handler'

ios/cnode.xcodeproj/project.pbxproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
1FEB46E0121F470996F70B07 /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E7CCB8C49F7D42D28A24A622 /* libRNGestureHandler.a */; };
4343
2B9D443650914636ABB57100 /* libRNGestureHandler-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 147B5297FABB40E392987A98 /* libRNGestureHandler-tvOS.a */; };
4444
4B787931F16149AB88D76FD7 /* libRNCAsyncStorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DBD2CEC315E846B5A29BAA35 /* libRNCAsyncStorage.a */; };
45+
6548DEBC162C43C4B479D83B /* libRNCWebView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BC58C63B444E4DF9A1D0BE93 /* libRNCWebView.a */; };
4546
/* End PBXBuildFile section */
4647

4748
/* Begin PBXContainerItemProxy section */
@@ -354,6 +355,8 @@
354355
147B5297FABB40E392987A98 /* libRNGestureHandler-tvOS.a */ = {isa = PBXFileReference; name = "libRNGestureHandler-tvOS.a"; path = "libRNGestureHandler-tvOS.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
355356
6F994D615335488A9A176C02 /* RNCAsyncStorage.xcodeproj */ = {isa = PBXFileReference; name = "RNCAsyncStorage.xcodeproj"; path = "../node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
356357
DBD2CEC315E846B5A29BAA35 /* libRNCAsyncStorage.a */ = {isa = PBXFileReference; name = "libRNCAsyncStorage.a"; path = "libRNCAsyncStorage.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
358+
AB0D853D2F5C47D88B5E768D /* RNCWebView.xcodeproj */ = {isa = PBXFileReference; name = "RNCWebView.xcodeproj"; path = "../node_modules/react-native-webview/ios/RNCWebView.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
359+
BC58C63B444E4DF9A1D0BE93 /* libRNCWebView.a */ = {isa = PBXFileReference; name = "libRNCWebView.a"; path = "libRNCWebView.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
357360
/* End PBXFileReference section */
358361

359362
/* Begin PBXFrameworksBuildPhase section */
@@ -384,6 +387,7 @@
384387
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
385388
1FEB46E0121F470996F70B07 /* libRNGestureHandler.a in Frameworks */,
386389
4B787931F16149AB88D76FD7 /* libRNCAsyncStorage.a in Frameworks */,
390+
6548DEBC162C43C4B479D83B /* libRNCWebView.a in Frameworks */,
387391
);
388392
runOnlyForDeploymentPostprocessing = 0;
389393
};
@@ -576,6 +580,7 @@
576580
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
577581
5E59F1BA8750480A82F4FB5D /* RNGestureHandler.xcodeproj */,
578582
6F994D615335488A9A176C02 /* RNCAsyncStorage.xcodeproj */,
583+
AB0D853D2F5C47D88B5E768D /* RNCWebView.xcodeproj */,
579584
);
580585
name = Libraries;
581586
sourceTree = "<group>";
@@ -1206,11 +1211,13 @@
12061211
"\"$(SRCROOT)/$(TARGET_NAME)\"",
12071212
"\"$(SRCROOT)/$(TARGET_NAME)\"",
12081213
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1214+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
12091215
);
12101216
HEADER_SEARCH_PATHS = (
12111217
"$(inherited)",
12121218
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
12131219
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
1220+
"$(SRCROOT)/../node_modules/react-native-webview/ios",
12141221
);
12151222
};
12161223
name = Debug;
@@ -1235,11 +1242,13 @@
12351242
"\"$(SRCROOT)/$(TARGET_NAME)\"",
12361243
"\"$(SRCROOT)/$(TARGET_NAME)\"",
12371244
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1245+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
12381246
);
12391247
HEADER_SEARCH_PATHS = (
12401248
"$(inherited)",
12411249
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
12421250
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
1251+
"$(SRCROOT)/../node_modules/react-native-webview/ios",
12431252
);
12441253
};
12451254
name = Release;
@@ -1264,6 +1273,7 @@
12641273
"$(inherited)",
12651274
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
12661275
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
1276+
"$(SRCROOT)/../node_modules/react-native-webview/ios",
12671277
);
12681278
};
12691279
name = Debug;
@@ -1287,6 +1297,7 @@
12871297
"$(inherited)",
12881298
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
12891299
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
1300+
"$(SRCROOT)/../node_modules/react-native-webview/ios",
12901301
);
12911302
};
12921303
name = Release;
@@ -1319,11 +1330,13 @@
13191330
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13201331
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13211332
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1333+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13221334
);
13231335
HEADER_SEARCH_PATHS = (
13241336
"$(inherited)",
13251337
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
13261338
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
1339+
"$(SRCROOT)/../node_modules/react-native-webview/ios",
13271340
);
13281341
};
13291342
name = Debug;
@@ -1356,11 +1369,13 @@
13561369
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13571370
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13581371
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1372+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13591373
);
13601374
HEADER_SEARCH_PATHS = (
13611375
"$(inherited)",
13621376
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
13631377
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
1378+
"$(SRCROOT)/../node_modules/react-native-webview/ios",
13641379
);
13651380
};
13661381
name = Release;
@@ -1392,11 +1407,13 @@
13921407
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13931408
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13941409
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1410+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
13951411
);
13961412
HEADER_SEARCH_PATHS = (
13971413
"$(inherited)",
13981414
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
13991415
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
1416+
"$(SRCROOT)/../node_modules/react-native-webview/ios",
14001417
);
14011418
};
14021419
name = Debug;
@@ -1428,11 +1445,13 @@
14281445
"\"$(SRCROOT)/$(TARGET_NAME)\"",
14291446
"\"$(SRCROOT)/$(TARGET_NAME)\"",
14301447
"\"$(SRCROOT)/$(TARGET_NAME)\"",
1448+
"\"$(SRCROOT)/$(TARGET_NAME)\"",
14311449
);
14321450
HEADER_SEARCH_PATHS = (
14331451
"$(inherited)",
14341452
"$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**",
14351453
"$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios",
1454+
"$(SRCROOT)/../node_modules/react-native-webview/ios",
14361455
);
14371456
};
14381457
name = Release;

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"test": "jest"
88
},
99
"dependencies": {
10-
"@ant-design/react-native": "^3.1.8",
1110
"@react-native-community/async-storage": "^1.4.1",
1211
"@types/react": "^16.8.18",
1312
"@types/react-native": "^0.57.58",
@@ -17,15 +16,14 @@
1716
"react": "16.8.3",
1817
"react-native": "0.59.8",
1918
"react-native-gesture-handler": "^1.2.1",
20-
"react-native-htmlview": "^0.14.0",
2119
"react-native-picker-select": "^6.1.0",
2220
"react-native-refresh-list-view": "^1.0.10",
2321
"react-native-render-html": "^4.1.2",
2422
"react-native-side-menu": "^1.1.3",
23+
"react-native-webview": "^5.10.0",
2524
"react-navigation": "^3.11.0",
2625
"react-redux": "^7.0.3",
2726
"redux": "^4.0.1",
28-
"timeago": "^1.6.6",
2927
"tslib": "^1.9.3"
3028
},
3129
"devDependencies": {

src/assets/back.png

473 Bytes
Loading

src/store/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export default function (state, action) {
3737
}
3838
case REMOVE_PREV:
3939
return {
40-
// dataList: [],
41-
...state
40+
...state,
41+
dataList: []
4242
}
4343
case DELETE_COMMENT:
4444
// 删除评论
@@ -75,7 +75,7 @@ export const removeLogin = (name) => {
7575

7676
return { type: REMOVE_LOGIN, name }
7777
}
78-
export const removePrev = (name) => {
78+
export const removePrev = (data) => {
7979

80-
return { type: REMOVE_PREV, name }
80+
return { type: REMOVE_PREV, data }
8181
}

src/views/Detail/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ import { connect } from 'react-redux'
8282
navigation.navigate('Mine')
8383
}
8484
// console.log(this.props.lohi);
85+
}
86+
giveTop = () => {
8587

8688
}
8789
allDetail (props) {
@@ -142,9 +144,10 @@ import { connect } from 'react-redux'
142144
<TouchableOpacity onPress={this.isLogin}>
143145
<Text style={{color: '#009688'}}>回复</Text>
144146
</TouchableOpacity>
145-
<TouchableOpacity>
147+
<TouchableOpacity onPress={this.giveTop}>
146148
<Text>
147-
🖤{ele.ups.length}</Text>
149+
🖤
150+
{ele.ups.length}</Text>
148151
</TouchableOpacity>
149152
</View>
150153
<View style={{flex: 1, flexDirection: 'column',}}>

src/views/Home/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ import { loadData, removePrev } from '../../store'
4040
getData = (item, index) => {
4141
// console.log(this.state.params.tab);
4242

43-
// if (item.value !== this.state.params.tab) {
44-
// // this.setState({
45-
// // dataList: []
46-
// // })
47-
// console.log(111);
43+
if (item.value !== this.state.params.tab) {
44+
// this.setState({
45+
// dataList: []
46+
// })
47+
// console.log(111);
4848

49-
// this.props.removePrev()
49+
this.props.removePrev()
5050

5151
// // this.props.state = []
52-
// }
52+
}
5353
// console.log(item);
5454

5555
this.setState({
@@ -73,7 +73,7 @@ import { loadData, removePrev } from '../../store'
7373
getALl(query).then((res) => {
7474

7575
let datas = res.data.data
76-
// console.log(this.props);
76+
console.log(datas);
7777

7878
this.setState({
7979
// dataList: [...this.state.dataList, ...datas],

0 commit comments

Comments
 (0)