add 优惠劵优化 review by chenlin
Showing
5 changed files
with
13 additions
and
12 deletions
@@ -75,11 +75,11 @@ export default class CouponCell extends React.Component { | @@ -75,11 +75,11 @@ export default class CouponCell extends React.Component { | ||
75 | frontView = {width: cellOneFront,height: 60,flexDirection: 'row'}; | 75 | frontView = {width: cellOneFront,height: 60,flexDirection: 'row'}; |
76 | units = {marginLeft: 20,marginTop: 20,width: 15,height: 20}; | 76 | units = {marginLeft: 20,marginTop: 20,width: 15,height: 20}; |
77 | unitsSize = {fontSize:20}; | 77 | unitsSize = {fontSize:20}; |
78 | - money = (Platform.OS === 'ios') ? {marginLeft: 1,marginTop: 15,width: 60,height: 25} : {marginLeft: 1,marginTop: 15,width: 60,height: 30}; | 78 | + money = (Platform.OS === 'ios') ? {marginLeft: 1,maxWidth: 60,marginTop: 15,height: 25} : {marginLeft: 1,marginTop: 15,width: 60,height: 30}; |
79 | moneySize = {fontSize:25}; | 79 | moneySize = {fontSize:25}; |
80 | - name = {marginLeft: 1,marginTop: 0,width: 160,height: 60,alignItems: 'center',justifyContent:'center',flexDirection:'row'}; | 80 | + name = {marginLeft: 10,marginTop: 0,width: 160,height: 60,alignItems: 'center',justifyContent:'center',flexDirection:'row'}; |
81 | nameSize = {fontSize:15}; | 81 | nameSize = {fontSize:15}; |
82 | - statesTitleStyle = {alignItems:'center',width: cellOneBack,height: 60}; | 82 | + statesTitleStyle = {alignItems:'center',marginTop: 5,width: cellOneBack,height: 60}; |
83 | states = {marginTop: rowData.status==1?6:10,fontSize:9,width: 10,height: 60}; | 83 | states = {marginTop: rowData.status==1?6:10,fontSize:9,width: 10,height: 60}; |
84 | }else { | 84 | }else { |
85 | backgroundImage = require('../../../../image/coupons_s_r.png'); | 85 | backgroundImage = require('../../../../image/coupons_s_r.png'); |
@@ -107,10 +107,11 @@ class BrandStoreContainer extends Component { | @@ -107,10 +107,11 @@ class BrandStoreContainer extends Component { | ||
107 | } | 107 | } |
108 | 108 | ||
109 | _onPressCoupon(rowData, resourceId, rowID) { | 109 | _onPressCoupon(rowData, resourceId, rowID) { |
110 | - if (rowData.status) { | ||
111 | - this.props.actions.getCoupon(rowData.id); | ||
112 | - }else { | 110 | + |
111 | + if (rowData.status == 3) { | ||
113 | this.props.actions.couponHasRecived(); | 112 | this.props.actions.couponHasRecived(); |
113 | + }else { | ||
114 | + this.props.actions.getCoupon(rowData.id); | ||
114 | } | 115 | } |
115 | 116 | ||
116 | let param = { | 117 | let param = { |
@@ -237,7 +237,7 @@ export function getShopInfo() { | @@ -237,7 +237,7 @@ export function getShopInfo() { | ||
237 | } | 237 | } |
238 | dispatch(shopDataExposure('YB_SHOW_CLASSICAL_SHOP_INFO', params)); | 238 | dispatch(shopDataExposure('YB_SHOW_CLASSICAL_SHOP_INFO', params)); |
239 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_L', {SHOP_ID: brandStore.shopId, TEMPLATE_TYPE:json.shop_template_type, IS_RED: 0}); | 239 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_L', {SHOP_ID: brandStore.shopId, TEMPLATE_TYPE:json.shop_template_type, IS_RED: 0}); |
240 | - | 240 | + |
241 | ReactNative.NativeModules.YH_CommonHelper.setShopIntro(json); | 241 | ReactNative.NativeModules.YH_CommonHelper.setShopIntro(json); |
242 | 242 | ||
243 | }) | 243 | }) |
@@ -1281,7 +1281,7 @@ export function getCoupon(couponId) { | @@ -1281,7 +1281,7 @@ export function getCoupon(couponId) { | ||
1281 | for (var i = 0; i < list.length; i++) { | 1281 | for (var i = 0; i < list.length; i++) { |
1282 | let item = list[i]; | 1282 | let item = list[i]; |
1283 | if (item.id == couponId) { | 1283 | if (item.id == couponId) { |
1284 | - item.status = false; //领取成功 | 1284 | + item.status = 3; //领取成功 |
1285 | break; | 1285 | break; |
1286 | } | 1286 | } |
1287 | } | 1287 | } |
@@ -279,10 +279,10 @@ class RedPersonBrandContainer extends Component { | @@ -279,10 +279,10 @@ class RedPersonBrandContainer extends Component { | ||
279 | } | 279 | } |
280 | 280 | ||
281 | _onPressCoupon(rowData) { | 281 | _onPressCoupon(rowData) { |
282 | - if (rowData.status) { | ||
283 | - this.props.actions.getCoupon(rowData.id); | ||
284 | - }else { | 282 | + if (rowData.status == 3) { |
285 | this.props.actions.couponHasRecived(); | 283 | this.props.actions.couponHasRecived(); |
284 | + }else { | ||
285 | + this.props.actions.getCoupon(rowData.id); | ||
286 | } | 286 | } |
287 | } | 287 | } |
288 | 288 |
@@ -1047,7 +1047,7 @@ export function getCoupon(couponId) { | @@ -1047,7 +1047,7 @@ export function getCoupon(couponId) { | ||
1047 | for (var i = 0; i < list.length; i++) { | 1047 | for (var i = 0; i < list.length; i++) { |
1048 | let item = list[i]; | 1048 | let item = list[i]; |
1049 | if (item.id == couponId) { | 1049 | if (item.id == couponId) { |
1050 | - item.status = false; //领取成功 | 1050 | + item.status = 3; //领取成功 |
1051 | break; | 1051 | break; |
1052 | } | 1052 | } |
1053 | } | 1053 | } |
-
Please register or login to post a comment