master
ELF 5 years ago
parent 71e736b27d
commit dba4fb4e6e

@ -19,7 +19,7 @@
<link rel="stylesheet" type="text/css" href="__CSS__/giftbag.css">
<title>{$game['relation_game_name']}</title>
</head>
<body onclick="checkSafari()">
<body class="dialog-open" onclick="checkSafari()">
<style>
.layui-layer-btn0 {
font-size: 18px;
@ -1449,9 +1449,7 @@ var PhoneObj = {
var giftbags = []
$(".giftBag_mode").click(function(){
$(this).hide()
document.body.style.overflow = 'auto';
document.html.style.overflow = 'auto';
$(".home").style.overflow = 'auto';
document.body.classList.remove('dialog-open');
});
$(".giftBag").click(function(){
@ -1486,9 +1484,16 @@ var PhoneObj = {
if (giftbags[key].get_status == 1) {
$('.giftSecond .getGift-box').find('.get-novice').html('已领取')
$('.giftSecond .getGift-box').find('.get-novice').addClass('has-get')
$('.giftSecond .getGift-box').find('.novice-value').html(giftbags[key].novice)
$(".getGift-activation").show();
$(".getGift-second").css({"height" : "1.26rem"});
$(".getGift-secondInfo").css({"height" : "1.93rem"})
} else {
$('.giftSecond .getGift-box').find('.get-novice').html('领取')
$('.giftSecond .getGift-box').find('.get-novice').removeClass('has-get')
$(".getGift-activation").hide();
$(".getGift-second").css({"height" : "0.86rem"});
$(".getGift-secondInfo").css({"height" : "2.33rem"})
}
$('.giftSecond .getGift-box').find('.get-novice').attr('data-gift-id', giftbags[key].id)
$('.giftSecond .getGift-box').find('.giftbag-name').html(giftbags[key].giftbag_name)
@ -1528,7 +1533,8 @@ var PhoneObj = {
var novice = getNovice(giftId)
if (novice !== '') {
$('.giftSecond .getGift-box').find('.novice-value').html(novice)
$(this).addClass('.has-get')
$(this).addClass('has-get')
$(this).html('已领取')
$(".getGift-activation").show();
$(".getGift-second").css({"height" : "1.26rem"});
$(".getGift-secondInfo").css({"height" : "1.93rem"})

@ -282,7 +282,7 @@ class GiftController extends BaseController {
$conditions = [];
$conditions['user_id'] = $logininfo['user_id'];
$conditions['gift_id'] = ['in', array_column($lists, 'id')];
$existRecords = M("gift_record",'tab_')->field(['id', 'gift_id'])->where($conditions)->select();
$existRecords = M("gift_record",'tab_')->field(['id', 'gift_id', 'novice'])->where($conditions)->select();
$existRecords = index_by_column('gift_id', $existRecords);
}
@ -290,8 +290,10 @@ class GiftController extends BaseController {
foreach ($lists as $key => $val){
$novices = str2arr($val['novice'],',');
$noviceNum = count(array_filter($novices));
$novice = '';
if (isset($existRecords[$val['id']])) {
$getStatus = 1;
$novice = $existRecords[$val['id']]['novice'];
} else {
$getStatus = 0;
}
@ -300,6 +302,7 @@ class GiftController extends BaseController {
$records[$key]['giftbag_name'] = $val['giftbag_name'];
$records[$key]['digest'] = $val['digest'];
$records[$key]['get_status'] = $getStatus;
$records[$key]['novice'] = $novice;
$records[$key]['novice_num'] = $noviceNum;
$records[$key]['game_icon'] = get_cover($val['icon'],'path');
$records[$key]['game_name'] = $val['giftbag_name'];

@ -1,5 +1,6 @@
html,body{
overflow: hidden;
body.dialog-open {
position: fixed;
width: 100%;
}
.mode{
position: fixed;

@ -2,7 +2,6 @@
.home{
width: 100%;
font-family:PingFang SC;
overflow: hidden;
}
.home-box{
padding: 0.5rem 0.37rem 0 0.31rem;

Loading…
Cancel
Save