Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
package net.pixvi.myr.panel.pay
|
||||
{
|
||||
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.PayCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class PayPackPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:PayPackPanelUI = new PayPackPanelUI();
|
||||
|
||||
public var vo:Object;
|
||||
|
||||
public function PayPackPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public static function getIns() : PayPackPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PayPackPanel) as PayPackPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
update();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
this.vo = vo;
|
||||
ui.container_img.loadNetImg("data/img/common/pay/" + vo.bgimg);
|
||||
ui.text_name.text = vo.name;
|
||||
if(PayCenter.getIns().checkBuyAble(vo.id))
|
||||
{
|
||||
ui.btn_buy.onClick(buyHandler);
|
||||
ui.btn_buy.enabled = true;
|
||||
ui.btn_buy.alpha = 1;
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
ui.text_price.text = vo.rmb + lang("元");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_price.text = (vo.rmb / 100).toFixed(2) + lang("元");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_buy.enabled = false;
|
||||
ui.btn_buy.alpha = 0.5;
|
||||
ui.text_price.text = lang("售罄");
|
||||
}
|
||||
var rewardvo:RewardVo = new RewardVo();
|
||||
rewardvo.setByObject(vo.reward);
|
||||
ui.list_reward.setDatas(rewardvo.getRewardShowArray());
|
||||
if(vo.num != -1)
|
||||
{
|
||||
ui.text_goodNum.text = lang("剩余:") + (vo.num - PayCenter.getIns().getGoodBuyNum(vo.id.toString())) + "/" + vo.num;
|
||||
}
|
||||
else if(vo.dayNum != -1)
|
||||
{
|
||||
ui.text_goodNum.text = lang("每日:") + (vo.dayNum - PayCenter.getIns().getGoodDayBuyNum(vo.id.toString())) + "/" + vo.dayNum;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_goodNum.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
public function buyHandler(e:Event = null) : void
|
||||
{
|
||||
this.mouseChildren = this.mouseEnabled = false;
|
||||
PayCenter.getIns().buyGood(vo.id,buySuccessHandler,buyFailHandler);
|
||||
}
|
||||
|
||||
public function buySuccessHandler() : void
|
||||
{
|
||||
this.mouseChildren = this.mouseEnabled = true;
|
||||
update();
|
||||
}
|
||||
|
||||
public function buyFailHandler(msg:String) : void
|
||||
{
|
||||
this.mouseChildren = this.mouseEnabled = true;
|
||||
Alert.yes(lang("错误"),msg);
|
||||
}
|
||||
|
||||
public function popByPayId(id:String) : void
|
||||
{
|
||||
vo = Table.pay_info[id];
|
||||
popIn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package net.pixvi.myr.panel.pay
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.panel.reward.RewardShowListSmallItem;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class PayPackPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_buy:PiLightButton;
|
||||
|
||||
public var list_reward:PiDataList;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_price:TextField;
|
||||
|
||||
public var text_goodNum:PiBitTextField;
|
||||
|
||||
public function PayPackPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.PayPackPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_name.visible = false;
|
||||
}
|
||||
container_img.setSize(600,420);
|
||||
text_name.scaleMode = true;
|
||||
list_reward.itemClass = RewardShowListSmallItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
package net.pixvi.myr.panel.pay
|
||||
{
|
||||
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.GameMath;
|
||||
import net.pixvi.myr.center.PayCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.panel.paypoint.PayPointPanel;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class PayPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:PayPanelUI = new PayPanelUI();
|
||||
|
||||
public var curMode:int = 1;
|
||||
|
||||
public function PayPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_payPoint.onClick(payPointHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : PayPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PayPanel) as PayPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
setMode(1);
|
||||
ui.btn_event.loadByBtnData(Table.activity_info.specialBtn.payBtn);
|
||||
ui.switch_mode.selectByValue(1);
|
||||
ui.switch_mode.addEventListener("piselect",switchHandler);
|
||||
ui.list_item.addEventListener("piselect",selectHandler);
|
||||
GlobalBroadcast.addEventListener(MYREvent.DAY_CHANGE,dayChangeHandler);
|
||||
if(GameMath.OpenPay)
|
||||
{
|
||||
Caller.delayCall(PayRewardListPanel.checkPayReward,100);
|
||||
}
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function dayChangeHandler(e:Event = null) : void
|
||||
{
|
||||
setMode(1);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function payPointHandler(e:Event = null) : void
|
||||
{
|
||||
PopCenter.POP(PayPointPanel.getIns());
|
||||
}
|
||||
|
||||
public function switchHandler(e:Event = null) : void
|
||||
{
|
||||
setMode(int(ui.switch_mode.value));
|
||||
}
|
||||
|
||||
public function setMode(mode:int) : void
|
||||
{
|
||||
var keDatas:Array = null;
|
||||
var i:int = 0;
|
||||
var mode1data:Object = null;
|
||||
var packDatas:Array = null;
|
||||
var j:int = 0;
|
||||
var mode2data:Object = null;
|
||||
var canbuy:Array = null;
|
||||
var cantbuy:Array = null;
|
||||
var k:int = 0;
|
||||
var goodid:String = null;
|
||||
curMode = mode;
|
||||
if(mode == 1)
|
||||
{
|
||||
keDatas = [];
|
||||
for(i = 0; i < Table.pay_infoArr.length; )
|
||||
{
|
||||
mode1data = Table.pay_infoArr[i];
|
||||
if(mode1data.payType == "ke" && (mode1data.platform == null || mode1data.platform == MyrCenter.platform) && (PayCenter.getIns().checkItemTime(mode1data.id) && !mode1data.hide || GameMath.ModeTrace))
|
||||
{
|
||||
if(!(MyrCenter.platform == "IOS" && (MyrCenter.channel != "XDG" && mode1data.iid == null)))
|
||||
{
|
||||
keDatas.push(Table.pay_infoArr[i]);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
keDatas.sortOn("sort",16);
|
||||
ui.list_item.setDatas(keDatas);
|
||||
}
|
||||
else if(mode == 2 || mode == 3)
|
||||
{
|
||||
packDatas = [];
|
||||
for(j = 0; j < Table.pay_infoArr.length; )
|
||||
{
|
||||
mode2data = Table.pay_infoArr[j];
|
||||
if(mode2data.payType == "pack" && (mode2data.platform == null || mode2data.platform == MyrCenter.platform) && (PayCenter.getIns().checkItemTime(mode2data.id) && !mode2data.hide || GameMath.ModeTrace))
|
||||
{
|
||||
if(!(MyrCenter.platform == "IOS" && mode2data.iid == null))
|
||||
{
|
||||
if(!(mode == 2 && mode2data.skin == true))
|
||||
{
|
||||
if(!(mode == 3 && mode2data.skin != true))
|
||||
{
|
||||
packDatas.push(Table.pay_infoArr[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
packDatas.sortOn("sort",16);
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
packDatas.sortOn("hide");
|
||||
}
|
||||
canbuy = [];
|
||||
cantbuy = [];
|
||||
for(k = 0; k < packDatas.length; )
|
||||
{
|
||||
goodid = packDatas[k].id;
|
||||
if(PayCenter.getIns().checkBuyAble(goodid))
|
||||
{
|
||||
canbuy.push(packDatas[k]);
|
||||
}
|
||||
else
|
||||
{
|
||||
cantbuy.push(packDatas[k]);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
ui.list_item.setDatas(canbuy.concat(cantbuy));
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
if(Singleton.hasIns(PayPackPanel))
|
||||
{
|
||||
PayPackPanel.getIns().removeIns();
|
||||
}
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,maskHandler);
|
||||
super.showOut();
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
var vo:Object = ui.list_item.curSelectedItemData;
|
||||
if(vo.replace != null && PayCenter.getIns().checkBuyAble(vo.replace))
|
||||
{
|
||||
vo = Table.pay_info[vo.replace];
|
||||
}
|
||||
if(curMode == 1)
|
||||
{
|
||||
PayCenter.getIns().buyGood(vo.id,buySuccessHandler,buyFailHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
PayPackPanel.getIns().vo = vo;
|
||||
PayPackPanel.getIns().popIn();
|
||||
}
|
||||
}
|
||||
|
||||
public function buySuccessHandler() : void
|
||||
{
|
||||
this.mouseChildren = this.mouseEnabled = true;
|
||||
ui.list_item.refresh();
|
||||
}
|
||||
|
||||
public function buyFailHandler(msg:String) : void
|
||||
{
|
||||
this.mouseChildren = this.mouseEnabled = true;
|
||||
Alert.yes(lang("错误"),msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.pixvi.myr.panel.pay
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.panel.stagesp.MYREventButton;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
import net.pixvi.psg.ui.controller.PiLightSwitch;
|
||||
|
||||
public class PayPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_item:PiSliderList;
|
||||
|
||||
public var switch_mode:PiLightSwitch;
|
||||
|
||||
public var btn_payPoint:PiLightButton;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_event:MYREventButton;
|
||||
|
||||
public function PayPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.PayPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_item.setList(PaySliderListItem,8,false,163,2,302);
|
||||
if(Table.game_setting.closePayPoint == true)
|
||||
{
|
||||
btn_payPoint.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package net.pixvi.myr.panel.pay
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class PayRewardListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var btn_getReward:PiLightButton;
|
||||
|
||||
public function PayRewardListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(81,81);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var goodId:String = value.rewardTypeId;
|
||||
container_img.loadNetImg("data/img/common/pay/" + Table.pay_info[goodId].img);
|
||||
text_name.text = Table.pay_info[goodId].name;
|
||||
btn_getReward.onClick(sendSelect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
package net.pixvi.myr.panel.pay
|
||||
{
|
||||
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.Master;
|
||||
import net.pixvi.myr.center.RewardCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.net.NetPay;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class PayRewardListPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var firstPayRewardCheck:Boolean = false;
|
||||
|
||||
public var ui:PayRewardListPanelUI = new PayRewardListPanelUI();
|
||||
|
||||
private var cacheGoodId:String = "";
|
||||
|
||||
public function PayRewardListPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public static function checkPayReward() : void
|
||||
{
|
||||
if(firstPayRewardCheck)
|
||||
{
|
||||
return;
|
||||
}
|
||||
firstPayRewardCheck = true;
|
||||
NetPay.getIns().getPayRewardList(Master.id.toString(),checkPayRewardHandler);
|
||||
}
|
||||
|
||||
public static function checkPayRewardHandler(list:Array) : void
|
||||
{
|
||||
if(list != null && list.length > 0)
|
||||
{
|
||||
PopCenter.POP(PayRewardListPanel.getIns());
|
||||
PayRewardListPanel.getIns().update(list);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIns() : PayRewardListPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PayRewardListPanel) as PayRewardListPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
update();
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
}
|
||||
|
||||
public function update(list:Array = null) : void
|
||||
{
|
||||
if(list == null)
|
||||
{
|
||||
NetPay.getIns().getPayRewardList(Master.id.toString(),updateHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
updateHandler(list);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateHandler(list:Array) : void
|
||||
{
|
||||
if(list == null)
|
||||
{
|
||||
list = [];
|
||||
}
|
||||
if(list.length > 0)
|
||||
{
|
||||
ui.btn_close.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_close.visible = true;
|
||||
}
|
||||
ui.list_list.setDatas(list);
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
var data:Object = ui.list_list.curSelectedItemData;
|
||||
data.goodId = data.rewardTypeId;
|
||||
data.tradeId = data.tradeNo;
|
||||
cacheGoodId = data.goodId;
|
||||
NetPay.getIns().getTradeReward(data.tradeId,"",getTradeRewardHandler,false);
|
||||
}
|
||||
|
||||
private function getTradeRewardHandler(rewardData:Object, errmsg:String, resCode:Object = null) : void
|
||||
{
|
||||
if(rewardData != null)
|
||||
{
|
||||
if(Master.history.payTypeCount[cacheGoodId] == null)
|
||||
{
|
||||
Master.history.payTypeCount[cacheGoodId] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.history.payTypeCount[cacheGoodId]++;
|
||||
}
|
||||
if(Master.history.payTypeDayCount[cacheGoodId] == null)
|
||||
{
|
||||
Master.history.payTypeDayCount[cacheGoodId] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.history.payTypeDayCount[cacheGoodId]++;
|
||||
}
|
||||
Master.history.payPoint += Table.pay_info[cacheGoodId].payPoint;
|
||||
update();
|
||||
RewardCenter.getIns().getRewardByData(rewardData,true,"panel");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.yes(lang("领取出错"),errmsg);
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
PayPanel.getIns().setMode(1);
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.panel.pay
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class PayRewardListPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public function PayRewardListPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.PayRewardListPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.itemClass = PayRewardListItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package net.pixvi.myr.panel.pay
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.PayCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class PaySliderListItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var btn_info:PiLightButton;
|
||||
|
||||
public var btn_buy:PiLightButton;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_rmb:PiBitTextField;
|
||||
|
||||
public var mc_type:MovieClip;
|
||||
|
||||
public var container_tagimg:PiImgContainer;
|
||||
|
||||
public function PaySliderListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.PaySliderListItemUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(103,103);
|
||||
mc_type.stop();
|
||||
text_name.scaleMode = true;
|
||||
container_tagimg.setSize(91,34);
|
||||
}
|
||||
|
||||
override public function onData(goodData:Object) : void
|
||||
{
|
||||
var value:Object = goodData;
|
||||
alpha = 1;
|
||||
var isReplaced:Boolean = false;
|
||||
if(value.payType == "ke")
|
||||
{
|
||||
if(value.replace != null && !GameMath.ModeTrace)
|
||||
{
|
||||
if(PayCenter.getIns().checkBuyAble(value.replace))
|
||||
{
|
||||
isReplaced = true;
|
||||
value = Table.pay_info[value.replace];
|
||||
}
|
||||
}
|
||||
btn_buy.visible = true;
|
||||
btn_info.visible = false;
|
||||
mc_type.gotoAndStop(1);
|
||||
}
|
||||
else if(value.payType == "pack")
|
||||
{
|
||||
btn_buy.visible = false;
|
||||
btn_info.visible = true;
|
||||
mc_type.gotoAndStop(2);
|
||||
if(!PayCenter.getIns().checkBuyAble(value.id))
|
||||
{
|
||||
this.alpha = 0.8;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.alpha = 1;
|
||||
}
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
if(goodData.hide == true && !isReplaced)
|
||||
{
|
||||
this.alpha = 0.4;
|
||||
}
|
||||
else if(PayCenter.getIns().checkBuyAble(value.id))
|
||||
{
|
||||
this.alpha = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
btn_buy.onClick(sendSelect);
|
||||
btn_info.onClick(sendSelect);
|
||||
text_name.text = value.name;
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_rmb.text = value.rmb + lang("元");
|
||||
}
|
||||
else
|
||||
{
|
||||
text_rmb.text = (value.rmb / 100).toFixed(2) + lang("元");
|
||||
}
|
||||
if(value.tagimg != null && value.tagimg != "")
|
||||
{
|
||||
container_tagimg.loadNetImg("data/img/common/pay/" + value.tagimg);
|
||||
}
|
||||
else
|
||||
{
|
||||
container_tagimg.reset();
|
||||
}
|
||||
container_img.loadNetImg("data/img/common/pay/" + value.img);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user