Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
package net.pixvi.myr.panel.paypoint
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PayCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class PayPointPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:PayPointPanelUI = new PayPointPanelUI();
|
||||
|
||||
public function PayPointPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public static function getIns() : PayPointPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PayPointPanel) as PayPointPanel;
|
||||
}
|
||||
|
||||
public function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
updateInfo();
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
ui.list_list.setDatas(Table.payGift_infoArr);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
PayCenter.getIns().payPointReward(ui.list_list.curSelectedItemData.id,rewardHandler);
|
||||
}
|
||||
|
||||
public function rewardHandler(rewardResultVo:RewardResultVo) : void
|
||||
{
|
||||
RewardShowPanel.showByVo(rewardResultVo);
|
||||
updateInfo();
|
||||
ui.list_list.curSelectedItem.update();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function updateInfo() : void
|
||||
{
|
||||
ui.text_payPoint.text = Master.history.payPoint.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.pixvi.myr.panel.paypoint
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class PayPointPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiSliderList;
|
||||
|
||||
public var text_payPoint:PiBitTextField;
|
||||
|
||||
public function PayPointPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.PayPointPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.setList(PayPointSliderItem,5,false,165);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package net.pixvi.myr.panel.paypoint
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PayCenter;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.panel.reward.RewardShowListSmallItem;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class PayPointSliderItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var btn_getReward:PiLightButton;
|
||||
|
||||
public var list_reward:PiDataList;
|
||||
|
||||
public var mc_get:Sprite;
|
||||
|
||||
public function PayPointSliderItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.PayPointSliderListItemUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_reward.itemClass = RewardShowListSmallItem;
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
text_name.htmlText = Paster.font(lang("累计积分:"),"#ffffff",24) + value.payPoint.toString();
|
||||
var rewardvo:RewardVo = new RewardVo();
|
||||
rewardvo.setByObject(value.reward);
|
||||
list_reward.setDatas(rewardvo.getRewardShowArray());
|
||||
if(PayCenter.getIns().checkPayGiftCanGet(value.id))
|
||||
{
|
||||
btn_getReward.visible = true;
|
||||
if(value.payPoint <= Master.history.payPoint)
|
||||
{
|
||||
btn_getReward.enabled = true;
|
||||
btn_getReward.alpha = 1;
|
||||
btn_getReward.onClick(sendSelect);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_getReward.alpha = 0.5;
|
||||
btn_getReward.enabled = false;
|
||||
}
|
||||
mc_get.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_get.visible = true;
|
||||
btn_getReward.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
package net.pixvi.myr.panel.paypoint
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.center.RewardCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.net.NetPayPoint;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class PayPointTimePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var curTeam:String = "";
|
||||
|
||||
public var loadInfo:Object;
|
||||
|
||||
public var startTime:Number;
|
||||
|
||||
public var endTime:Number;
|
||||
|
||||
public var teamRewards:Array;
|
||||
|
||||
public var countMoney:int;
|
||||
|
||||
public var getRecords:Array;
|
||||
|
||||
public var ui:PayPointTimePanelUI = new PayPointTimePanelUI();
|
||||
|
||||
public function PayPointTimePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public static function getIns() : PayPointTimePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PayPointTimePanel) as PayPointTimePanel;
|
||||
}
|
||||
|
||||
public function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
var pdata:Object = null;
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
teamRewards = [];
|
||||
for(var key:String in Table.chargeReward_info)
|
||||
{
|
||||
pdata = Table.chargeReward_info[key];
|
||||
if(pdata.team == curTeam)
|
||||
{
|
||||
teamRewards.push(pdata);
|
||||
}
|
||||
}
|
||||
if(teamRewards.length > 0)
|
||||
{
|
||||
startTime = teamRewards[0].startTime;
|
||||
endTime = teamRewards[0].endTime;
|
||||
teamRewards.sortOn("money",16);
|
||||
var startDate:Date = MyrCalendar.getShowDate(startTime);
|
||||
var endDate:Date = MyrCalendar.getShowDate(endTime);
|
||||
ui.text_time.text = lang("{0}月{1}日~{2}月{3}日",startDate.month + 1,startDate.date,endDate.month + 1,endDate.date);
|
||||
this.mouseChildren = this.mouseEnabled = false;
|
||||
this.loadChargeInfo();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
return;
|
||||
}
|
||||
Alert.showMsg("No Data");
|
||||
}
|
||||
|
||||
private function loadChargeInfo() : void
|
||||
{
|
||||
NetPayPoint.getIns().timeChargeInfo(startTime,endTime,loadChargeInfoHandler);
|
||||
}
|
||||
|
||||
private function loadChargeInfoHandler(re:Object) : void
|
||||
{
|
||||
countMoney = re.money;
|
||||
getRecords = re.records;
|
||||
updateInfo();
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
ui.list_list.setDatas(teamRewards);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this && this.mouseChildren == true)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
getRecords.push(ui.list_list.curSelectedItemData.id);
|
||||
NetPayPoint.getIns().timeChargeReward(ui.list_list.curSelectedItemData.id,rewardHandler);
|
||||
}
|
||||
|
||||
public function rewardHandler(reward:Object) : void
|
||||
{
|
||||
RewardCenter.getIns().getRewardByData(reward,true,"panel");
|
||||
ui.list_list.curSelectedItem.update();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function updateInfo() : void
|
||||
{
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
ui.text_payPoint.text = countMoney.toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_payPoint.text = (countMoney / 100).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.pixvi.myr.panel.paypoint
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class PayPointTimePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiSliderList;
|
||||
|
||||
public var text_payPoint:PiBitTextField;
|
||||
|
||||
public var text_time:TextField;
|
||||
|
||||
public function PayPointTimePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.PayPointTimePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.setList(PayPointTimeSliderItem,5,false,165);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package net.pixvi.myr.panel.paypoint
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.panel.reward.RewardShowListSmallItem;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class PayPointTimeSliderItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var btn_getReward:PiLightButton;
|
||||
|
||||
public var list_reward:PiDataList;
|
||||
|
||||
public var mc_get:Sprite;
|
||||
|
||||
public function PayPointTimeSliderItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.PayPointSliderListItemUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_reward.itemClass = RewardShowListSmallItem;
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_name.htmlText = Paster.font(lang("累计充值:"),"#ffffff",24) + value.money.toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
text_name.htmlText = Paster.font(lang("累计充值:"),"#ffffff",24) + (value.money / 100).toString();
|
||||
}
|
||||
var rewardvo:RewardVo = new RewardVo();
|
||||
rewardvo.setByObject(value.reward);
|
||||
list_reward.setDatas(rewardvo.getRewardShowArray());
|
||||
if(PayPointTimePanel.getIns().getRecords.indexOf(data.id) == -1)
|
||||
{
|
||||
btn_getReward.visible = true;
|
||||
if(value.money <= PayPointTimePanel.getIns().countMoney)
|
||||
{
|
||||
btn_getReward.enabled = true;
|
||||
btn_getReward.alpha = 1;
|
||||
btn_getReward.onClick(sendSelect);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_getReward.alpha = 0.5;
|
||||
btn_getReward.enabled = false;
|
||||
}
|
||||
mc_get.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_get.visible = true;
|
||||
btn_getReward.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user