Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cof_vip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
houdong
cof_vip
Commits
fe69eef6
Commit
fe69eef6
authored
Nov 16, 2022
by
houdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更多大赛修改
parent
abd28958
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
568 additions
and
184 deletions
+568
-184
pktop.js
Public/Home/js/pktop.js
+6
-4
pk.js
Public/js/pk.js
+1
-1
config.php
app/Conf/config.php
+3
-1
IndexAction.class.php
app/Lib/Action/Vip/IndexAction.class.php
+103
-99
PkTopAction.class.php
app/Lib/Action/Vip/PkTopAction.class.php
+190
-9
NiuModel.class.php
app/Lib/Model/NiuModel.class.php
+121
-16
pop.html
app/Tpl/Vip/Index/pop.html
+1
-1
index.html
app/Tpl/Vip/PkTop/index.html
+44
-1
moreDs.html
app/Tpl/Vip/PkTop/moreDs.html
+30
-41
pop.html
app/Tpl/Vip/PkTop/pop.html
+69
-11
No files found.
Public/Home/js/pktop.js
View file @
fe69eef6
...
...
@@ -160,9 +160,11 @@ function sendSmsAndSubmit(){
$
(
".code-btn"
).
click
(
function
()
{
// alert($(".phone-input").val());
var
mobileNumber
=
$
(
".phone-input"
).
val
();
// var mobileNumber=$(".phone-input").val();
var
mobileNumber
=
$
(
this
).
parent
().
prev
().
find
(
'input'
).
val
();
if
(
mobileNumber
==
''
){
layer
.
open
({
content
:
'请输入手机号'
,
skin
:
'msg'
,
time
:
2
});
return
;}
var
reg
=
/^
(((
13
[
0-9
]{1})
|
(
14
[
0-9
]{1})
|
(
15
[
0-9
]{1})
|
(
16
[
0-9
]{1})
|
(
17
[
0-9
]{1})
|
(
18
[
0-9
]{1})
|
(
19
[
0-9
]{1}))
+
\d{8})
$/
;
// var reg = /^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|(19[0-9]{1}))+\d{8})$/ ;
var
reg
=
/^
((
1
[
2-9
]{1}[
0-9
]{1})
+
\d{8})
$/
;
if
(
!
reg
.
test
(
mobileNumber
)){
layer
.
open
({
content
:
'请输入有效的11位手机号码'
,
skin
:
'msg'
,
time
:
2
});
return
;}
$
(
this
).
attr
(
'disabled'
,
true
)
$
.
post
(
"/PkTop/sendMessage.html"
,{
mobile
:
mobileNumber
},
function
(
data
){
...
...
@@ -178,8 +180,8 @@ function sendSmsAndSubmit(){
});
//输入手机号后报名提交
$
(
".
form-info-btn
"
).
click
(
function
()
{
//输入手机号后报名提交
form-info-btn
$
(
".
bmStep2
"
).
click
(
function
()
{
if
(
$
(
".phone-input"
).
val
()
==
''
){
layer
.
open
({
content
:
'请输入手机号'
,
skin
:
'msg'
,
time
:
2
});
return
;}
if
(
$
(
".code-input"
)
==
''
){
layer
.
open
({
content
:
'请输入验证码'
,
skin
:
'msg'
,
time
:
2
});
return
;}
var
param
=
{
groupId
:
$
(
'#groupId'
).
val
(),
mobile
:
$
(
".phone-input"
).
val
(),
smsCode
:
$
(
".code-input"
).
val
(),
referer
:
$
(
'#referer'
).
val
(),
inviterId
:
$
(
'#inviterId'
).
val
()};
...
...
Public/js/pk.js
View file @
fe69eef6
...
...
@@ -52,7 +52,7 @@ function baoming(userId,wwwUrl){
}
function
submitBaoming
(
userType
,
tradeUrl
){
//form-info-btn
$
(
".bmSt
atus
2"
).
click
(
function
()
{
$
(
".bmSt
ep
2"
).
click
(
function
()
{
userType
=
$
(
'#userType'
).
val
();
//新用户需输入用户名密码
if
(
userType
==
0
){
...
...
app/Conf/config.php
View file @
fe69eef6
...
...
@@ -39,6 +39,7 @@ define('M2M_GROUP',24321);
define
(
'ZHONGJIN_GROUP'
,
24299
);
define
(
'NIU_STRONG_ID'
,
24323
);
define
(
'NIU_SAN_ID'
,
24326
);
return
array
(
...
...
@@ -215,7 +216,8 @@ return array(
24
=>
array
(
'type'
=>
''
,
'content'
=>
'叩富简投-短信验证登录,验证码为:\\1 提示:请勿泄露验证码'
),
30
=>
array
(
'type'
=>
''
,
'content'
=>
'验证码\\1,您正在报名叩富『全民炼股』争霸赛(2020赛季),请输入验证码完成报名。'
),
31
=>
array
(
'type'
=>
''
,
'content'
=>
'有人向您发起了PK挑战,胜者可获得66元挑战金,请登录叩富炒股查看挑战详情,挑战时间为下个自然周'
),
32
=>
array
(
'type'
=>
''
,
'content'
=>
'验证码\\1,您正在报名叩富『全民炼股』争霸赛(2021赛季),请输入验证码完成报名。'
)
// 32=>array('type'=>'','content'=>'验证码\\1,您正在报名叩富『全民炼股』争霸赛(2021赛季),请输入验证码完成报名。'),
32
=>
array
(
'type'
=>
''
,
'content'
=>
'验证码\\1,您正在报名叩富官方有奖赛,请输入验证码完成报名。'
)
)
...
...
app/Lib/Action/Vip/IndexAction.class.php
View file @
fe69eef6
This diff is collapsed.
Click to expand it.
app/Lib/Action/Vip/PkTopAction.class.php
View file @
fe69eef6
...
...
@@ -239,6 +239,7 @@ class PkTopAction extends IdentityAction{
//更多大赛
$gList
=
D
(
'Niu'
)
->
getMoreDs
(
$userId
);
$this
->
assign
(
'gList'
,
$gList
);
$this
->
assign
(
'gid'
,
$gid
);
$this
->
display
();
}
...
...
@@ -380,13 +381,13 @@ class PkTopAction extends IdentityAction{
// $this->ajaxReturn(array('status' => 0, 'info' => '对不起!手机验证码错误或已过期!'));
// }
$param
=
array
(
'mobile'
=>
$mobile
,
'code'
=>
$smsCode
,
'type'
=>
$code_type
)
;
$param
=
[
'mobile'
=>
$mobile
,
'code'
=>
$smsCode
,
'type'
=>
$code_type
]
;
if
(
D
(
'Sms'
)
->
checkCode
(
$param
)){
}
else
{
$this
->
ajaxReturn
(
array
(
'status'
=>
0
,
'info'
=>
'对不起!手机验证码错误或已过期!'
)
);
$this
->
ajaxReturn
(
[
'status'
=>
0
,
'info'
=>
'对不起!手机验证码错误或已过期!'
]
);
}
$ucUser
=
uc_get_user
(
array
(
'token'
=>
$mobile
)
);
$ucUser
=
uc_get_user
(
[
'token'
=>
$mobile
]
);
//没有该用户,开始注册,status0有该用户,111表示用户不存在
if
(
$ucUser
[
'status'
]
==
111
){
$ucData
=
$this
->
reg2020
(
$mobile
);
...
...
@@ -1171,12 +1172,192 @@ class PkTopAction extends IdentityAction{
return
1
;
}
//官方有奖赛列表页
// public function moreDs(){
// $userId=$this->user['userID'];
// $gList=D('Niu')->getMoreDs($userId);
// $this->assign('gList',$gList);
// $this->display();
public
function
bmOtherGroup
(){
$userId
=
$this
->
user
[
'userID'
];
$userName
=
$this
->
user
[
'userName'
];
$mobile
=
I
(
'mobile'
,
''
);
$smsCode
=
I
(
'smsCode'
,
''
);
$gid
=
I
(
'gid'
);
if
(
$gid
==
ZHONGJIN_GROUP
){
$this
->
joinZj
();
}
// if($gid==PRIZE_GROUP_2021){
// $return=D('Niu')->joinVip($loginInfo,$mobile,$smsCode,$gid);
// }
if
(
in_array
(
$gid
,[
M2M_GROUP
,
NIU_BAI_ID
,
NIU_SAN_ID
,
NIU_STRONG_ID
])){
$return
=
D
(
'Niu'
)
->
joinNiu
(
$mobile
,
$smsCode
,
$userId
,
$userName
,
$gid
);
$this
->
ajaxReturn
(
$return
);
}
// $this->ajaxReturn($res);
}
//加入大赛
public
function
joinZj
(
$gid
=
ZHONGJIN_GROUP
){
$code_type
=
38
;
$mfrom
=
I
(
'mfrom'
,
0
);
$userId
=
$this
->
user
[
'userID'
];
//报名大赛
$mobile
=
I
(
'mobile'
,
''
);
$smsCode
=
I
(
'smsCode'
,
''
);
$kaihuSource
=
I
(
'kaihuSource'
,
''
);
$kaihuSource
=
$kaihuSource
?
$kaihuSource
:
cookie
(
'kaihuSource'
);
$res
=
D
(
'Niu'
)
->
joinZjBefore
(
$mobile
,
$smsCode
,
$userId
);
if
(
$res
[
'status'
]
==
2
)
{
$this
->
ajaxReturn
([
'status'
=>
2
,
'info'
=>
$res
[
'info'
]]);
}
// $groupInfo=M('Group')->field('startTime,endTime')->where(['group_id'=>$gid])->find();
// $groupStatus=$this->getGroupStatus($groupInfo);
// if ($groupStatus==3) {
// $this->ajaxReturn(['status' => 0, 'info' => '大赛已经结束,不能报名!']);
// }
//
// if (!$smsCode) {
// $this->ajaxReturn(['status' => 0, 'info' => '请输入手机验证码!']);
// }
// if (CS('tel:'. $mobile . ':'.$code_type) != $smsCode) {
// $this->ajaxReturn(['status' => 0, 'info' => '对不起!手机验证码错误或已过期!']);
// }
//
// //如果该手机号的申请状态是未审核0和已通过1,应返回提示
// $oldData=M('Zhongjin')->where(['mobile'=>$mobile,'status'=>0])->count();
// if ($oldData) {
// $this->ajaxReturn(['status' => 0, 'info' => '您提交的信息正在审核中,请不要重复提交!']);
// }
// $oldData=M('Zhongjin')->where(['mobile'=>$mobile,'status'=>1])->count();
// if ($oldData) {
// $this->ajaxReturn(['status' => 0, 'info' => '该手机号已经开过户,不能重复报名!']);
// }
//已登录
// if($userId){
// $bmData=M('Zhongjin')->where(['mobile'=>$mobile,'status'=>['in',[0,1]]])->find();
// if(empty($bmData)){
// $uc = uc_get_user(['userId' => $userId,'type'=>3]);
//// var_dump($uc);exit;
// if($uc['status']==0&&!empty($uc['data'])){
// $ucData = $uc['data'];
// }
//
// M('Zhongjin')->add(['user_id'=>$userId,'user_name'=>$ucData['user_name'],'mobile'=>$mobile,
// 'nick'=>$ucData['nick'],'add_time'=>time(),'source'=>$kaihuSource]);
// $joinStatus=0;
// }else{
// $joinStatus=empty($bmData)?-1:$bmData['status'];
// }
// $debug='已登录用户';
// }else{
// $uc = uc_get_user(['token' => $mobile]);
// $ucData=$uc['data'];
// //没有该用户,开始注册,status0有该用户,111表示用户不存在
// if($uc['status']==111){
// $userName = randUsername($mobile);
// $password = substr(md5($userName), 18);
// $uc = uc_user_register(['userName' => $userName, 'password' => $password, 'ip' => get_client_ip(),
// 'mobile' => $mobile,'mobile_status' => 1,'sourse' =>'m']);
//
//
//// var_dump($uc);exit;
// //status0是注册成功
// if ($uc['status']) {
// $this->ajaxReturn(['status' => 0, 'info' => '注册失败!']);
// }
// //注册成功
// $ucData = $uc['data'];
// $userId=$ucData['user_id'];
//
// $info = ['user_id'=>$userId,'user_name'=>$userName,'mobile'=>$mobile,'mobile_status'=>1];
// $res = D('Userinfo')->_addUser($info);
//
// if ($res <= 0) {
// $this->ajaxReturn(['status' => 0, 'info' => '添加用户失败!']);
// }
// $debug='新注册';
// M('Zhongjin')->add(['user_id'=>$userId,'user_name'=>$userName,'nick'=>$userName,'mobile'=>$mobile,
// 'add_time'=>time(),'source'=>$kaihuSource]);
// $joinStatus=0;
// }else{
// $debug='老用户';
//
// $bmData=M('Zhongjin')->where(['mobile'=>$mobile,'status'=>['in',[0,1]]])->find();
// if(empty($bmData)){
// M('Zhongjin')->add(['user_id'=>$ucData['user_id'],'user_name'=>$ucData['user_name'],'mobile'=>$mobile,
// 'nick'=>$ucData['nick'],'add_time'=>time(),'source'=>$kaihuSource]);
// $joinStatus=0;
// }else{
// $joinStatus=empty($bmData)?-1:$bmData['status'];
// }
// }
//
// $this->setUcLogin($userId);
//
// }
$res
=
D
(
'Niu'
)
->
joinZj
(
$mobile
,
$userId
,
$kaihuSource
);
$info
=
'您提交的信息正在审核,通过后将以短信方式通知您'
;
$this
->
ajaxReturn
([
'status'
=>
1
,
'joinStatus'
=>
$res
[
0
],
'userId'
=>
$userId
,
'debug'
=>
$res
[
0
],
'info'
=>
$info
]);
}
//加入大赛
// public function joinM2m(){
// $smsType=$this->smsType;
// $mobile = I('mobile', '');
// $smsCode = I('smsCode', '');
// $referer =I('referer', '');
// require_once './uc_client_php/client.php';
// //app外打开
// if($mobile){
// if (!$smsCode) {
// $this->ajaxReturn(['status' =>2, 'info' => '请输入手机验证码!']);
// }
//
//// if (CS('tel:'. $mobile . ':'.$smsType) != $smsCode) {
//// $this->ajaxReturn(['status' => 2, 'info' => '对不起!手机验证码错误或已过期!']);
//// }
// $param = ['mobile'=>$mobile,'code'=>$smsCode,'type'=>$smsType];
// if(D('Sms')->checkCode($param)){
// }else{
// $this->ajaxReturn(['status' => 2, 'info' => '对不起!手机验证码错误或已过期!']);
// }
// $ucUser = uc_get_user(['token' => $mobile]);
// //没有该用户,开始注册,status0有该用户,111表示用户不存在
// if($ucUser['status']==111){
// $ucData=$this->reg2020($mobile);
// }else{
// $ucData=$ucUser['data'];
// }
// $userId=$ucData['user_id'];
// $userName=$ucData['user_name'];
//
// //自动登录
// $this->setLogin(['userID'=>$userId,'userName'=>$userName]);
// //同步登陆
// uc_user_synlogin(['userId'=>$userId,'userName'=>$userName,'webId'=>$ucData['web_id']]);
//
// }else{
// $userId = $this->user['userID'];
// $userName = $this->user['userName'];
// $user_data = uc_get_user(['userId' => $userId,'type' => 3]);
// $mobile = $user_data['data']['mobile'];
// }
// //后台审核才能加入大赛,申请中0,审核通过1,审核未通过2
// $old=M('M2m')->where(['user_id'=>$userId])->find();
// if(empty($old)){
// M('M2m')->add(['user_id'=>$userId,'user_name'=>$userName,'mobile'=>$mobile,'add_time'=>time(),'status'=>0,'source'=>'m']);
// $this->ajaxReturn(['status' => 1]);
// }else{
// if($old['status']==0){
// $this->ajaxReturn(['status' => 2,'info'=>'报名参赛正在审核中']);
// }
// if($old['status']==1){
// $this->ajaxReturn(['status' => 2,'info'=>'登录成功']);
// }
// if($old['status']==2){
// $this->ajaxReturn(['status' => 2,'info'=>'报名参赛未通过审核']);
// }
// }
// }
}
?>
...
...
app/Lib/Model/NiuModel.class.php
View file @
fe69eef6
...
...
@@ -3,10 +3,11 @@ class NiuModel extends Model{
public
$autoCheckFields
=
false
;
public
function
getMoreDs
(
$userId
,
$source
=
'm'
)
{
$STATUS_TXT
=
array
(
'1'
=>
'未开赛'
,
'2'
=>
'进行中'
,
'3'
=>
'已结束'
);
$ids
=
D
(
'Group'
)
->
getGroupCache
(
$userId
);
$MAP
=
[
NIU_BAI_ID
=>
M_URL
.
'/Niubai'
,
NIU_SAN_ID
=>
M_URL
.
'/Niusan'
,
NIU_STRONG_ID
=>
M_URL
.
'/Strong'
,
M2M_GROUP
=>
M_URL
.
'/M2m'
];
if
(
$source
==
'm'
){
$MAP
[
PRIZE_GROUP_2021
]
=
VIP_URL
.
'/PkTop'
;
$MAP
[
PRIZE_GROUP_2021
]
=
'/PkTop'
;
$MAP
[
ZHONGJIN_GROUP
]
=
M_URL
.
'/Zjds'
;
}
else
{
$MAP
[
PRIZE_GROUP_2021
]
=
'/'
;
...
...
@@ -15,42 +16,146 @@ class NiuModel extends Model{
$where
=
[
'a.group_id'
=>
[
'in'
,
array_keys
(
$MAP
)]];
$gList
=
M
(
'Group a'
)
->
join
(
'left join cofool_group_info b on a.group_id=b.group_id'
)
->
field
(
'a.group_id,a.name,startTime,endTime,b.cover,introduction'
)
->
where
(
$where
)
->
select
();
->
field
(
'a.group_id,a.name,startTime,endTime,b.cover,introduction
,a.web_id
'
)
->
where
(
$where
)
->
select
();
// var_dump($gList);exit;
foreach
(
$gList
as
$k
=>
&
$g
)
{
$g
[
'active'
]
=
$g
[
'group_id'
]
==
PRIZE_GROUP_2021
?
1
:
0
;
$g
[
'joinStatus'
]
=
in_array
(
$g
[
'group_id'
],
$ids
)
?
1
:
0
;
$g
[
'url'
]
=
$MAP
[
$g
[
'group_id'
]];
if
(
mb_strlen
(
$g
[
'introduction'
])
>
60
){
$v
[
'introduction'
]
=
msubstr
(
$g
[
'introduction'
],
0
,
60
,
'utf-8'
)
.
'...'
;
$gid
=
$g
[
'group_id'
];
$g
[
'active'
]
=
$gid
==
PRIZE_GROUP_2021
?
1
:
0
;
$g
[
'joinStatus'
]
=
in_array
(
$gid
,
$ids
)
?
1
:
0
;
$g
[
'url'
]
=
$MAP
[
$gid
];
$len
=
$source
==
'm'
?
40
:
60
;
if
(
mb_strlen
(
$g
[
'introduction'
])
>
$len
){
$g
[
'introduction'
]
=
msubstr
(
$g
[
'introduction'
],
0
,
$len
,
'utf-8'
)
.
'...'
;
}
$endTime
=
$g
[
"endTime"
];
$g
[
"startTime"
]
=
date
(
'Y-m-d'
,
$g
[
"startTime"
]);
$g
[
"endTime"
]
=
$endTime
?
date
(
'Y-m-d'
,
$g
[
"endTime"
])
:
'长期'
;
$g
[
"cover"
]
=
str_replace
(
'http://image.cofool.com/'
,
IMAGE_URL
,
$g
[
"cover"
]);
//进入交易需要的参数
$gStatus
=
is_end
(
$g
[
'endTime'
])
?
3
:
(
$g
[
'startTime'
]
>
time
()
?
1
:
2
);
$goOtherTrade
=
[
'groupId'
=>
$gid
,
'web_id'
=>
$g
[
'web_id'
],
'name'
=>
$g
[
'name'
],
'groupStatus'
=>
$gStatus
,
'viewPage'
=>
2
,
'statusInt'
=>
$gStatus
,
'userID'
=>
$userId
,
'zhuangtai'
=>
$STATUS_TXT
[
$gStatus
]];
$g
[
"goOtherTrade"
]
=
json_encode
(
$goOtherTrade
);
}
return
$gList
;
}
public
function
joinZjBefore
(
$mobile
,
$smsCode
,
$userId
){
$groupInfo
=
M
(
'Group'
)
->
field
(
'startTime,endTime'
)
->
where
([
'group_id'
=>
ZHONGJIN_GROUP
])
->
find
();
//1未开始,2是进行中,3已结束
$groupStatus
=
is_end
(
$groupInfo
[
'endTime'
])
?
3
:
(
$groupInfo
[
'startTime'
]
>
time
()
?
1
:
2
);
if
(
$groupStatus
==
3
)
{
return
([
'status'
=>
2
,
'info'
=>
'该大赛已经结束,不能报名!'
]);
}
//
if
(
$mobile
)
{
$map
=
[
'mobile'
=>
$mobile
,
'code'
=>
$smsCode
,
'type'
=>
38
,
'add_time'
=>
[
'gt'
,
NOW_TIME
-
1800
]];
$row
=
M
(
'Sms'
)
->
where
(
$map
)
->
find
();
if
(
empty
(
$row
)){
return
([
'status'
=>
2
,
'info'
=>
'验证码失效或者错误!'
]);
}
//如果该手机号的申请状态是未审核0和已通过1,应返回提示
$oldData1
=
M
(
'Zhongjin'
)
->
where
([
'mobile'
=>
$mobile
,
'status'
=>
0
])
->
count
();
$oldData2
=
M
(
'Zhongjin'
)
->
where
([
'mobile'
=>
$mobile
,
'status'
=>
1
])
->
count
();
}
else
{
//如果该手机号的申请状态是未审核0和已通过1,应返回提示
$oldData1
=
M
(
'Zhongjin'
)
->
where
([
'user_id'
=>
$userId
,
'status'
=>
0
])
->
count
();
$oldData2
=
M
(
'Zhongjin'
)
->
where
([
'user_id'
=>
$userId
,
'status'
=>
1
])
->
count
();
}
if
(
$oldData1
)
{
return
([
'status'
=>
2
,
'info'
=>
'您提交的信息正在审核中,请不要重复提交!'
]);
}
if
(
$oldData2
)
{
return
([
'status'
=>
2
,
'info'
=>
'您已经开过户,不能重复报名!'
]);
}
}
public
function
joinZj
(
$mobile
,
$userId
,
$kaihuSource
){
if
(
$mobile
){
$uc
=
uc_get_user
([
'token'
=>
$mobile
]);
$ucData
=
$uc
[
'data'
];
//没有该用户,开始注册,status0有该用户,111表示用户不存在
if
(
$uc
[
'status'
]
==
111
){
$userName
=
randUsername
(
'股神'
,
$mobile
);
$password
=
substr
(
md5
(
$userName
),
18
);
$uc
=
uc_user_register
([
'userName'
=>
$userName
,
'password'
=>
$password
,
'ip'
=>
get_client_ip
(),
'mobile'
=>
$mobile
,
'mobile_status'
=>
1
,
'sourse'
=>
'www'
]);
// var_dump($uc);exit;
//status0是注册成功
if
(
$uc
[
'status'
])
{
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'注册失败!'
]);
}
//注册成功
$ucData
=
$uc
[
'data'
];
$userId
=
$ucData
[
'user_id'
];
$info
=
[
'user_id'
=>
$userId
,
'user_name'
=>
$userName
,
'mobile'
=>
$mobile
,
'mobile_status'
=>
1
];
$res
=
D
(
'Userinfo'
)
->
_addUser
(
$info
);
if
(
$res
<=
0
)
{
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'添加用户失败!'
]);
}
$debug
=
'新注册'
;
M
(
'Zhongjin'
)
->
add
([
'user_id'
=>
$userId
,
'user_name'
=>
$userName
,
'nick'
=>
$userName
,
'mobile'
=>
$mobile
,
'add_time'
=>
time
(),
'source'
=>
$kaihuSource
]);
$joinStatus
=
0
;
}
else
{
$debug
=
'老用户'
;
$bmData
=
M
(
'Zhongjin'
)
->
where
([
'mobile'
=>
$mobile
,
'status'
=>
[
'in'
,[
0
,
1
]]])
->
find
();
if
(
empty
(
$bmData
)){
M
(
'Zhongjin'
)
->
add
([
'user_id'
=>
$ucData
[
'user_id'
],
'user_name'
=>
$ucData
[
'user_name'
],
'mobile'
=>
$mobile
,
'nick'
=>
$ucData
[
'nick'
],
'add_time'
=>
time
(),
'source'
=>
$kaihuSource
]);
$joinStatus
=
0
;
}
else
{
$joinStatus
=
empty
(
$bmData
)
?-
1
:
$bmData
[
'status'
];
}
}
//注册后用让其自动登录
require_once
'./uc_client_php/client.php'
;
$this
->
setLogin
([
'userID'
=>
$ucData
[
'user_id'
],
'userName'
=>
$ucData
[
'user_name'
]]);
//同步登陆
uc_user_synlogin
([
'userId'
=>
$ucData
[
'user_id'
],
'userName'
=>
$ucData
[
'user_name'
],
'nick'
=>
$ucData
[
'nick'
]]);
}
else
{
$bmData
=
M
(
'Zhongjin'
)
->
where
([
'user_id'
=>
$userId
,
'status'
=>
[
'in'
,[
0
,
1
]]])
->
find
();
if
(
empty
(
$bmData
)){
$uc
=
uc_get_user
([
'userId'
=>
$userId
,
'type'
=>
3
]);
// var_dump($uc);exit;
if
(
$uc
[
'status'
]
==
0
&&!
empty
(
$uc
[
'data'
])){
$ucData
=
$uc
[
'data'
];
}
M
(
'Zhongjin'
)
->
add
([
'user_id'
=>
$userId
,
'user_name'
=>
$ucData
[
'user_name'
],
'mobile'
=>
$ucData
[
'mobile'
],
'nick'
=>
$ucData
[
'nick'
],
'add_time'
=>
time
(),
'source'
=>
$kaihuSource
]);
$joinStatus
=
0
;
}
else
{
$joinStatus
=
empty
(
$bmData
)
?-
1
:
$bmData
[
'status'
];
}
}
return
[
$joinStatus
,
$debug
];
}
//加入大赛
public
function
joinNiu
(
$mobile
,
$smsCode
,
$smsType
,
$userId
,
$userName
,
$gid
){
// $smsType=$this->smsType;
// $mobile = I('mobile', '');
// $smsCode = I('smsCode', '');
// $referer =I('referer', '');
// require_once './uc_client_php/client.php';
public
function
joinNiu
(
$mobile
,
$smsCode
,
$userId
,
$userName
,
$gid
){
if
(
$mobile
){
if
(
!
$smsCode
)
{
return
([
'status'
=>
2
,
'info'
=>
'请输入手机验证码!'
]);
}
if
(
CS
(
'tel:'
.
$mobile
.
':'
.
$smsType
)
!=
$smsCode
)
{
// $smsType=$gid==M2M_GROUP?38:44;
$smsType
=
32
;
// if (CS('tel:'. $mobile . ':'.$smsType) != $smsCode) {
// return(['status' => 2, 'info' => '对不起!手机验证码错误或已过期!']);
// }
$param
=
[
'mobile'
=>
$mobile
,
'code'
=>
$smsCode
,
'type'
=>
$smsType
];
if
(
D
(
'Sms'
)
->
checkCode
(
$param
)){
}
else
{
return
([
'status'
=>
2
,
'info'
=>
'对不起!手机验证码错误或已过期!'
]);
}
$ucUser
=
uc_get_user
([
'token'
=>
$mobile
]);
//没有该用户,开始注册,status0有该用户,111表示用户不存在
if
(
$ucUser
[
'status'
]
==
111
){
...
...
app/Tpl/Vip/Index/pop.html
View file @
fe69eef6
...
...
@@ -23,7 +23,7 @@
<div
class=
"form-info-input"
style=
"display: none"
>
<input
type=
"password"
class=
"phone-input"
placeholder=
"请再次输入密码"
maxlength=
"20"
id=
"password2"
autocomplete=
"off"
>
</div>
<input
class=
"form-info-btn bmSt
atus
2"
type=
"button"
value=
"立即报名"
>
<input
class=
"form-info-btn bmSt
ep
2"
type=
"button"
value=
"立即报名"
>
</div>
</div>
...
...
app/Tpl/Vip/PkTop/index.html
View file @
fe69eef6
...
...
@@ -342,7 +342,34 @@
if
(
mfrom
[
1
]
>
0
){
checkLoginAndDo
(
mfrom
[
0
],
'{$user.userID}'
,
1
);
}
else
{
// animPop('#baomingPOP');
if
(
'{$user.userID}'
==
''
){
animPop
(
'#baomingPOP'
);
}
else
{
$
.
post
(
"/PkTop/join"
,{},
function
(
data
){
if
(
data
.
status
==
0
){
//已经参加过该大赛
if
(
data
.
flag
==
1
){
layer
.
open
({
content
:
data
.
info
,
skin
:
'msg'
,
time
:
2
,
end
:
function
()
{
var
href
=
location
.
href
;
console
.
log
(
'当前页面url:'
+
href
);
window
.
location
.
reload
();
}});
}
else
{
//可能有各种错误提示
layer
.
open
({
content
:
data
.
info
,
skin
:
'msg'
,
time
:
2
,
end
:
function
()
{
//window.location.reload();
}});
}
return
false
;
}
else
{
animPop
(
'#baomingPOP'
);
animPop
(
'#popPkTopSucc'
);
}
});
}
}
// }
});
...
...
@@ -366,6 +393,22 @@
}
});
$
(
".goOtherTrade"
).
click
(
function
()
{
console
.
log
(
'2点击进入交易按钮'
+
mfrom
[
0
]);
if
(
mfrom
[
1
]
>
0
){
// if($('#groupStatus').val()==1){
// layer.open({content: '当前大赛未开始',skin: 'msg',time: 2});
// }
// var appParam=$('#groupInfo').val();
// appParam=appParam.replace(/XXXXXX/g, userId);
var
appParam
=
$
(
this
).
attr
(
'goOtherTrade'
);
AppBridge
.
refreshMyGroup
();
AppBridge
.
goTrade
(
appParam
);
}
else
{
location
.
href
=
'http://app.jiantou8.com/jiantou.html'
;
}
});
//点击底部的更多大赛
$
(
'.showMoreDs'
).
click
(
function
(){
$
(
'.en-li'
).
eq
(
3
).
click
();
...
...
app/Tpl/Vip/PkTop/moreDs.html
View file @
fe69eef6
<div
class=
"ds-item-block"
>
<foreach
name=
"gList"
key=
'key'
item=
"vo"
>
<div
class=
"ds-item-block"
>
<eq
name=
"vo.active"
value=
"1"
>
<img
class=
"active-img"
src=
"__PUBLIC__/Home/images/g2020/active-icon.png"
alt=
""
>
</eq>
<div
class=
"item-block"
>
<div
class=
"ds-img"
><img
src=
"{$vo.cover}"
alt=
""
></div>
<div
class=
"ds-right-info"
>
...
...
@@ -11,35 +17,18 @@
<div
class=
"ds-time-btn"
>
<span
class=
"time-span"
><img
src=
"__PUBLIC__/Home/images/g2020/time-icon.png"
alt=
""
>
比赛时间:{$vo.startTime} ~ {$vo.endTime}
</span>
<eq
name=
"vo.joinStatus"
value=
"1"
>
<a
href=
"{$Think.config.WWW_URL}/Trade/Stock/index/gid/{$_GET.gid|default=PRIZE_GROUP_2021}"
class=
"join-btn"
><img
src=
"__PUBLIC__/Home/images/g2020/cs-left.png"
alt=
""
>
进入交易
</a>
<a
href=
"javascript:;"
class=
"join-btn goOtherTrade"
goOtherTrade=
"{$vo.goOtherTrade}"
>
<img
src=
"__PUBLIC__/Home/images/g2020/cs-left.png"
alt=
""
>
进入交易
</a>
<else/>
<if
condition=
"$gid eq $vo['group_id']"
>
<a
href=
"javascript:;"
class=
"join-btn baoming"
><img
src=
"__PUBLIC__/Home/images/g2020/cs-left.png"
alt=
""
><span>
报名参赛
</span></a>
<else/>
<a
href=
"javascript:;"
class=
"join-btn bmOtherGroupStep1"
gid=
"{$vo.group_id}"
><img
src=
"__PUBLIC__/Home/images/g2020/cs-left.png"
alt=
""
><span>
报名参赛
</span></a>
<a
href=
"javascript:;"
class=
"join-btn bmOtherGroupStep1"
gid=
"{$vo.group_id}"
>
<img
src=
"__PUBLIC__/Home/images/g2020/cs-left.png"
alt=
""
><span>
报名参赛
</span>
</a>
</if>
</eq>
</div>
</div>
<div
class=
"ds-item-block"
>
<div
class=
"item-block"
>
<div
class=
"ds-img"
><img
src=
"{$vo.cover}"
alt=
""
></div>
<div
class=
"ds-right-info"
>
<a
href=
"{$vo.url}"
class=
"info-title"
target=
"_blank"
><img
class=
"gf-icon"
src=
"__PUBLIC__/Home/images/g2020/td-icon.png"
alt=
""
>
{$vo.name}
<img
class=
"jiang"
src=
"__PUBLIC__/Home/images/g2020/jiang-icon.png"
alt=
""
></a>
<div
class=
"ds-des"
>
{$vo.introduction}
</div>
</div>
</div>
<div
class=
"ds-time-btn"
>
<span
class=
"time-span"
><img
src=
"__PUBLIC__/Home/images/g2020/time-icon.png"
alt=
""
>
比赛时间:{$vo.startTime} ~ {$vo.endTime}
</span>
<eq
name=
"vo.joinStatus"
value=
"1"
>
<a
href=
"{$Think.config.WWW_URL}/Trade/Stock/index/gid/{$_GET.gid|default=PRIZE_GROUP_2021}"
class=
"join-btn"
><img
src=
"__PUBLIC__/Home/images/g2020/cs-left.png"
alt=
""
>
进入交易
</a>
<else/>
<if
condition=
"$gid eq $vo['group_id']"
>
<a
href=
"javascript:;"
class=
"join-btn baoming"
><img
src=
"__PUBLIC__/Home/images/g2020/cs-left.png"
alt=
""
><span>
报名参赛
</span></a>
<else/>
<a
href=
"javascript:;"
class=
"join-btn bmOtherGroupStep1"
gid=
"{$vo.group_id}"
><img
src=
"__PUBLIC__/Home/images/g2020/cs-left.png"
alt=
""
><span>
报名参赛
</span></a>
</if>
</eq>
</div>
</div>
\ No newline at end of file
</foreach>
app/Tpl/Vip/PkTop/pop.html
View file @
fe69eef6
...
...
@@ -11,7 +11,24 @@
<input
class=
"code-input"
placeholder=
"请输入短信验证码"
maxlength=
"6"
>
<span
class=
"part-line"
>
|
</span><input
type=
"button"
class=
"code-btn"
value=
"获取验证码"
>
</div>
<input
class=
"form-info-btn bmStatus2"
type=
"button"
value=
"立即报名"
>
<input
class=
"form-info-btn bmStep2"
type=
"button"
value=
"立即报名"
>
</div>
</div>
<div
class=
"submit-info-pop pops dialog-pop"
style=
"display: none;"
id=
"popBase"
>
<span
class=
"t-pop-close"
id=
"closeBm"
>
<img
src=
"__PUBLIC__/Home/images/g2020/trade-close.png"
alt=
""
>
</span>
<!--<div class="p-msg"></div>-->
<div
class=
"form-info-box"
>
<div
class=
"form-info-input"
>
<input
type=
"tel"
class=
"phone-input base1"
placeholder=
"请输入手机号"
maxlength=
"11"
>
</div>
<div
class=
"form-info-input"
>
<input
class=
"code-input base2"
placeholder=
"请输入短信验证码"
maxlength=
"6"
>
<span
class=
"part-line"
>
|
</span><input
type=
"button"
class=
"code-btn"
value=
"获取验证码"
>
</div>
<input
class=
"form-info-btn bmOtherGroupStep2"
type=
"button"
value=
"立即报名"
>
</div>
</div>
...
...
@@ -69,14 +86,55 @@
<!--<input id="isapp" value="{$isapp}" type="hidden"/>-->
<!--pk获胜-->
<div
class=
"pk-result-pop pops dialog-pop"
style=
"display: none"
id=
"pop3"
>
<span
class=
"t-pop-close"
><img
src=
"__PUBLIC__/Home/images/g2020/trade-close.png"
alt=
""
></span>
<p
class=
"result-msg-m"
>
恭喜您,PK挑战获胜
</p><p
class=
"result-msg-r"
>
获得66元挑战金、年度精英赛门票
</p>
<p
class=
"result-msg-s"
>
在与【】的PK挑战当中获得胜利,请继续努力。
</p>
</div>
<!--<div class="pk-result-pop pops dialog-pop" style="display: none" id="pop3">-->
<!--<span class="t-pop-close"><img src="__PUBLIC__/Home/images/g2020/trade-close.png" alt=""></span>-->
<!--<p class="result-msg-m">恭喜您,PK挑战获胜</p><p class="result-msg-r">获得66元挑战金、年度精英赛门票</p>-->
<!--<p class="result-msg-s">在与【】的PK挑战当中获得胜利,请继续努力。</p>-->
<!--</div>-->
<!--pk失败-->
<div
class=
"pk-result-pop pops dialog-pop"
style=
"display: none"
id=
"pop4"
>
<p
class=
"result-msg-m"
>
很遗憾,PK挑战失败
</p><p
class=
"result-msg-s"
>
在与【】的PK挑战当中失败,请继续努力,维护作为投资者的荣耀
</p>
<span
class=
"t-pop-close"
><img
src=
"__PUBLIC__/Home/images/g2020/trade-close.png"
alt=
""
></span>
</div>
\ No newline at end of file
<!--<div class="pk-result-pop pops dialog-pop" style="display: none" id="pop4">-->
<!--<p class="result-msg-m">很遗憾,PK挑战失败</p><p class="result-msg-s">在与【】的PK挑战当中失败,请继续努力,维护作为投资者的荣耀</p>-->
<!--<span class="t-pop-close"><img src="__PUBLIC__/Home/images/g2020/trade-close.png" alt=""></span>-->
<!--</div>-->
<script>
var
mfrom
=
isAPP
();
//加入其他的大赛
$
(
".bmOtherGroupStep1"
).
click
(
function
()
{
var
gid
=
$
(
this
).
attr
(
"gid"
);
if
(
'{$user.userID}'
==
''
){
if
(
mfrom
[
1
]
>
0
){
AppBridge
.
goLogin
();
}
else
{
$
(
".bmOtherGroupStep2"
).
attr
(
'gid'
,
gid
);
animPop
(
'#popBase'
);
}
}
else
{
$
.
post
(
"/PkTop/bmOtherGroup"
,{
gid
:
gid
},
function
(
data
){
if
(
data
.
status
==
1
){
layer
.
open
({
content
:
data
.
info
,
skin
:
'msg'
,
time
:
2
,
end
:
function
()
{
location
.
reload
();}});
}
else
{
layer
.
open
({
content
:
data
.
info
,
skin
:
'msg'
,
time
:
2
},
8
);
return
false
;
}
});
}
});
//输入手机号,验证码后点击报名按钮
$
(
".bmOtherGroupStep2"
).
click
(
function
()
{
var
mobile
=
$
(
".base1"
).
val
();
if
(
mobile
==
''
){
layer
.
open
({
content
:
"请输入手机号"
,
skin
:
'msg'
,
time
:
2
},
8
);
return
;}
var
smsCode
=
$
(
".base2"
).
val
();
if
(
smsCode
==
''
){
layer
.
open
({
content
:
"请输入验证码"
,
skin
:
'msg'
,
time
:
2
},
8
);
return
;}
$
.
post
(
"/PkTop/bmOtherGroup"
,{
mobile
:
mobile
,
smsCode
:
smsCode
,
gid
:
$
(
this
).
attr
(
"gid"
)},
function
(
data
){
if
(
data
.
status
==
1
){
layer
.
open
({
content
:
data
.
info
,
skin
:
'msg'
,
time
:
2
,
end
:
function
()
{
location
.
reload
();}});
}
else
{
layer
.
open
({
content
:
data
.
info
,
skin
:
'msg'
,
time
:
2
},
8
);
return
false
;
}
});
});
</script>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment