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.

223 lines
9.0 KiB
HTML

<extend name="Public/bases" />
<block name="css">
<link href="__CSS__/{:C('DEFAULT_THEME')}/gift.css" rel="stylesheet" >
</block>
<block name="body">
<div class="trunk-box detail">
<div class="wrap clearfix">
<div class="mainer">
<div class="location"><span>当前位置:</span><a href="{:U('Gift/index',array('account'=>I('account')))}" class="location-item">礼包</a><img class="location-mark" src="__IMG__/location-mark.png"><a href="javascript:;" class="location-item last">礼包详情</a></div>
<div class="mainer-content">
<div class="base clearfix">
<div class="item clearfix">
<div class="pic"><span class="font table"><span class="table-cell">----游戏</span></span><notempty name="data.game_icon"><img src="{:get_cover($data['game_icon'],'path')}"></notempty></div>
<div class="but clearfix">
<span class="table">
<span class="table-cell">
<gt name='data.recordid' value='0'>
<a href="javascript:;" class="butn jsgetgift disabled">已领取</a>
<else />
<a href="javascript:;" data-id="{$data.id}" class="butn jsgetgift">立即领取</a>
</gt>
</span>
</span>
</div>
<div class="txt">
<h3 class="name">[{:str_replace(array('(安卓版)','(苹果版)'),'',$data['game_name'])}]{$data.gift_name}</h3>
<div class="info">
<span class="surplus" style="margin-right: 0px;">剩余:<i><notempty name="data.novice">{:count(explode(',',$data['novice']))}<else />0</notempty></i></span>
<eq name="data.giftbag_version" value="1"><img src="__IMG__/icon_package_android.png" class="and"></eq>
<eq name="data.giftbag_version" value="2"><img src="__IMG__/icon_package_ios.png" class="ios"></eq>
<span class="time">有效期:{$data.start_time|date='Y-m-d',###} 至 {$data.end_time|date='Y-m-d',###}</span>
</div>
<div class="download-area">
<a href="{$data.download1}" class="butn download-butn download-and"><img src="__IMG__/icon_android.png"><span>安卓下载</span></a>
<a href="{$data.download2}" class="butn download-butn download-and"><img src="__IMG__/icon_ios.png"><span>苹果下载</span></a>
</div>
</div>
</div>
</div>
<div class="description">
<div class="description-title">礼包内容</div>
<div class="description-content">
{$data.gift_content}
</div>
</div>
<div class="useway">
<div class="useway-title">使用方法</div>
<div class="useway-content">
{$data.get_way}
</div>
</div>
<notempty name="relevant">
<div class="relevant">
<div class="relevant-title">相关礼包</div>
<div class="relevant-content">
<ul class="clearfix">
<volist name="relevant" id="vo" mod="3">
<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>
</div>
</div>
</notempty>
</div>
</div>
<div class="side">
<div class="recommon">
<div class="list-title"><i></i><span>推荐礼包</span></div>
<div class="recommon-content">
<ul>
<gift:giftrecommon name="vo" recommon="1" limit="6">
<li>
<div class="item clearfix">
<div class="pic">
<span class="font table"><span class="table-cell">----游戏</span></span>
<notempty name="vo.game_icon"><img src="{:get_cover($vo['game_icon'],'path')}" class="icon"></notempty>
</div>
<div class="txt">
<a href="{:U('Gift/detail',array('id'=>$vo['id'],'account'=>I('account')))}" class="name">[{:str_replace(array('(安卓版)','(苹果版)'),'',$vo['game_name'])}]{$vo.gift_name}</a>
<p class="surplus">剩余:<i><notempty name="vo.novice">{:count(explode(',',$vo['novice']))}<else />0</notempty></i><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></p>
<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>
</div>
</li>
</gift:giftrecommon>
</ul>
</div>
</div>
<div class="hot">
<div class="list-title"><i></i><span>热门礼包</span></div>
<div class="hot-content">
<ul>
<gift:giftrecommon name="vo" recommon="2" limit="6">
<li>
<div class="item clearfix">
<div class="pic">
<span class="font table"><span class="table-cell">----游戏</span></span>
<notempty name="vo.game_icon"><img src="{:get_cover($vo['game_icon'],'path')}" class="icon"></notempty>
</div>
<div class="txt">
<a href="{:U('Gift/detail',array('id'=>$vo['id'],'account'=>I('account')))}" class="name">[{:str_replace(array('(安卓版)','(苹果版)'),'',$vo['game_name'])}]{$vo.gift_name}</a>
<p class="surplus">剩余:<i><notempty name="vo.novice">{:count(explode(',',$vo['novice']))}<else />0</notempty></i><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></p>
<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>
</div>
</li>
</gift:giftrecommon>
</ul>
</div>
</div>
</div>
</div>
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<empty name="data">
<script>layer.msg('未查到此礼包数据');setTimeout(function(){window.location.href="{:U('Gift/index',array('account'=>I('account')))}";},1500);</script>
</empty>
<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>