1(self.webpackChunkaichiense=self.webpackChunkaichiense||[]).push([["src_mobile_screens_me_RewardPlanListScreen_js"],{11674:function(e,t,r){"use strict";r.r(t),r.d(t,{ActionTypes:function(){return a}});var n=r("244223").default.screens.me.rewardPlanList,a={LOAD_SCREEN_VIEW_ASYNC:"".concat(n,".loadScreenViewAsync"),LOAD_SCREEN_VIEW_SUCCESS:"".concat(n,".loadScreenViewSuccess"),LOAD_SCREEN_VIEW_FAILURE:"".concat(n,".loadScreenViewFailure"),DELETE_REWARD_PLAN_ASYNC:"".concat(n,".deleteRewardPlanAsync"),DELETE_REWARD_PLAN_SUCCESS:"".concat(n,".deleteRewardPlanSuccess"),DELETE_REWARD_PLAN_FAILURE:"".concat(n,".deleteRewardPlanFailure")}},360051:function(e,t,r){"use strict";r.r(t),r.d(t,{ActionTypes:function(){return d.ActionTypes},Actions:function(){return E},reducer:function(){return y},INITIAL_STATE:function(){return _}});var n,a=r("629232"),o=r("171697"),i=r("926690"),s=r("246695");r("600291");var l=r("244223"),c=r("44020"),d=r("11674"),u=r("966373"),p=r("214136"),E={loadScreenViewAsync:function(){return function(e){e({type:d.ActionTypes.LOAD_SCREEN_VIEW_ASYNC}),u.default.loadScreenView(function(t){e(E.loadScreenViewSuccess(t))},function(t){e(E.loadScreenViewFailure(t))})}},loadScreenViewSuccess:function(e){return{type:d.ActionTypes.LOAD_SCREEN_VIEW_SUCCESS,parentType:d.ActionTypes.LOAD_SCREEN_VIEW_ASYNC,postReducer:loadScreenViewSuccessPostReducer,data:e}},loadScreenViewFailure:function(e){return{type:d.ActionTypes.LOAD_SCREEN_VIEW_FAILURE,parentType:d.ActionTypes.LOAD_SCREEN_VIEW_ASYNC,error:e}},deleteRewardPlanAsync:function(e){return function(t){t({type:d.ActionTypes.DELETE_REWARD_PLAN_ASYNC,id:e}),u.default.deleteRewardPlan(e,function(r){t(E.deleteRewardPlanSuccess(r,e))},function(e){t(E.deleteRewardPlanFailure(e))})}},deleteRewardPlanSuccess:function(e,t){return{type:d.ActionTypes.DELETE_REWARD_PLAN_SUCCESS,parentType:d.ActionTypes.DELETE_REWARD_PLAN_ASYNC,data:e,id:t}},deleteRewardPlanFailure:function(e){return{type:d.ActionTypes.DELETE_REWARD_PLAN_FAILURE,parentType:d.ActionTypes.DELETE_REWARD_PLAN_ASYNC,error:e}}},_={rewardPlans:[],rewardPlansHistory:[]},loadScreenViewSuccessPostReducer=function(e,t){var r=t.data.rewardPlanDetails,n=r.rewardPlans,a=r.rewardPlansHistory;return(0,i._)((0,o._)({},e),{rewardPlans:n,rewardPlansHistory:a})},f=(0,s.createReducer)(_,(n={},(0,a._)(n,d.ActionTypes.LOAD_SCREEN_VIEW_ASYNC,p.default.actionReducer),(0,a._)(n,d.ActionTypes.LOAD_SCREEN_VIEW_SUCCESS,p.default.successReducer),(0,a._)(n,d.ActionTypes.LOAD_SCREEN_VIEW_FAILURE,p.default.failureReducer),(0,a._)(n,d.ActionTypes.DELETE_REWARD_PLAN_ASYNC,p.default.actionReducer),(0,a._)(n,d.ActionTypes.DELETE_REWARD_PLAN_SUCCESS,p.default.successReducer),(0,a._)(n,d.ActionTypes.DELETE_REWARD_PLAN_FAILURE,p.default.failureReducer),n)),y=new c.default(l.default.screens.me.rewardPlanList,f)},461985:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return L}});var n=r("212939"),a=r("831113"),o=r("975471"),i=r("629232"),s=r("157934"),l=r("16171"),c=r("972768"),d=r("709580"),u=r("250490"),p=r.n(u),E=r("261692");r("576627");var _=r("862605"),f=r("47314"),y=r("927103"),A=r("509002"),S=r("327769"),m=r("224289"),T=r("580142"),w=r("244223"),R=r("360051"),g=r("206726"),P=w.default.screens.me.rewardPlanList,h=function(e){(0,c._)(RewardPlanListScreen,e);var t=(0,d._)(RewardPlanListScreen);function RewardPlanListScreen(e){var r;return(0,a._)(this,RewardPlanListScreen),r=t.call(this,e),(0,i._)((0,n._)(r),"_handleDeleteRewardPlan",function(e){r.props.deleteRewardPlanAsync(e)}),(0,i._)((0,n._)(r),"_onPress",function(){T.NavigationService.navigateToPage((0,n._)(r),w.default.screens.me.default)}),(0,i._)((0,n._)(r),"_onPressSetRewardPlan",function(){r.props.navigation.navigate(w.default.screens.me.setRewardPlan,{refresh:function(){r.props.loadScreenViewAsync()}})}),(0,i._)((0,n._)(r),"_onPressApprove",function(){T.NavigationService.navigateToPage((0,n._)(r),w.default.screens.course.list)}),(0,i._)((0,n._)(r),"_onPressHistory",function(e){var t=r.props.localState.rewardPlansHistory,a=[r.props.t("everyTask"),r.props.t("everyWeek"),r.props.t("everyMonth"),r.props.t("everySeason"),r.props.t("everyYear")],o=t[e].id,i=t[e].rewardData,s=a[t[e].rewardCycle];T.NavigationService.navigateToPage((0,n._)(r),w.default.screens.me.rewardHistory,{id:o,prize:i,rewardCycle:s})}),(0,i._)((0,n._)(r),"_handleDeleteRewardPlanAsyncDone",function(){r.props.loadScreenViewAsync()}),r}return(0,o._)(RewardPlanListScreen,[{key:"routeName",get:function(){return P}},{key:"reducer",get:function(){return R.reducer}},{key:"actionHandlers",get:function(){var e,t=this;return e={},(0,i._)(e,R.ActionTypes.LOAD_SCREEN_VIEW_ASYNC,{done:null}),(0,i._)(e,R.ActionTypes.DELETE_REWARD_PLAN_ASYNC,{done:this._handleDeleteRewardPlanAsyncDone,error:function(e){return t.displayAsyncActionError(e.error,"deleteRewardPlanFailure")}}),e}},{key:"componentDidMount",value:function(){(0,s._)((0,l._)(RewardPlanListScreen.prototype),"componentDidMount",this).call(this),this.props.loadScreenViewAsync()}},{key:"renderScreen",value:function(){var e=this;return!this.props.localState.rewardPlans||this.isActionExecuting(R.ActionTypes.LOAD_SCREEN_VIEW_ASYNC)?p.createElement(m.default,{title:this.props.t("rewardPlan")}):p.createElement(y.Container,{style:[C.backgroundColor]},p.createElement(A.default,{style:[C.headerColor]},p.createElement(y.Left,{style:[C.flex1]},p.createElement(y.Button,{transparent:!0,onPress:function(){return e._onPress()}},p.createElement(g.default,{name:"ios-arrow-back",style:[C.headerIcon]}))),p.createElement(y.Body,{style:[C.flex3,C.alignItemsCenter]},p.createElement(y.Title,{style:[C.headerTitle]},this.props.t("rewardPlan"))),p.createElement(y.Right,{style:[C.flex1]})),p.createElement(y.Content,null,this._renderCurrentRewardPlansArea(),p.createElement(_.View,{style:[C.centerAlign,C.marginTop30]},p.createElement(y.Button,{transparent:!0,onPress:function(){return e._onPressSetRewardPlan()},style:[C.centerAlign,C.addButton]},p.createElement(_.Text,{style:[C.addText]},this.props.t("setNewReward"))),p.createElement(y.Button,{transparent:!0,onPress:function(){return e._onPressApprove()},style:[C.centerAlign,C.studyButton,C.marginTop20]},p.createElement(_.Text,{style:[C.studyText]},this.props.t("studyStart")))),p.createElement(_.Text,{style:[C.marginHorizontal16,C.marginTop30,C.historyText,C.marginBottom8]},this.props.t("history")),this._renderHistoryRewardPlansArea()))}},{key:"_renderCurrentRewardPlansArea",value:function(){var e=this,t=this.props.localState.rewardPlans,r=[this.props.t("everyTask"),this.props.t("everyWeek"),this.props.t("everyMonth"),this.props.t("everySeason"),this.props.t("everyYear")];return p.createElement(p.Fragment,null,!t||this.isActionExecuting(R.ActionTypes.LOAD_SCREEN_VIEW_ASYNC)?p.createElement(_.View,{style:[C.headerColor,C.marginTop2]}):t.map(function(t,n){var a=t.id,o=t.rewardCycle,i=t.startOn,s=t.endOn;return p.createElement(_.View,{style:[C.headerColor,C.marginTop2]},p.createElement(_.View,{style:[C.marginHorizontal16,C.marginVertical16,C.justifyContentBetween,C.flexDirection]},p.createElement(g.default,{name:"logo-usd",style:[C.usd]}),p.createElement(_.View,{style:{left:0}},p.createElement(_.Text,null,r[o]),""===s?p.createElement(_.Text,{style:[C.marginTop2,C.ListText]},e.props.t("effectiveTime"),i," "," "):p.createElement(_.Text,{style:[C.marginTop2,C.ListText]},e.props.t("effectiveTime"),i," ~ ",s)),p.createElement(y.Button,{transparent:!0,style:[C.centerAlign,C.deleteButton],onPress:function(){return e._handleDeleteRewardPlan(a)}},p.createElement(_.Text,{style:[C.deleteText]}
1,e.props.t("delete")))))}))}},{key:"_renderHistoryRewardPlansArea",value:function(){var e=this,t=this.props.localState.rewardPlansHistory,r=[this.props.t("everyTask"),this.props.t("everyWeek"),this.props.t("everyMonth"),this.props.t("everySeason"),this.props.t("everyYear")];return p.createElement(p.Fragment,null,!t||this.isActionExecuting(R.ActionTypes.LOAD_SCREEN_VIEW_ASYNC)?p.createElement(_.View,{style:[C.headerColor,C.marginTop2]}):t.map(function(t,n){t.id;var a=t.rewardCycle,o=t.rewardData,i=t.amount;return p.createElement(_.View,{style:[C.headerColor,C.marginTop2]},p.createElement(_.View,{style:[C.marginHorizontal16,C.marginVertical16,C.justifyContentBetween,C.flexDirection]},p.createElement(_.View,null,p.createElement(_.Text,null,r[a]),p.createElement(_.Text,{style:[C.marginTop6,C.ListText]},e.props.t("prize"),o),p.createElement(_.Text,{style:[C.marginTop2,C.ListText]},e.props.t("numberTaskCompleted"),""===i?0:i)),p.createElement(y.Button,{transparent:!0,onPress:function(){return e._onPressHistory(n)},style:[C.backButton]},p.createElement(g.default,{name:"ios-arrow-forward",style:[C.backIcon]}))))}))}}]),RewardPlanListScreen}(S.default),C=_.StyleSheet.create({centerAlign:{justifyContent:"center",alignItems:"center"},backgroundColor:{backgroundColor:"#f4f4f4"},headerColor:{backgroundColor:"#fff"},headerTitle:{color:"#111"},usd:{fontSize:16,color:"#eea236",top:2},flex1:{flex:1},flex3:{flex:3},alignItemsCenter:{alignItems:"center"},headerIcon:{fontSize:30,color:"#777"},marginTop30:{marginTop:30},marginTop20:{marginTop:20},marginBottom10:{marginBottom:10},marginTop8:{marginTop:8},marginTop6:{marginTop:6},marginTop2:{marginTop:2},historyText:{color:"#999"},addButton:{borderRadius:30,width:320,height:50,borderWidth:1,borderColor:"#5cb85c",alignSelf:"center"},studyButton:{borderRadius:30,backgroundColor:"rgb(100,218,73)",width:320,height:50,alignSelf:"center"},studyText:{textAlign:"center",fontSize:16,color:"#fff"},addText:{textAlign:"center",fontSize:16,color:"#5cb85c"},deleteButton:{height:20,width:42,backgroundColor:"red"},deleteText:{fontSize:10,color:"#fff"},flexDirection:{flexDirection:"row"},justifyContentBetween:{justifyContent:"space-between"},marginHorizontal16:{marginHorizontal:16},marginVertical16:{marginVertical:16},ListText:{fontSize:12,color:"#999"},backIcon:{fontSize:18,color:"#ccc",alignSelf:"center"},backButton:{width:40,height:60,justifyContent:"flex-end"},detailText:{fontSize:12,color:"#999",marginTop:6}}),L=(0,E.connect)(function(e){return{localState:e.screens[R.reducer.key]?e.screens[R.reducer.key]:R.INITIAL_STATE,userId:e.session.userId}},function(e){return{loadScreenViewAsync:function(){return e(R.Actions.loadScreenViewAsync())},deleteRewardPlanAsync:function(t){return e(R.Actions.deleteRewardPlanAsync(t))}}})((0,f.withTranslation)(P)(h))},966373:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return a}});var n=r("463704"),a={loadScreenView:function(e,t){n.default.post("/mobile/me/rewardplanlist/loadscreenview",{},e,t)},deleteRewardPlan:function(e,t,r){n.default.post("/mobile/me/rewardplanlist/deleterewardplan",{id:e},t,r)}}}}]); 2//# sourceMappingURL=src_mobile_screens_me_RewardPlanListScreen_js.f0159d79.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.