Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BasicApp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
施贇杰
BasicApp
Commits
7b3177fe
Commit
7b3177fe
authored
Sep 12, 2019
by
shiyunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'shiyunjie'
parents
23bcdd7e
a70a5c8c
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
413 additions
and
400 deletions
+413
-400
UserInterfaceState.xcuserstate
...data/shiyunjie.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
BaseContainer.js
src/pages/Agera-App-Insure/BaseContainer.js
+0
-270
PolicyContainer.js
src/pages/Agera-App-Insure/PolicyContainer.js
+281
-0
fillInfo.js
src/pages/Agera-App-Insure/config/fillInfo.js
+6
-1
index.js
src/pages/Agera-App-Insure/config/index.js
+13
-4
keys.js
src/pages/Agera-App-Insure/config/keys.js
+3
-0
payment.js
src/pages/Agera-App-Insure/config/payment.js
+5
-2
productDetail.js
src/pages/Agera-App-Insure/config/productDetail.js
+5
-14
index.js
src/pages/Agera-App-Insure/index.js
+2
-1
FillPolicyInfoPage.js
src/pages/insurePage/FillPolicyInfoPage.js
+32
-38
PaymentPage.js
src/pages/insurePage/PaymentPage.js
+30
-28
ProductDetailPage.js
src/pages/insurePage/ProductDetailPage.js
+36
-42
No files found.
ios/BasicApp.xcodeproj/project.xcworkspace/xcuserdata/shiyunjie.xcuserdatad/UserInterfaceState.xcuserstate
View file @
7b3177fe
No preview for this file type
src/pages/Agera-App-Insure/BaseContainer.js
deleted
100644 → 0
View file @
23bcdd7e
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
}
from
'react-native'
;
import
{
SpringScrollView
}
from
'react-native-spring-scrollview'
;
import
{
CommonLottieHeader
}
from
'react-native-spring-scrollview/Customize/CommonLottieHeader'
;
import
Picker
from
'../../components/Picker'
;
import
Styles
from
'../../theme/Styles'
;
import
{
trailPolicyAPI
}
from
'../InsuranceList/InsuranceAPI'
;
import
{
BANNER
,
PROCESS
,
PAGE_TITLE
,
BUTTON_GROUP
,
LIST_ITEM
,
CELL
,
CHECKBOX
,
PICKER
,
DATE_PICKER
,
IMAGE
,
TAB
,
MULTINPUT
,
TEXTAREA
,
PRODUCT_TITLE
,
PRODUCT_BANNER
,
PLAN_INFO
,
PREM_GROUP
,
PRODUCT_IMAGE
,
SERVICE_IMAGE
,
NOTICE_IMAGE
,
INSURE_YEAR
,
MULT
,
JIACHENG
,
AIFEIXIANG
,
XUESHENGYIWAI
,
}
from
'./config/keys'
;
import
{
getConfig
,
}
from
'./config'
;
import
{
renderPageByConfig
}
from
'.'
;
import
Button
from
'../../components/ThemeButton'
;
import
SubmitButton
from
'./components/SubmitButton'
;
type
Props
=
{
routes
:
Array
,
popTo
:
()
=>
void
,
blueId
:
string
,
pageName
:
string
,
};
const
pageName
=
'productDetail'
;
class
BaseContainer
extends
Component
{
constructor
(
props
:
Props
)
{
super
(
props
);
//console.log('props', props);
const
productDetail
=
getConfig
(
props
.
blueId
)[
props
.
pageName
];
const
{
params
}
=
props
;
const
{
keys
,
layout
}
=
productDetail
;
this
.
productDetail
=
productDetail
;
this
.
policy
=
{
mult
:
''
,
prem
:
99
,
premTotal
:
99
,
};
this
.
state
=
{
params
,
config
:
{},
keys
,
};
//console.log('ProductDetailPage', this.state);
}
componentWillMount
()
:
void
{
const
config
=
{};
const
{
params
}
=
this
.
state
;
const
{
keys
,
layout
}
=
this
.
productDetail
;
keys
.
forEach
((
key
)
=>
{
const
data
=
this
.
fillData
(
key
,
this
.
productDetail
[
key
],
params
);
//console.log('productDetail:', this.productDetail, layout[key], key);
config
[
key
]
=
{
...
layout
[
key
],
...
data
};
});
this
.
setState
({
config
,
});
}
fillData
=
(
key
,
lay
,
params
)
=>
{
const
{
name
,
description
,
tagNameList
,
bannerIconUrl
,
guaranteeContent
,
productIntroductionUrl
,
serviceProcessUrl
,
}
=
params
.
detail
;
//console.log('productIntroductionUrl', productIntroductionUrl);
switch
(
key
)
{
case
PRODUCT_BANNER
:
return
{
uri
:
bannerIconUrl
.
url
,
width
:
global
.
SCREEN_WIDTH
,
height
:
global
.
SCREEN_WIDTH
*
bannerIconUrl
.
height
/
bannerIconUrl
.
width
,
};
case
PREM_GROUP
:
return
{
onSelect
:
(
index
)
=>
{
//console.log('BUTTON_GROUP,onSelect', index);
switch
(
index
)
{
case
0
:
this
.
policy
.
prem
=
99
;
break
;
case
1
:
this
.
policy
.
prem
=
199
;
break
;
default
:
break
;
}
},
selectIndex
:
0
,
};
case
PRODUCT_TITLE
:
return
{
h1
:
name
,
// title需要装填数据 主标题
h2
:
description
,
// title需要装填数据 副标题
label
:
tagNameList
,
// 多个展示标签
labelColor
:
'#cf4100'
,
//颜色
};
case
PLAN_INFO
:
return
{
label
:
{
icon
:
''
,
//左侧icon
h1
:
'保障计划'
,
//主标题
rightIcon
:
''
,
//右侧icon
rightText
:
'查看保障详情'
,
//右侧文字
onPress
:
()
=>
{
},
//点击事件
},
data
:
JSON
.
parse
(
guaranteeContent
),
};
case
INSURE_YEAR
:
return
{};
case
MULT
:
return
{
onChangeText
:
(
value
)
=>
{
//console.log('ProductDetailPage_onChangeText', value);
this
.
policy
.
mult
=
value
;
//console.log(this.policy.mult);
},
onEndEditing
:
()
=>
{
},
value
:
this
.
state
.
mult
,
};
case
NOTICE_IMAGE
:
return
{};
case
PRODUCT_IMAGE
:
return
{
uri
:
productIntroductionUrl
.
url
,
width
:
global
.
SCREEN_WIDTH
,
height
:
global
.
SCREEN_WIDTH
*
productIntroductionUrl
.
height
/
productIntroductionUrl
.
width
,
label
:
{
icon
:
''
,
//左侧icon
h1
:
'特色产品'
,
//主标题
rightIcon
:
''
,
//右侧icon
rightText
:
''
,
//右侧文字
onPress
:
()
=>
{
},
//点击事件
},
};
case
SERVICE_IMAGE
:
return
{
uri
:
serviceProcessUrl
.
url
,
width
:
global
.
SCREEN_WIDTH
,
height
:
global
.
SCREEN_WIDTH
*
serviceProcessUrl
.
height
/
serviceProcessUrl
.
width
,
label
:
{
icon
:
''
,
//左侧icon
h1
:
'理赔流程'
,
//主标题
rightIcon
:
''
,
//右侧icon
rightText
:
''
,
//右侧文字
onPress
:
()
=>
{
},
//点击事件
},
};
default
:
return
{};
}
}
translateDataToRules
=
(
key
,
rule
,
params
)
=>
{
switch
(
key
)
{
case
BANNER
:
return
{};
case
PAGE_TITLE
:
return
{};
case
LIST_ITEM
:
return
{};
case
PICKER
:
return
{};
default
:
return
{};
}
}
renderExtraViews
=
(
viewType
)
=>
{
switch
(
viewType
)
{
case
PICKER
:
return
this
.
renderPicker
;
case
'submit'
:
return
this
.
renderSubmit
;
default
:
return
()
=>
{};
}
}
renderSubmit
=
()
=>
(
<
SubmitButton
/>
)
renderPicker
=
(
data
)
=>
{
//console.log('renderPicker:', data);
return
(
<
Picker
{...
data
}
/
>
);
}
renderInsureViews
=
(
config
,
key
,
type
)
=>
{
renderPageByConfig
(
config
[
key
][
type
],
this
.
renderExtraViews
,
)(
config
[
key
]);
// 第二个参数可以传入自己的方法根据自定义类型渲染组件
}
render
()
{
const
{
config
,
keys
}
=
this
.
state
;
//console.log('config:', config, keys);
const
type
=
'type'
;
return
(
<
SpringScrollView
ref
=
{(
com
)
=>
{
this
.
scrollView
=
com
;
}}
onScroll
=
{({
nativeEvent
:
{
contentOffset
:
{
x
,
y
}
}
})
=>
{
//console.log('offset : x=', x, 'y=', y);
}}
styles
=
{
Styles
.
container
}
inverted
=
{
false
}
//onRefresh={this._onRefresh}
//onLoading={this._onLoading}
// allLoaded={this.state.allLoaded}
refreshHeader
=
{
CommonLottieHeader
}
//loadingFooter={CommonLottieFooter}
>
<
View
>
{
keys
.
map
((
key
,
index
)
=>
(
this
.
renderInsureViews
(
config
,
key
,
type
)
))}
<
/View
>
<
/SpringScrollView
>
);
}
}
export
default
BaseContainer
;
src/pages/Agera-App-Insure/PolicyContainer.js
0 → 100644
View file @
7b3177fe
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
}
from
'react-native'
;
import
{
SpringScrollView
}
from
'react-native-spring-scrollview'
;
import
{
CommonLottieHeader
}
from
'react-native-spring-scrollview/Customize/CommonLottieHeader'
;
import
Picker
from
'../../components/Picker'
;
import
Styles
from
'../../theme/Styles'
;
import
{
trailPolicyAPI
}
from
'../InsuranceList/InsuranceAPI'
;
import
{
BANNER
,
PROCESS
,
PAGE_TITLE
,
BUTTON_GROUP
,
LIST_ITEM
,
CELL
,
CHECKBOX
,
PICKER
,
DATE_PICKER
,
IMAGE
,
TAB
,
MULTINPUT
,
TEXTAREA
,
PRODUCT_TITLE
,
PRODUCT_BANNER
,
PLAN_INFO
,
PREM_GROUP
,
PRODUCT_IMAGE
,
SERVICE_IMAGE
,
NOTICE_IMAGE
,
INSURE_YEAR
,
MULT
,
JIACHENG
,
AIFEIXIANG
,
XUESHENGYIWAI
,
}
from
'./config/keys'
;
import
{
getConfig
,
}
from
'./config'
;
import
{
renderPageByConfig
}
from
'./'
;
import
Button
from
'../../components/ThemeButton'
;
import
SubmitButton
from
'./components/SubmitButton'
;
type
Props
=
{
routes
:
Array
,
popTo
:
()
=>
void
,
blueId
:
string
,
pageName
:
string
,
params
:
Object
,
config
:
Object
,
keys
:
Object
};
class
PolicyContainer
extends
Component
{
constructor
(
props
:
Props
)
{
super
(
props
);
//console.log('props', props);
//const productDetail = getConfig(props.blueId)[props.pageName];
const
{
params
,
config
,
keys
}
=
props
;
//const { keys, layout } = productDetail;
//this.productDetail = productDetail;
//this.policy = {
// mult: '',
// prem: 99,
// premTotal: 99,
//};
this
.
state
=
{
params
,
config
,
keys
,
};
//console.log('ProductDetailPage', this.state);
}
//componentWillMount() : void {
//const config = {};
//const { params } = this.state;
//const { keys, layout } = this.productDetail;
//keys.forEach((key) => {
// const data = this.fillData(key, this.productDetail[key], params);
// //console.log('productDetail:', this.productDetail, layout[key], key);
// config[key] = { ...layout[key], ...data };
//});
//this.setState({
// config,
//});
//}
//fillData = (key, lay, params) => {
// const {
// name, description, tagNameList, bannerIconUrl, guaranteeContent,
// productIntroductionUrl, serviceProcessUrl,
// } = params.detail;
// //console.log('productIntroductionUrl', productIntroductionUrl);
// switch (key) {
// case PRODUCT_BANNER:
// return {
// uri: bannerIconUrl.url,
// width: global.SCREEN_WIDTH,
// height: global.SCREEN_WIDTH * bannerIconUrl.height / bannerIconUrl.width,
// };
// case PREM_GROUP:
// return {
// onSelect: (index) => {
// //console.log('BUTTON_GROUP,onSelect', index);
// switch (index) {
// case 0:
// this.policy.prem = 99;
// break;
// case 1:
// this.policy.prem = 199;
// break;
// default:
// break;
// }
// },
// selectIndex: 0,
// };
// case PRODUCT_TITLE:
// return {
// h1: name, // title需要装填数据 主标题
// h2: description, // title需要装填数据 副标题
// label: tagNameList, // 多个展示标签
// labelColor: '#cf4100', //颜色
// };
// case PLAN_INFO:
// return {
// label: {
// icon: '', //左侧icon
// h1: '保障计划', //主标题
// rightIcon: '', //右侧icon
// rightText: '查看保障详情', //右侧文字
// onPress: () => {
// }, //点击事件
// },
// data: JSON.parse(guaranteeContent),
// };
// case INSURE_YEAR:
// return {};
// case MULT:
// return {
// onChangeText: (value) => {
// //console.log('ProductDetailPage_onChangeText', value);
// this.policy.mult = value;
// //console.log(this.policy.mult);
// },
// onEndEditing: () => {
// },
// value: this.state.mult,
// };
// case NOTICE_IMAGE:
// return {};
// case PRODUCT_IMAGE:
// return {
// uri: productIntroductionUrl.url,
// width: global.SCREEN_WIDTH,
// height: global.SCREEN_WIDTH * productIntroductionUrl.height / productIntroductionUrl.width,
// label: {
// icon: '', //左侧icon
// h1: '特色产品', //主标题
// rightIcon: '', //右侧icon
// rightText: '', //右侧文字
// onPress: () => {
// }, //点击事件
// },
// };
// case SERVICE_IMAGE:
// return {
// uri: serviceProcessUrl.url,
// width: global.SCREEN_WIDTH,
// height: global.SCREEN_WIDTH * serviceProcessUrl.height / serviceProcessUrl.width,
// label: {
// icon: '', //左侧icon
// h1: '理赔流程', //主标题
// rightIcon: '', //右侧icon
// rightText: '', //右侧文字
// onPress: () => {
// }, //点击事件
// },
// };
// default:
// return {};
// }
//}
//translateDataToRules = (key, rule, params) => {
// switch (key) {
// case BANNER:
// return {};
// case PAGE_TITLE:
// return {};
// case LIST_ITEM:
// return {};
// case PICKER:
// return {};
// default:
// return {};
// }
//}
//renderExtraViews = (viewType) => {
// switch (viewType) {
// case PICKER:
// return this.renderPicker;
// case 'submit':
// return this.renderSubmit;
// default:
// return () => {};
// }
//}
//
//
//renderSubmit = () => (
// <SubmitButton />
//)
//
//renderPicker = (data) => {
// //console.log('renderPicker:', data);
// return (
// <Picker {...data} />
// );
//}
componentWillReceiveProps
(
nextProps
,
nextContext
:
any
)
:
void
{
console
.
log
(
'componentWillReceiveProps'
,
nextProps
)
const
{
params
,
config
,
keys
}
=
nextProps
;
this
.
setState
({
params
,
config
,
keys
})
}
renderInsureViews
=
(
config
,
key
,
type
)
=>
{
return
(
renderPageByConfig
(
config
[
key
][
type
],
this
.
props
.
renderExtraViews
,
)(
config
[
key
]));
// 第二个参数可以传入自己的方法根据自定义类型渲染组件
}
render
()
{
const
{
config
,
keys
}
=
this
.
state
;
console
.
log
(
'PolicyContainer_render:'
,
config
,
keys
,);
const
type
=
'type'
;
return
(
<
SpringScrollView
ref
=
{(
com
)
=>
{
this
.
scrollView
=
com
;
}}
onScroll
=
{({
nativeEvent
:
{
contentOffset
:
{
x
,
y
}
}
})
=>
{
//console.log('offset : x=', x, 'y=', y);
}}
styles
=
{[
Styles
.
container
]}
inverted
=
{
false
}
//onRefresh={this._onRefresh}
//onLoading={this._onLoading}
// allLoaded={this.state.allLoaded}
refreshHeader
=
{
CommonLottieHeader
}
//loadingFooter={CommonLottieFooter}
>
<
View
>
{
keys
.
map
((
key
,
index
)
=>
(
this
.
renderInsureViews
(
config
,
key
,
type
)
))}
<
/View
>
<
/SpringScrollView
>
);
}
}
export
default
PolicyContainer
;
src/pages/Agera-App-Insure/config/fillInfo.js
View file @
7b3177fe
...
...
@@ -18,6 +18,8 @@ import {
INSURED_TITLE
,
INSURED_NAME
,
INSURED_ID_TYPE
,
BUTTON
,
SUBMIT_BUTTON
,
AMOUNT_BUTTON
,
}
from
'./keys'
;
...
...
@@ -127,6 +129,9 @@ export default {
begin
:
''
,
end
:
''
,
},
[
SUBMIT_BUTTON
]:
{
type
:
BUTTON
,
}
},
rules
:
{
[
INSURE_YEAR
]:
{
...
...
@@ -135,5 +140,5 @@ export default {
},
keys
:
[
POLICY_PROGRESS
,
APPLICANT_TITLE
,
APPLICANT_NAME
,
APPLICANT_ID_TYPE
,
APPLICANT_ID
,
APPLICANT_BIRTHDAY
,
APPLICANT_GENDER
,
APPLICANT_MOBILE
,
APPLICANT_EMAIL
,
INSURED_TITLE
,
INSURED_NAME
,
INSURED_ID_TYPE
,
INSURE_YEAR_TITLE
,
INSURE_YEAR
],
INSURED_NAME
,
INSURED_ID_TYPE
,
INSURE_YEAR_TITLE
,
INSURE_YEAR
,
SUBMIT_BUTTON
],
};
src/pages/Agera-App-Insure/config/index.js
View file @
7b3177fe
...
...
@@ -60,13 +60,22 @@ export const getConfig = (blueID) => {
return
config
;
case
AIFEIXIANG
:
// 爱飞翔
delete
config
.
productDetail
[
PREM_GROUP
];
config
.
productDetail
.
keys
.
splice
(
premIndex
,
1
);
if
(
config
.
productDetail
[
PREM_GROUP
]){
delete
config
.
productDetail
[
PREM_GROUP
];
}
if
(
premIndex
!==
-
1
){
config
.
productDetail
.
keys
.
splice
(
premIndex
,
1
);
}
return
config
;
case
XUESHENGYIWAI
:
//学生意外
delete
config
.
productDetail
[
PREM_GROUP
];
config
.
productDetail
.
keys
.
splice
(
premIndex
,
1
);
if
(
config
.
productDetail
[
PREM_GROUP
]){
delete
config
.
productDetail
[
PREM_GROUP
];
}
if
(
premIndex
!==
-
1
){
config
.
productDetail
.
keys
.
splice
(
premIndex
,
1
);
}
return
config
;
default
:
return
config
;
...
...
src/pages/Agera-App-Insure/config/keys.js
View file @
7b3177fe
...
...
@@ -18,6 +18,8 @@ export const PROGRESS = 'progress';
export
const
GRAY_LABEL
=
'grayLabel'
;
export
const
DATE_RANGE
=
'dateRange'
;
export
const
NOTICE
=
'notice'
;
export
const
AMOUNT_BUTTON
=
'amountButton'
;
export
const
BUTTON
=
'button'
;
// layout key 组件作用于哪个业务,是装填数据,绑定事件的依据
...
...
@@ -48,6 +50,7 @@ export const INSURED_PRODUCT = 'insureProduct';
export
const
PAYMENT_TITLE
=
'paymentTitle'
;
export
const
PAYMENT_NOTICE
=
'paymentNotice'
;
export
const
PAYMENT_TYPE
=
'paymentType'
;
export
const
SUBMIT_BUTTON
=
'submitButton'
;
// 保险ID
export
const
JIACHENG
=
'200000156'
;
...
...
src/pages/Agera-App-Insure/config/payment.js
View file @
7b3177fe
...
...
@@ -5,7 +5,7 @@
BANNER
,
BUTTON_GROUP
,
IMAGE
,
LIST_ITEM
,
MULTINPUT
,
PAGE_TITLE
,
PICKER
,
PRODUCT_BANNER
,
PRODUCT_TITLE
,
PREM_GROUP
,
PLAN_INFO
,
INSURE_YEAR
,
MULT
,
PRODUCT_IMAGE
,
SERVICE_IMAGE
,
NOTICE
,
POLICY_PROGRESS
,
PROGRESS
,
INSURED_TITLE
,
GRAY_LABEL
,
INSURED_NAME
,
TEXT_INPUT
,
INSURED_PREM
,
INSURED_PRODUCT
,
PAYMENT_TITLE
,
PAYMENT_NOTICE
,
CHECKBOX
,
PAYMENT_TYPE
,
INSURED_PREM
,
INSURED_PRODUCT
,
PAYMENT_TITLE
,
PAYMENT_NOTICE
,
CHECKBOX
,
PAYMENT_TYPE
,
SUBMIT_BUTTON
,
BUTTON
,
}
from
'./keys'
;
export
default
{
...
...
@@ -55,7 +55,10 @@ export default {
onSelect
:
()
=>
{},
selectIndex
:
-
1
,
},
[
SUBMIT_BUTTON
]:
{
type
:
BUTTON
,
}
},
rules
:
{},
keys
:
[
POLICY_PROGRESS
,
INSURED_TITLE
,
INSURED_PRODUCT
,
INSURED_PREM
,
PAYMENT_TITLE
,
PAYMENT_TYPE
],
keys
:
[
POLICY_PROGRESS
,
INSURED_TITLE
,
INSURED_PRODUCT
,
INSURED_PREM
,
PAYMENT_TITLE
,
PAYMENT_TYPE
,
SUBMIT_BUTTON
],
};
src/pages/Agera-App-Insure/config/productDetail.js
View file @
7b3177fe
...
...
@@ -3,7 +3,7 @@
import
{
BANNER
,
BUTTON_GROUP
,
IMAGE
,
LIST_ITEM
,
MULTINPUT
,
PAGE_TITLE
,
PICKER
,
PRODUCT_BANNER
,
PRODUCT_TITLE
,
PREM_GROUP
,
PLAN_INFO
,
INSURE_YEAR
,
MULT
,
PRODUCT_IMAGE
,
SERVICE_IMAGE
,
NOTICE_IMAGE
,
SERVICE_IMAGE
,
SUBMIT_BUTTON
,
AMOUNT_BUTTON
}
from
'./keys'
;
export
default
{
...
...
@@ -96,18 +96,9 @@ export default {
},
//点击事件
},
},
[
NOTICE_IMAGE
]:
{
type
:
IMAGE
,
uri
:
''
,
label
:
{
icon
:
''
,
//左侧icon
h1
:
''
,
//主标题
rightIcon
:
''
,
//右侧icon
rightText
:
''
,
//右侧文字
onPress
:
()
=>
{
},
//点击事件
},
},
[
SUBMIT_BUTTON
]:
{
type
:
AMOUNT_BUTTON
,
}
},
rules
:
{
[
INSURE_YEAR
]:
{
// 串联 key 为 INSURE_YEAR的组件
...
...
@@ -115,5 +106,5 @@ export default {
},
},
keys
:
[
PRODUCT_BANNER
,
PRODUCT_TITLE
,
PREM_GROUP
,
PLAN_INFO
,
INSURE_YEAR
,
MULT
,
PRODUCT_IMAGE
,
SERVICE_IMAGE
,
NOTICE_IMAGE
],
SERVICE_IMAGE
,
SUBMIT_BUTTON
],
};
src/pages/Agera-App-Insure/index.js
View file @
7b3177fe
...
...
@@ -309,8 +309,9 @@ export function renderPageByConfig(type, renderCustomView?) {
// 有自定义方法执行传入的渲染方法
if
(
renderCustomView
)
{
return
renderCustomView
(
type
);
}
else
{
return
{};
}
return
()
=>
{};
}
}
...
...
src/pages/insurePage/FillPolicyInfoPage.js
View file @
7b3177fe
...
...
@@ -36,7 +36,7 @@ import {
INSURED_ID_TYPE
,
INSURE_YEAR_TITLE
,
PICKER
,
DATE_RANGE
,
DATE_RANGE
,
BUTTON
,
}
from
'../Agera-App-Insure/config/keys'
;
import
{
getConfig
,
...
...
@@ -44,7 +44,7 @@ import {
import
{
renderPageByConfig
}
from
'../Agera-App-Insure'
;
import
Button
from
'../../components/ThemeButton'
;
import
SubmitButton
from
'../Agera-App-Insure/components/SubmitButton'
;
import
BaseContainer
from
'../Agera-App-Insure/Base
Container'
;
import
PolicyContainer
from
'../Agera-App-Insure/Policy
Container'
;
import
localData
from
'../../utils/api/localData'
;
import
ListItem
from
'../Agera-App-Insure/components/ListItem'
;
...
...
@@ -185,10 +185,31 @@ class FillPolicyInfoPage extends Component {
);
}
render
()
{
const
{
config
,
keys
}
=
this
.
state
;
renderSubmit
=
()
=>
{
const
{
pushTo
}
=
this
.
props
;
console
.
log
(
'config:'
,
config
,
keys
);
return
(
<
Button
title
=
"下一步"
containerStyle
=
{{
margin
:
15
}}
onPress
=
{()
=>
pushTo
(
'PaymentPage'
,
{
policy
:
this
.
policy
})}
/
>
)
}
renderExtraViews
=
(
viewType
)
=>
{
console
.
log
(
'renderExtraViews'
,
viewType
)
switch
(
viewType
)
{
case
PICKER
:
return
this
.
renderPicker
;
case
BUTTON
:
return
this
.
renderSubmit
;
default
:
return
()
=>
{};
}
}
render
()
{
const
{
config
,
keys
,
params
}
=
this
.
state
;
const
type
=
'type'
;
return
(
<
View
style
=
{
Styles
.
container
}
>
...
...
@@ -196,40 +217,13 @@ class FillPolicyInfoPage extends Component {
left
=
{
<
BackButton
/>
}
title
=
"太平保险"
/>
<
SpringScrollView
ref
=
{(
com
)
=>
{
this
.
scrollView
=
com
;
}}
onScroll
=
{({
nativeEvent
:
{
contentOffset
:
{
x
,
y
}
}
})
=>
{
//console.log('offset : x=', x, 'y=', y);
}}
styles
=
{
Styles
.
container
}
inverted
=
{
false
}
//onRefresh={this._onRefresh}
//onLoading={this._onLoading}
// allLoaded={this.state.allLoaded}
refreshHeader
=
{
CommonLottieHeader
}
>
<
View
>
{
keys
.
map
((
key
,
index
)
=>
(
renderPageByConfig
(
config
[
key
][
type
],
(
viewType
)
=>
{
switch
(
viewType
)
{
case
DATE_RANGE
:
return
this
.
renderPicker
;
default
:
return
()
=>
{};
}
})(
config
[
key
])
// 第二个参数可以传入自己的switch 方法根据自定义类型渲染组件
))}
<
/View
>
<
Button
title
=
"下一步"
containerStyle
=
{{
margin
:
15
}}
onPress
=
{()
=>
pushTo
(
'PaymentPage'
,
{
policy
:
this
.
policy
})}
/
>
<
/SpringScrollView
>
<
PolicyContainer
params
=
{
params
}
config
=
{
config
}
keys
=
{
keys
}
renderExtraViews
=
{
this
.
renderExtraViews
}
/
>
<
/View
>
);
}
}
...
...
src/pages/insurePage/PaymentPage.js
View file @
7b3177fe
...
...
@@ -40,7 +40,7 @@ import {
INSURED_PREM
,
INSURED_PRODUCT
,
POLICY_PROGRESS
,
PAYMENT_TYPE
,
PAYMENT_TYPE
,
BUTTON
,
}
from
'../Agera-App-Insure/config/keys'
;
import
{
getConfig
,
...
...
@@ -48,7 +48,7 @@ import {
import
{
renderPageByConfig
}
from
'../Agera-App-Insure'
;
import
Button
from
'../../components/ThemeButton'
;
import
SubmitButton
from
'../Agera-App-Insure/components/SubmitButton'
;
import
BaseContainer
from
'../Agera-App-Insure/Base
Container'
;
import
PolicyContainer
from
'../Agera-App-Insure/Policy
Container'
;
import
localData
from
'../../utils/api/localData'
;
import
ListItem
from
'../Agera-App-Insure/components/ListItem'
;
import
{
ENV
,
resourceURLMapping
}
from
"../../utils/constants"
;
...
...
@@ -135,11 +135,32 @@ class PaymentPage extends Component {
}
}
renderSubmit
=
()
=>
{
const
{
pushTo
}
=
this
.
props
;
return
(
<
Button
title
=
"确认支付"
containerStyle
=
{{
margin
:
15
}}
onPress
=
{()
=>
{
pushTo
(
'PolicyResultPage'
)}}
/
>
)
}
renderExtraViews
=
(
viewType
)
=>
{
console
.
log
(
'renderExtraViews'
,
viewType
)
switch
(
viewType
)
{
case
BUTTON
:
return
this
.
renderSubmit
;
default
:
return
()
=>
{};
}
}
translateDataToRules
=
(
key
,
rul
,
params
)
=>
({})
render
()
{
const
{
config
,
keys
}
=
this
.
state
;
const
{
config
,
keys
,
params
}
=
this
.
state
;
const
{
pushTo
}
=
this
.
props
;
console
.
log
(
'config:'
,
config
,
keys
);
const
type
=
'type'
;
...
...
@@ -149,31 +170,12 @@ class PaymentPage extends Component {
left
=
{
<
BackButton
/>
}
title
=
"太平保险"
/>
<
SpringScrollView
ref
=
{(
com
)
=>
{
this
.
scrollView
=
com
;
}}
onScroll
=
{({
nativeEvent
:
{
contentOffset
:
{
x
,
y
}
}
})
=>
{
//console.log('offset : x=', x, 'y=', y);
}}
styles
=
{
Styles
.
container
}
inverted
=
{
false
}
//onRefresh={this._onRefresh}
//onLoading={this._onLoading}
// allLoaded={this.state.allLoaded}
refreshHeader
=
{
CommonLottieHeader
}
>
<
View
>
{
keys
.
map
((
key
,
index
)
=>
(
renderPageByConfig
(
config
[
key
][
type
])(
config
[
key
])
// 第二个参数可以传入自己的switch 方法根据自定义类型渲染组件
))}
<
/View
>
<
Button
title
=
"确认支付"
containerStyle
=
{{
margin
:
15
}}
onPress
=
{()
=>
{
pushTo
(
'PolicyResultPage'
)}}
/
>
<
/SpringScrollView
>
<
PolicyContainer
params
=
{
params
}
config
=
{
config
}
keys
=
{
keys
}
renderExtraViews
=
{
this
.
renderExtraViews
}
/
>
<
/View
>
);
...
...
src/pages/insurePage/ProductDetailPage.js
View file @
7b3177fe
...
...
@@ -12,8 +12,6 @@ import {
}
from
'react-native'
;
import
{
compose
}
from
'redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
SpringScrollView
}
from
'react-native-spring-scrollview'
;
import
{
CommonLottieHeader
}
from
'react-native-spring-scrollview/Customize/CommonLottieHeader'
;
import
{
pop
,
push
}
from
'../../BasicNavigator/actions'
;
import
NavigationBar
,
{
NavHeight
}
from
'../../components/NavigationBar'
;
import
BackButton
from
'../../components/BackButton'
;
...
...
@@ -21,7 +19,6 @@ import Picker from '../../components/Picker';
import
Styles
from
'../../theme/Styles'
;
import
decorator
from
'../../utils/decorator'
;
import
{
trailPolicyAPI
}
from
'../InsuranceList/InsuranceAPI'
;
import
Text
from
'../../components/Text'
;
import
{
BANNER
,
PROCESS
,
...
...
@@ -45,6 +42,7 @@ import {
NOTICE_IMAGE
,
INSURE_YEAR
,
MULT
,
AMOUNT_BUTTON
,
JIACHENG
,
AIFEIXIANG
,
XUESHENGYIWAI
,
...
...
@@ -52,8 +50,8 @@ import {
import
{
getConfig
,
}
from
'../Agera-App-Insure/config'
;
import
{
renderPageByConfig
}
from
'../Agera-App-Insure'
;
import
SubmitButton
from
'../Agera-App-Insure/components/SubmitButton'
;
import
PolicyContainer
from
'../Agera-App-Insure/PolicyContainer'
;
type
Props
=
{
routes
:
Array
,
...
...
@@ -197,7 +195,7 @@ class ProductDetailPage extends Component {
},
};
default
:
return
{}
;
return
null
;
}
}
...
...
@@ -231,8 +229,34 @@ class ProductDetailPage extends Component {
);
}
renderSubmit
=
()
=>
{
const
{
pushTo
}
=
this
.
props
;
console
.
log
(
'renderSubmit'
,
pushTo
)
return
(
<
SubmitButton
ref
=
{(
com
)
=>
{
this
.
submit
=
com
;
}}
value
=
{
this
.
policy
.
premTotal
}
onPress
=
{()
=>
pushTo
(
'FillPolicyInfoPage'
,
{
policy
:
this
.
policy
})}
/
>
);
}
renderExtraViews
=
(
viewType
)
=>
{
console
.
log
(
'renderExtraViews'
,
viewType
)
switch
(
viewType
)
{
case
PICKER
:
return
this
.
renderPicker
;
case
AMOUNT_BUTTON
:
return
this
.
renderSubmit
;
default
:
return
()
=>
{};
}
}
render
()
{
const
{
config
,
keys
}
=
this
.
state
;
const
{
config
,
keys
,
params
}
=
this
.
state
;
const
{
pushTo
}
=
this
.
props
;
console
.
log
(
'config:'
,
config
,
keys
);
const
type
=
'type'
;
...
...
@@ -242,43 +266,13 @@ class ProductDetailPage extends Component {
left
=
{
<
BackButton
/>
}
title
=
"太平保险"
/>
<
SpringScrollView
ref
=
{(
com
)
=>
{
this
.
scrollView
=
com
;
}}
onScroll
=
{({
nativeEvent
:
{
contentOffset
:
{
x
,
y
}
}
})
=>
{
//console.log('offset : x=', x, 'y=', y);
}}
styles
=
{
Styles
.
container
}
inverted
=
{
false
}
//onRefresh={this._onRefresh}
//onLoading={this._onLoading}
// allLoaded={this.state.allLoaded}
refreshHeader
=
{
CommonLottieHeader
}
//loadingFooter={CommonLottieFooter}
>
<
View
>
{
keys
.
map
((
key
,
index
)
=>
(
renderPageByConfig
(
config
[
key
][
type
],
(
viewType
)
=>
{
switch
(
viewType
)
{
case
PICKER
:
return
this
.
renderPicker
;
default
:
return
()
=>
{};
}
})(
config
[
key
])
// 第二个参数可以传入自己的switch 方法根据自定义类型渲染组件
))}
<
/View
>
<
SubmitButton
ref
=
{(
com
)
=>
{
this
.
submit
=
com
;
}}
value
=
{
this
.
policy
.
premTotal
}
onPress
=
{()
=>
pushTo
(
'FillPolicyInfoPage'
,
{
policy
:
this
.
policy
})}
/
>
<
/SpringScrollView
>
<
PolicyContainer
params
=
{
params
}
config
=
{
config
}
keys
=
{
keys
}
renderExtraViews
=
{
this
.
renderExtraViews
}
/
>
<
/View
>
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment