You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
6.7 KiB
HTML

<extend name="Public/bases" />
<block name="css">
<link href="__CSS__/{:C('DEFAULT_THEME')}/game.css" rel="stylesheet" >
</block>
<block name="body">
<div class="trunk-box detail">
<div class="bg"><span class="table font"><span class="table-cell">----游戏</span></span><notempty name="data.game_bg_img"><img src="{:get_cover($data['game_bg_img'],'path')}"></notempty></div>
<div class="wrap">
<div class="content">
<div class="tab clearfix">
<a href="{:U('Game/detail',array('account'=>I('account'),'name'=>I('name'),'source'=>I('source')))}" class="tab-item">游戏专区</a>
<a href="{:U('Game/open',array('account'=>I('account'),'name'=>I('name'),'source'=>I('source')))}" class="tab-item">开服信息</a>
<a href="javascript:;" class="tab-item active">礼包信息</a>
</div>
<div class="panal">
<div class="base clearfix game-base">
<div class="item ">
<div class="pic"><span class="font table"><span class="table-cell">----游戏</span></span><img src="{:get_cover($data['game_icon'],'path')}"></div>
<div class="but clearfix">
<div class="qrcode-area">
<img src="{:U('Base/qrcode',array('url'=>base64_encode(base64_encode($data['download']))))}">
<p>扫一扫快速下载</p>
</div>
<div class="butn-area">
<notempty name="data.download1">
<a href="{$data.download1}" class="butn download-butn download-and"><img src="__IMG__/icon_android.png"><span>安卓下载</span></a>
<else />
<a href="javascript:;" class="butn download-butn download-and disabled"><img src="__IMG__/icon_android.png"><span>安卓下载</span></a>
</notempty>
<notempty name="data.download2">
<a href="{$data.download2}" class="butn download-butn download-ios"><img src="__IMG__/icon_ios.png"><span>苹果下载</span></a>
<else />
<a href="javascript:;" class="butn download-butn download-ios disabled"><img src="__IMG__/icon_ios.png"><span>苹果下载</span></a>
</notempty>
<notempty name="data.pc_url">
<a href="{$data.pc_url}" target="_blank" class="butn qq-butn">玩家Q群</a>
<else />
<a href="javascript:;" target="_blank" class="butn qq-butn disabled">玩家Q群</a>
</notempty>
</div>
</div>
<div class="txt">
<h3 class="name">{:str_replace(array('(安卓版)','(苹果版)'),'',$data['game_name'])}</h3>
<div class="info">
<span class="table">
<span class="table-row">
<span class="table-cell">状态:{$data.open_type}</span>
<span class="table-cell">类型:{:get_game_type_by_id($data['game_type_id'])}</span>
</span>
<span class="table-row">
<span class="table-cell">下载:{$data.download_number}</span>
<span class="table-cell">版本:{$data.version}</span></span>
</span>
</div>
</div>
</div>
</div>
<div class="gift-list">
<div class="gift-list-content">
<notempty name="lists">
<ul class="clearfix">
<volist name="lists" id="vo" mod="4">
<li class="<eq name='mod' value='0'>first</eq>">
<div class="item">
<h5><a href="{:U('Gift/detail',array('id'=>$vo['id'],'account'=>I('account')))}" class="name">[{$vo.game_name}]{$vo.gift_name}</a></h5>
<p class="">礼包内容:<if condition="mb_strwidth($vo['gift_content'],'utf-8') gt 50">{:mb_strimwidth($vo['gift_content'],0,50,'...','utf-8')}<else />{$vo.gift_content}</if></p>
<div class="suplus">剩余:<span><notempty name="vo.novice">{:count(explode(',',$vo['novice']))}<else />0</notempty></span>
<eq name="vo.giftbag_version" value="1"><img src="__IMG__/icon_package_android.png" class="and"></eq>
<eq name="vo.giftbag_version" value="2"><img src="__IMG__/icon_package_ios.png" class="ios"></eq>
</div>
<gt name='vo.recordid' value='0'>
<a href="javascript:;" class="butn jsgetgift disabled">已领取</a>
<else />
<a href="javascript:;" data-id="{$vo.id}" class="butn jsgetgift">领取</a>
</gt>
</div>
</li>
</volist>
</ul>
<else />
<div class="empty" style="min-height:auto;height:400px;">
<span class="table">
<span class="table-cell">
<img src="__IMG__/empty_icon_list2.png" class="empty-icon">
<p class="empty-text">无数据</p>
</span>
</span>
</div>
</notempty>
</div>
<div class="pagenation">{$_page}</div>
</div>
</div>
</div>
</div>
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script>
function Copy(str,that,index){
var save = function(e){
e.clipboardData.setData('text/plain', str);
e.preventDefault();
}
document.addEventListener('copy', save);
document.execCommand('copy');
document.removeEventListener('copy',save);
that.text('复制成功');
setTimeout(function(){layer.close(index);layer.msg('复制成功');},1500);
}
$(function() {
$('.jsgetgift').on('click',function() {
var that=$(this),id=$.trim(that.attr('data-id')),text = $.trim(that.text());
if (id>0) {
if (that.hasClass('disabled')) {return false;}
that.addClass('disabled').text('领取中');
$.ajax({
type:'post',
dataType:'json',
url:'{:U("Gift/getgift")}',
data:{id:id},
success:function(data) {
switch(parseInt(data.status)) {
case 1:
case 2:
case 3:{
that.text('已领取');
var title = parseInt(data.status)==2?'你已成功领取过':'领取成功!';
layer.open({
type: 1,
closeBtn: '1',
title: false,
skin: 'layer-lwx-style', //加上边框
area: ['262px', '133px'], //宽高
content: '<div class="layer-lwx-notice"><h4 class="layer-lwx-title">'+title+'</h4><p class="layer-lwx-novice"><span>激活码:</span><span class="novice-txt">'+data.info+'</span></p><div class="layer-lwx-butn"><a href="javascript:;" class="butn copy">复制激活码</a></div></div>',
success:function(layero, index){
$('.copy').click(function() {
// //移动端复制
$(".copy").text('复制');
Copy($('.novice-txt').text(),$(this),index);
return false;
});
}
});
};break;
case 4:{
that.text('已领完');
layer.msg(data.info);
};break;
default:{layer.msg(data.info);
that.removeClass('disabled').text(text);}
}
},error:function() {
layer.msg('服务器故障,请稍候再试...');
that.removeClass('disabled').text(text);
}
});
}
return false;
});
});
</script>
</block>