Authored by 陈林

Merge branch 'V6.8.7' into 'master'

V6.8.7



See merge request !28
@@ -10,7 +10,7 @@ import TabStatistics from '../components/TabStatistics'; @@ -10,7 +10,7 @@ import TabStatistics from '../components/TabStatistics';
10 import Statistics from "./Statistics"; 10 import Statistics from "./Statistics";
11 import ReactNative from "react-native"; 11 import ReactNative from "react-native";
12 import { TipsAlertItem, TipsAlert } from '../../common/components/YH_TipsAlert'; 12 import { TipsAlertItem, TipsAlert } from '../../common/components/YH_TipsAlert';
13 - 13 +import Prompt from '../../common/components/Prompt';
14 14
15 const tabTitles = ['昨日', '本月', '上月']; 15 const tabTitles = ['昨日', '本月', '上月'];
16 16
@@ -43,18 +43,19 @@ export default class Data extends Component { @@ -43,18 +43,19 @@ export default class Data extends Component {
43 isShowHelp, 43 isShowHelp,
44 isShowSure, 44 isShowSure,
45 isShowWithdrawal, 45 isShowWithdrawal,
46 - statisticsInfo 46 + statisticsInfo,
  47 + tipMessage
47 } = this.props; 48 } = this.props;
48 let bindStatus = this.props.settlementInfo.settlementInfoData.hasBankCard; 49 let bindStatus = this.props.settlementInfo.settlementInfoData.hasBankCard;
49 let scrollEnabled = height < 667; 50 let scrollEnabled = height < 667;
50 - 51 +
51 // 处理了空值判断 52 // 处理了空值判断
52 let settlementAmount = this.props.settlementInfo.settlementInfoData.settlementAmount; 53 let settlementAmount = this.props.settlementInfo.settlementInfoData.settlementAmount;
53 settlementAmount = settlementAmount ? settlementAmount : '0'; 54 settlementAmount = settlementAmount ? settlementAmount : '0';
54 55
55 return ( 56 return (
56 <ScrollView style={styles.container} scrollEnabled = {scrollEnabled}> 57 <ScrollView style={styles.container} scrollEnabled = {scrollEnabled}>
57 - <TipsAlert 58 + <TipsAlert
58 tips={this.props.tips} 59 tips={this.props.tips}
59 isShow={isShowTipsAlert} 60 isShow={isShowTipsAlert}
60 > 61 >
@@ -138,6 +139,15 @@ export default class Data extends Component { @@ -138,6 +139,15 @@ export default class Data extends Component {
138 </ScrollableTabView> 139 </ScrollableTabView>
139 140
140 <View style={{height: 10, backgroundColor: '#f0f0f0'}}/> 141 <View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
  142 +
  143 + {tipMessage != '' ?
  144 + <Prompt
  145 + text={tipMessage}
  146 + duration={800}
  147 + onPromptHidden={this.props.onHiddenTipMessage}
  148 + />
  149 + : null
  150 + }
141 </ScrollView> 151 </ScrollView>
142 ); 152 );
143 } 153 }
@@ -157,4 +157,7 @@ export default keyMirror({ @@ -157,4 +157,7 @@ export default keyMirror({
157 SHARETOTAL_REQUEST: null, 157 SHARETOTAL_REQUEST: null,
158 SHARETOTAL_SUCCESS: null, 158 SHARETOTAL_SUCCESS: null,
159 SHARETOTAL_FAILURE: null, 159 SHARETOTAL_FAILURE: null,
  160 +
  161 + SHOW_TIP_MESSAGE: null,
  162 + HIDDEN_TIP_MESSAGE: null,
160 }); 163 });
@@ -54,6 +54,7 @@ class DataContainer extends Component { @@ -54,6 +54,7 @@ class DataContainer extends Component {
54 this._jumpWithUrl = this._jumpWithUrl.bind(this); 54 this._jumpWithUrl = this._jumpWithUrl.bind(this);
55 this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this); 55 this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this);
56 this._refreshSettlementInfo = this._refreshSettlementInfo.bind(this); 56 this._refreshSettlementInfo = this._refreshSettlementInfo.bind(this);
  57 + this._onHiddenTipMessage = this._onHiddenTipMessage.bind(this);
57 58
58 } 59 }
59 60
@@ -106,6 +107,10 @@ class DataContainer extends Component { @@ -106,6 +107,10 @@ class DataContainer extends Component {
106 this.props.actions.getSettlementInfo(); 107 this.props.actions.getSettlementInfo();
107 } 108 }
108 109
  110 + _onHiddenTipMessage() {
  111 + this.props.actions.hiddenTipMessage();
  112 + }
  113 +
109 _changeTab(type){ 114 _changeTab(type){
110 this.props.actions.getStatisticsInfo(type); 115 this.props.actions.getStatisticsInfo(type);
111 } 116 }
@@ -137,6 +142,7 @@ class DataContainer extends Component { @@ -137,6 +142,7 @@ class DataContainer extends Component {
137 addSettlement, 142 addSettlement,
138 statisticsInfo, 143 statisticsInfo,
139 shareTotalInfo, 144 shareTotalInfo,
  145 + tipMessage,
140 } = this.props.alliance; 146 } = this.props.alliance;
141 let tip = this.state.tips; 147 let tip = this.state.tips;
142 let isFetching = settlementInfo.isFetching; 148 let isFetching = settlementInfo.isFetching;
@@ -164,6 +170,8 @@ class DataContainer extends Component { @@ -164,6 +170,8 @@ class DataContainer extends Component {
164 jumpWithUrl={this._jumpWithUrl} 170 jumpWithUrl={this._jumpWithUrl}
165 refreshSettlementInfo={this._refreshSettlementInfo} 171 refreshSettlementInfo={this._refreshSettlementInfo}
166 resourceJumpWithUrl={this._resourceJumpWithUrl} 172 resourceJumpWithUrl={this._resourceJumpWithUrl}
  173 + tipMessage={tipMessage}
  174 + onHiddenTipMessage={this._onHiddenTipMessage}
167 /> 175 />
168 <LoadingIndicator isVisible={isFetching}/> 176 <LoadingIndicator isVisible={isFetching}/>
169 </View> 177 </View>
@@ -22,6 +22,9 @@ const { @@ -22,6 +22,9 @@ const {
22 SHOW_BANK_INFO_DIALOG, 22 SHOW_BANK_INFO_DIALOG,
23 DISMISS_BANK_INFO_DIALOG, 23 DISMISS_BANK_INFO_DIALOG,
24 24
  25 + SHOW_TIP_MESSAGE,
  26 + HIDDEN_TIP_MESSAGE,
  27 +
25 SET_ORDER_CODE, 28 SET_ORDER_CODE,
26 SET_ACTIVITY_ID, 29 SET_ACTIVITY_ID,
27 SET_SRC, 30 SET_SRC,
@@ -169,6 +172,19 @@ export function hiddenBankInfoDialog() { @@ -169,6 +172,19 @@ export function hiddenBankInfoDialog() {
169 } 172 }
170 } 173 }
171 174
  175 +export function showTipMessage(message) {
  176 + return {
  177 + type: SHOW_TIP_MESSAGE,
  178 + payload: message
  179 + }
  180 +}
  181 +
  182 +export function hiddenTipMessage() {
  183 + return {
  184 + type:HIDDEN_TIP_MESSAGE,
  185 + }
  186 +}
  187 +
172 export function setOrderCode(orderCode) { 188 export function setOrderCode(orderCode) {
173 return { 189 return {
174 type: SET_ORDER_CODE, 190 type: SET_ORDER_CODE,
@@ -636,6 +652,7 @@ export function getAddSettlement() { @@ -636,6 +652,7 @@ export function getAddSettlement() {
636 }) 652 })
637 .catch(error => { 653 .catch(error => {
638 dispatch(addSettlementFailure(error)); 654 dispatch(addSettlementFailure(error));
  655 + dispatch(showTipMessage(error.message));
639 }); 656 });
640 }; 657 };
641 658
@@ -12,6 +12,7 @@ let InitialState = Record({ @@ -12,6 +12,7 @@ let InitialState = Record({
12 showTipsAlert: false, 12 showTipsAlert: false,
13 showWithdrawalDialog: false, 13 showWithdrawalDialog: false,
14 showBankInfoDialog: false, 14 showBankInfoDialog: false,
  15 + tipMessage: '',
15 16
16 settlementInfo: new (Record({ 17 settlementInfo: new (Record({
17 isFetching: false, 18 isFetching: false,
@@ -19,6 +19,9 @@ const { @@ -19,6 +19,9 @@ const {
19 SHOW_BANK_INFO_DIALOG, 19 SHOW_BANK_INFO_DIALOG,
20 DISMISS_BANK_INFO_DIALOG, 20 DISMISS_BANK_INFO_DIALOG,
21 21
  22 + SHOW_TIP_MESSAGE,
  23 + HIDDEN_TIP_MESSAGE,
  24 +
22 SET_ORDER_CODE, 25 SET_ORDER_CODE,
23 SET_ACTIVITY_ID, 26 SET_ACTIVITY_ID,
24 SET_SRC, 27 SET_SRC,
@@ -360,7 +363,7 @@ export default function couponReducer(state = initialState, action) { @@ -360,7 +363,7 @@ export default function couponReducer(state = initialState, action) {
360 return state.setIn(['invitedFriendsList', 'isFetching'], true) 363 return state.setIn(['invitedFriendsList', 'isFetching'], true)
361 .setIn(['invitedFriendsList', 'error'], null); 364 .setIn(['invitedFriendsList', 'error'], null);
362 } 365 }
363 - 366 +
364 case INVITED_FRIENDS_SUCCESS: { 367 case INVITED_FRIENDS_SUCCESS: {
365 let { 368 let {
366 page, 369 page,
@@ -375,7 +378,7 @@ export default function couponReducer(state = initialState, action) { @@ -375,7 +378,7 @@ export default function couponReducer(state = initialState, action) {
375 .setIn(['invitedFriendsList', 'list'], Immutable.fromJS(list)) 378 .setIn(['invitedFriendsList', 'list'], Immutable.fromJS(list))
376 .setIn(['invitedFriendsList', 'error'], null); 379 .setIn(['invitedFriendsList', 'error'], null);
377 } 380 }
378 - 381 +
379 case INVITED_FRIENDS_FAILURE: { 382 case INVITED_FRIENDS_FAILURE: {
380 return state.setIn(['invitedFriendsList', 'isFetching'], false) 383 return state.setIn(['invitedFriendsList', 'isFetching'], false)
381 .setIn(['invitedFriendsList', 'error'], action.payload); 384 .setIn(['invitedFriendsList', 'error'], action.payload);
@@ -601,7 +604,14 @@ export default function couponReducer(state = initialState, action) { @@ -601,7 +604,14 @@ export default function couponReducer(state = initialState, action) {
601 .setIn(['shareTotalInfo', 'error'], action.payload); 604 .setIn(['shareTotalInfo', 'error'], action.payload);
602 } 605 }
603 606
604 - } 607 + case SHOW_TIP_MESSAGE: {
  608 + return state.set('tipMessage', Immutable.fromJS(action.payload));
  609 + }
  610 +
  611 + case HIDDEN_TIP_MESSAGE: {
  612 + return state.set('tipMessage', '');
  613 + }
605 614
  615 + }
606 return state; 616 return state;
607 } 617 }
@@ -16,6 +16,7 @@ import {Immutable, Map} from 'immutable'; @@ -16,6 +16,7 @@ import {Immutable, Map} from 'immutable';
16 import ReceiveGiftAlert from './ReceiveGiftAlert'; 16 import ReceiveGiftAlert from './ReceiveGiftAlert';
17 import ProductListCell from '../../common/components/ListCell/ProductListCell'; 17 import ProductListCell from '../../common/components/ListCell/ProductListCell';
18 import CouponsBagListCell from "./CouponsBagListCell"; 18 import CouponsBagListCell from "./CouponsBagListCell";
  19 +import Prompt from '../../common/components/Prompt';
19 20
20 export default class AssociatorGift extends Component { 21 export default class AssociatorGift extends Component {
21 constructor(props) { 22 constructor(props) {
@@ -101,7 +102,8 @@ export default class AssociatorGift extends Component { @@ -101,7 +102,8 @@ export default class AssociatorGift extends Component {
101 showGiftAlert, 102 showGiftAlert,
102 couponsBag, 103 couponsBag,
103 productList, 104 productList,
104 - drawCouponsBag 105 + drawCouponsBag,
  106 + bagTipMessage
105 } = this.props; 107 } = this.props;
106 108
107 let dataSource = { 109 let dataSource = {
@@ -131,6 +133,15 @@ export default class AssociatorGift extends Component { @@ -131,6 +133,15 @@ export default class AssociatorGift extends Component {
131 renderRow={this._renderRow} 133 renderRow={this._renderRow}
132 renderHeader={this._renderHeader} 134 renderHeader={this._renderHeader}
133 /> 135 />
  136 +
  137 + {bagTipMessage != '' ?
  138 + <Prompt
  139 + text={bagTipMessage}
  140 + duration={800}
  141 + onPromptHidden={this.props.onHiddenBagTipMessage}
  142 + />
  143 + : null
  144 + }
134 </View> 145 </View>
135 ); 146 );
136 } 147 }
@@ -25,9 +25,9 @@ export default class CouponsBagListCell extends React.Component { @@ -25,9 +25,9 @@ export default class CouponsBagListCell extends React.Component {
25 let nameStyle = data.get('notExpired') ? {color: '#222222'} : {color: '#B0B0B0'}; 25 let nameStyle = data.get('notExpired') ? {color: '#222222'} : {color: '#B0B0B0'};
26 let bgStyle = data.get('status') === 0 && data.get('notExpired') ? {backgroundColor: '#A69073'} : {backgroundColor: '#B0B0B0'}; 26 let bgStyle = data.get('status') === 0 && data.get('notExpired') ? {backgroundColor: '#A69073'} : {backgroundColor: '#B0B0B0'};
27 let textStyle = data.get('status') === 0 && data.get('notExpired') ? {fontFamily: 'PingFang-SC-Bold'} : {fontFamily: 'PingFang-SC-Medium'}; 27 let textStyle = data.get('status') === 0 && data.get('notExpired') ? {fontFamily: 'PingFang-SC-Bold'} : {fontFamily: 'PingFang-SC-Medium'};
28 - //"status": 是否已领取 未领取:0,已领取:1; 28 + //"status": 是否已领取 未领取:0,已领取:1,已作废:2
29 //"notExpired": 未过期:true,过期:false; 29 //"notExpired": 未过期:true,过期:false;
30 - let text = data.get('status') === 1 ? '已领取' : data.get('notExpired') ? '领取' : '已失效'; 30 + let text = data.get('status') === 2 ? '已作废' : data.get('status') === 1 ? '已领取' : data.get('notExpired') ? '领取' : '已失效';
31 return ( 31 return (
32 <View style={styles.container}> 32 <View style={styles.container}>
33 <View style={styles.contentContainer}> 33 <View style={styles.contentContainer}>
@@ -6,7 +6,7 @@ export default keyMirror({ @@ -6,7 +6,7 @@ export default keyMirror({
6 SET_HOST: null, 6 SET_HOST: null,
7 SET_CHANNEL: null, 7 SET_CHANNEL: null,
8 SHOWGIFTALERT: null, 8 SHOWGIFTALERT: null,
9 - DISMISSGIFTALERT: null, 9 + DISMISSGIFTALERT: null,
10 10
11 COUPONS_BAG_REQUEST: null, 11 COUPONS_BAG_REQUEST: null,
12 COUPONS_BAG_SUCCESS: null, 12 COUPONS_BAG_SUCCESS: null,
@@ -24,4 +24,7 @@ export default keyMirror({ @@ -24,4 +24,7 @@ export default keyMirror({
24 COUPONS_BAG_CNT_SUCCESS: null, 24 COUPONS_BAG_CNT_SUCCESS: null,
25 COUPONS_BAG_CNT_FAILURE: null, 25 COUPONS_BAG_CNT_FAILURE: null,
26 26
  27 + SHOW_BAG_TIP_MESSAGE: null,
  28 + HIDDEN_BAG_TIP_MESSAGE: null,
  29 +
27 }); 30 });
@@ -48,6 +48,7 @@ class AssociatorGiftContainer extends Component { @@ -48,6 +48,7 @@ class AssociatorGiftContainer extends Component {
48 this._onPressShopCar = this._onPressShopCar.bind(this); 48 this._onPressShopCar = this._onPressShopCar.bind(this);
49 this._onPressCouponItem = this._onPressCouponItem.bind(this); 49 this._onPressCouponItem = this._onPressCouponItem.bind(this);
50 this._onPressLookDetail = this._onPressLookDetail.bind(this); 50 this._onPressLookDetail = this._onPressLookDetail.bind(this);
  51 + this._onHiddenBagTipMessage = this._onHiddenBagTipMessage.bind(this);
51 } 52 }
52 53
53 componentDidMount() { 54 componentDidMount() {
@@ -72,6 +73,10 @@ class AssociatorGiftContainer extends Component { @@ -72,6 +73,10 @@ class AssociatorGiftContainer extends Component {
72 this.props.actions.hiddenGiftAlert(); 73 this.props.actions.hiddenGiftAlert();
73 } 74 }
74 75
  76 + _onHiddenBagTipMessage(){
  77 + this.props.actions.hiddenBagTipMessage();
  78 + }
  79 +
75 _onPressCouponItem(data){ 80 _onPressCouponItem(data){
76 let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.couponProductList", 81 let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.couponProductList",
77 "params":{"coupon_id":"${data.get("id")}","coupon_code":"${data.get("couponCode")}"}, "coupon_title":"${data.get("couponName")}"}`; 82 "params":{"coupon_id":"${data.get("id")}","coupon_code":"${data.get("couponCode")}"}, "coupon_title":"${data.get("couponName")}"}`;
@@ -134,7 +139,8 @@ class AssociatorGiftContainer extends Component { @@ -134,7 +139,8 @@ class AssociatorGiftContainer extends Component {
134 couponsBagCnt, 139 couponsBagCnt,
135 couponsBag, 140 couponsBag,
136 productList, 141 productList,
137 - drawCouponsBag 142 + drawCouponsBag,
  143 + bagTipMessage
138 } = this.props.associatorGift; 144 } = this.props.associatorGift;
139 return ( 145 return (
140 <AssociatorGift 146 <AssociatorGift
@@ -150,6 +156,8 @@ class AssociatorGiftContainer extends Component { @@ -150,6 +156,8 @@ class AssociatorGiftContainer extends Component {
150 onPressShopCar={this._onPressShopCar} 156 onPressShopCar={this._onPressShopCar}
151 onPressCouponItem={this._onPressCouponItem} 157 onPressCouponItem={this._onPressCouponItem}
152 onPressLookDetail={this._onPressLookDetail} 158 onPressLookDetail={this._onPressLookDetail}
  159 + bagTipMessage={bagTipMessage}
  160 + onHiddenBagTipMessage={this._onHiddenBagTipMessage}
153 /> 161 />
154 ); 162 );
155 } 163 }
@@ -5,8 +5,8 @@ import AssociatorGiftService from '../../services/AssociatorGiftService'; @@ -5,8 +5,8 @@ import AssociatorGiftService from '../../services/AssociatorGiftService';
5 const Platform = require('Platform'); 5 const Platform = require('Platform');
6 6
7 const { 7 const {
8 - SHOWGIFTALERT,  
9 - DISMISSGIFTALERT, 8 + SHOWGIFTALERT,
  9 + DISMISSGIFTALERT,
10 10
11 COUPONS_BAG_REQUEST, 11 COUPONS_BAG_REQUEST,
12 COUPONS_BAG_SUCCESS, 12 COUPONS_BAG_SUCCESS,
@@ -24,6 +24,9 @@ const { @@ -24,6 +24,9 @@ const {
24 COUPONS_BAG_CNT_SUCCESS, 24 COUPONS_BAG_CNT_SUCCESS,
25 COUPONS_BAG_CNT_FAILURE, 25 COUPONS_BAG_CNT_FAILURE,
26 26
  27 + SHOW_BAG_TIP_MESSAGE,
  28 + HIDDEN_BAG_TIP_MESSAGE,
  29 +
27 } = require('../../constants/actionTypes').default; 30 } = require('../../constants/actionTypes').default;
28 31
29 export function displayGiftAlert() { 32 export function displayGiftAlert() {
@@ -118,6 +121,19 @@ export function couponsBagCntFailure(error) { @@ -118,6 +121,19 @@ export function couponsBagCntFailure(error) {
118 }; 121 };
119 } 122 }
120 123
  124 +export function showBagTipMessage(message) {
  125 + return {
  126 + type: SHOW_BAG_TIP_MESSAGE,
  127 + payload: message
  128 + }
  129 +}
  130 +
  131 +export function hiddenBagTipMessage() {
  132 + return {
  133 + type:HIDDEN_BAG_TIP_MESSAGE,
  134 + }
  135 +}
  136 +
121 export function getCouponsBagList() { 137 export function getCouponsBagList() {
122 return (dispatch, getState) => { 138 return (dispatch, getState) => {
123 let {app} = getState(); 139 let {app} = getState();
@@ -179,6 +195,7 @@ export function getDrawCouponsBag(couponsBagId) { @@ -179,6 +195,7 @@ export function getDrawCouponsBag(couponsBagId) {
179 }) 195 })
180 .catch(error => { 196 .catch(error => {
181 dispatch(drawCouponsBagFailure(error)); 197 dispatch(drawCouponsBagFailure(error));
  198 + dispatch(showBagTipMessage(error.message));
182 }); 199 });
183 }; 200 };
184 201
@@ -301,4 +318,4 @@ export function reportFavoriteData(payload) { @@ -301,4 +318,4 @@ export function reportFavoriteData(payload) {
301 318
302 } 319 }
303 } 320 }
304 -}  
  321 +}
@@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
3 import {Record, List, Map} from 'immutable'; 3 import {Record, List, Map} from 'immutable';
4 4
5 let InitialState = Record({ 5 let InitialState = Record({
6 - showGiftAlert: false, 6 + showGiftAlert: false,
  7 + bagTipMessage: '',
7 8
8 couponsBagCnt: new (Record({ 9 couponsBagCnt: new (Record({
9 isFetching: false, 10 isFetching: false,
@@ -23,6 +23,9 @@ const { @@ -23,6 +23,9 @@ const {
23 COUPONS_BAG_CNT_SUCCESS, 23 COUPONS_BAG_CNT_SUCCESS,
24 COUPONS_BAG_CNT_FAILURE, 24 COUPONS_BAG_CNT_FAILURE,
25 25
  26 + SHOW_BAG_TIP_MESSAGE,
  27 + HIDDEN_BAG_TIP_MESSAGE,
  28 +
26 } = require('../../constants/actionTypes').default; 29 } = require('../../constants/actionTypes').default;
27 30
28 const initialState = new InitialState; 31 const initialState = new InitialState;
@@ -111,6 +114,15 @@ export default function couponReducer(state = initialState, action) { @@ -111,6 +114,15 @@ export default function couponReducer(state = initialState, action) {
111 return state.setIn(['couponsBagCnt', 'isFetching'], false) 114 return state.setIn(['couponsBagCnt', 'isFetching'], false)
112 .setIn(['couponsBagCnt', 'error'], action.payload); 115 .setIn(['couponsBagCnt', 'error'], action.payload);
113 } 116 }
  117 +
  118 + case SHOW_BAG_TIP_MESSAGE: {
  119 + return state.set('bagTipMessage', Immutable.fromJS(action.payload));
  120 + }
  121 +
  122 + case HIDDEN_BAG_TIP_MESSAGE: {
  123 + return state.set('bagTipMessage', '');
  124 + }
  125 +
114 } 126 }
115 127
116 return state; 128 return state;
@@ -44,26 +44,30 @@ export default class GroupPurchaseDetail extends Component { @@ -44,26 +44,30 @@ export default class GroupPurchaseDetail extends Component {
44 switch(sectionID) { 44 switch(sectionID) {
45 45
46 case 'productResourceInfo': { 46 case 'productResourceInfo': {
47 - // if(!rowData || !rowData.get('data')){  
48 - // return null;  
49 - // }  
50 - // let infoData = rowData.get('data');  
51 - // let info = infoData?infoData.toJS():'';  
52 - // let item = info[0];  
53 - // let src = YH_Image.getSlicedUrl(item.src, width, 70, 2);  
54 - let src = 'http://img13.static.yhbimg.com/article/2019/02/28/14/02b72ac74385bdefd089ffa860d29d0862.jpeg'; 47 + let data = rowData ? rowData.toJS() : null;
55 48
  49 + if(data.template_name == "single_image"){
  50 +
  51 + if(!data.data || !data.data[0]){
  52 + return null;
  53 + }
  54 +
  55 + let resourceData = data.data[0];
  56 + let src = YH_Image.getSlicedUrl(resourceData.src, width, 70*DEVICE_WIDTH_RATIO, 2);
  57 + let url = resourceData.url;
56 return( 58 return(
57 - <View style={{width:width, height:70*DEVICE_WIDTH_RATIO+8, backgroundColor:'#f0f0f0'}}>  
58 - <View style={{width:width, height:70*DEVICE_WIDTH_RATIO}}>  
59 - <TouchableOpacity activeOpacity={1} onPress={() => {  
60 - // this.props.didTouchBanner && this.props.didTouchBanner(item.url);  
61 - }}>  
62 - <YH_Image style={{width: '100%', height: '100%'}} url={src}></YH_Image>  
63 - </TouchableOpacity> 59 + <View style={{width:width, height:70*DEVICE_WIDTH_RATIO+8, backgroundColor:'#f0f0f0'}}>
  60 + <View style={{width:width, height:70*DEVICE_WIDTH_RATIO}}>
  61 + <TouchableOpacity activeOpacity={1} onPress={() => {
  62 + this.props.didTouchBanner && this.props.didTouchBanner(url);
  63 + }}>
  64 + <YH_Image style={{width: '100%', height: '100%'}} url={src}></YH_Image>
  65 + </TouchableOpacity>
  66 + </View>
64 </View> 67 </View>
65 - </View>  
66 - ); 68 + );
  69 + }
  70 + return null;
67 } 71 }
68 72
69 case 'productListTitle': { 73 case 'productListTitle': {
@@ -92,7 +96,7 @@ export default class GroupPurchaseDetail extends Component { @@ -92,7 +96,7 @@ export default class GroupPurchaseDetail extends Component {
92 resource, 96 resource,
93 } = this.props; 97 } = this.props;
94 let dataSource = { 98 let dataSource = {
95 - productResourceInfo: [1], 99 + productResourceInfo: resource.resourceList ? resource.resourceList.toArray() : [],
96 productListTitle: [2], 100 productListTitle: [2],
97 productList: productList.list ? productList.list.toArray() : [], 101 productList: productList.list ? productList.list.toArray() : [],
98 }; 102 };
@@ -63,7 +63,7 @@ class GroupPurchaseDetailContainer extends Component { @@ -63,7 +63,7 @@ class GroupPurchaseDetailContainer extends Component {
63 async componentDidMount() { 63 async componentDidMount() {
64 this.props.actions.getProductList(); 64 this.props.actions.getProductList();
65 this.props.actions.fetchActivityGroupDetail(this.props.FP_NAME, this.props.FP_PARAM); 65 this.props.actions.fetchActivityGroupDetail(this.props.FP_NAME, this.props.FP_PARAM);
66 - // this.props.actions.fetchResourceInfo(); 66 + this.props.actions.fetchResourceInfo();
67 } 67 }
68 68
69 componentWillUnmount() { 69 componentWillUnmount() {
@@ -198,7 +198,7 @@ export function fetchResourceInfo() { @@ -198,7 +198,7 @@ export function fetchResourceInfo() {
198 return (dispatch, getState) => { 198 return (dispatch, getState) => {
199 let {app} = getState(); 199 let {app} = getState();
200 dispatch(resourceInfoRequest()); 200 dispatch(resourceInfoRequest());
201 - let content_code = 'cea0efae77f4e04c935beb1e87181247'; 201 + let content_code = '3c3a94fd6c6e19508b6921acd7f6cbad';
202 return new GroupPurchaseService(app.host).fetchDetailResourceInfo(content_code) 202 return new GroupPurchaseService(app.host).fetchDetailResourceInfo(content_code)
203 .then(json => { 203 .then(json => {
204 dispatch(resourceInfoSuccess(json)); 204 dispatch(resourceInfoSuccess(json));
@@ -4,11 +4,11 @@ import InitialState from './messageInitialState'; @@ -4,11 +4,11 @@ import InitialState from './messageInitialState';
4 import Immutable, {Map} from 'immutable'; 4 import Immutable, {Map} from 'immutable';
5 5
6 const { 6 const {
7 - LATEST_MESSAGE_REQUEST, 7 + LATEST_MESSAGE_REQUEST,
8 LATEST_MESSAGE_SUCCESS, 8 LATEST_MESSAGE_SUCCESS,
9 LATEST_MESSAGE_FAILURE, 9 LATEST_MESSAGE_FAILURE,
10 10
11 - MESSAGE_CATEGORY_SELECT, 11 + MESSAGE_CATEGORY_SELECT,
12 12
13 } = require('../../constants/actionTypes').default; 13 } = require('../../constants/actionTypes').default;
14 14
@@ -18,33 +18,33 @@ export default function messageReducer(state=initialState, action) { @@ -18,33 +18,33 @@ export default function messageReducer(state=initialState, action) {
18 switch(action.type) { 18 switch(action.type) {
19 case LATEST_MESSAGE_REQUEST: { 19 case LATEST_MESSAGE_REQUEST: {
20 return state.setIn(['latest', 'isFetching'], true) 20 return state.setIn(['latest', 'isFetching'], true)
21 - .setIn(['latest', 'error'], null); 21 + .setIn(['latest', 'error'], null);
22 } 22 }
23 23
24 case LATEST_MESSAGE_SUCCESS: { 24 case LATEST_MESSAGE_SUCCESS: {
25 - let onlineService = {  
26 - id: 99,  
27 - inboxCatName: '在线客服',  
28 - content: '服务时间:08:00-22:30',  
29 - unReadCount:0,  
30 - createTime:'',  
31 - imageUrl: '',  
32 - };  
33 - let list = action.payload.list;  
34 - list = [...list,onlineService]; 25 + let onlineService = {
  26 + id: 99,
  27 + inboxCatName: '在线客服',
  28 + content: '服务时间:08:00-22:30',
  29 + unReadCount:0,
  30 + createTime:'',
  31 + imageUrl: '',
  32 + };
  33 + let list = action.payload.list;
  34 + list = [...list,onlineService];
35 return state.setIn(['latest', 'isFetching'], false) 35 return state.setIn(['latest', 'isFetching'], false)
36 - .setIn(['latest', 'data'], Immutable.fromJS(list))  
37 - .setIn(['latest', 'error'], null);  
38 - }  
39 -  
40 - case LATEST_MESSAGE_FAILURE: {  
41 - return state.setIn(['latest', 'isFetching'], false)  
42 - .setIn(['latest', 'error'], action.payload);  
43 - }  
44 -  
45 - case MESSAGE_CATEGORY_SELECT: {  
46 - return state.setIn(['latest', 'data'], Immutable.fromJS(action.payload));  
47 - } 36 + .setIn(['latest', 'data'], Immutable.fromJS(list))
  37 + .setIn(['latest', 'error'], null);
  38 + }
  39 +
  40 + case LATEST_MESSAGE_FAILURE: {
  41 + return state.setIn(['latest', 'isFetching'], false)
  42 + .setIn(['latest', 'error'], action.payload);
  43 + }
  44 +
  45 + case MESSAGE_CATEGORY_SELECT: {
  46 + return state.setIn(['latest', 'data'], Immutable.fromJS(action.payload));
  47 + }
48 } 48 }
49 return state; 49 return state;
50 } 50 }