Ext.namespace("ECoin");ECoin.showPurchaseSuccess=function(){var a=new Ext.Template('<div class="msg_main">',"<p>恭喜您，充值成功！登陆易充会员即可马上看到您的交易</p>",'<table width="100%" border="0" cellpadding="0" cellspacing="0" style="height: 108px;width:302px;">',"<tr>",'<td align="center" valign="middle"><a href="#"><img src="images/msg_btn01.gif" width="79" height="32" border="0" /></a></td>','<td align="center" valign="middle"><a href="#"><img src="images/msg_btn02.gif" width="79" height="32" border="0" /></a></td>','<td align="center"><a href="#"><img src="images/msg_btn03.gif" width="79" height="32" border="0" style="cursor:hand" onclick="ECoin.win.close();" /></a></td>',"</tr></table><p>&nbsp;</p></div>");ECoin.win=new Ext.Window({width:425,height:190,modal:true});ECoin.win.show();a.overwrite(ECoin.win.body,{})};ECoin.showPurchaseWait=function(h,b,c,f,g,e,i,a){if(a==null){a="./"}var j='<div id="msg_main2">';j+='<p style="color: #FFFFFF;font-weight: bold;font-size: 14px;">定单号：{orderno}</p>';j+='<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top: 10px;">';j+='<tr><td width="33%" align="left" style="line-height: 20px;">产品名称：</td><td width="67%" style="line-height: 20px;"><strong>{coin_name}</strong></td></tr>';j+='<tr><td align="left" style="line-height: 20px;">交易金额：</td>';j+='<td style="line-height: 20px;"><span style="color: #FF3300">{coin_value}元</span></td></tr>';j+='<tr><td align="left" style="line-height: 20px;">支付电话：</td><td style="line-height: 20px;">{phone}</td></tr>';if(e==0){j+='<tr><td align="left" style="line-height: 20px;">充入QQ或帐号：</td><td style="line-height: 20px;">{qq}</td></tr>'}j+='<tr><td colspan="2" align="left" valign="middle" style="line-height: 14px;">';if(i=="callout"){j+='<p>系统正对您的<span style="color: #FF3300;"><strong>{phone}</strong></span>进行外呼确认，请保持挂机状态</p></td></tr>'}else{j+='<p>请使用<span style="color: #FF3300"><strong>{phone}</strong></span>即可拨打<span style="color: #FF3300"><strong>1183188</strong></span>进行支付</p></td></tr>'}j+"</table></div>";ECoin.winPurchaseWait=new Ext.Window({title:"通知消息",width:425,height:190,modal:true,resizable:false,closable:true});ECoin.winPurchaseWait.show();var d=new Ext.Template(j);d.overwrite(ECoin.winPurchaseWait.body,{orderno:h,coin_name:b,coin_value:c,phone:f,qq:g});ECoin.winPurchaseWait.on("close",function(){ECoin.winPurchaseWait=null;location.href=a+"search.aspx"})};ECoin.showPurchaseOk=function(c){if(c.relative_path==null){c.relative_path="./"}var b='<div id="msg_main2">';b+='<p style="color: #FFFFFF;font-weight: bold;font-size: 14px;">恭喜您，定单 {orderno} 支付成功了！</p>';b+='<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top: 10px;">';b+='<tr><td width="29%" align="left" style="line-height: 20px;">产品名称：</td><td width="71%" style="line-height: 20px;"><strong>{coin_name}</strong></td></tr>';b+='<tr><td align="left" style="line-height: 20px;">交易金额：</td>';b+='<td style="line-height: 20px;"><span style="color: #FF3300">{coin_value}元</span></td></tr>';if(c.charge_type==0){b+='<tr><td align="left" style="line-height: 20px;">充入QQ或帐号：</td><td style="line-height: 20px;">{qq}</td></tr>'}else{b+='<tr><td align="left" style="line-height: 20px;">卡号：</td><td style="line-height: 20px;">{cardno}</td></tr>';b+='<tr><td align="left" style="line-height: 20px;">密码：</td><td style="line-height: 20px;">{cardpwd}</td></tr>'}b+='<tr><td colspan="2" align="left" valign="middle" style="line-height: 14px;">';if(c.logined==true){b+='<p><strong>（<a href="#" onclick="location.href=\''+c.relative_path+"private_gy.aspx';\">请点击这里查看交易记录</a>）</strong></p>"}else{if(c.coin_id==103){b+='<p><span style="color: #FF3300"><strong>（注册或登录易充直通车，可以参与更多好玩的活动）</strong></span></p>'}else{b+='<p><span style="color: #FF3300"><strong>（登录或注册为会员后，可查看交易记录并累积积分）</strong></span></p>'}}b+="</td></tr></table>";b+="</div>";ECoin.win=new Ext.Window({title:"通知消息",width:425,height:220,modal:true,resizable:true,buttons:[{text:"登录",hidden:c.logined,handler:function(){location.href=c.relative_path+"login.aspx"}},{text:"注册",hidden:c.logined,handler:function(){location.href=c.relative_path+"register.aspx"}},{text:"关闭",scope:this,handler:function(){ECoin.win.close()}}]});if(ECoin.winPurchaseWait){ECoin.winPurchaseWait.hide()}ECoin.win.show();var a=new Ext.Template(b);a.overwrite(ECoin.win.body,c);ECoin.win.on("close",function(){ECoin.win=null;if(ECoin.winPurchaseWait){ECoin.winPurchaseWait.close()}});Ext.Ajax.request({url:c.relative_path+"act_checkbill_fin.aspx",params:{id:c.id}})};ECoin.showMsgBox=function(c,b){ECoin.win=new Ext.Window({title:c,width:300,height:150,layout:"fit",border:true,modal:true,bodyCfg:{cls:"msg_main_clean"},resizable:false,plain:true,items:[{xtype:"form",buttonAlign:"center",unstyled:true,headerAsText:false,border:false,buttons:[{text:"确认",scope:this,handler:function(){ECoin.win.close();ECoin.win=null}}]}]});var a=new Ext.Template('<div style="width:100%;height:100%"><br/><p style="margin-left:9px;margin-right:70px;">{message}<p></div>');ECoin.win.show();a.overwrite(ECoin.win.items.itemAt(0).body,{message:b});ECoin.win.on("close",function(){ECoin.win=null})};ECoin.prompt=function(a){ECoin.showMsgBox("通知",a)};ECoin.warn=function(a){ECoin.showMsgBox("警告",a)};ECoin.error=function(a){ECoin.showMsgBox("出错消息",a)};ECoin.close=function(){if(ECoin.win){ECoin.win.close()}};ECoin.mask=function(a){ECoin.loadMask=new Ext.LoadMask(Ext.getBody(),{msg:a});ECoin.loadMask.show()};ECoin.unmask=function(){if(ECoin.loadMask){ECoin.loadMask.hide()}};ECoin.redir=function(f,e,d,c){ECoin.win=new Ext.Window({title:f,width:300,height:180,layout:"fit",border:false,modal:true,resizable:false,plain:true,items:[{xtype:"form"}],buttons:[{text:"立刻跳转",scope:this,handler:function(){location.href=d}}]});var b=new Ext.Template('<div class="msg_main_clean" style="width:100%;height:100%"><br/><p style="margin-left:9px">{message}<p></div>');ECoin.win.show();b.overwrite(ECoin.win.items.itemAt(0).body,{message:e});var a=new Ext.util.DelayedTask();a.delay(c,function(g){location.href=d;0});ECoin.win.on("close",function(){ECoin.win=null})};ECoin.ajaxfail=function(a,b){ECoin.error("<br/>系统繁忙，请稍后再试")};ECoin.showRegOk_old=function(a){ECoin.win=new Ext.Window({title:"通知消息",width:425,height:190,bodyCfg:{cls:"msg_main1"},border:true,modal:true,plain:true,closable:false,resizable:false,items:[{buttonAlign:"center",xtype:"form",labelWidth:110,labelAlign:"left",layout:"form",unstyled:true,headerAsText:false,border:false,labelAlign:"right",buttons:[{text:"确认修改",handler:function(){var b=ECoin.win.items.itemAt(0).getForm();var c=b.getFieldValues(false);if((c.password)&&(c.password1)&&(c.password==c.password1)){b.submit({url:"act_changepwd.aspx",success:function(d,e){if(e.result.success==true){alert("密码修改成功");ECoin.win.close()}else{alert("密码修改失败")}},failure:function(d,e){alert("密码修改失败。")}})}else{alert("请填写新的密码。")}}},{text:"无需修改",score:this,handler:function(){ECoin.win.close()}}],items:[{xtype:"displayfield",hideLabel:true,labelSeperator:"",value:"恭喜！您已注册成功",style:"color: #FFFFFF;font-size:14px;font-weight:bold;"},{xtype:"displayfield",fieldLabel:"您的会员密码是",value:a.password,style:"color: #FF3300;margin-top:5"},{xtype:"numberfield",fieldLabel:"修改密码",name:"password",anchor:"100%",inputType:"password"},{xtype:"numberfield",fieldLabel:"再次输入",anchor:"100%",name:"password1",inputType:"password"}]}]});ECoin.win.on("close",function(){window.location="private_index.aspx"});ECoin.win.show();ECoin.win.on("close",function(){ECoin.win=null})};ECoin.showRegOk=function(a){ECoin.redir("恭喜","恭喜！您已注册成功！","private_index.aspx",10)};ECoin.showExchangeOk=function(a){ECoin.win=new Ext.Window({title:"通知消息",width:425,height:190,bodyCfg:{cls:"msg_main1"},border:true,modal:true,plain:true,closable:false,resizable:false,items:[{buttonAlign:"center",xtype:"form",labelWidth:130,labelAlign:"left",layout:"form",unstyled:true,headerAsText:false,border:false,labelAlign:"right",buttons:[{text:"确认",handler:function(){var c=ECoin.win.items.itemAt(0).getForm();var d=c.getFieldValues(false);var b="";c.items.each(function(g,e,f){if((g.getValue().length>0)&&(e!=0)){b+=g.label.dom.innerHTML+g.getValue()+"\n"}});c.submit({params:{id:a.exch_id,data:b},url:"act_exchextra.aspx",success:function(e,f){if(f.result.success==true){location.href="private_index.aspx"}else{alert("提交失败。")}},failure:function(e,f){alert("提交失败。")}})}},{text:"取消",score:this,handler:function(){ECoin.win.close()}}],items:[{xtype:"displayfield",hideLabel:true,labelSeperator:"",value:"恭喜您，兑换成功!",style:"color: #FFFFFF;font-size:14px;font-weight:bold;"},{xtype:"textfield",fieldLabel:"请输入要充入的QQ号",name:"qq",anchor:"100%",hideLabel:(a.prize_type!=1)?true:false,hidden:(a.prize_type!=1)?true:false},{xtype:"textfield",fieldLabel:"请输入接受短信的号码",anchor:"100%",name:"mobile",hideLabel:(a.prize_type!=2)?true:false,hidden:(a.prize_type!=2)?true:false},{xtype:"textfield",fieldLabel:"联系地址",anchor:"100%",name:"address",hideLabel:(a.prize_type!=3)?true:false,hidden:(a.prize_type!=3)?true:false},{xtype:"textfield",fieldLabel:"邮编",anchor:"100%",name:"zip",vtype:"integer",hideMode:"offset",hideLabel:(a.prize_type!=3)?true:false,hidden:(a.prize_type!=3)?true:false},{xtype:"textfield",fieldLabel:"联系电话",anchor:"100%",name:"phone",vtype:"phone",hideLabel:(a.prize_type!=3)?true:false,hidden:(a.prize_type!=3)?true:false}]}]});ECoin.win.on("close",function(){window.location="private_index.aspx"});ECoin.win.show()};ECoin.showGameEgg=function(a){return;ECoin.win=new Ext.Window({title:"砸蛋游戏",width:470,height:420,modal:true,resizable:false,layout:"fit",items:[{xtype:"flash",width:450,height:350,url:"main2.swf?order="+a}],buttons:[{text:"关闭",scope:this,handler:function(){ECoin.win.close()}}]});ECoin.win.show();ECoin.win.on("close",function(){ECoin.win=null})};