落地页更新

master
chenxiaojun 5 years ago
parent 797fd18bf2
commit 1c6297f5a8

@ -142,12 +142,18 @@ class HomeController extends Controller
{
$gameId = I('get.gid');
$promoteId = I('get.pid');
$status = I('get.status');
if (empty($gameId) || empty($promoteId)) {
$this->error('链接丢失');
}
$downLink = get_apply_dow_url($gameId, $promoteId);
if ($status == 1) {
$downLink = 'itms-services://?action=download-manifest&url=' . 'https://' . C('APPLY_DOWN_DOMAIN') . M('Apply', 'tab_')->where(array('promote_id'=>$promoteId,'game_id'=>$gameId))->getField('original_url');
} else {
$downLink = get_apply_dow_url($gameId, $promoteId);
}
$this->assign('downLink', $downLink);
$this->display();
}

@ -120,6 +120,8 @@
setTimeout(function () {
var url = "{$downLink}";
console.log(url);
return false;
window.location.href = url;
}, 500);
}

@ -64,6 +64,66 @@
margin-top: 21px;
width: 100%;
}
.register-box-max {
width: 80%;
height: 40%;
top: 30%;
left: 10%;
position: fixed;
z-index: 10;
background-color: #fff;
border-radius: 10px;
}
.register-bg {
width: 100%;
height: inherit;
position: fixed;
background-color: #0a0a0a;
opacity: 0.5;
}
.register-title-box {
padding: 10px 10px;
margin-top: 10px;
text-align: center;
font-size: 1.2rem;
}
.register-title-box span {
font-weight: 600;
}
.register-input-box {
text-align: center;
font-size: 1rem;
}
.register-input-box input {
width: calc(80% - 5px);
height: 2rem;
padding-left: 5px;
margin-top: 10px;
margin-bottom: 10px;
border: 1px solid #6f6f6f;
border-radius: 3px;
}
.register-btn-box {
margin-top: 40px;
text-align: center;
}
.register-btn-box button {
width: 80%;
height: 2.5rem;
border: 0;
border-radius: 5px;
background-color: #1993ff;
color: #fff;
font-size: 1.1rem;
}
</style>
</head>
@ -73,6 +133,20 @@
<input type="hidden" name="desc" value="{$data[0]['features']}">
<div class="bn-rule" style="display: none;"><img id="rule-img" src=""></div>
<!--<div class="register-box-max">-->
<!-- <div class="register-title-box">-->
<!-- <span>注册</span>-->
<!-- </div>-->
<!-- <div class="register-input-box">-->
<!-- <input value="" placeholder="账号">-->
<!-- <input value="" placeholder="密码">-->
<!-- </div>-->
<!-- <div class="register-btn-box">-->
<!-- <button>注册</button>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="register-bg"></div>-->
<div class="h_wrap">
<notempty name="data[0]['flooring_page_imgs']">
<div id="data-1" style="display: none;">
@ -116,7 +190,6 @@
</div>
</notempty>
<div class="h_title_box ta_c p_t_15">
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/ios9/js/layer/layer.js?VerNo=20190923" type="text/javascript"></script>
@ -136,6 +209,17 @@
}
} else {
if (is_ios()) {
if (!Boolean(navigator.userAgent.match(/OS [1][3]_[1][_\d]* like Mac OS X/i)) && !parseInt("{:I('get.status')}")) {
if (!parseInt("{:I('get.status')}")) {
layer.confirm('请先到官网注册',{title:''} , function () {
location.href = "/mobile.php?s=/User/login/pid/" + "{:I('get.pid')}" + "/gid/" + "{:I('get.gid')}" + ".html";
});
return false;
} else {
location.href = "{:U('iosDown',array('gid'=>$gameId,'pid'=>I('get.pid'),'status'=>1))}";
}
}
location.href = "{:U('iosDown',array('gid'=>$gameId,'pid'=>I('get.pid')))}";
} else {
var downLink = $(this).attr('down-link');

@ -32,7 +32,6 @@ class UserController extends BaseController {
/*是否开启Ucenter*/
if( C('UC_OPEN')==1 ){
$username = $account;
//Ucenter登录
@ -142,13 +141,57 @@ class UserController extends BaseController {
}
}
$res = $this->suser->login($account,$password);file_put_contents(dirname(__FILE__) . '/login_res_text.txt',json_encode([$res]));
if($res > 0) {
$data=array(
'status' => 1,
'msg' => '登录成功',
);
$promoteId = I('post.promote_id');
$promoteId = intval($promoteId);
if ($promoteId > 0) {
$wherePromote['id'] = $promoteId;
$promoteData = M('Promote','tab_')->field('id,account')->where($wherePromote)->find();
if (!empty($promoteData)) {
$whereUser['account'] = $account;
$whereUser['_logic'] = 'or';
$whereUser['mobile_phone'] = $account;
$userData = M('User', 'tab_')->where($whereUser)->find();
if (!empty($userData)) {
if (empty($userData['promote_id'])) {
$saveData['promote_id'] = $promoteId;
$saveData['promote_account'] = $promoteData['account'];
$saveRes = M('User', 'tab_')->where(array('id'=>$userData['id']))->save($saveData);
if ($saveRes) {
$data = array(
'status' => 2,
'msg' => '登录成功!绑定成功',
);
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
);
}
}
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
);
}
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
);
}
} else {
$data=array(
'status' => 1,
'msg' => '登录成功',
);
}
} else {
switch($res) {
case -1000: $error = '账号不存在'; break;
@ -190,9 +233,18 @@ class UserController extends BaseController {
if (empty($password)) {
echo json_encode(array('status'=>0,'msg'=>'请输入密码'));exit;
}
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1);
$promoteId = I('post.promote_id');
$promoteId = intval($promoteId);
if ($promoteId > 0) {
$gameId = intval(I('post.game_id'));
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1,'promote_id' => $promoteId, 'game_id' => $gameId);
} else {
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1);
}
session('safeinfo',$safeinfo);
$url = U('register');
echo json_encode(array('status'=>1,'msg'=>$url));
} else{
$this->display();
@ -275,11 +327,19 @@ class UserController extends BaseController {
$pid = $this->suser->register($phone,$password,$phone,$register_way,$register_type,'','',$sex,$nickname,$head_img);
}
if($pid > 0){
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
if (empty($safeinfo['promote_id'])) {
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
} else {
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('User/login', array('pid' => $safeinfo['promote_id'], 'gid' => $safeinfo['game_id'])),
);
}
session('safeinfo',null);
} else{
$data = array(
@ -369,14 +429,28 @@ class UserController extends BaseController {
if($is_setting){
echo json_encode(array('status'=>0,'msg'=>'账号已存在'));exit;
}
$pid = $this->suser->register($account,$password,'',$register_way,$register_type,'','',$sex,$nickname,$head_img);
if($pid > 0){
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
$promoteId = I('post.promote_id');
$promoteId = intval($promoteId);
if ($promoteId > 0) {
$gameId = intval(I('post.game_id'));
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('User/login', array('pid' => $promoteId, 'gid' => $gameId)),
);
} else {
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
}
} else{
$data = array(
'status' => $pid,

@ -68,7 +68,13 @@
<input type="button" class="submit" value="登录">
</div>
<div class="link-group clearfix">
<?php if (empty(I('get.pid'))) {?>
<a href="{:U('User/step1')}" class="register-btn">账号注册 <font class="line">|</font> </a><a href="{:U('User/step')}" class="register-btn">&nbsp;手机注册</a>
<?php } else {?>
<a href="<?='mobile.php?s=/User/step1/pid/'.I('get.pid').'/gid/'.I('get.gid').'.html'?>" class="register-btn">账号注册 <font class="line">|</font> </a>
<a href="<?='mobile.php?s=/User/step/pid/'.I('get.pid').'/gid/'.I('get.gid').'.html'?>" class="register-btn">&nbsp;手机注册</a>
<?php }?>
<a href="{:U('User/forget')}" class="forget-btn" style="color: #333">忘记密码</a>
</div>
</form>
@ -149,15 +155,17 @@
$('.submit').click(function(event) {
var mobile = $.trim($('#mobile').val());
var password = $.trim($('#password').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if (mobile) {
if (password) {
$.ajax({
type:'POST',
url:'{:U("login")}',
data:{'phone':mobile,'password':password},
data:{'phone':mobile,'password':password,'promote_id':promoteId,'game_id':gameId},
dataType:"Json",
success:function(data){
if(data.status == 1){
if(data.status == 1 || data.status == 2){
var username = lwx.getItem('username');
if(username) {
@ -173,13 +181,18 @@
pmsg.msg(data.msg);
var url = $.trim($('#login_form').attr('data-url'));
setTimeout(function(){
if (url) {
window.location.href = url;
} else {
window.location.href = "{:U('index')}";
}
},1500);
setTimeout(function(){
if (data.status == 2) {
window.location.href = 'http://' + "{:C('APPLY_DOWN_DOMAIN')}" + "/index.php?s=/Home/Home/promitionofregestion/gid/" + gameId + "/pid/" + promoteId + "/status/" + "1" + ".html";
} else {
if (url) {
window.location.href = url;
} else {
window.location.href = "{:U('index')}";
}
}
},1500);
}else{
pmsg.msg(data.msg);
return false;

@ -84,6 +84,8 @@
var mobile = $.trim($('#nickname').val());
var code = $.trim($('#password').val());
var sex = $.trim($('input[name=sex]:checked').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if(mobile.length == 0 ){
pmsg.msg('昵称不能为空');event.preventDefault();
return false;
@ -105,7 +107,7 @@
$.ajax({
type:'POST',
url:'{:U("User/step")}',
data:{'nickname':mobile,'password':code,'sex':sex},
data:{'nickname':mobile,'password':code,'sex':sex,'promote_id':promoteId,'game_id':gameId},
dataType:"Json",
success:function(data){
console.log(data);

@ -90,6 +90,9 @@
var nickname = $.trim($('#nickname').val())
var password = $.trim($('#password').val());
var sex = $.trim($('input[name=sex]:checked').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if(account.length == 0 ){
pmsg.msg('账号不能为空');event.preventDefault();
return false;
@ -119,7 +122,7 @@
$.ajax({
type:'POST',
url:'{:U("User/step1")}',
data:{'account':account,'nickname':nickname,'password':password,'sex':sex},
data:{'account':account,'nickname':nickname,'password':password,'sex':sex,'promote_id':promoteId,'game_id':gameId},
dataType:"Json",
success:function(data){
pmsg.msg(data.msg);

Loading…
Cancel
Save