master
ELF 5 years ago
parent 71e736b27d
commit dba4fb4e6e

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

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

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

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

Loading…
Cancel
Save