Skip to content

Commit beef9c6

Browse files
committed
1. 修复百思页面没有数据的问题
1 parent afa337b commit beef9c6

File tree

8 files changed

+44
-26
lines changed

8 files changed

+44
-26
lines changed

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6868
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6969

7070
[version]
71-
^0.94.0
71+
^0.93.0

app/mobx/News/BuDeJieMobx.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { action, observable, runInAction } from 'mobx';
7-
import type { RTBDJData, RTBDJList } from '../../servers/News/interfaces';
7+
import type { RTBDJData, RTBDJList, RTBDJResult } from '../../servers/News/interfaces';
88
import type { RTBuDeJieType } from '../../servers/News';
99
import { loadBuDeJieData } from '../../servers/News';
1010
import { System } from '../../utils';
@@ -165,15 +165,15 @@ class BuDeJieMobx extends ConfigStore {
165165
this.showLoading();
166166
console.log('不得姐加载');
167167
try {
168-
const buDeJieData: RTBDJData = await loadBuDeJieData(type, value);
168+
const buDeJieData: RTBDJResult = await loadBuDeJieData(type, value);
169169

170-
const { largeListData, dataSource } = await BuDeJieMobx.handleLargeListData(buDeJieData.data.list, type);
170+
const { largeListData, dataSource } = await BuDeJieMobx.handleLargeListData(buDeJieData.list, type);
171171

172172
if (value === '') {
173173
runInAction(() => {
174174
this.dataSource = dataSource;
175175
this.largeListData = [largeListData];
176-
this.maxtime = buDeJieData.data.info.maxid;
176+
this.maxtime = buDeJieData.info.maxid;
177177
});
178178
} else {
179179
runInAction(() => {

app/mobx/News/WelfareMobx.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { observable, action, runInAction } from 'mobx';
7-
import type { RTGankData, RTWeal } from '../../servers/News/interfaces';
7+
import type { RTGankData, RTWeal, RTWealResult } from '../../servers/News/interfaces';
88
import { fetchWelfareData } from '../../servers/News';
99
import { System } from '../../utils';
1010
import { CameraRoll } from 'react-native';
@@ -62,9 +62,11 @@ class WelfareMobx extends ConfigStore {
6262
this.page = type === 'refreshing' ? 1 : this.page + 1;
6363

6464
try {
65-
const welfareData: RTGankData = await fetchWelfareData(this.page);
65+
// const welfareData: RTGankData = await fetchWelfareData(this.page);
66+
const welfareData: RTWealResult = await fetchWelfareData(this.page);
67+
console.log('welfareData', welfareData);
6668

67-
const results = welfareData.data;
69+
const results = welfareData.results;
6870

6971
const defaultHeights = [216, 245, 263, 234, 259, 222];
7072

app/servers/News/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@
55

66
import { Fetch } from '../../utils';
77

8-
import { RTGankData, RTBDJData } from './interfaces';
8+
import { RTGankData, RTBDJData, RTBDJResult, RTWealResult } from './interfaces';
99

1010
type RGankType = '福利' | 'iOS' | 'Android';
1111

1212
export async function fetchWelfareData(
1313
page: number,
1414
type: RGankType = '福利',
1515
count: number = 20
16-
): Promise<RTGankData> {
16+
): Promise<RTWealResult> {
1717
const _type: string = encodeURIComponent(type);
1818

19-
// const url = `http://gank.io/api/data/${_type}/${count}/${page}`;
19+
const url = `http://gank.io/api/data/${_type}/${count}/${page}`;
2020

2121
const params = {
2222
type: _type,
2323
count: count,
2424
page: page
2525
};
2626

27-
const url = ApiConfig.api.news.list;
27+
// const url = ApiConfig.api.news.list;
2828

2929
return await Fetch.get(url, params);
3030
}
@@ -39,15 +39,15 @@ export async function fetchWelfareData(
3939
// export type RTBuDeJieType = $Keys<typeof BuDeJieValue>;
4040
export type RTBuDeJieType = '1' | '41' | '10' | '29' | string | number;
4141

42-
export async function loadBuDeJieData(type: RTBuDeJieType, maxtime: string): Promise<RTBDJData> {
43-
// const url = `http://api.budejie.com/api/api_open.php?a=list&c=data&type=${type}&maxtime=${maxtime}`;
42+
export async function loadBuDeJieData(type: RTBuDeJieType, maxtime: string): Promise<RTBDJResult> {
43+
const url = `http://api.budejie.com/api/api_open.php?a=list&c=data&type=${type}&maxtime=${maxtime}`;
4444

4545
const params = {
4646
type,
4747
maxtime
4848
};
4949

50-
const url = ApiConfig.api.news.list;
50+
// const url = ApiConfig.api.news.list;
5151

5252
return await Fetch.get(url, params);
5353
}

app/servers/News/interfaces.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export interface RTGankData {
88
status: string;
99
}
1010

11+
export interface RTWealResult {
12+
results: Array<RTWeal>;
13+
error: boolean;
14+
}
15+
1116
export interface RTWeal {
1217
_id: string;
1318
createdAt: string;

app/utils/Request/Fetch.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ async function checkStatus(resp) {
3939

4040
if (resp.respInfo.status === 200) {
4141
responseData = resp.json();
42-
if (responseData.status === 'success') {
43-
return responseData;
44-
} else {
45-
console.log('200 ---- throwError', responseData);
46-
throwError(responseData);
47-
}
48-
// return responseData;
42+
// if (responseData.status === 'success') {
43+
// return responseData;
44+
// } else {
45+
// console.log('200 ---- throwError', responseData);
46+
// throwError(responseData);
47+
// }
48+
return responseData;
4949
} else {
5050
// console.log('throwError', resp.text());
5151
throwError(resp.text());

ios/ShiTu.xcodeproj/project.pbxproj

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,10 @@
11021102
CreatedOnToolsVersion = 6.2;
11031103
TestTargetID = 13B07F861A680F5B00A75B9A;
11041104
};
1105+
13B07F861A680F5B00A75B9A = {
1106+
DevelopmentTeam = 84SCG89399;
1107+
ProvisioningStyle = Automatic;
1108+
};
11051109
2D02E47A1E0B4A5D006451C7 = {
11061110
CreatedOnToolsVersion = 8.2.1;
11071111
ProvisioningStyle = Automatic;
@@ -1119,7 +1123,6 @@
11191123
hasScannedForEncodings = 0;
11201124
knownRegions = (
11211125
English,
1122-
en,
11231126
Base,
11241127
"zh-Hans",
11251128
);
@@ -1893,8 +1896,11 @@
18931896
buildSettings = {
18941897
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
18951898
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1899+
CODE_SIGN_IDENTITY = "iPhone Developer";
1900+
CODE_SIGN_STYLE = Automatic;
18961901
CURRENT_PROJECT_VERSION = 1;
18971902
DEAD_CODE_STRIPPING = NO;
1903+
DEVELOPMENT_TEAM = 84SCG89399;
18981904
HEADER_SEARCH_PATHS = (
18991905
"$(inherited)",
19001906
"$(SRCROOT)/../node_modules/react-native-fast-image/ios/FastImage/**",
@@ -1919,8 +1925,9 @@
19191925
"-ObjC",
19201926
"-lc++",
19211927
);
1922-
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
1928+
PRODUCT_BUNDLE_IDENTIFIER = com.shitu;
19231929
PRODUCT_NAME = ShiTu;
1930+
PROVISIONING_PROFILE_SPECIFIER = "";
19241931
VERSIONING_SYSTEM = "apple-generic";
19251932
};
19261933
name = Debug;
@@ -1930,7 +1937,10 @@
19301937
buildSettings = {
19311938
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
19321939
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1940+
CODE_SIGN_IDENTITY = "iPhone Developer";
1941+
CODE_SIGN_STYLE = Automatic;
19331942
CURRENT_PROJECT_VERSION = 1;
1943+
DEVELOPMENT_TEAM = 84SCG89399;
19341944
HEADER_SEARCH_PATHS = (
19351945
"$(inherited)",
19361946
"$(SRCROOT)/../node_modules/react-native-fast-image/ios/FastImage/**",
@@ -1955,8 +1965,9 @@
19551965
"-ObjC",
19561966
"-lc++",
19571967
);
1958-
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
1968+
PRODUCT_BUNDLE_IDENTIFIER = com.shitu;
19591969
PRODUCT_NAME = ShiTu;
1970+
PROVISIONING_PROFILE_SPECIFIER = "";
19601971
VERSIONING_SYSTEM = "apple-generic";
19611972
};
19621973
name = Release;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"eslint-plugin-prettier": "^3.0.1",
5151
"eslint-plugin-react": "^7.13.0",
5252
"eslint-plugin-react-native": "^3.7.0",
53-
"flow-bin": "^0.94.0",
53+
"flow-bin": "^0.93.0",
5454
"jest": "^24.5.0",
5555
"metro-react-native-babel-preset": "^0.53.0",
5656
"mobx": "^5.9.0",

0 commit comments

Comments
 (0)