Skip to content

Commit 8ff16be

Browse files
committed
1. WebView添加hideLoading
2. 点击放大的图片宽度减少
1 parent c088702 commit 8ff16be

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

app/components/BaseContainer/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import { View, StyleSheet } from 'react-native';
99
import { observer } from 'mobx-react';
1010
import { NavigationEvents } from 'react-navigation';
1111
import NetInfo from '@react-native-community/netinfo';
12+
import type { ConnectionType } from '@react-native-community/netinfo';
1213

1314
import { NavigatorBar, LoadingSpinner, ErrorView } from '../index';
1415
import { Theme } from 'teaset';
16+
import { ConfigStore } from '../../store/ConfigStore';
1517

1618
type Props = {
17-
store?: Object, // 页面中的mobx状态
19+
store?: ConfigStore, // 页面中的mobx状态
1820
onErrorPress?: Function, // 出错页面的点击事件
1921
navBar?: any, // 导航条
2022
children?: any,
@@ -58,6 +60,7 @@ type State = {
5860
class BaseContainer extends Component<Props, State> {
5961
netInfoListen: any;
6062
componentWillUnmount() {
63+
this.props.store && this.props.store.hideLoading();
6164
this.netInfoListen && NetInfo.removeEventListener('connectionChange', this.networkHandle);
6265
}
6366

@@ -72,7 +75,7 @@ class BaseContainer extends Component<Props, State> {
7275
}
7376
};
7477

75-
networkHandle = (netInfo: NetType) => {
78+
networkHandle = (netInfo: any) => {
7679
const { netInfoCallBack } = this.props;
7780
const network: NetType = this.getNetInfoStatus(netInfo);
7881

@@ -82,7 +85,7 @@ class BaseContainer extends Component<Props, State> {
8285
};
8386

8487
getNetInfoStatus = (netInfo: any) => {
85-
const type: string = netInfo.type;
88+
const type: ConnectionType = netInfo.type;
8689
return {
8790
isConnect: type.toUpperCase() === 'WIFI' || type.toUpperCase() === 'CELLULAR',
8891
isWifi: type.toUpperCase() === 'WIFI',

app/pages/News/BuDeJie/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ const BuDeJie = observer(function(props: Props) {
6060
if (item.isLongPicture || !item.is_gif) {
6161
navigation.navigate('WebView', { uri: item.weixin_url });
6262
} else {
63+
64+
const height = isIPhoneX ? SCREEN_HEIGHT - 44 - 49 : SCREEN_HEIGHT;
65+
6366
const overlayView = (
6467
<Overlay.PopView
6568
style={{ alignItems: 'center', justifyContent: 'center' }}
@@ -76,7 +79,7 @@ const BuDeJie = observer(function(props: Props) {
7679
style={{
7780
backgroundColor: 'black',
7881
width: SCREEN_WIDTH,
79-
height: SCREEN_HEIGHT
82+
height: height
8083
}}
8184
/>
8285
</Button>

app/pages/News/Welfare/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const Welfare = observer(function(props: Props) {
7373
>
7474
<CustomImage
7575
source={{ uri: item.largeUrl }}
76-
resizeMode="cover"
76+
// resizeMode="cover"
7777
style={{
7878
backgroundColor: 'white',
7979
width: SCREEN_WIDTH,

app/pages/WebView/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ export default class index extends React.Component<Props, State> {
5555
}
5656

5757
componentWillUnmount() {
58+
const { configStore } = this.context;
59+
configStore.hideLoading();
5860
// this.props.configStore.hideLoading();
5961
StatusBar.setHidden(false);
6062
}

0 commit comments

Comments
 (0)