<?php if (!defined('ROOT')) exit; ?>
<!DOCTYPE html>
<html>

	<head>
		<title>网盘</title>
		<meta name="description" content="">
		<meta name="keywords" content="">
		<?php
			include 'Inc_files_mobile.php';
		?>
		<style type="text/css">
		body,.mui-content{ background:#fff; color: #666; line-height: 2em;}
		a{ color: #666;}
		#row1{ line-height: 0;}
		
		#row2{ padding: 0 10px;}
		#row2 .title{ font-weight: 700;}
		
		#row3,#row4{display: none; padding: 10px; margin: 10px auto; border: 1px solid #eee; border-left: none; border-right: none;}
		#row3 .mui-radio{ padding-top: 3px;}
		#row3 .pay_way_c1{ width: 100px; padding-top: 3px;}
		
		#row5{ margin: 10px auto; line-height: 0;}
		
		#row6{ margin: 10px auto 20px;}
		#row6 dt{font-weight: 700;}
		#row6 dt span{ color: #999; font-size: 14px;}
		
		#row7{ line-height: 1.5em;font-size: 14px;}
		</style>
	</head>
	<body>
		<div class="mui-content">
		    <div id="row1" ng-bind-html="advert_10|html"></div>
		    <ul id="row2">
		    	<li class="title"><?php echo $info['name'];?></li>
		    	<li>资源大小：<?php echo $info['size'];?></li>
				<li>购买价格：￥<?php echo $info['price'] ;?></li>
				<li>下载量：<?php echo $info['donwload_num'] ;?>次</li>
				<li>更新时间：<?php echo wd_date('Y-m-d', $info['ctime']) ;?></li>
				<li>
					<?php if($info['price']>0){?>
					<button type="button" class="mui-btn mui-btn-danger btn_tqmxz" data-url='<?php echo $info['downurl'];?>&attname=<?php echo $info['name'];?>'>提取码下载</button>
					<button type="button" class="mui-btn mui-btn-danger btn_goumai" >购买下载</button>
					<?php }else{?>
					<button type="button" class="mui-btn mui-btn-danger btn_down" data-url='<?php echo $info['downurl'];?>&attname=<?php echo $info['name'];?>'>电信下载</button>
					<button type="button" class="mui-btn mui-btn-danger btn_down" data-url='<?php echo $info['downurl'];?>&attname=<?php echo $info['name'];?>'>网通下载</button>
					<button type="button" class="mui-btn mui-btn-danger btn_down" data-url='<?php echo $info['downurl'];?>&attname=<?php echo $info['name'];?>'>普通下载</button>
					<?php }?>
				</li>
		    </ul>
		    <?php if($info['price']>0){?>
			    <div id="row3">
					<form action="/pay/file_alipay_wap" method="post" target="_blank">
						<input type="hidden" name="model_id" value="58" />
						<input type="hidden" name="ctime" value="<?php echo time();?>" />
						<input type="hidden" name="file_id" value="<?php echo $info['id'];?>" />
						<input type="hidden" name="uid" value="<?php echo $info['uid'];?>" />
						<input type="hidden" name="pk1" value="<?php echo $info['pk1'];?>" />
						<input type="hidden" name="pk2" value="<?php echo $info['pk2'];?>" />
						<input type="hidden" name="pk3" value="<?php echo $info['pk3'];?>" />
						<input type="hidden" name="pk4" value="<?php echo $info['pk4'];?>" />
						<ul>
							<li>
								<label>邮箱：<span class="cf00">*</span>成功付款后会将提取码发送到您的网盘</label>
								<input type="email"  class="input" required name="email" id="email" placeholder="请输入邮箱" />
							</li>
							<li>
								<label>手机：（手机接提取码会收取0.1元短信费）</label>
								<input type="tel"  class="input"  name="mobile" placeholder="请输入手机" />
							</li>
							<li class="pay_way" flex>
								<div class="pay_way_c1">支付方式：</div>
								<div flex-box='1' class="mui-radio mui-left">
									<label>支付宝</label>
									<input checked="checked" name="pay_way" value="alipay" type="radio">
								</div>
								<div flex-box='1' class="mui-radio mui-left">
									<label>微信</label>
									<input name="pay_way" value="wxpay" type="radio">
								</div>
							</li>
							<li>
								<button type="submit" class="mui-btn mui-btn-danger">确定购买</button>
							</li>
						</ul>
					</form>
				</div>
				<div id="row4" <?php if(I('showdown')==1){echo 'style="display:block;"';}?>> 
					<form  method="post" target="_blank">
						<input type="hidden" name="pk1" value="<?php echo $info['pk1'];?>" />
						<input type="hidden" name="pk2" value="<?php echo $info['pk2'];?>" />
						<input type="hidden" name="pk3" value="<?php echo $info['pk3'];?>" />
						<input type="hidden" name="pk4" value="<?php echo $info['pk4'];?>" />
						<ul>
							<li>
								<label>邮箱：<span class="cf00">*</span></label>
								<input type="email"  class="input" required name="email" id="email" placeholder="请输入邮箱" />
							</li>
							<li>
								<label>提取码：<span class="cf00">*</span></label>
								<input type="tel"  class="input" required  name="code" placeholder="" />
							</li>
							<li>
								<button type="submit" class="mui-btn mui-btn-danger btn_download_tqm">立即下载</button>
							</li>
						</ul>
					</form>
				</div>
			<?php }?>
			<div id="row5" ng-bind-html="advert_11|html"></div>
			<dl id="row6">
				<dt>赞助商广告<span>在这里投放广告，每天只要1元钱！</span></dt>
				<dd ng-repeat="v in advert_12" ng-bind-html="v.content|html"></dd>
			</dl>
			<div id="row7">
				106云盘 &copy;版权归属：扎兰屯市姝妍计算机服务有限公司 诉邮箱：
				<a href="mailto:tousu@69kz.com">tousu@69kz.com</a>
				<a href="tousu@69kz.com"></a> <br> ICP备案号：
				<a href="http://www.miitbeian.gov.cn/" target="_blank">蒙ICP备18000186号 </a> 
				网络文化许可：
				<a href="http://www.miitbeian.gov.cn/" target="_blank">申请中 </a> 
				ICP经营许可：
				<a href="http://www.miitbeian.gov.cn/" target="_blank">蒙20180007号</a>
				<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=15078302000155" target="_blank">
					公安备：蒙公网安备 15078302000155
				</a>
			</div>
		</div>
		<script src="/static/home/js/jquery.2.1.4.mui.3.7.0.angular.1.2.16.sonar.js" type="text/javascript"></script>
		<script type="text/javascript" src="/static/home/js/wap.1.0.0.js"></script>
		<script type="text/javascript">
			mui(document).on("tap", "a[href]", function() {
			    if(this.getAttribute("href") != "") {
			        location.href = this.getAttribute("href");
			    }
			});
			mui(document).on("tap",".btn_tqmxz",function () {
			    jQuery("#row3").hide(); 
			    jQuery("#row4").show();             
			});
			mui(document).on("tap",".btn_goumai",function () {
			    jQuery("#row3").show();   
			    jQuery("#row4").hide();           
			});
			mui(document).on("tap",".btn_down",function () {
			    var the=jQuery(this);
			    location.href=the.attr('data-url');          
			});
			function rand(n, m){
		        var random = Math.floor(Math.random()*(m-n+1)+n);
		        return random;
		    }
		    jQuery(document).ready(function($){ 
		        try{
		            var advert=<?php echo $list_advert;?>;
					var advert_10_length=advert[10].length-1;
					var advert_10_content=advert[10][rand(0,advert_10_length)].content; 
					scope.advert_10=advert_10_content;
					
					var advert_11_length=advert[11].length-1;
					var advert_11_content=advert[11][rand(0,advert_11_length)].content; 
					scope.advert_11=advert_11_content; 
					
					var advert_12=advert[12];  
					scope.advert_12=advert_12;
					scope.$apply();
					
		        }catch(e){}
		    });
			
			jQuery(document).on('click','.btn_download',function () {
				var the=jQuery(this);
			    jQuery.ajax({
		       		url:"/file/download",
					data:{
						pk1:'<?php echo $info['pk1'];?>',
						pk2:'<?php echo $info['pk2'];?>',
						pk3:'<?php echo $info['pk3'];?>',
						pk4:'<?php echo $info['pk4'];?>',
						donwload_num:'<?php echo $info['donwload_num'];?>',
					},
					dataType: "json",
					type: "post",
					timeout: 10000,
					success: function(data) {
						location.href=the.data('url');
					},
					error: function() {
					}
		       });         
			})
			
			jQuery(document).on('click','.btn_download_tqm',function () {
			    var the=jQuery(this);
			    jQuery.ajax({
			    	url:"/file/download",
			        data:the.closest('form').serializeArray(),
			        dataType: "json",
			        type: "post",
			        timeout: 10000,
			        success: function(data) {
			        	if (data.status==1) {
			        		the.closest('form')[0].reset();  
			        		location.href=data.url;
			        	}else{
			        		mui.toast(data.info);
			        	}
			        	
			        },
			        error: function() {
			        }
			    });       
			})
		</script>
	</body>
</html>