我的游戏更新

master
chenxiaojun 5 years ago
parent d29984aaeb
commit 0e192a2f75

@ -1557,4 +1557,18 @@ class ApplyController extends BaseController
$this->ajaxReturn(array("status" => 0, "msg" => "添加成功"));
}
public function getEnableStatus()
{
$applyId = I('post.apply_id');
if (empty($applyId)) {
$this->ajaxReturn(['status' => 0, 'msg' => '数据异常']);
}
$map['id'] = $applyId;
$enableStatus = M('Apply', 'tab_')->where($map)->getField('enable_status');
$this->ajaxReturn(['status' => 1, 'data' => $enableStatus]);
}
}

@ -257,9 +257,9 @@
<span class="add-game" game-id="{$vo.id}" promote-type="3" style="cursor: pointer;margin-right: 10px;"><u>添加推广员游戏</u></span>
</if>
<?php $downloadUrl = get_apply_dow_url($vo['id'],$vo['promote_id']);?>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($downloadUrl)),'logo'=>$qrcode])}" data-url="{$downloadUrl}" data-status="{$vo.enable_status}" style="cursor: pointer;margin-right: 10px;"><u>复制下载链接</u></span>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($downloadUrl)),'logo'=>$qrcode])}" data-url="{$downloadUrl}" data-apply-id="{$vo.applyid}" style="cursor: pointer;margin-right: 10px;"><u>复制下载链接</u></span>
<?php $flooringPageUrl = 'http://'.C('APPLY_DOWN_DOMAIN').U('Home/promitionofregestion',array('gid'=>$vo['id'],'pid'=>$vo['promote_id']));?>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($flooringPageUrl)),'logo'=>$qrcode])}" data-url="{$flooringPageUrl}" data-status="{$vo.enable_status}" style="cursor: pointer;margin-right: 10px;"><u>落地页链接</u></span>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($flooringPageUrl)),'logo'=>$qrcode])}" data-url="{$flooringPageUrl}" data-apply-id="{$vo.applyid}" style="cursor: pointer;margin-right: 10px;"><u>落地页链接</u></span>
<span class="down-game-btn" data-id="{$vo.id}" style="cursor: pointer;margin-right: 10px;color: #999"><u>下架</u></span>
</div>
</div>
@ -974,40 +974,58 @@
$('.game-link').on('click', function () {
var url = $(this).attr('data-url');
var qrcode = $(this).attr('data-qrcode');
var enableStatus = parseInt($(this).attr('data-status'));
if (enableStatus != 1) {
var iconIndex = 7;
var enableStatusName = '';
switch (enableStatus) {
case 0:
enableStatusName = '未打包';
break;
case 2:
case 3:
enableStatusName = '打包中';
break;
case -1:
iconIndex = 5;
enableStatusName = '打包失败';
break;
}
var applyId = parseInt($(this).attr('data-apply-id'));
layer.alert(enableStatusName, {icon: iconIndex});
return false;
}
$.ajax({
type: "post",
url: "__URL__/getEnableStatus",
dataType: "json",
data: {'apply_id': applyId},
success: function (data) {
console.log(data);
if (data.status == 0) {
layer.msg(data.msg, {icon: 5});
return false;
}
// $('#download_copy').attr('data-url',url);
$('#game_link_ercode').attr('src',qrcode);
$('#game_link_address').text(url);
$('#game_link_address_copy').text(url);
$('#game_link').show();
$('.game-window-bg').show();
var enableStatus = parseInt(data.data);
if (enableStatus == 1) {
// $('#download_copy').attr('data-url',url);
$('#game_link_ercode').attr('src',qrcode);
$('#game_link_address').text(url);
$('#game_link_address_copy').text(url);
$('#game_link').show();
$('.game-window-bg').show();
var e = document.getElementById("game_link_address_copy");
e.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
} else {
var iconIndex = 7;
var enableStatusName = '';
switch (enableStatus) {
case 0:
enableStatusName = '未打包';
break;
case 2:
case 3:
enableStatusName = '打包中';
break;
case -1:
iconIndex = 5;
enableStatusName = '打包失败';
break;
}
var e = document.getElementById("game_link_address_copy");
e.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
layer.alert(enableStatusName, {icon: iconIndex});
return false;
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
// $("#download_copy").zclip({

Loading…
Cancel
Save