下面为html代码
<div class="caption">
<h4>[!--title--][!--gift_name--]</h4>
<p>消耗<span>10鱼丸</span></p>
<p>剩余:<span class="progress"><i class="in" style="width: 79.8%;"></i></span><span>[!--gift_sy--]</span></p>
<p>有效期:<span>[!--gift_data--]</span></p>
</div>
<div class="media-right cl">
<a id="btn" href="#" class="btn" value="1_1">领取</a>
</div>
</div>
<p>礼包详情:[!--gift_nr--]</p>
</li>
<input type="hidden" id="packageid" value="">
</div>
<!--礼包弹窗 start -->
<div class="cover"></div>
<div class="dialog" id="dialog-succeed">
<h4>领取礼包</h4>
<span id="package"></span>
<input type="hidden" id="packageno" value="">
<p>温馨提示:本礼包请在3小时内使用,过期收回。</p>
<div class="btn-groups">
<button type="button" id="subno">返回</button>
<button type="button" id="sub">复制</button>
</div>
</div>
<!--礼包弹窗 end -->
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
以下为js代码
<script type="text/javascript">
//领取的时候怎么处理type
$('.btn').click(function () {
$('.btn').click(function () {
function cover_screen1() {
var body_h = $(window).height();
$(".cover").css("height", body_h).show();
};
cover_screen1();
var gameid = $(this).attr('value');
var gameid1 = gameid.split("_");
$('#packageid').val($(this).attr('value'));
$.post('/gift/gift_lq.php', {'gameid': gameid1[1], 'package_type_id': gameid1[0]},
function (response) {
if (response.status != 'ok') {
if (response.status == 'errdeng') {
location.href = '/e/member/login/';
$(".cover").hide();
return;
}
alert(response.info);
$(".cover").hide();
return;
} else {
$('.dialog').show();
$('#packageno').val(response.info);
$('#package').html(response.data);
$('#package').val(response.data);
}
}, 'json');
;
})
$('#sub').click(function () {
alert('请长按复制');
})
$('#subno').click(function () {
$(this).parents('.dialog').hide();
$(".cover").hide();
$('.dialog').hide();
})
</script>
<script type="text/javascript">$(function(){
$('#icon_friends').click(function(){
LGY.showSharePage("0", "http://m.leguyu.com/index.php/game/gift/");
});
});
</script>