-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
161 changed files
with
7,458 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* Created by zhaochong on 2017/12/15. | ||
*/ | ||
import React, {Component} from 'react'; | ||
import { | ||
BackAndroid, | ||
Platform, NativeModules, NativeEventEmitter, DeviceEventEmitter, ToastAndroid | ||
} from 'react-native'; | ||
|
||
import {connect} from 'react-redux'; | ||
import {addNavigationHelpers} from 'react-navigation'; | ||
import MemberRouters from './routers/memberRouters' | ||
|
||
class AppWithNavigationState extends Component { | ||
componentWillMount() { | ||
// ToastAndroid.show("发送成功" +NativeModules.commModule.RNContants, ToastAndroid.SHORT); | ||
/* NativeModules.commModule.rnCallNativeFromPromise("zhaochong").then( | ||
(result) =>{ | ||
ToastAndroid.show("Promise收到消息:" + result, ToastAndroid.SHORT) | ||
} | ||
).catch((error) =>{console.log(error)});*/ | ||
|
||
/* DeviceEventEmitter.addListener('Payeco_Event',(msg)=>{ | ||
let title = "React Native界面,收到数据:会员中心" + msg; | ||
ToastAndroid.show("发送成功" +title, ToastAndroid.SHORT); | ||
})*/ | ||
|
||
/* NativeModules.commModule.rnCallNativeFromCallback("zhaochong",(result) => { | ||
ToastAndroid.show("CallBack收到消息:" + result, ToastAndroid.SHORT); | ||
})*/ | ||
|
||
//进入RN界面存下认证等相关信息 | ||
let author = { | ||
Authorization: this.props.params.accessToken, | ||
uId: this.props.params.userId | ||
} | ||
console.log('%%%%%%%%%%%%%', this.props.params, this.props); | ||
this.props.dispatch({type: 'AUTH_INFO', data: author}) | ||
console.log('收到事件', author) | ||
} | ||
|
||
|
||
componentWillUnmount() { | ||
|
||
} | ||
|
||
|
||
render() { | ||
const {dispatch, nav, params} = this.props; | ||
//console.log('%%%%%%%%%%%%%',nav); | ||
return ( | ||
<MemberRouters navigation={addNavigationHelpers({ | ||
dispatch: dispatch, | ||
state: nav | ||
})} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
function mapStateToProps(state) { | ||
const {nav} = state; | ||
return { | ||
nav | ||
} | ||
} | ||
|
||
export default connect(mapStateToProps)(AppWithNavigationState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Created by zhaochong on 2018/1/1. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
//获取banner图列表 | ||
import request from "../api/request"; | ||
import * as types from "../../VPCenter/constants/VPCenterActionType"; | ||
|
||
export function getBanners(){ | ||
console.log('^^^^^1111^^^^^^12122'); | ||
return dispatch =>{ | ||
return request.get(`user/promotion`) | ||
.then(data=>{ | ||
console.log('^^^^^^^^^^^12122',data.data.image); | ||
dispatch({type:types.VPCENTER_BANNER,data:data.data});// | ||
}) | ||
.catch(response =>{ | ||
|
||
}); | ||
} | ||
} | ||
//获取成长值明细 | ||
export function getVpGrowthDetails(params){ | ||
return dispatch =>{ | ||
return request.get(`integration/log`,{params:params}) | ||
.then(data=>{ | ||
console.log('^^^^^^^^^^^',data); | ||
dispatch({type:types.VPCENTER_VPGROWTHDETAILSLIST,data:data.data});// | ||
}) | ||
.catch(response =>{ | ||
|
||
}); | ||
} | ||
} | ||
//获取会员规则说明 | ||
export function getVPInstructions(params){ | ||
return dispatch =>{ | ||
return request.get(`member/info`,{params:params}) | ||
.then(data=>{ | ||
console.log('^^^^^^^^^^^data.rules',data.rules); | ||
dispatch({type:types.VPCENTER_VPINSTRUCTION,data:data.data});// | ||
}) | ||
.catch(response =>{ | ||
/* if(response){ | ||
alert(response) | ||
}*/ | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Created by zhaochong on 2018/1/1. | ||
*/ | ||
'use strict'; | ||
import axios from 'axios'; | ||
import * as configs from "../constants/configs"; | ||
import store from "../../VPCenter/store/createStore"; | ||
|
||
const httpConfig={ | ||
baseURL:__DEV__? configs.API_DEV:configs.API_PRO, | ||
headers: { | ||
'Content-type': 'application/json', | ||
'Accept': 'application/json;responseformat=3', | ||
// 'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAwMDgwIiwiYXVkIjoiYnJvd3NlciIsImlhdCI6MTUxNDI3NTE0MSwibmJmIjoxNTE0Mjc1MTQxLCJleHAiOjE1MjIwNTExNDEsImlzcyI6ImVjYXJ4IiwianRpIjoxNTE0Mjc1MTQxLCJjbGllbnRJZCI6ImJyb3dzZXIiLCJ1aWQiOiIxMDAwMDgwIiwiZW52IjoidGVzdGluZyJ9.XxKP0LqTLa1tUeoCu7TNipr01W_KaK_AXtCutrSri-o', | ||
'X-STORE': 'FLOW', | ||
'X-ENV-TYPE':__DEV__? configs.ENV_TYPE_DEV:configs.ENV_TYPE_PRO, | ||
'X-APP-ID':'M820igii5lL4tcy' | ||
|
||
|
||
}, | ||
timeout: __DEV__? configs.API_TIMEOUT_DEV:configs.API_TIMEOUT_PRO | ||
}; | ||
|
||
const request=axios.create(httpConfig); | ||
|
||
request.interceptors.request.use(config=>{ | ||
let commonData = store.getState().commonData; | ||
console.log('---store---',commonData); | ||
config.headers.Authorization = commonData.authInfo.Authorization; | ||
return config; | ||
}); | ||
|
||
request.interceptors.response.use(response=>{ | ||
//console.log("************************",response); | ||
if(response.status==200){ | ||
return response.data; | ||
} | ||
return response; | ||
|
||
}); | ||
|
||
|
||
export default request; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* Copyright (c) 2017-present, Liu Jinyong | ||
* All rights reserved. | ||
* | ||
* https://github.com/huanxsd/MeiTuan | ||
* @flow | ||
*/ | ||
|
||
import { urlByAppendingParams } from './tool' | ||
|
||
const kFirstPage = 1 | ||
const kCurrentPageKey = 'page' | ||
const kPageSizeKey = 'count' | ||
const kPageSize = 20 | ||
const kDefaultListNode = 'list' | ||
const host = '' | ||
|
||
class ListRequest { | ||
requestNode: string | ||
isFirstLoad: boolean | ||
dataList: Array<Object> | ||
isReload: boolean | ||
currentPage: number | ||
noMoreData: boolean | ||
onSuccess: function | ||
onFailure: function | ||
|
||
constructor(requestNode: string) { | ||
this.requestNode = requestNode | ||
this.isFirstLoad = true | ||
this.dataList = [] | ||
this.isReload = true | ||
this.currentPage = kFirstPage | ||
this.noMoreData = false | ||
} | ||
|
||
requestFirstPage(params: Object) { | ||
this.isReload = true | ||
this.startRequest(params, kFirstPage) | ||
} | ||
|
||
requestNextPage(params: Object) { | ||
this.isReload = false | ||
this.startRequest(params, this.currentPage + 1) | ||
} | ||
|
||
startRequest(params: Object, page: number) { | ||
let requestParams = { ...params } | ||
requestParams[kCurrentPageKey] = page | ||
requestParams[kPageSizeKey] = kPageSize | ||
|
||
let url = urlByAppendingParams(host + this.requestNode, requestParams); | ||
fetch(url) | ||
.then((response) => { | ||
return response.json() | ||
}) | ||
.then((json) => { | ||
if (this.isReload) { | ||
this.dataList = json.items | ||
} else { | ||
this.dataList.push(...json.items) | ||
} | ||
this.currentPage = page | ||
this.noMoreData = json.items.count < kPageSize | ||
|
||
this.onSuccess && this.onSuccess() | ||
|
||
console.log(`ListRequest - Success node:${this.requestNode}`); | ||
}).catch((error) => { | ||
if (this.onFailure) { | ||
this.onFailure() | ||
} | ||
console.log(`ListRequest - Error node:${this.requestNode} error:${error}`); | ||
}); | ||
} | ||
} | ||
|
||
export default ListRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Copyright (c) 2017-present, Liu Jinyong | ||
* All rights reserved. | ||
* | ||
* https://github.com/huanxsd/MeiTuan | ||
* @flow | ||
*/ | ||
|
||
import screen from './screen' | ||
import system from './system' | ||
import tool from './tool' | ||
|
||
export {screen, system, tool} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Copyright (c) 2017-present, Liu Jinyong | ||
* All rights reserved. | ||
* | ||
* https://github.com/huanxsd/MeiTuan | ||
* @flow | ||
*/ | ||
|
||
import { Dimensions, Platform, PixelRatio } from 'react-native' | ||
|
||
export default { | ||
width: Dimensions.get('window').width, | ||
height: Dimensions.get('window').height, | ||
onePixel: 1 / PixelRatio.get(), | ||
statusBarHeight: (Platform.OS === 'ios' ? 20 : 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Copyright (c) 2017-present, Liu Jinyong | ||
* All rights reserved. | ||
* | ||
* https://github.com/huanxsd/MeiTuan | ||
* @flow | ||
*/ | ||
|
||
// System | ||
import { Platform } from 'react-native' | ||
|
||
export default { | ||
isIOS: Platform.OS === 'ios', | ||
|
||
} |
Oops, something went wrong.