Authored by 张丽霞

分期银行卡图标,开通成功优惠券领取页

'use strict';
import React from 'react';
import ReactNative, {
View,
Text,
Image,
StyleSheet,
Dimensions,
PixelRatio,
TouchableOpacity,
Alert,
} from 'react-native';
import Immutable, {Map} from 'immutable';
import {getSlicedUrl} from '../../../classify/utils/Utils';
export default class AdvertisementView extends React.Component {
constructor(props) {
super(props);
}
render() {
let{dataSource}=this.props;
dataSource = {
"alt": "",
"src": "http://img10.static.yhbimg.com/yhb-img01/2016/11/23/16/0191a7b024e397cd8989ee0ee25dce9f29.png?imageView2/{mode}/w/{width}/h/{height}",
"title": "",
"url": "http://feature.yoho.cn/0906/TIPGOODS/index.html?title=潮流尖货&share_id=1335"
};
return(
<View style={styles.container}>
<TouchableOpacity activeOpacity={1.0} onPress={() => {
this.props.jumpWithUrl && this.props.jumpWithUrl(dataSource.url);
}}>
<View style={styles.imageContainer}>
<Image
source={require('../../image/close-btn.png')}
style={styles.closeBtn}
resizeMode={'contain'}
/>
<Image
source={{uri: getSlicedUrl(dataSource.src, width, 105*DEVICE_WIDTH_RATIO, 2)}}
style={styles.image}
resizeMode={'contain'}
/>
</View>
</TouchableOpacity>
</View>
);
}
};
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
let styles = StyleSheet.create({
container: {
position:'absolute',
top: 0,
left: 0,
backgroundColor:'rgba(44, 44, 44, 0.5)',
height: height,
width: width,
},
imageContainer: {
width: 270 * DEVICE_WIDTH_RATIO,
height: 275 * DEVICE_WIDTH_RATIO,
position: 'relative',
marginTop: (height - 275 * DEVICE_WIDTH_RATIO - 64) / 2,
marginLeft: (width - 270 * DEVICE_WIDTH_RATIO) / 2,
backgroundColor:'rgba(237, 237, 237, 0.8)',
borderRadius: 5,
},
closeBtn: {
width: 28 * DEVICE_WIDTH_RATIO,
height: 28 * DEVICE_WIDTH_RATIO,
position: 'absolute',
right: 34 * DEVICE_WIDTH_RATIO,
},
image: {
width: 270 * DEVICE_WIDTH_RATIO,
height: 275 * DEVICE_WIDTH_RATIO,
position: 'absolute',
top: 0,
left: 0,
},
});
... ...
... ... @@ -90,6 +90,7 @@ let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
position: 'relative',
},
contentContainer:{
flexDirection: 'row',
... ...
... ... @@ -103,7 +103,7 @@ export default class Open extends React.Component {
<View style={styles.bankCellContainer}>
<View style={styles.bankIconContainer}>
{bankInfo.bankCode !='' ?
<SlicedImage source={{uri: bankInfo.bankLogo}} style={{width:16,height:16}}/>
<Image style={{width:18,height:18}} source={bankInfo.bankCode}/>
:null}
<Text style={{marginLeft:5*DEVICE_WIDTH_RATIO,}}>{bankInfo.bankName?bankInfo.bankName:bankInfo.bankText}</Text>
... ...
... ... @@ -2,6 +2,7 @@
import ReactNative, {Platform}from 'react-native';
import InstallmentService from '../../services/InstallmentService';
import Utils from '../../utils/Utils';
const {
... ... @@ -197,10 +198,10 @@ export function getBankInfo(cellInfo,cardNo) {
show: false,
};
let nextBtnEnable = true;
return new InstallmentService('http://api-test2.yohops.com:9999/').fentchBankInfo(cardNo,uid)
return new InstallmentService(app.host).fentchBankInfo(cardNo,uid)
.then(json => {
if (json.businessSupport == '0' && json.bankCode && json.bankCode != '') {
bankInfo.bankCode = json.bankCode;
bankInfo.bankCode = Utils.getBankSmallImage(json.bankCode);
bankInfo.bankName = json.bankName;
bankInfo.bankLogo = json.bankLogo;
bankInfo.show = true;
... ...
... ... @@ -205,10 +205,12 @@ function amtAndFeeCount(list) {
_.forEach(list, (data) => {
if (data.isChecked) {
count++;
formateData.currAmtCount += (+data.currAmt);
formateData.currFeeCount += (+data.currFee);
formateData.currAmtCount += parseFloat(data.currAmt);
formateData.currFeeCount += parseFloat(data.currFee);
}
});
formateData.currAmtCount = parseFloat(formateData.currAmtCount).toFixed(2);
formateData.currFeeCount = parseFloat(formateData.currFeeCount).toFixed(2);
if (count == cellLength) {
formateData.isAllChecked = true;
}
... ... @@ -280,6 +282,8 @@ export function onPressRepaylistCellCheckbox(cellInfo) {
tipMessage = '同一个分期订单不能跨期还款,请按时间顺序还款';
dispatch(setTipMessage(tipMessage));
}else {
repaymentList[curIndex].isChecked = !repaymentList[curIndex].isChecked;
formateData = amtAndFeeCount(repaymentList);
dispatch(updatRepaymentListAndFormateData({repaymentList,formateData}));
}
}else if (curIndexInSameBillList == sameBillNoList.length - 1) {
... ...