Authored by 于良

增加图标和启动图,首页增加接口调用 review by 盖剑秋

... ... @@ -389,6 +389,7 @@
baseConfigurationReference = E38B39E1C626434D633DF86C /* Pods-YH_Vendor.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
DEAD_CODE_STRIPPING = NO;
FRAMEWORK_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
... ... @@ -407,7 +408,7 @@
"-ObjC",
);
PODS_ROOT = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = cn.yoho.boys;
PRODUCT_NAME = YH_Vendor;
};
name = Debug;
... ... @@ -417,6 +418,7 @@
baseConfigurationReference = B44EE6A85A06E0E02E6B1F23 /* Pods-YH_Vendor.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
FRAMEWORK_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
"$(inherited)",
... ... @@ -434,7 +436,7 @@
"-ObjC",
);
PODS_ROOT = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = cn.yoho.boys;
PRODUCT_NAME = YH_Vendor;
};
name = Release;
... ...
... ... @@ -31,7 +31,7 @@
* on the same Wi-Fi network.
*/
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
jsCodeLocation = [NSURL URLWithString:@"http://172.16.6.149:8081/index.ios.bundle?platform=ios&dev=true"];
/**
* OPTION 2
... ...
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "潮店宝-58.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "潮店宝-87.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "潮店宝-80.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "潮店宝-120.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"idiom" : "iphone",
"filename" : "潮店宝-121.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"idiom" : "iphone",
"filename" : "潮店宝-180.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"pre-rendered" : true
}
}
\ No newline at end of file
... ...
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
... ...
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "启动1242x2208.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "启动750x1334.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "启动640x960.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "启动640x1336.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
... ...
... ... @@ -35,11 +35,11 @@
<array>
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
... ...
... ... @@ -41,6 +41,10 @@ export default keyMirror({
HOME_OVERVIEW_SUCCESS: null,
HOME_OVERVIEW_FAILURE: null,
HOME_BRABDRANK_REQUEST: null,
HOME_BRABDRANK_SUCCESS: null,
HOME_BRABDRANK_FAILURE: null,
USER_ITEMS_PRESSED: null,
PHONE_CALL: null,
ABOUT_US: null,
... ...
module.exports = {
dev: {
// baseUrl: 'http://testapi.yoho.cn:28077',
baseUrl: 'http://service.yoho.cn',
baseUrl: 'http://172.16.6.108:8080/gateway',
privateKey: 'a85bb0674e08986c6b115d5e3a4884fa',
httpTimeout: 30000, //毫秒
... ...
... ... @@ -99,7 +99,9 @@ class HomeContainer extends Component {
}
componentDidMount() {
this.props.actions.overview(this.props.home.shopId);
// this.props.actions.overview(this.props.home.shopId);
this.props.actions.overview(1200);
this.props.actions.brandRank(1200);
}
_onPressCategory(id) {
... ...
... ... @@ -16,6 +16,10 @@ const {
HOME_OVERVIEW_SUCCESS,
HOME_OVERVIEW_FAILURE,
HOME_BRABDRANK_REQUEST,
HOME_BRABDRANK_SUCCESS,
HOME_BRABDRANK_FAILURE,
GO_TO_SALE_STATS,
GO_TO_REFOUND_STATS,
GO_TO_STOCK_STATS,
... ... @@ -27,10 +31,10 @@ const {
} = require('../../constants/actionTypes').default;
export function overviewRequest(shopId) {
export function overviewRequest(brandId) {
return {
type: HOME_OVERVIEW_REQUEST,
payload: shopId
payload: brandId
};
}
... ... @@ -48,25 +52,53 @@ export function overviewFailure(error) {
};
}
export function overview(shopId) {
export function brandRankRequest(brandId) {
return {
type: HOME_BRABDRANK_REQUEST,
payload: brandId
};
}
export function brandRankSuccess(json) {
return {
type: HOME_BRABDRANK_SUCCESS,
payload: json
};
}
export function brandRankFailure(error) {
return {
type: HOME_BRABDRANK_FAILURE,
payload: error
};
}
export function overview(brandId) {
return dispatch => {
dispatch(overviewRequest(shopId));
return new HomeService().overview(shopId)
dispatch(overviewRequest(brandId));
return new HomeService().overview(brandId)
.then(json => {
dispatch(overviewSuccess({
rank: 76,
rise: true,
riseCount: 28,
goodsCount: 7600,
goodsAmount: 19800.00,
}));
dispatch(overviewSuccess(json));
})
.catch(error => {
dispatch(overviewFailure(error));
});
};
}
export function brandRank(brandId) {
return dispatch => {
dispatch(brandRankRequest(brandId));
return new HomeService().brandRank(brandId)
.then(json => {
dispatch(brandRankSuccess(json));
})
.catch(error => {
dispatch(brandRankFailure(error));
});
};
}
export function goToStatsPage(type) {
... ...
/**
* # guideInitialState.js
*
*
*
*/
'use strict';
... ... @@ -11,13 +11,13 @@ import {Record} from 'immutable';
/**
* ## InitialState
*
*
* The fields we're concerned with
*/
let InitialState = Record({
isFetching: false,
error: null,
shopId: 0,
brandId: 0,
overview: new (Record({
rank: 0,
rise: true,
... ...
... ... @@ -17,6 +17,10 @@ const {
HOME_OVERVIEW_SUCCESS,
HOME_OVERVIEW_FAILURE,
HOME_BRABDRANK_REQUEST,
HOME_BRABDRANK_SUCCESS,
HOME_BRABDRANK_FAILURE,
GO_TO_SALE_STATS,
GO_TO_REFOUND_STATS,
GO_TO_STOCK_STATS,
... ... @@ -40,25 +44,33 @@ export default function userReducer(state = initialState, action) {
switch (action.type) {
case HOME_OVERVIEW_REQUEST: {
case HOME_OVERVIEW_REQUEST:
case HOME_BRABDRANK_REQUEST: {
let nextState = state.set('isFetching', true)
.set('error', null)
.set('shopId', action.payload);
.set('brandId', action.payload);
return nextState;
}
case HOME_OVERVIEW_SUCCESS: {
let nextState = state.set('isFetching', false)
.set('error', null)
.setIn(['overview', 'rank'], action.payload.rank)
.setIn(['overview', 'rise'], action.payload.rise)
.setIn(['overview', 'riseCount'], action.payload.riseCount)
.setIn(['overview', 'goodsCount'], action.payload.goodsCount)
.setIn(['overview', 'goodsAmount'], action.payload.goodsAmount);
.setIn(['overview', 'rank'], action.payload.rankNow)
.setIn(['overview', 'rise'], action.payload.rankLevel)
.setIn(['overview', 'riseCount'], action.payload.rankChange)
return nextState;
}
case HOME_BRABDRANK_SUCCESS: {
let nextState = state.set('isFetching', false)
.set('error', null)
.setIn(['overview', 'goodsCount'], action.payload.orderAmount)
.setIn(['overview', 'goodsAmount'], action.payload.buyNumbers);
return nextState;
}
case HOME_OVERVIEW_FAILURE:
case HOME_BRABDRANK_FAILURE:
return state.set('isFetching', false)
.set('error', action.payload);
... ...
'use strict';
import Request from './Request';
import moment from 'moment';
export default class UserService {
... ... @@ -9,18 +10,37 @@ export default class UserService {
this.api = new Request();
}
async overview(shopId) {
async overview(brandId) {
let dateId = moment().format('YYYYMMDD'); //20160524
return await this.api.get({
url: '/operations/api/v6/category/getCategory',
body: {
brandId,
dateId
}
})
.then((json) => {
return json;
})
.catch((error) => {
throw(error);
});
}
async brandRank(brandId) {
let dateId = moment().format('YYYYMMDD'); //20160524
return await this.api.get({
url: '/operations/api/v6/category/getCategory',
body: {
shopId,
brandId,
dateId
}
})
.then((json) => {
return json;
})
.catch((error) => {
console.error(eror);
throw(error);
});
}
... ...
... ... @@ -10,6 +10,7 @@
"immutable": "^3.8.1",
"key-mirror": "^1.0.1",
"md5": "^2.1.0",
"moment": "^2.13.0",
"object-assign": "^4.1.0",
"query-string": "^4.1.0",
"react": "^0.14.8",
... ...