<!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">
		<script src="../lib/fsize.js"></script>
		<script src="../lib/jquery-3.1.1.min.js"></script>
		<title></title>
		<link rel="stylesheet" href="../css/iosSelect.css">
		<link rel="stylesheet" href="../css/base.css">
		<link rel="stylesheet" href="../css/fireflyPay.css?v='20191120'">
		<style>
			.glyphicon {
				background: url(../img/right.png)no-repeat;
				background-size: 100% 100%;
				display: inline-block;
				width: 0.6rem;
				height: 0.6rem;
				margin-top: 0.4rem;
			}
			
			.big-zuan-box {
				background: url("../img/zuan-boxMeet.png")no-repeat;
				background-size: 100% 100%;
				position: relative;
				display: none;
				width: 8.187rem;
				height: 3.307rem;
				margin: 0 auto .666rem;
				overflow: hidden;
			}
			
			.big-money {
				width: 100%;
				text-align: center;
				font-size: 0.667rem;
				color: #00f3d7;
				height: 1.2rem;
				line-height: 1.2rem;
				font-weight: bold;
				position: absolute;
				left: 0;
				top: .8rem;
			}
			
			.big-money img {
				width: 1.2rem;
				height: 1.2rem;
				vertical-align: middle;
				margin-top: -.25rem;
			}
			
			.L-En .g-credit-En {
				width: 5rem !important;
			}
			
			.L-En .g-Point-En {
				width: 4.4rem !important;
			}
			
			.L-En .g-member-En {
				width: 5.5rem !important;
			}
			
			.L-En .g-phone-En {
				width: 5.8rem !important;
			}
			
			.p-w {
				background: #11101A;
				padding-top: .707rem;
			}
			
			.apple-ul li {
				background: #11101A;
				margin-bottom: 0;
			}
			
			
			.apple-ul li.visapay img {
				width: auto;
				height: .7rem;
			}
			
			.apple-ul li.alipay img {
				width: 2.6rem;
			}
			
			.apple-ul li.molpay img{
				width: 2.3rem;
			}
			.apple-ul li.gash-Point img,
			.apple-ul li.gash-member img,
			.apple-ul li.gash-credit img,
			.apple-ul li.gash-phone img {
				width: 3.3rem;
			}
			.apple-ul li.gash-credit img{
				width: 3.6rem;
			}
			 .apple-ul li.gash-phone img{
			 	width: 3.8rem;
			 }
			.apple-ul li.payatm img{
				width: 2.786rem;
			}
			.apple-ul li.gopay img{
				width: 4.106rem;
			}
			.apple-ul li.alfama img{
				width: 3.5rem;
			}
			.apple-ul li.paywallet img{
				width: 6rem;
			}
			.apple-ul li.gash-Point img.en {
				width: 4.4rem !important;
			}
			
			.apple-ul li.gash-member img.en {
				width: 5.5rem !important;
			}
			
			.apple-ul li.gash-credit img.en {
				width: 5rem !important;
			}
			
			.apple-ul li.gash-phone img.en {
				width: 5.8rem !important;
			}
			
			.apple-ul li.weipay img.en {
				width: 3.5rem;
			}
			.userInfo {
				position: absolute;
				left: 0;
				width: 50%;
				top: 2.4rem;
				height: .733rem;
				line-height: .733rem;
				font-size: 0;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			
			.userInfo img {
				width: .533rem;
				height: .533rem;
				vertical-align: middle;
				margin-top: -.25rem;
				margin-left: .373rem;
				border-radius: 50%;
				-webkit-border-radius: 50%;
				-moz-border-radius: 50%;
			}
			
			.userInfo span {
				font-size: .3rem;
				color: #CCC;
				display: inline-block;
			}
			
			.userInfo .userName {
				color: #FFF;
				margin: 0 0.066133rem;
			}
			
			.siteInfo {
				position: absolute;
				right: .373rem;
				width: 3.8rem;
				top: 2.4rem;
				height: .733rem;
				line-height: .733rem;
				font-size: 0;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				text-align: right;
				font-size: 0.32rem;
				color: #FFF;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			
			.siteInfo img {
				width: 0.213rem;
				height: 0.266rem;
				vertical-align: middle;
				margin-right: 0.066rem;
			}
			.ios-select-widget-box header.iosselect-header{
				    background-color: #FFF;
			}
			.ios-select-widget-box header.iosselect-header a{
				color:#007aff;
			}
			.bigRecord{
				color: #999999;
		    font-size: 0.32rem;
		    position: absolute;
		    right: .3rem;
		    top: .2rem;
			}
			.visapay{
				display: none;
			}
		</style>
	</head>

	<body>
		<div class="p-w">
			<div class='big-zuan-box'>
				<p class="big-money"><img src="../img/big-zuan.png" alt="">--</p>
				<div class="userInfo"></div>
				<div class="siteInfo"></div>
				<span class="bigRecord"></span>
			</div>
			<ul class="apple-ul"></ul>
		</div>

	</body>
	<script src="../lib/iosSelect.js"></script>
	<script src="../lib/payLangchange.js"></script>
	<script src="../lib/phonepay.js?v=201908061106"></script>
	<script>
		$('title').text(langList[langType].paytitle);
		$('.bigRecord').text(langList[langType].payrecord);
	   var bbb = location.href;
	    var data = url_get_params(bbb)
	    sessionStorage.token = data.token;//k
	//    if(sessionStorage.kkk!='undefined')sessionStorage.uid = data.uid;
	//    //t
	//    sessionStorage.kkk = data.token;//k
	    sessionStorage.appversion=data.appversion;
	    function url_get_params(url_path) {
	        var url = url_path;
	        var theRequest = new Object();
	        if (url.indexOf("?") != -1) {
	            var str = url.substr(url.indexOf("?") + 1);
	            strs = str.split("&");
	            for (var i = 0; i < strs.length; i++) {
	                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
	            }
	        }
	        return theRequest;
	    }
	    var url=window.location.href;
	    //   var strst = 'http://yabolive.com/archive/recharge.html?uid=1564864&pkg=ios.yabolive&version=100&lang=2';
	    //   console.log(url.split('uid=')[1].split('&')[0]);
	    var reg = /uid=([0-9]+)/;
	    try{
	        sessionStorage.uid=url.match(reg)[1];
	        sessionStorage.bbb=url.match(reg)[1];
	    }catch(error){
	
	    }
		//获取当前用户地区

		if(sessionStorage.appversion != 'undefined') {
			$(".big-zuan-box").show();
			$.ajax({
				url: $ip + '/user/getUserInfo.html',
				type: "post",
				data: {
					os: "WEB",
					cid: "web_gw",
					lang: sessionStorage.lang,
					uid: sessionStorage.uid,
					token: sessionStorage.token
				},
				success: function(msg) {
					var data = JSON.parse(msg)

					$(".big-money").html('<img src="../img/big-zuan.png" alt="">' + data.data.diamond);
					var str = '';
					str += '<img src="' + cdn + data.data.faceimg + '?x-oss-process=image/resize,w_81"/>';
					str += '<span class="userName">' + data.data.nickName + '</span>';
					str += '<span>(' + data.data.uid + ')</span>';
					$('.userInfo').html(str);
				}
			})
			$(".big-zuan-box span").on("click", function() {
				window.location.href = '../Nesting/recording/money.html';
			})
			getRegion();
		} else {
			getLangRegion('OTHER');
		}
		
		function getRegion(){
			$.ajax({
				type: "POST",
				url: $ip + "/setting/getCountryTranslation.html",
				async: true,
				data: {
					os: "WEB",
					cid: "web_gw",
					lang: sessionStorage.lang,
					uid: sessionStorage.uid,
					token: sessionStorage.token
				},
				success: function(data) {
					var res = JSON.parse(data);
					var code = '';
					$('.siteInfo').html('<img src="../img/site.png"/>' + res.countryName).attr('data-id',res.countryCode);
					if(res.countryCode == 'TW' || res.countryCode == 'MY' || res.countryCode == 'ID') {
						code = res.countryCode
					} else {
						code = 'OTHER';
					}
					getLangRegion(code)
	
				}
			});
		}
		function goPayDetail() {
			$(".gash-Point").on("click", function() {
				sessionStorage.pay = "GASHP99PAY";
				if(sessionStorage.uid != undefined) window.location.href = "gash-for.html";
				else window.location.href = "login.html";
				sessionStorage.select = 'COPGAM02';
			})
			$(".gash-member").on("click", function() {
				sessionStorage.pay = "GASHP99PAY";
				if(sessionStorage.uid != undefined) window.location.href = "gash-for.html";
				else window.location.href = "login.html";
				sessionStorage.select = 'COPGAM09';
			})
			$(".gash-credit").on("click", function() {
				sessionStorage.pay = "GASHP99PAY";
				if(sessionStorage.uid != undefined) window.location.href = "gash-for.html";
				else window.location.href = "login.html";
				sessionStorage.select = 'BNK82201';
			})
			$(".gash-phone").on("click", function() {
				sessionStorage.pay = "GASHP99PAY";
				window.location.href = "gash-phone.html";
				//        sessionStorage.select='gashPhone';
			})

			$(".Paypal").on("click", function() {
				sessionStorage.pay = "PAYPALPAY";
				if(sessionStorage.uid != undefined) window.location.href = 'payfor.html';
				else window.location.href = "login.html";

			})
			$(".alipay").on("click", function() {
				sessionStorage.pay = "ALIPAY";
				if(sessionStorage.uid != undefined) window.location.href = "payfor-new.html";
				else window.location.href = 'login.html';
			})
			$(".weipay").on("click", function() {
				sessionStorage.pay = "WECHATPAY";
				if(sessionStorage.uid != undefined) window.location.href = 'http://web.yazhaiyabo.com/wechatpay/payfor-new.html?uid='+sessionStorage.uid+'&token='+sessionStorage.token+'&lang='+sessionStorage.lang+'&pay='+sessionStorage.pay;
				else window.location.href = 'login.html';
			})
			$(".molpay").on("click", function() {
				sessionStorage.pay = "MOLPAY";
				if(sessionStorage.uid != undefined) window.location.href = "molpay.html";
				else window.location.href = 'login.html';
			})

			//visa信用卡储值
			$('.visapay').on('click', function() {
				sessionStorage.pay = "ASIABILLPAY";
				if(sessionStorage.uid != undefined) {
					window.location.href = 'http://www.firefly.live/appPhonePay/phonepay/visapay.html?uid=' + sessionStorage.uid + '&token=' + sessionStorage.token + '&lang=' + sessionStorage.lang + '&pay=' + sessionStorage.pay;
				} else {
					window.location.href = 'login.html';
				}
			})
			//payatm
			$('.payatm').on('click',function(){
				sessionStorage.pay = 'CODAPAY_PAYATM';
				sessionStorage.payType = '220';
				if(sessionStorage.uid!=undefined) window.location.href = 'idpay.html';
				else window.location.href = 'login.html'
			})
			//gopay
			$('.gopay').on('click',function(){
				sessionStorage.pay = 'CODAPAY_GOPAY';
				sessionStorage.payType = '227';
				if(sessionStorage.uid!=undefined) window.location.href = 'idpay.html';
				else window.location.href = 'login.html'
			})
			//alfama
			$('.alfama').on('click',function(){
				sessionStorage.pay = 'CODAPAY_ALFAMA';
				sessionStorage.payType = '221';
				if(sessionStorage.uid!=undefined) window.location.href = 'idpay.html';
				else window.location.href = 'login.html'
			})
			//paywallet
			$('.paywallet').on('click',function(){
				sessionStorage.pay = 'CODAPAY_PAYWALLET';
				sessionStorage.payType = '223';
				if(sessionStorage.uid!=undefined) window.location.href = 'idpay.html';
				else window.location.href = 'login.html'
			})
		}

		function getLangRegion(code) {
			var langStr = '';
			for(var i = 0; i < payOrder[code].length; i++) {
				langStr += '<li class="' + payList[payOrder[code][i]].name + '">';
				langStr += '	<img src="' + payList[payOrder[code][i]].img + '" alt="">';
				langStr += '	<span class="glyphicon"></span>';
				langStr += '</li>';
			}
			$('.apple-ul').html(langStr);
			goPayDetail();
			if(langType != 0) {
				$('.weipay img,.gash-Point img,.gash-member img,.gash-credit img,.gash-phone img').addClass('en');
			}
		}
		selectCountry()
		function selectCountry(){
			var showDom = document.querySelector('.siteInfo');// 绑定一个触发元素
			showDom.addEventListener('click', function () {  // 添加监听事件
			    var val = showDom.dataset['id'];             // 获取元素的data-id属性值
			    var title = showDom.dataset['value'];        // 获取元素的data-value属性值
			  // 实例化组件
			    var example = new IosSelect(1,               // 第一个参数为级联层级,演示为1
			        [[{'id': 'TW', 'value': '台灣'},{'id':'CN','value':'中国'},{'id': 'MY', 'value': 'Malaysia'},{'id':'ID','value':'Indonisia'},{'id':'VN','value':'Việt nam'},{'id':'OTHER','value':'其他'}]],                             // 演示数据
			        {
			            container: '.container',             // 容器class
			            itemHeight: 40,                      // 每个元素的高度
			            itemShowCount: 5,                    // 每一列显示元素个数,超出将隐藏
			            oneLevelId: val,                     // 第一级默认值
			            callback: function (selectOneObj) {  // 用户确认选择后的回调函数
			                
			                showDom.innerHTML = '<img src="../img/site.png"/>'+selectOneObj.value;
			                showDom.dataset['id'] = selectOneObj.id;
			                showDom.dataset['value'] = selectOneObj.value;
			                var countryCode = selectOneObj.id;
			                if(selectOneObj.id == 'CN' || selectOneObj.id == 'VN'){
			                	countryCode = 'OTHER'
			                }
			                getLangRegion(countryCode);
			            }
			    });
			});
		}
	</script>

</html>