Authored by 李犇

个人中心有货分期是否展示"去开通"——review by 陈林

... ... @@ -56,6 +56,7 @@ export default class MineList extends React.Component {
announcement={this.props.announcement}
globalOrderData={this.props.globalOrderData}
iconAll={this.props.iconAll}
instalmentStatus={this.props.instalmentStatus}
/>
);
}
... ...
... ... @@ -22,40 +22,8 @@ export default class MineListHeader extends React.Component {
this._renderMineOrderNumberPoint = this._renderMineOrderNumberPoint.bind(this);
this._renderMinePropertyNumberPoint = this._renderMinePropertyNumberPoint.bind(this);
this._renderVip = this._renderVip.bind(this);
/*this.state = {
offsetHigh: 0,
};*/
}
/*componentWillReceiveProps(nextProps){
//计算高度
let oHigh=0;
if(nextProps.certificationInfo&&nextProps.certificationInfo.isBindedOrRelated==='N'){
oHigh=oHigh+subRowHeight;
}
if(nextProps.announcement&&nextProps.announcement.open==='Y'){
oHigh=oHigh+subRowHeight;
}
if((nextProps.certificationInfo.isBindedOrRelated==='N')||(nextProps.announcement&&nextProps.announcement.open==='Y')){
oHigh=oHigh+10;
}
if(nextProps.globalOrderData&&nextProps.globalOrderData.hasOrder==='Y'){
oHigh=oHigh+rowheight;
}
if(nextProps.memberBill&&nextProps.memberBill.bill.open==='Y'){
oHigh=oHigh+rowheight;
}
if(nextProps.activityListInfo&&nextProps.activityListInfo.list&&nextProps.activityListInfo.list.toArray().length>0){
console.log('=====');
oHigh=oHigh+rowheight*nextProps.activityListInfo.list.length;
}
this.setState({
offsetHigh: oHigh,
});
}*/
/**
* 我的订单中的数字展示
* */
... ... @@ -169,6 +137,7 @@ export default class MineListHeader extends React.Component {
announcement,
globalOrderData,
iconAll,
instalmentStatus,
} = this.props;
let oHigh = 0;
... ... @@ -559,7 +528,7 @@ export default class MineListHeader extends React.Component {
}
<Text style={styles.order_text}>有货分期</Text>
{
(profile.uid != '0') ? this._renderMinePropertyNumberPoint(0) : this._renderMinePropertyNumberPoint('去开通')
(profile.uid === '0' || instalmentStatus.status === '0') ? this._renderMinePropertyNumberPoint('去开通') : this._renderMinePropertyNumberPoint(0)
}
</View>
</TouchableOpacity>
... ...
... ... @@ -270,6 +270,7 @@ class MineContainer extends Component {
announcement,
globalOrderData,
iconAll,
instalmentStatus,
} = this.props.mine;
return (
<MineList
... ... @@ -287,6 +288,7 @@ class MineContainer extends Component {
announcement={announcement}
globalOrderData={globalOrderData}
iconAll={iconAll}
instalmentStatus={instalmentStatus}
onPressItem={this._onPressItem}
onPressProductListProduct={this._onPressProductListProduct}
... ...
... ... @@ -438,6 +438,16 @@ export function getMineInstalemtInfo() {
return (dispatch, getState) => {
let {app, mine} = getState();
let {isFetching, open} = mine;
console.log('----getMemberBillTask-----');
return new MineService(app.host).getMineInstalemtInfo()
.then(json => {
console.log(json);
dispatch(getMineInstalemtInfoSuccess(json));
})
.catch(error => {
console.log(error);
dispatch(getMineInstalemtInfoFailure());
});
}
}
... ...
... ... @@ -101,6 +101,12 @@ let InitialState = Record({
useable_time: '',
})),
instalmentStatus: new (Record({
currCreditLimit: "",
isShow: "1",
status: "0",
})),
certificationInfo: new (Record({
isNeedPopupRelated: "N",
isBindedOrRelated: "Y",
... ...
... ... @@ -212,11 +212,24 @@ export default function appReducer(state = initialState, action) {
}
case GET_MINEINSTALEMTINFO_SUCCESS: {
break;
let {
currCreditLimit,
isShow,
status,
} = action.payload;
let newInstalmentStatus = state.instalmentStatus
.set("currCreditLimit", currCreditLimit)
.set("isShow", isShow)
.set("status", status);
return state.set("instalmentStatus",newInstalmentStatus);
}
case GET_MINEINSTALEMTINFO_FAILURE: {
break;
let newInstalmentStatus = state.instalmentStatus
.set("currCreditLimit", "")
.set("isShow", "1")
.set("status", "0");
return state.set("instalmentStatus",newInstalmentStatus);
}
case GET_MINEACTIVITY_SUCCESS: {
... ...