<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta content="telephone=no" name="format-detection">
    <meta name="wap-font-scale" content="no">
    <title>設置Paypal提現</title>
     <link rel="stylesheet" href="https://app.ixiulive.com/static/css/reset.css">
    <link rel="stylesheet" href="../../../layer-v3.1.0/layer/theme/default/layer.css">
    <link rel="stylesheet" href="css/indexLi.css?v=202004071813">
    <link rel="stylesheet" href="../../../css/background.css" />
    <script type="text/javascript" src="../../../lib/fsize.js"></script>
    <style>
        .layui-layer-setwin .layui-layer-close2{
            display: none !important;
        }
        .layui-layer-page .layui-layer-content{
            border-radius: 0.4rem !important;
        }
        .yourclass2{
            border-radius: 0.4rem !important;
        }
        .paypal-false-btn{
        	background:  #E62E74;
        }
        .paypal-tips{
        	color:#999;
        }
      
				.paypal-mall-tips{
					color:#F65755;
				}
				.paypal-layer .paypal-layer-content :nth-child(2),.paypal-layer .paypal-layer-btnBox :nth-child(1){
					color:#007AFF;
				}
				.mask5{
						position: relative;
						width: 7.2rem;
						background: #F7F7F7;
						font-size: 0;
						border-radius: 0.213rem;
						-webkit-border-radius: 0.213rem;
						-moz-border-radius: 0.213rem;
						-ms-border-radius: 0.213rem;
						-o-border-radius: 0.213rem;
					}
					.mask5Title{
						padding: 1.173rem 0 1.053rem;
						width: 100%;
						text-align: center;
						font-size: 0.346rem;
						color:#000;
					}
					.mask5Btn{
						position: relative;
						width: 100%;
						text-align: center;
						height: 1.16rem;
						line-height: 1.16rem;
						border-top: 1px solid #DDD;
						font-size: 0.453rem;
						color:#007AFF;
						font-weight: bold;
					}
    </style>
</head>
<body>
<div style="height: 1rem;"></div>
<div class="paypal-box">
    <div class="paypal-input"><img class="mall" src="img/mall2.png" alt="">
        <input class="paypal-input-inp" type="text" placeholder="">
				<img class="clearInput" src="img/clear.png">
    </div>
    <p class="paypal-mall-tips paypal-mall-tips-Cn">請輸入正確的郵箱</p>
    <p class="paypal-mall-tips paypal-mall-tips-En">Please enter your vaild email</p>
</div>
<div class="paypal-false-btn L-Cn">完成</div>
<div class="paypal-false-btn L-En">Done</div>
<p class="paypal-tips L-Cn">沒有 PayPal 賬號,<a href="https://www.paypal.com/ "><span style="color: #00A0E9;">去註冊&gt</span></a></p>
<p class="paypal-tips L-En">No PayPal account,<a href="https://www.paypal.com/ "><span style="color: #00A0E9;">go to register&gt</span></a></p>
<!--<a class="L-Cn" href="../../help/registeredHelp.html"><p style="width: 10rem;text-align: center;font-size: 0.35rem;color: #333;margin-top: 4rem;  text-decoration: underline;">paypal註冊流程</p></a>
<a class="L-En" href="../../help/registeredHelp.html"><p style="width: 10rem;text-align: center;font-size: 0.35rem;color: #333;margin-top: 4rem;  text-decoration: underline;">Paypal registration process</p></a>-->
<div class="paypal-layer">
    <div class="paypal-layer-content">
        <p><span class="lang-show"></span></p>
        <p class="paypal-check">paypal:--</p>
    </div>
    <div class="paypal-layer-btnBox">
        <div class="paypal-layer-no "><span class="lang-show"></span></div>
        <div class="paypal-layer-yes "><span class="lang-show"></span></div>
    </div>
</div>

<!--提現設置成功彈窗-->
	<div class="mask mask5 hide">
		<p class="mask5Title"></p>
		<div class="mask5Btn"></div>
	</div>
</body>
<script src="../../../lib/jquery-3.1.1.min.js"></script>
<script src="../../../layer-v3.1.0/layer/layer.js"></script>
<script src="../../../lib/globalizationJq.js"></script>
<script>
	
       //$ip = "http://ceshi.yabolive.tv/web";
    $ip = "https://webserver.yabolive.net";
        if(sessionStorage.lang==1 || sessionStorage.lang == 7){
            $("title").text("Set up Paypal withdrawal")
            $('.paypal-input-inp').attr('placeholder','Please enter your Paypal account');
            $(".wx-true-p2").css("width","9rem")
            $(".wx-true-p2").css("margin-left","auto")
            $(".wx-true-p2").css("margin-right","auto")
            $(".paypal-input input").attr("placeholder","Please enter amount")
            $(".paypal-layer-content p").eq(0).css("margin-top","0.5rem");
            $(".paypal-layer").css("height","5.6rem")
            $(".paypal-layer .paypal-layer-content").css("height","4.4rem")

            var langJSON={
                "langList":[
                    {"text":"The Paypal withdrawal account can only be set once and cannot be changed once submitted. Are you sure to set the following withdrawal account?"},
                    {"text":"Cancel"},
                    {"text":"Sure"},
                ]
            }
            var newLang = {
            		'draw15':'Got it', 
								'draw16':'Withdrawal method set successfully',
								}
        } else {
            $("title").text("設置Paypal提現")
            $('.paypal-input-inp').attr('placeholder','請填寫您的Paypal郵箱');
            var langJSON={
                "langList":[
                    {"text":"Paypal提現賬號僅能設置一次,一旦提交無法更改。確定設置以下提現賬號?"},
                    {"text":"取消"},
                    {"text":"確定"},
                ]
            }
            var newLang = {
            		'draw15':'知道了', 
								'draw16':'提現已設置成功',
							}
        }
        for(var i=0;i<langJSON.langList.length;i++){
            $(".lang-show").eq(i).text(langJSON.langList[i].text);
        }
				$('.mask5Btn').html(newLang.draw15);
				$('.mask5Title').html(newLang.draw16);
				
				$('.mask5Btn').on('click',function(){
					layer.closeAll();
				})
        //呼唤分享
        try{
            var obj2 = {
                "cid": 9,
                "reqCode": new Date().getTime(),
                "data": {
                    msg: '是否分享或帮助',
                    shareType: 0,
                    helpType: 1,
                    drawType:0
                }
            }
            var obj = JSON.stringify(obj2);
            localStorage.help='paypal'
            appCollaboration(obj)

        }
        catch(err){
            console.log(err)
        }
        //  $ip = "https://webserver.yabolive.net";
        $(".paypal-input-inp").on("input", function () {
//        var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
            var reg=/^([a-z0-9A-Z_]+[-|\.]?)+[a-z0-9A-Z_]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-zA-Z]{2,}$/;
            if(!reg.test($(".paypal-input-inp").val()))
            {
                if(sessionStorage.lang==1||sessionStorage.lang == 7)   $(".paypal-mall-tips-En").show()
                else $(".paypal-mall-tips-Cn").show()
                $('.clearInput').hide();
                $(".paypal-btn-ok").unbind("click");
                $(".paypal-false-btn").removeClass("paypal-btn-ok")

                return false;
            }else{
            		$('.clearInput').show();
                $(".paypal-mall-tips").hide()
                $(".paypal-false-btn").addClass("paypal-btn-ok")
                $(".paypal-btn-ok").unbind("click");
                $(".paypal-btn-ok").on("click", function () {
                   if($(".paypal-input-inp").val()==0)return;
 										$('.paypal-check').text('paypal: '+$(".paypal-input-inp").val())
                    if(sessionStorage.lang==1||sessionStorage.lang == 7){
                        setTimeout(function(){
                        	layer.open({
                            type: 1,
                            title: false,
                            shadeClose: false,
                            skin: 'yourclass2',
                            area : ['7.2rem','5.6rem'],
                            content:$(".paypal-layer"),
                        });
                        },500)
                    }else{
                       setTimeout(function(){
                       	 layer.open({
                            type: 1,
                            title: false,
                            shadeClose: false,
                            skin: 'yourclass2',
                            area : ['7.2rem','4.6rem'],
                            content:$(".paypal-layer"),
                        });
                       },500)
                    }
                })
            }
        })
				
        $(".paypal-layer-no").on("click", function () {
            layer.closeAll()
        })
        $(".paypal-layer-yes").on("click", function () {
            $.ajax({
                url:$ip+'/withdraw/paypalbinding.html',
                type:"post",
                data:{
                    os: "WEB",
                    cid: "web_gw",
                    lang: 2,
                    uid:  sessionStorage.bbb,
                    token:  sessionStorage.kkk,
                    cardaddr:$(".paypal-input-inp").val()
                },
                success: function (msg) {
                    var data=JSON.parse(msg);
                    console.log(data);
                    if(data.code==1){
                    	layer.closeAll();
                       layer.open({
													type: 1,
													title: false,
													shadeClose: true,
													shade: .4,
													area: ['7.2rem', ''],
													closeBtn: 0,
													content: $('.mask5'),
													end: function() {
														window.location.href="http://yazhai://_closeweb";
													}
												})
                       
                    }else if(data.code=-70007){
                        if(sessionStorage.lang==1||sessionStorage.lang==7)layer.msg("The paypal account has been bound, please re-enter a new one")
                        else layer.msg("該郵箱已經被綁定過,請重新輸入")
                        setTimeout(function () {
                            layer.closeAll()
                        },2000)
                        $(".paypal-input-inp").val("");
                        $(".paypal-btn-ok").unbind("click");
                        $(".paypal-false-btn").removeClass("paypal-btn-ok")
                    }else{
                        layer.msg(data.msg);
                    }
                }
            })
        })
        
        $('.clearInput').on('click',function(){
        	$('.paypal-input-inp').val('');
        })
</script>
</html>