修改落地页二维码图标问题

master
ELF 5 years ago
parent 09223cb99c
commit d2826e7bf0

@ -199,7 +199,7 @@
<li class="game-li" data-game-id="{$game.id}"> <li class="game-li" data-game-id="{$game.id}">
<div class="media"> <div class="media">
<div class="img-box" style="cursor: pointer;"> <div class="img-box" style="cursor: pointer;">
<img src="__ROOT__{$game.icon|get_cover='path'}" /> <img src="__ROOT__{$game.icon|get_cover='path'}" onerror="javascript:this.src='__IMG__/game_icon.png';"/>
</div> </div>
<div class="game-msg" style="width: calc(92% - 90px);"> <div class="game-msg" style="width: calc(92% - 90px);">
<h5 class="game-title"> <h5 class="game-title">
@ -594,7 +594,7 @@
function isImg(src) { function isImg(src) {
var img = new Image(); var img = new Image();
img.src = src; img.src = src;
if (img.fileSize > 0) { if (img.width > 0 && img.height>0) {
return true return true
} }
return false return false
@ -602,7 +602,7 @@
function getGameLogo(obj) { function getGameLogo(obj) {
var logo = null; var logo = null;
var logoSrc = $(obj).parents('.game-li').eq(0).find('.img-box').children('img').attr('src'); var logoSrc = $(obj).parents('.game-li').eq(0).find('.img-box').children('img').attr('src')
if (isImg(logoSrc)) { if (isImg(logoSrc)) {
logo = $(obj).parents('.game-li').eq(0).find('.img-box').children('img')[0] logo = $(obj).parents('.game-li').eq(0).find('.img-box').children('img')[0]
} else { } else {

Loading…
Cancel
Save