|
|
|
@ -311,39 +311,18 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="game-window-box" id="game_link">
|
|
|
|
|
<div class="game-window-title">
|
|
|
|
|
<p style="width: calc(80% - 20px)">复制结果</p>
|
|
|
|
|
<p class="add-game-close" style="width: calc(20% - 20px);text-align: right;"><i class="iconfont iconguanbi"></i></p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="game-window-content" style="text-align: center;width: auto;padding-bottom: 0px;">
|
|
|
|
|
<div class="game-window-content-eveyone" style="display: block;color: #3A97FF;font-size: 1.1rem;">
|
|
|
|
|
<label style="margin-right: 20px;">下载地址:</label>
|
|
|
|
|
<span id="game_link_address" style="word-wrap: break-word;white-space: normal;"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="game-window-content" style="text-align: center;width: auto;padding-top: 5px;">
|
|
|
|
|
<div class="game-window-content-eveyone" style="display: block;color: #999;font-size: 1.1rem;">
|
|
|
|
|
<span id="copy_msg">复制成功,ctrl+v粘贴即可</span>
|
|
|
|
|
<button class="clipboard-btn" id="clipboard-btn" style="display: none;" data-text="">复制</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="game-window-content" style="text-align: center;width: auto;padding-bottom: 5px;">
|
|
|
|
|
<div id="game_link_ercode" class="game-window-content-eveyone" style="display: block;color: #999;font-size: 1.1rem;">
|
|
|
|
|
<!-- <img id="game_link_ercode" style="width: 200px;height: 200px;"> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="game-window-bg"></div>
|
|
|
|
|
|
|
|
|
|
<div class="game-window-content" style="text-align: center;width: auto;padding-top: 5px;">
|
|
|
|
|
<div class="game-window-content-eveyone" style="display: block;color: #999;font-size: 1.1rem;">
|
|
|
|
|
<span>下载地址二维码</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="game-link-box" class="layer-box" style="display: none;">
|
|
|
|
|
<span class="game-link-title" style="font-size: 87.5%; color: #212529; font-weight: 700;"></span>
|
|
|
|
|
<span id="game_link_address" style="font-size: 87.5%; color: #212529; word-wrap: break-word;white-space: normal;"></span>
|
|
|
|
|
<p class="work-mark"style="font-size: 12px; text-align: center; margin-bottom: 30px; margin-top: 5px">复制成功,ctrl+v粘贴即可</p>
|
|
|
|
|
<button class="clipboard-btn" id="clipboard-btn" style="display: none;">复制</button>
|
|
|
|
|
<div id="game_link_ercode" class="game-window-content-eveyone" style="text-align:center;">
|
|
|
|
|
</div>
|
|
|
|
|
<p class="game-link-qrcode-mark" class="work-mark"style="font-size: 12px; text-align: center;"></p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="game-window-bg"></div>
|
|
|
|
|
|
|
|
|
|
<div id="apply-child-box" class="layer-box" style="display: none;">
|
|
|
|
|
<form method="post" enctype="multipart/form-data">
|
|
|
|
@ -378,7 +357,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</block>
|
|
|
|
|
<block name="script">
|
|
|
|
|
<script src="__STATIC__/zeroclipboard/jquery.zclip.min.js"></script>
|
|
|
|
|
<script src="__STATIC__/clipboard.min.js"></script>
|
|
|
|
|
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
|
|
|
|
|
<script src="__STATIC__/clipboard.min.js"></script>
|
|
|
|
|
<script type="text/javascript" src="__JS__/jquery.qrcode.min.js"></script>
|
|
|
|
@ -498,6 +477,22 @@
|
|
|
|
|
$('.game-window-bg').hide();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var clipboard = new ClipboardJS('#clipboard-btn', {
|
|
|
|
|
text: function(trigger) {
|
|
|
|
|
return trigger.getAttribute('data-text');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
clipboard.on('success', function (e) {
|
|
|
|
|
$('#copy_msg').text('复制成功,ctrl+v粘贴即可');
|
|
|
|
|
$('#clipboard-btn').hide();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
clipboard.on('error', function (e) {
|
|
|
|
|
$('#copy_msg').text('自动复制失败,请点击复制按钮');
|
|
|
|
|
$('#clipboard-btn').show();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
highlight_subnav('{:U($curUri)}');
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -577,7 +572,7 @@
|
|
|
|
|
if (response.status == 1) {
|
|
|
|
|
var logo = getGameLogo(obj)
|
|
|
|
|
drawQrcode(response.data.url, logo)
|
|
|
|
|
showLinkDialog(response.data.url)
|
|
|
|
|
showLinkDialog(response.data.url, type)
|
|
|
|
|
} else {
|
|
|
|
|
layer.alert(response.message, {icon: 7});
|
|
|
|
|
}
|
|
|
|
@ -591,15 +586,13 @@
|
|
|
|
|
function isImg(src) {
|
|
|
|
|
var img = new Image();
|
|
|
|
|
img.src = src;
|
|
|
|
|
if (img.width > 0 || img.height > 0) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getGameLogo(obj) {
|
|
|
|
|
var logo = null;
|
|
|
|
|
var logoSrc = $(obj).parents('.game-li').eq(0).find('.img-box').children('img').attr('src');
|
|
|
|
|
console.log(isImg(logoSrc))
|
|
|
|
|
if (isImg(logoSrc)) {
|
|
|
|
|
logo = $(obj).parents('.game-li').eq(0).find('.img-box').children('img')[0]
|
|
|
|
|
} else {
|
|
|
|
@ -641,18 +634,37 @@
|
|
|
|
|
label: 'jQuery.qrcode',
|
|
|
|
|
fontname: 'Ubuntu',
|
|
|
|
|
fontcolor: '#ff9818',
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
$('#game_link_ercode').empty().qrcode(options);
|
|
|
|
|
$("#game_link_ercode canvas")[0].getContext('2d').drawImage(logo, (qrcodeWidth - logoWidth) / 2, (qrcodeHeight - logoHeight) / 2, logoWidth, logoHeight);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showLinkDialog(url) {
|
|
|
|
|
function showLinkDialog(url, type) {
|
|
|
|
|
$('#clipboard-btn').attr('data-text', url)
|
|
|
|
|
$('#clipboard-btn').click()
|
|
|
|
|
|
|
|
|
|
$('#game_link_address').text(url);
|
|
|
|
|
var typeName = ''
|
|
|
|
|
if (type == 'landing-page') {
|
|
|
|
|
typeName = '落地页链接'
|
|
|
|
|
} else {
|
|
|
|
|
typeName = '下载链接'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var box = $('#game-link-box')
|
|
|
|
|
$('#game_link_address').text(url)
|
|
|
|
|
box.find('.game-link-title').html(typeName + ':')
|
|
|
|
|
box.find('.game-link-qrcode-mark').html(typeName + '二维码')
|
|
|
|
|
layer.open({
|
|
|
|
|
title: typeName,
|
|
|
|
|
type: 1,
|
|
|
|
|
content: box,
|
|
|
|
|
area: ['400px', '450px'],
|
|
|
|
|
zIndex: 250,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
/* $('#game_link_address').text(url);
|
|
|
|
|
$('#game_link').show();
|
|
|
|
|
$('.game-window-bg').show();
|
|
|
|
|
$('.game-window-bg').show(); */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function batchApplyGame(gameId, promoteIds, successCallback) {
|
|
|
|
@ -676,13 +688,13 @@
|
|
|
|
|
var games = response.data.games;
|
|
|
|
|
var html = '<option value="">请选择游戏</option>';
|
|
|
|
|
if (games.length > 0) {
|
|
|
|
|
$.each(promotes, function (index, item) {
|
|
|
|
|
$.each(games, function (index, item) {
|
|
|
|
|
var selected = ''
|
|
|
|
|
if (curGameId == item.id) {
|
|
|
|
|
selected = 'selected'
|
|
|
|
|
}
|
|
|
|
|
html += '<option value="' + item.id + '" title="' + item.name + '"' + selected + '>';
|
|
|
|
|
html += promoteTitle;
|
|
|
|
|
html += item.name;
|
|
|
|
|
html += '</option>';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|