first commit
@@ -0,0 +1,394 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
$act=isset($_GET['act'])?daddslashes($_GET['act']):null;
|
||||
|
||||
if(!checkRefererHost())exit('{"code":403}');
|
||||
|
||||
@header('Content-Type: application/json; charset=UTF-8');
|
||||
|
||||
switch($act){
|
||||
case 'testpay':
|
||||
if(!$conf['test_open'])exit('{"code":-1,"msg":"未开启测试支付"}');
|
||||
$money=trim($_POST['money']);
|
||||
$typeid=intval($_POST['typeid']);
|
||||
$name = '支付测试';
|
||||
if(!$_POST['csrf_token'] || $_POST['csrf_token']!=$_SESSION['csrf_token'])exit('{"code":-1,"msg":"CSRF TOKEN ERROR"}');
|
||||
if($money<=0 || !is_numeric($money) || !preg_match('/^[0-9.]+$/', $money))exit('{"code":-1,"msg":"金额不合法"}');
|
||||
if($conf['pay_maxmoney']>0 && $money>$conf['pay_maxmoney'])exit('{"code":-1,"msg":"最大支付金额是'.$conf['pay_maxmoney'].'元"}');
|
||||
if($conf['pay_minmoney']>0 && $money<$conf['pay_minmoney'])exit('{"code":-1,"msg":"最小支付金额是'.$conf['pay_minmoney'].'元"}');
|
||||
if($conf['captcha_open_test']==1){
|
||||
if(!isset($_SESSION['gtserver']))exit('{"code":-1,"msg":"验证加载失败"}');
|
||||
if(!verify_captcha())exit('{"code":-1,"msg":"验证失败,请重新验证"}');
|
||||
}
|
||||
|
||||
$trade_no=date("YmdHis").rand(11111,99999);
|
||||
$return_url=$siteurl.'user/test.php?ok=1&trade_no='.$trade_no;
|
||||
$domain=getdomain($return_url);
|
||||
if(!$DB->exec("INSERT INTO `pre_order` (`trade_no`,`out_trade_no`,`uid`,`tid`,`addtime`,`name`,`money`,`notify_url`,`return_url`,`domain`,`ip`,`status`) VALUES (:trade_no, :out_trade_no, :uid, 3, NOW(), :name, :money, :notify_url, :return_url, :domain, :clientip, 0)", [':trade_no'=>$trade_no, ':out_trade_no'=>$trade_no, ':uid'=>$conf['test_pay_uid'], ':name'=>$name, ':money'=>$money, ':notify_url'=>$return_url, ':return_url'=>$return_url, ':domain'=>$domain, ':clientip'=>$clientip]))exit('{"code":-1,"msg":"创建订单失败,请返回重试!"}');
|
||||
$result = ['code'=>0, 'msg'=>'succ', 'url'=>'../submit2.php?typeid='.$typeid.'&trade_no='.$trade_no];
|
||||
exit(json_encode($result));
|
||||
break;
|
||||
case 'login':
|
||||
$type=intval($_POST['type']);
|
||||
$user=trim($_POST['user']);
|
||||
$pass=trim($_POST['pass']);
|
||||
if(empty($user) || empty($pass))exit('{"code":-1,"msg":"请确保各项不能为空"}');
|
||||
if(!$_POST['csrf_token'] || $_POST['csrf_token']!=$_SESSION['csrf_token'])exit('{"code":-1,"msg":"CSRF TOKEN ERROR"}');
|
||||
|
||||
if($conf['captcha_open_login']==1){
|
||||
if(!isset($_SESSION['gtserver']))exit('{"code":-1,"msg":"验证加载失败"}');
|
||||
if(!verify_captcha())exit('{"code":-1,"msg":"验证失败,请重新验证"}');
|
||||
}
|
||||
|
||||
if($type==1 && is_numeric($user) && strlen($user)<=6)$type=0;
|
||||
if($type==1){
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE email=:user OR phone=:user limit 1", [':user'=>$user]);
|
||||
$pass=getMd5Pwd($pass, $userrow['uid']);
|
||||
}else{
|
||||
if($conf['close_keylogin']==1)exit('{"code":-1,"msg":"未开启密钥登录,请使用账号密码登录!"}');
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE uid=:user limit 1", [':user'=>$user]);
|
||||
if($userrow && $userrow['keylogin']==0){
|
||||
exit('{"code":-1,"msg":"该商户未开启密钥登录,请使用账号密码登录!"}');
|
||||
}
|
||||
}
|
||||
if($userrow && ($type==0 && $pass==$userrow['key'] || $type==1 && $pass==$userrow['pwd'])) {
|
||||
$uid = $userrow['uid'];
|
||||
if($alipay_uid=$_SESSION['Oauth_alipay_uid']){
|
||||
$DB->update('user', ['alipay_uid'=>$alipay_uid], ['uid'=>$uid]);
|
||||
unset($_SESSION['Oauth_alipay_uid']);
|
||||
}
|
||||
if($qq_uid=$_SESSION['Oauth_qq_uid']){
|
||||
$DB->update('user', ['qq_uid'=>$qq_uid], ['uid'=>$uid]);
|
||||
unset($_SESSION['Oauth_qq_uid']);
|
||||
}
|
||||
$city=get_ip_city($clientip);
|
||||
$DB->insert('log', ['uid'=>$uid, 'type'=>'普通登录', 'date'=>'NOW()', 'ip'=>$clientip, 'city'=>$city]);
|
||||
|
||||
if(!isset($_SESSION['wxnotice_login_uid']) || $_SESSION['wxnotice_login_uid']!=$uid){
|
||||
if(\lib\MsgNotice::send('login', $uid, ['user'=>$user, 'clientip'=>$clientip, 'ipinfo'=>$city, 'time'=>date('Y-m-d H:i:s')])){
|
||||
$_SESSION['wxnotice_login_uid'] = $uid;
|
||||
}
|
||||
}
|
||||
$session=md5($uid.$userrow['key'].$password_hash);
|
||||
$expiretime=time()+604800;
|
||||
$token=authcode("{$uid}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
|
||||
ob_clean();
|
||||
setcookie("user_token", $token, time() + 2592000);
|
||||
$DB->exec("update `pre_user` set `lasttime`=NOW() where `uid`='$uid'");
|
||||
if(empty($userrow['account']) || empty($userrow['username'])){
|
||||
$result=array("code"=>0,"msg"=>"登录成功!正在跳转到收款账号设置","url"=>"./editinfo.php?start=1");
|
||||
}else{
|
||||
$result=array("code"=>0,"msg"=>"登录成功!正在跳转到用户中心","url"=>"./");
|
||||
}
|
||||
unset($_SESSION['csrf_token']);
|
||||
}else {
|
||||
$result=array("code"=>-1,"msg"=>"用户名或密码不正确!");
|
||||
}
|
||||
exit(json_encode($result));
|
||||
break;
|
||||
case 'connect':
|
||||
$type = isset($_POST['type'])?$_POST['type']:exit('{"code":-1,"msg":"no type"}');
|
||||
$bind = isset($_POST['bind'])?$_POST['bind']:null;
|
||||
if($type == 'qq' && $conf['login_qq']==3 || $type == 'wx' && $conf['login_wx']==-1 || $type == 'alipay' && $conf['login_alipay']==-1){
|
||||
if(!$conf['login_apiurl'] || !$conf['login_appid'] || !$conf['login_appkey'])exit('{"code":-1,"msg":"未配置好聚合登录信息"}');
|
||||
$Oauth_config = [
|
||||
'apiurl' => $conf['login_apiurl'],
|
||||
'appid' => $conf['login_appid'],
|
||||
'appkey' => $conf['login_appkey'],
|
||||
'callback' => $siteurl.'user/connect.php'
|
||||
];
|
||||
$Oauth = new \lib\Oauth($Oauth_config);
|
||||
$res = $Oauth->login($type);
|
||||
if(isset($res['code']) && $res['code']==0){
|
||||
$result = ['code'=>0, 'url'=>$res['url']];
|
||||
}elseif(isset($res['code'])){
|
||||
$result = ['code'=>-1, 'msg'=>$res['msg']];
|
||||
}else{
|
||||
$result = ['code'=>-1, 'msg'=>'聚合登录接口请求失败'];
|
||||
}
|
||||
}elseif($type == 'qq' && $conf['login_qq']==1){
|
||||
$QC_config = [
|
||||
'appid' => $conf['login_qq_appid'],
|
||||
'appkey' => $conf['login_qq_appkey'],
|
||||
'callback' => $siteurl.'user/connect.php'
|
||||
];
|
||||
$QC=new \lib\QC($QC_config);
|
||||
$url = $QC->qq_login(true);
|
||||
$result = ['code'=>0, 'url'=>$url];
|
||||
}elseif($type == 'qq' && $conf['login_qq']==2){
|
||||
$result = ['code'=>0, 'url'=>'connect.php'.($bind=='1'?'?bind=1':'')];
|
||||
}elseif($type == 'wx' && $conf['login_wx']>0){
|
||||
$result = ['code'=>0, 'url'=>'wxlogin.php'.($bind=='1'?'?bind=1':'')];
|
||||
}elseif($type == 'alipay' && $conf['login_alipay']>0){
|
||||
$result = ['code'=>0, 'url'=>'oauth.php'.($bind=='1'?'?bind=1':'')];
|
||||
}else{
|
||||
$result = ['code'=>-1, 'msg'=>'未开启当前登录方式'];
|
||||
}
|
||||
exit(json_encode($result));
|
||||
break;
|
||||
case 'captcha':
|
||||
if($conf['captcha_version'] == '1'){
|
||||
$captcha_id = !empty($conf['captcha_id'])?$conf['captcha_id']:'54088bb07d2df3c46b79f80300b0abbe';
|
||||
$result = ['success'=>1, 'gt'=>$captcha_id, 'version'=>1];
|
||||
}else{
|
||||
$GtSdk = new \lib\GeetestLib($conf['captcha_id'], $conf['captcha_key']);
|
||||
$data = array(
|
||||
'user_id' => isset($uid)?$uid:'public',
|
||||
'client_type' => "web",
|
||||
'ip_address' => $clientip
|
||||
);
|
||||
$result = $GtSdk->pre_process($data);
|
||||
$result['version'] = 0;
|
||||
}
|
||||
$_SESSION['gtserver'] = $result['success'];
|
||||
exit(json_encode($result));
|
||||
break;
|
||||
case 'sendcode':
|
||||
$sendto=htmlspecialchars(strip_tags(trim($_POST['sendto'])));
|
||||
if($conf['reg_open']==0)exit('{"code":-1,"msg":"未开放商户申请"}');
|
||||
if(isset($_SESSION['send_code_time']) && $_SESSION['send_code_time']>time()-10){
|
||||
exit('{"code":-1,"msg":"请勿频繁发送验证码"}');
|
||||
}
|
||||
|
||||
if(!isset($_SESSION['gtserver']))exit('{"code":-1,"msg":"验证加载失败"}');
|
||||
if(!verify_captcha())exit('{"code":-1,"msg":"验证失败,请重新验证"}');
|
||||
|
||||
if($conf['verifytype']==1){
|
||||
$row=$DB->getRow("select * from pre_user where phone=:phone limit 1", [':phone'=>$sendto]);
|
||||
if($row){
|
||||
exit('{"code":-1,"msg":"该手机号已经注册过商户,如需找回商户信息,请返回登录页面点击找回商户"}');
|
||||
}
|
||||
$type = 1;
|
||||
}else{
|
||||
$row=$DB->getRow("select * from pre_user where email=:email limit 1", [':email'=>$sendto]);
|
||||
if($row){
|
||||
exit('{"code":-1,"msg":"该邮箱已经注册过商户,如需找回商户信息,请返回登录页面点击找回商户"}');
|
||||
}
|
||||
$type = 0;
|
||||
}
|
||||
$result = \lib\VerifyCode::send_code('reg', $type, $sendto);
|
||||
if($result === true){
|
||||
$_SESSION['send_code_time']=time();
|
||||
exit('{"code":0,"msg":"succ"}');
|
||||
}else{
|
||||
exit(json_encode(['code'=>-1, 'msg'=>$result]));
|
||||
}
|
||||
break;
|
||||
case 'reg':
|
||||
if($conf['reg_open']==0)exit('{"code":-1,"msg":"未开放商户申请"}');
|
||||
$email=htmlspecialchars(strip_tags(trim($_POST['email'])));
|
||||
$phone=htmlspecialchars(strip_tags(trim($_POST['phone'])));
|
||||
$code=trim($_POST['code']);
|
||||
$pwd=trim($_POST['pwd']);
|
||||
$invitecode=trim($_POST['invitecode']);
|
||||
|
||||
if(isset($_SESSION['reg_submit']) && $_SESSION['reg_submit']>time()-600){
|
||||
exit('{"code":-1,"msg":"请勿频繁注册"}');
|
||||
}
|
||||
if($conf['verifytype']==1 && empty($phone) || $conf['verifytype']==0 && empty($email) || empty($code) || empty($pwd)){
|
||||
exit('{"code":-1,"msg":"请确保各项不能为空"}');
|
||||
}
|
||||
if(!$_POST['csrf_token'] || $_POST['csrf_token']!=$_SESSION['csrf_token'])exit('{"code":-1,"msg":"CSRF TOKEN ERROR"}');
|
||||
if (strlen($pwd) < 6) {
|
||||
exit('{"code":-1,"msg":"密码不能低于6位"}');
|
||||
}elseif ($pwd == $email) {
|
||||
exit('{"code":-1,"msg":"密码不能和邮箱相同"}');
|
||||
}elseif ($pwd == $phone) {
|
||||
exit('{"code":-1,"msg":"密码不能和手机号码相同"}');
|
||||
}elseif (is_numeric($pwd)) {
|
||||
exit('{"code":-1,"msg":"密码不能为纯数字"}');
|
||||
}
|
||||
|
||||
if($conf['reg_open']==2){
|
||||
$inviterow = $DB->find('invitecode', '*', ['code'=>$invitecode]);
|
||||
if(!$inviterow)exit('{"code":-1,"msg":"邀请码不存在"}');
|
||||
if($inviterow['status']==1)exit('{"code":-1,"msg":"邀请码已被使用"}');
|
||||
}
|
||||
|
||||
if($conf['verifytype']==1){
|
||||
if(!is_numeric($phone) || strlen($phone)!=11){
|
||||
exit('{"code":-1,"msg":"手机号码不正确"}');
|
||||
}
|
||||
$row=$DB->getRow("select * from pre_user where phone=:phone limit 1", [':phone'=>$phone]);
|
||||
if($row){
|
||||
exit('{"code":-1,"msg":"该手机号已经注册过商户,如需找回商户信息,请返回登录页面点击找回商户"}');
|
||||
}
|
||||
}else{
|
||||
if(!preg_match('/^[A-z0-9._-]+@[A-z0-9._-]+\.[A-z0-9._-]+$/', $email)){
|
||||
exit('{"code":-1,"msg":"邮箱格式不正确"}');
|
||||
}
|
||||
$row=$DB->getRow("select * from pre_user where email=:email limit 1", [':email'=>$email]);
|
||||
if($row){
|
||||
exit('{"code":-1,"msg":"该邮箱已经注册过商户,如需找回商户信息,请返回登录页面点击找回商户"}');
|
||||
}
|
||||
}
|
||||
if($conf['verifytype']==1){
|
||||
$sendto = $phone;
|
||||
$type = 1;
|
||||
}else{
|
||||
$sendto = $email;
|
||||
$type = 0;
|
||||
}
|
||||
$result = \lib\VerifyCode::verify_code('reg', $type, $sendto, $code);
|
||||
if($result !== true){
|
||||
exit(json_encode(['code'=>-1, 'msg'=>$result]));
|
||||
}
|
||||
$upid = $_SESSION['invite_uid']?$_SESSION['invite_uid']:0;
|
||||
if($conf['reg_pay']==1){
|
||||
$urow = $DB->getRow("SELECT uid,gid FROM pre_user WHERE uid='{$conf['reg_pay_uid']}' limit 1");
|
||||
if(!$urow)exit('{"code":-1,"msg":"注册收款商户ID不存在"}');
|
||||
$return_url = $siteurl.'user/reg.php?regok=1';
|
||||
$trade_no=date("YmdHis").rand(11111,99999);
|
||||
$domain=getdomain($return_url);
|
||||
if(!$DB->exec("INSERT INTO `pre_order` (`trade_no`,`out_trade_no`,`uid`,`tid`,`addtime`,`name`,`money`,`notify_url`,`return_url`,`domain`,`ip`,`status`) VALUES (:trade_no, :out_trade_no, :uid, 1, NOW(), :name, :money, :notify_url, :return_url, :domain, :clientip, 0)", [':trade_no'=>$trade_no, ':out_trade_no'=>$trade_no, ':uid'=>$conf['reg_pay_uid'], ':name'=>'商户申请', ':money'=>$conf['reg_pay_price'], ':notify_url'=>$return_url, ':return_url'=>$return_url, ':domain'=>$domain, ':clientip'=>$clientip]))
|
||||
exit('{"code":-1,"msg":"创建订单失败,请返回重试!"}');
|
||||
|
||||
$cacheData = ['verifytype'=>$conf['verifytype'], 'email'=>$email, 'phone'=>$phone, 'pwd'=>$pwd, 'upid'=>$upid];
|
||||
if($inviterow) $cacheData['invitecodeid'] = $inviterow['id'];
|
||||
$sds = $CACHE->save('reg_'.$trade_no ,$cacheData, 3600);
|
||||
if($sds){
|
||||
\lib\VerifyCode::void_code();
|
||||
$paytype = \lib\Channel::getTypes($urow['uid'], $urow['gid']);
|
||||
$result=array("code"=>2,"msg"=>"订单创建成功!","trade_no"=>$trade_no,"need"=>$conf['reg_pay_price'],"paytype"=>$paytype);
|
||||
unset($_SESSION['csrf_token']);
|
||||
}else{
|
||||
$result=array("code"=>-1,"msg"=>"订单创建失败!".$DB->error());
|
||||
}
|
||||
}else{
|
||||
$key = random(32);
|
||||
$paystatus = $conf['user_review']==1?2:1;
|
||||
$sds=$DB->exec("INSERT INTO `pre_user` (`upid`, `key`, `money`, `email`, `phone`, `addtime`, `pay`, `settle`, `keylogin`, `apply`, `status`) VALUES (:upid, :key, '0.00', :email, :phone, NOW(), :paystatus, 1, 0, 0, 1)", [':upid'=>$upid, ':key'=>$key, ':email'=>$email, ':phone'=>$phone, ':paystatus'=>$paystatus]);
|
||||
$uid=$DB->lastInsertId();
|
||||
if($sds){
|
||||
$pwd = getMd5Pwd($pwd, $uid);
|
||||
$DB->exec("update `pre_user` set `pwd` ='{$pwd}' where `uid`='$uid'");
|
||||
if(!empty($email)){
|
||||
$sub = $conf['sitename'].' - 注册成功通知';
|
||||
$msg = '<h2>商户注册成功通知</h2>感谢您注册'.$conf['sitename'].'!<br/>您的登录账号:'.($info['email']?$info['email']:$info['phone']).'<br/>您的商户ID:'.$uid.'<br/>您的商户秘钥:'.$key.'<br/>'.$conf['sitename'].'官网:<a href="http://'.$_SERVER['HTTP_HOST'].'/" target="_blank">'.$_SERVER['HTTP_HOST'].'</a><br/>【<a href="'.$siteurl.'user/" target="_blank">商户管理后台</a>】';
|
||||
send_mail($email, $sub, $msg);
|
||||
}
|
||||
\lib\VerifyCode::void_code();
|
||||
if($inviterow){
|
||||
$DB->update('invitecode', ['status'=>1, 'uid'=>$uid, 'usetime'=>'NOW()'], ['id'=>$inviterow['id']]);
|
||||
}
|
||||
$_SESSION['reg_submit']=time();
|
||||
$result=array("code"=>1,"msg"=>"申请商户成功!","uid"=>$uid,"key"=>$key);
|
||||
unset($_SESSION['csrf_token']);
|
||||
if($paystatus == 2){
|
||||
\lib\MsgNotice::send('regaudit', 0, ['uid'=>$uid, 'account'=>$info['email']?$info['email']:$info['phone']]);
|
||||
}
|
||||
}else{
|
||||
$result=array("code"=>-1,"msg"=>"申请商户失败!".$DB->error());
|
||||
}
|
||||
}
|
||||
exit(json_encode($result));
|
||||
break;
|
||||
case 'sendcode2':
|
||||
$verifytype=$_POST['type'];
|
||||
$sendto=htmlspecialchars(strip_tags(trim($_POST['sendto'])));
|
||||
if(isset($_SESSION['send_code_time']) && $_SESSION['send_code_time']>time()-10){
|
||||
exit('{"code":-1,"msg":"请勿频繁发送验证码"}');
|
||||
}
|
||||
|
||||
if(!isset($_SESSION['gtserver']))exit('{"code":-1,"msg":"验证加载失败"}');
|
||||
if(!verify_captcha())exit('{"code":-1,"msg":"验证失败,请重新验证"}');
|
||||
|
||||
if($verifytype=='phone'){
|
||||
$userrow=$DB->getRow("select * from pre_user where phone=:phone limit 1", [':phone'=>$sendto]);
|
||||
if(!$userrow){
|
||||
exit('{"code":-1,"msg":"该手机号未找到注册商户"}');
|
||||
}
|
||||
$type = 1;
|
||||
}else{
|
||||
$userrow=$DB->getRow("select * from pre_user where email=:email limit 1", [':email'=>$sendto]);
|
||||
if(!$userrow){
|
||||
exit('{"code":-1,"msg":"该邮箱未找到注册商户"}');
|
||||
}
|
||||
$type = 0;
|
||||
}
|
||||
$result = \lib\VerifyCode::send_code('find', $type, $sendto);
|
||||
if($result === true){
|
||||
$_SESSION['send_code_time']=time();
|
||||
exit(json_encode(['code'=>0, 'msg'=>'succ']));
|
||||
}else{
|
||||
exit(json_encode(['code'=>-1, 'msg'=>$result]));
|
||||
}
|
||||
break;
|
||||
case 'findpwd':
|
||||
$verifytype=$_POST['type'];
|
||||
$account=htmlspecialchars(strip_tags(trim($_POST['account'])));
|
||||
$code=trim($_POST['code']);
|
||||
$pwd=trim($_POST['pwd']);
|
||||
|
||||
if(empty($account) || empty($code) || empty($pwd)){
|
||||
exit('{"code":-1,"msg":"请确保各项不能为空"}');
|
||||
}
|
||||
if(!$_POST['csrf_token'] || $_POST['csrf_token']!=$_SESSION['csrf_token'])exit('{"code":-1,"msg":"CSRF TOKEN ERROR"}');
|
||||
if (strlen($pwd) < 6) {
|
||||
exit('{"code":-1,"msg":"密码不能低于6位"}');
|
||||
}elseif ($pwd == $account && $verifytype=='email') {
|
||||
exit('{"code":-1,"msg":"密码不能和邮箱相同"}');
|
||||
}elseif ($pwd == $account && $verifytype=='phone') {
|
||||
exit('{"code":-1,"msg":"密码不能和手机号码相同"}');
|
||||
}elseif (is_numeric($pwd)) {
|
||||
exit('{"code":-1,"msg":"密码不能为纯数字"}');
|
||||
}
|
||||
if($verifytype=='phone'){
|
||||
if(!is_numeric($account) || strlen($account)!=11){
|
||||
exit('{"code":-1,"msg":"手机号码不正确"}');
|
||||
}
|
||||
$userrow=$DB->getRow("select * from pre_user where phone=:account limit 1", [':account'=>$account]);
|
||||
if(!$userrow){
|
||||
exit('{"code":-1,"msg":"该手机号未找到注册商户"}');
|
||||
}
|
||||
}else{
|
||||
if(!preg_match('/^[A-z0-9._-]+@[A-z0-9._-]+\.[A-z0-9._-]+$/', $account)){
|
||||
exit('{"code":-1,"msg":"邮箱格式不正确"}');
|
||||
}
|
||||
$userrow=$DB->getRow("select * from pre_user where email=:account limit 1", [':account'=>$account]);
|
||||
if(!$userrow){
|
||||
exit('{"code":-1,"msg":"该邮箱未找到注册商户"}');
|
||||
}
|
||||
}
|
||||
if($verifytype=='phone'){
|
||||
$type = 1;
|
||||
}else{
|
||||
$type = 0;
|
||||
}
|
||||
$result = \lib\VerifyCode::verify_code('find', $type, $account, $code);
|
||||
if($result !== true){
|
||||
exit(json_encode(['code'=>-1, 'msg'=>$result]));
|
||||
}
|
||||
$pwd = getMd5Pwd($pwd, $userrow['uid']);
|
||||
$sqs=$DB->exec("update `pre_user` set `pwd`='{$pwd}' where `uid`='{$userrow['uid']}'");
|
||||
if($sqs!==false){
|
||||
\lib\VerifyCode::void_code();
|
||||
exit('{"code":1,"msg":"重置密码成功!请牢记新密码"}');
|
||||
}else{
|
||||
exit('{"code":-1,"msg":"重置密码失败!'.$DB->error().'"}');
|
||||
}
|
||||
break;
|
||||
case 'qrcode':
|
||||
unset($_SESSION['openid']);
|
||||
if(!empty($conf['localurl_wxpay']) && !strpos($conf['localurl_wxpay'],$_SERVER['HTTP_HOST'])){
|
||||
$qrcode = $conf['localurl_wxpay'].'user/openid.php?sid='.session_id();
|
||||
}else{
|
||||
$qrcode = $siteurl.'user/openid.php?sid='.session_id();
|
||||
}
|
||||
$result=array("code"=>0,"msg"=>"succ","url"=>$qrcode);
|
||||
exit(json_encode($result));
|
||||
break;
|
||||
case 'getopenid':
|
||||
if(isset($_SESSION['openid']) && !empty($_SESSION['openid'])){
|
||||
$openid = $_SESSION['openid'];
|
||||
unset($_SESSION['openid']);
|
||||
$result=array("code"=>0,"msg"=>"succ","openid"=>$openid);
|
||||
}else{
|
||||
$result=array("code"=>-1);
|
||||
}
|
||||
exit(json_encode($result));
|
||||
break;
|
||||
default:
|
||||
exit('{"code":-4,"msg":"No Act"}');
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
$uid = isset($_GET['uid'])?intval($_GET['uid']):exit('param is error');
|
||||
$certify_id = isset($_GET['certtoken'])?$_GET['certtoken']:exit('param is error');
|
||||
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE uid='{$uid}' limit 1");
|
||||
if(!$userrow)sysmsg('uid不存在');
|
||||
if($certify_id!=$userrow['certtoken'])sysmsg('certtoken不正确');
|
||||
|
||||
$channel = \lib\Channel::get($conf['cert_channel']);
|
||||
if(!$channel)sysmsg('当前实名认证通道信息不存在');
|
||||
$alipay_config = require(PLUGIN_ROOT.$channel['plugin'].'/inc/config.php');
|
||||
$certify = new \Alipay\AlipayCertifyService($alipay_config);
|
||||
$html = $certify->certify($certify_id);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<title>正在跳转</title>
|
||||
<style type="text/css">
|
||||
body {margin:0;padding:0;}
|
||||
p {position:absolute;
|
||||
left:50%;top:50%;
|
||||
width:330px;height:30px;
|
||||
margin:-35px 0 0 -160px;
|
||||
padding:20px;font:bold 14px/30px "宋体", Arial;
|
||||
background:#f9fafc url(../assets/img/loading.gif) no-repeat 20px 20px;
|
||||
text-indent:40px;border:1px solid #c5d0dc;}
|
||||
#waiting {font-family:Arial;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>正在跳转,请稍候...</p>
|
||||
<?php echo $html?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
|
||||
if($conf['cert_open'] == 1){ //支付宝身份验证
|
||||
$uid = authcode($_GET['state'], 'DECODE', SYS_KEY);
|
||||
if(!$uid || $uid<=0)sysmsg('state校验失败');
|
||||
$uid = intval($uid);
|
||||
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE uid='{$uid}' limit 1");
|
||||
if(!$userrow)sysmsg('uid不存在');
|
||||
$certtoken = $userrow['certtoken'];
|
||||
|
||||
$channel = \lib\Channel::get($conf['cert_channel']);
|
||||
if(!$channel)sysmsg('当前实名认证通道信息不存在');
|
||||
$alipay_config = require(PLUGIN_ROOT.$channel['plugin'].'/inc/config.php');
|
||||
try{
|
||||
$certify = new \Alipay\AlipayCertifyService($alipay_config);
|
||||
$certifyResult = $certify->query($certtoken);
|
||||
if($certifyResult['passed'] == 'T'){
|
||||
if($DB->exec("update `pre_user` set `cert`=1 where `uid`='$uid'")){
|
||||
$DB->exec("update `pre_user` set `certtime`='$date' where `uid`='$uid'");
|
||||
if($conf['cert_money']>0){
|
||||
changeUserMoney($uid, $conf['cert_money'], false, '实名认证');
|
||||
}
|
||||
}
|
||||
}else{
|
||||
sysmsg('<center>实名认证未通过('.$certifyResult['fail_reason'] .')</center>');
|
||||
}
|
||||
}catch(Exception $e){
|
||||
sysmsg('支付宝接口返回异常'.$e->getMessage());
|
||||
}
|
||||
|
||||
}elseif($conf['cert_open'] == 3){ //支付宝实名信息验证
|
||||
$uid = authcode(str_replace(' ', '+', $_GET['state']), 'DECODE', SYS_KEY);
|
||||
if(!$uid || $uid<=0)sysmsg('state校验失败');
|
||||
$uid = intval($uid);
|
||||
|
||||
$channel = \lib\Channel::get($conf['cert_channel']);
|
||||
if(!$channel)sysmsg('当前支付通道信息不存在');
|
||||
$alipay_config = require(PLUGIN_ROOT.$channel['plugin'].'/inc/config.php');
|
||||
|
||||
$certdoc = new \Alipay\AlipayCertdocService($alipay_config);
|
||||
try{
|
||||
$tokenArr = $certdoc->getToken($_GET['auth_code']);
|
||||
$result = $certdoc->consult($_GET['cert_verify_id'], $tokenArr['access_token']);
|
||||
}catch(Exception $e){
|
||||
sysmsg('实名证件信息比对验证失败!'.$e->getMessage());
|
||||
}
|
||||
|
||||
if($result['passed'] == 'T'){
|
||||
if(!empty($tokenArr['user_id'])){
|
||||
$openid = $tokenArr['user_id'];
|
||||
}else{
|
||||
$openid = $tokenArr['open_id'];
|
||||
}
|
||||
$DB->exec("update `pre_user` set `cert`=1,`certtime`=NOW(),`alipay_uid`=:user_id where `uid`=:uid", [':user_id'=>$openid, ':uid'=>$uid]);
|
||||
if($conf['cert_money']>0){
|
||||
changeUserMoney($uid, $conf['cert_money'], false, '实名认证');
|
||||
}
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
if($islogin2==1){
|
||||
exit("<script language='javascript'>alert('实名认证成功!');window.location.href='./certificate.php';</script>");
|
||||
}
|
||||
}else{
|
||||
$msg = '实名认证失败,原因:'.$result['fail_reason'].'';
|
||||
if($islogin2==1)$msg .= '<br/><br/><a href="./certificate.php">返回重新认证</a>';
|
||||
sysmsg('<center>'.$msg.'</center>');
|
||||
}
|
||||
|
||||
}elseif($conf['cert_open'] == 4){ //微信扫码实名认证
|
||||
$uid = intval($_GET['state']);
|
||||
$AuthToken = isset($_GET['AuthToken'])?$_GET['AuthToken']:exit('param is error');
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE uid='{$uid}' limit 1");
|
||||
if(!$userrow)sysmsg('uid不存在');
|
||||
if($AuthToken!=$userrow['certtoken'])sysmsg('AuthToken不正确');
|
||||
|
||||
$qcloud = new \lib\QcloudFaceid($conf['cert_qcloudid'], $conf['cert_qcloudkey']);
|
||||
$result = $qcloud->GetRealNameAuthResult($AuthToken);
|
||||
if(isset($result['ResultType'])){
|
||||
if($result['ResultType'] == '0'){
|
||||
if($DB->exec("update `pre_user` set `cert`=1 where `uid`='$uid'")){
|
||||
$DB->exec("update `pre_user` set `certtime`='$date' where `uid`='$uid'");
|
||||
if($conf['cert_money']>0){
|
||||
changeUserMoney($uid, $conf['cert_money'], false, '实名认证');
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$msg = '实名认证未通过';
|
||||
if($result['ResultType'] == '-1'){
|
||||
$msg .= ':姓名和身份证号不一致';
|
||||
}elseif($result['ResultType'] == '-2'){
|
||||
$msg .= ':姓名和微信实名姓名不一致';
|
||||
}elseif($result['ResultType'] == '-3'){
|
||||
$msg .= ':微信号未实名';
|
||||
}else{
|
||||
$msg .= '(ResultType='.$result['ResultType'].')';
|
||||
}
|
||||
sysmsg('<center>'.$msg.'</center>');
|
||||
}
|
||||
}else{
|
||||
sysmsg('接口返回异常['.$result['Error']['Code'].']'.$result['Error']['Message']);
|
||||
}
|
||||
|
||||
}elseif($conf['cert_open'] == 5){ //阿里云金融级实人认证
|
||||
$uid = authcode($_GET['state'], 'DECODE', SYS_KEY);
|
||||
if(!$uid || $uid<=0)sysmsg('state校验失败');
|
||||
$uid = intval($uid);
|
||||
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE uid='{$uid}' limit 1");
|
||||
if(!$userrow)sysmsg('uid不存在');
|
||||
$certtoken = $userrow['certtoken'];
|
||||
|
||||
$aliyun = new \lib\AliyunCertify($conf['cert_aliyunid'], $conf['cert_aliyunkey'], $conf['cert_aliyunsceneid']);
|
||||
$result = $aliyun->query($certtoken);
|
||||
if (isset($result['Code']) && $result['Code']==200) {
|
||||
if($result['Data']['passed'] == 'T'){
|
||||
if($DB->exec("update `pre_user` set `cert`=1 where `uid`='$uid'")){
|
||||
$DB->exec("update `pre_user` set `certtime`='$date' where `uid`='$uid'");
|
||||
if($conf['cert_money']>0){
|
||||
changeUserMoney($uid, $conf['cert_money'], false, '实名认证');
|
||||
}
|
||||
}
|
||||
}else{
|
||||
sysmsg('<center>实名认证未通过('.$result['Data']['fail_reason'].')</center>');
|
||||
}
|
||||
}else{
|
||||
sysmsg('接口返回异常['.$result['Code'].']'.$result['Message']);
|
||||
}
|
||||
}
|
||||
if($islogin2==1){
|
||||
exit("<script language='javascript'>window.location.href='./certificate.php';</script>");
|
||||
}
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
include PAYPAGE_ROOT.'certok.php';
|
||||
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='申请提现';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
|
||||
function display_type($type){
|
||||
if($type==1)
|
||||
return '支付宝';
|
||||
elseif($type==2)
|
||||
return '微信';
|
||||
elseif($type==3)
|
||||
return 'QQ钱包';
|
||||
elseif($type==4)
|
||||
return '银行卡';
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
function convert_type($type){
|
||||
if($type==1)
|
||||
return 'alipay';
|
||||
elseif($type==2)
|
||||
return 'wxpay';
|
||||
elseif($type==3)
|
||||
return 'qqpay';
|
||||
elseif($type==4)
|
||||
return 'bank';
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
if($conf['settle_open']==0||$conf['settle_open']==1)exit('未开启手动申请提现');
|
||||
|
||||
if($conf['settle_type']==1){
|
||||
$today=date("Y-m-d").' 00:00:00';
|
||||
$order_today=$DB->getColumn("SELECT SUM(realmoney) from pre_order where uid={$uid} and status=1 and endtime>='$today'");
|
||||
if(!$order_today) $order_today = 0;
|
||||
$enable_money=round($userrow['money']-$order_today,2);
|
||||
if($enable_money<0)$enable_money=0;
|
||||
}else{
|
||||
$enable_money=$userrow['money'];
|
||||
}
|
||||
|
||||
if(isset($_GET['act']) && $_GET['act']=='do'){
|
||||
if($_POST['submit']=='申请提现'){
|
||||
if(!checkRefererHost())exit();
|
||||
$money=daddslashes(strip_tags($_POST['money']));
|
||||
if(!is_numeric($money) || !preg_match('/^[0-9.]+$/', $money) || $money<=0)exit("<script language='javascript'>alert('提现金额输入不规范');history.go(-1);</script>");
|
||||
if($enable_money<$conf['settle_money']){
|
||||
exit("<script language='javascript'>alert('满{$conf['settle_money']}元才可以提现!');history.go(-1);</script>");
|
||||
}
|
||||
if($money>$enable_money){
|
||||
exit("<script language='javascript'>alert('所输入的提现金额大于你所拥有的余额!');history.go(-1);</script>");
|
||||
}
|
||||
if($money<$conf['settle_money']){
|
||||
exit("<script language='javascript'>alert('最低提现金额为{$conf['settle_money']}元');history.go(-1);</script>");
|
||||
}
|
||||
if($userrow['settle']==0){
|
||||
exit("<script language='javascript'>alert('您的商户出现异常,无法提现');history.go(-1);</script>");
|
||||
}
|
||||
if($conf['settle_maxlimit']>0){
|
||||
$a_count = $DB->getColumn('SELECT count(*) FROM pre_settle WHERE uid=:uid AND addtime>=:addtime', [':uid'=>$uid, ':addtime'=>date('Y-m-d').' 00:00:00']);
|
||||
if($a_count >= $conf['settle_maxlimit']){
|
||||
exit("<script language='javascript'>alert('您今天手动申请提现次数已达到上限');history.go(-1);</script>");
|
||||
}
|
||||
}
|
||||
if($conf['settle_rate']>0){
|
||||
$fee=round($money*$conf['settle_rate']/100,2);
|
||||
if(!empty($conf['settle_fee_min']) && $fee<$conf['settle_fee_min'])$fee=$conf['settle_fee_min'];
|
||||
if(!empty($conf['settle_fee_max']) && $fee>$conf['settle_fee_max'])$fee=$conf['settle_fee_max'];
|
||||
$realmoney=round($money-$fee, 2);
|
||||
}else{
|
||||
$realmoney=round($money, 2);
|
||||
}
|
||||
$data = ['uid'=>$uid, 'type'=>$userrow['settle_id'], 'account'=>$userrow['account'], 'username'=>$userrow['username'], 'money'=>$money, 'realmoney'=>$realmoney, 'addtime'=>'NOW()', 'status'=>0];
|
||||
if($DB->insert('settle', $data)){
|
||||
$settleid=$DB->lastInsertId();
|
||||
changeUserMoney($uid, $money, false, '手动提现');
|
||||
if($conf['settle_transfer']==1 && $conf['settle_transfermax']>0 && $money>$conf['settle_transfermax']) $conf['settle_transfer']=0;
|
||||
$app = convert_type($userrow['settle_id']);
|
||||
$channelid = $conf['transfer_'.$app];
|
||||
if($conf['settle_transfer']==1 && $channelid > 0){
|
||||
$out_biz_no = date("YmdHis").rand(11111,99999);
|
||||
$channel = \lib\Channel::get($channelid);
|
||||
$result = \lib\Transfer::submit($app, $channel, $out_biz_no, $userrow['account'], $userrow['username'], $realmoney);
|
||||
if($result['code']==0){
|
||||
$update = ['status'=>1, 'endtime'=>'NOW()', 'transfer_no'=>$out_biz_no, 'transfer_channel'=>$channelid, 'transfer_status'=>1, 'transfer_result'=>$result["orderid"], 'transfer_date'=>$result["paydate"]];
|
||||
if(isset($result['wxpackage'])) $update['transfer_ext'] = $result['wxpackage'];
|
||||
$DB->update('settle', $update, ['id'=>$settleid]);
|
||||
if($result['status'] == 1){
|
||||
$msg = '提现成功,资金已到账!';
|
||||
}elseif(isset($result['wxpackage'])){
|
||||
if(checkwechat()){
|
||||
$jumpurl = $siteurl.'paypage/wxtrans.php?id='.$out_biz_no.'&type=transfer';
|
||||
exit("<script language='javascript'>window.location.href='{$jumpurl}';</script>");
|
||||
}
|
||||
$msg = '提现成功!请在结算记录页面扫描二维码确认收款,1天内未确认,将退还给商家。';
|
||||
}else{
|
||||
$msg = '提现成功,资金稍后到账!';
|
||||
}
|
||||
exit("<script language='javascript'>alert('$msg');window.location.href='./settle.php';</script>");
|
||||
}else{
|
||||
$message='转账失败 '.$result['msg'];
|
||||
$DB->update('settle', ['status'=>3, 'result'=>$result["msg"], 'transfer_status'=>2, 'transfer_result'=>$message], ['id'=>$settleid]);
|
||||
\lib\MsgNotice::send('apply', 0, ['uid'=>$uid, 'money'=>$money, 'realmoney'=>$realmoney, 'type'=>display_type($userrow['settle_id']), 'account'=>$userrow['account'], 'username'=>$userrow['username']]);
|
||||
exit("<script language='javascript'>alert('申请提现成功,但转账失败,请联系客服处理!');window.location.href='./settle.php';</script>");
|
||||
}
|
||||
}else{
|
||||
\lib\MsgNotice::send('apply', 0, ['uid'=>$uid, 'money'=>$money, 'realmoney'=>$realmoney, 'type'=>display_type($userrow['settle_id']), 'account'=>$userrow['account'], 'username'=>$userrow['username']]);
|
||||
}
|
||||
}
|
||||
exit("<script language='javascript'>alert('申请提现成功!');window.location.href='./settle.php';</script>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">申请提现</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
申请提现
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal devform" action="./apply.php?act=do" method="post">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">提现方式</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" value="<?php echo display_type($userrow['settle_id'])?>" disabled><a href="./editinfo.php" class="input-group-addon">修改收款账号</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">提现账号</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" value="<?php echo $userrow['account']?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">你的姓名</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" value="<?php echo $userrow['username']?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">当前余额</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" value="<?php echo $userrow['money']?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">可提现余额</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="tmoney" value="<?php echo $enable_money?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">申请提现余额</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" name="money" value="" required><a href="javascript:inputMoney()" class="input-group-addon">全部</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="submit" name="submit" value="申请提现" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</form>
|
||||
<footer class="panel-footer">
|
||||
<div class="col-sm-offset-2 col-sm-6"><br/>
|
||||
<h4><span class="glyphicon glyphicon-info-sign"></span>注意事项</h4>
|
||||
当前最低提现金额为<b><?php echo $conf['settle_money']?></b>元<br/>
|
||||
当前手动提现模式是:<?php echo $conf['settle_type']==1?'<b>D+1</b>,可提现余额为截止到前一天你的收入':'<b>D+0</b>,可提现余额为截止到现在你的收入';?><br/>
|
||||
<?php echo $conf['settle_transfer']==1?'申请提现后,你的款项将立刻下发到指定账户内。':'申请提现后,你的款项将在1天内下发到指定账户内。';?>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script>
|
||||
function inputMoney(){
|
||||
$("input[name='money']").val($("input[name='tmoney']").val());
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
#captcha_text{height:42px;width:100%;text-align:center;border-radius:2px;background-color:#F3F3F3;color:#BBBBBB;font-size:14px;letter-spacing:0.1px;line-height:42px}#captcha_wait{display:none;height:42px;width:100%;text-align:center;border-radius:2px;background-color:#F3F3F3}.loading{margin:auto;width:70px;height:20px}.loading-dot{float:left;width:8px;height:8px;margin:18px 4px;background:#ccc;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;opacity:0;-webkit-box-shadow:0 0 2px black;-moz-box-shadow:0 0 2px black;-ms-box-shadow:0 0 2px black;-o-box-shadow:0 0 2px black;box-shadow:0 0 2px black;-webkit-animation:loadingFade 1s infinite;-moz-animation:loadingFade 1s infinite;animation:loadingFade 1s infinite}.loading-dot:nth-child(1){-webkit-animation-delay:0s;-moz-animation-delay:0s;animation-delay:0s}.loading-dot:nth-child(2){-webkit-animation-delay:0.1s;-moz-animation-delay:0.1s;animation-delay:0.1s}.loading-dot:nth-child(3){-webkit-animation-delay:0.2s;-moz-animation-delay:0.2s;animation-delay:0.2s}.loading-dot:nth-child(4){-webkit-animation-delay:0.3s;-moz-animation-delay:0.3s;animation-delay:0.3s}@-webkit-keyframes loadingFade{0%{opacity:0}50%{opacity:0.8}100%{opacity:0}}@-moz-keyframes loadingFade{0%{opacity:0}50%{opacity:0.8}100%{opacity:0}}@keyframes loadingFade{0%{opacity:0}50%{opacity:0.8}100%{opacity:0}}
|
||||
@@ -0,0 +1,69 @@
|
||||
.certification_type{padding-top: 6.5px;}
|
||||
.verified .row{padding:25px}
|
||||
.verified .mt-step-col{padding:5px 5px 5px 30px;}
|
||||
.verified .mt-step-col .mt-step-col-cont{background:#94aac5;color:rgba(255,255,255,.6);width:100%;border-radius:3px}
|
||||
.verified .font-grey-cascade{padding-top:0;font-size:16px!important}
|
||||
.verified .complete-active .mt-step-col-cont{background:#635ebe}
|
||||
.verified .icon{color:#fff;position:absolute;top:10px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);left:20px;width:40px;height:40px;font-size:24px;line-height:40px;color:#fff;text-align:center;background:rgba(255,255,255,.1);border-radius:50%}
|
||||
@media screen and (max-width:1200px) {
|
||||
.verified .row {
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
.type-item {
|
||||
padding: 50px 80px;
|
||||
border: 1px solid #eff2f7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
border-radius:20px;
|
||||
}
|
||||
|
||||
.type-item a {
|
||||
width: 100px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.type-icon {
|
||||
width: 49px;
|
||||
height: 36px;
|
||||
margin-bottom: 1.5rem!important;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.personal {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAAqCAYAAADibUizAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjVEQzc4NzVDOEY2MzExRUE4RUNEQkVCQ0I5NzlBREU4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjVEQzc4NzVEOEY2MzExRUE4RUNEQkVCQ0I5NzlBREU4Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NURDNzg3NUE4RjYzMTFFQThFQ0RCRUJDQjk3OUFERTgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NURDNzg3NUI4RjYzMTFFQThFQ0RCRUJDQjk3OUFERTgiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz44qZ6BAAAG8klEQVR42txae2xTVRhvb9u1W7u269q9GBt7OMZjEDQaNQgo8YUiYHgkmpDgFEVRJBEFAyFGFBIE/QcUmQYFSYxEkaAGEZg4wVfIpmQ8xqDQja1r19fWx/r0d+ZpPbus7dYV1/rBL+fcc797e373e5zvHBDOPPGyICwP/jVrPJq5QBHACdJTOoHvgTPsoJghuQXNq4BQkP6yGdgNrAACgrDVQPIFNK/9T0iG5RlgI9+iaxmFBuB1wJCG5NTAUmA1vSbtW0CfGNbUoVNMb3iAeUdq6i3pwgzz5w81AlOA2YACKAfOEdeVM0qX0olkDPmV6UsHJCMqgQS+KEe/Wh5gBfT4WO5RJurjD4hH4DLE5dcBTwD5zC0X7h1G+yYIn00VE3MJkrwXzXka7Pm821nAYqAJeqvTligmfweabwENa0WgGTDz3r0d+i+mAlHxMElK0HwGyOiQm66/deG4hM49aHYANVRnG8a+w/1LUd4p4y1vicgHtCJKDlHIEqCSSVxzQKCeVcD1T5j8dHRPAxMBCSXydJR3ytiFPUE5GI/ocF13PtPfzyfJkHWgeYUZmpdWrgupYvqH4uiSwtoLZABaWFmND2AbRI/E97IR8riWbKIypt8TSxGkAiAXJkokE7ANokd09iSxMkqK67Yz/VvjTKCClmDheO5KJ9c9DoQ/4UqQ2QmL2KPormP6PxILp1PW3UN3NjK6OT+EiS4CiS5eSbgeqGWe+yROONz0rDssoiBkAJFN6G6iQzOAFox9QSslLbCAl7RO0bX3pklIGBLib1Jdlwg5iXgEuIteK3nWY4Ukn4XR3JaKk36cQSXABTmv2Nuf0MQBkZ8LcSGBQBgKU/RzAc6T4bmmcimTWhmVodnFkBzKRrgez60A2eNRvMRHXS/hrCv1ZyQv6+KFc+iB0/28W0bgGPA5XTv1g6y9R/H8WsF/JAEuIErIopTkQVrO9fsMsJfWtL/DKiGe/kR6ZvM8XUfJB92McTl0N/B0pfQQixUT9BKOa4vcptb15A6PKF0P9zMkO0jNS2raGEmL7GRW49kP0R6gNS+R9Rg7g/tfMeqkkHiX94qmwRJYuamkyi3p2+aUuqa7MzxKn8jHHZ18UiDzSfsUHnlzple2s7qjss4ldW+0BRx5apdy8XBcl0xWxZCcEYskj/A5NHfTiYdlF8gqY7tecEAKregaJy605R2+mtt+oUNtfNSR2aMmJMm9oDAocGW4pV1K87Sr2rbdv1ScMXlFviqQXIKxfXBjLq5FMaEH0NzHuOviaNutGGTteM8CSjYb0NEN+xv8WpcsEyS+emTOPoakwiK3XrTK7YVD+T17lkMLi57Ce2rFQXEtMray2FIU13WfY/qfYtINicQMnrsCsuRQ+W06VItrctQSjFfr2rLsfw6VZOTASOQTtud0fjTWUqQHyRMxXRcTIUnkYWZoxwiT4S7m8G0sMDXeA5jolm6FtSyRH/OL/EJztuXgpXw9Fy9GpzK7FRKbf4yEJT1GZWP7tnjPdMutq0bymz2yXpKwNsQjWsL0z/OXkASlkekXxVIcZx67CLEmG+4PKN3ZtlJz8ZMFdt1Jct0rc9bGS0atTMJoTtJa/jXJF7R/OpYiMufC4b4cZaBZ26uZUGkcZ75Q2Eoqrhm9UteYmERhwUaeBUYs9OilfogxVs5ek6I9JIzuVGqXypjbm1MJkr0tBZerTdnd/TsmZF0OcapJ5X8DjRgh26NwlJtKVXDJ5ZKAJMhX1DjVbWGSFwsu396pMjWiqMiM7G4EIXnKEhUFuQ6m39eap3eQgmCMtWARS1bTm6PPcaor/iHZOrNT3fUzKSAiFVGIE9xiLDPwiYpShajULz3y71rq0OU7tP0xrdcaviRkM/ySoLZHcz7HpRoPkl6QfOh6jvGYW+KRsO+R92X1hLOuixmvxPqpTQWiSCzvY5L+yBZJab5T58htRKXEEbIoBKap3MpJhCQSz+Ntms5v+sTeGwyl8GT1Z18h+T8MIHcd/UKmoH4HaBstkqh1/T9MOtkAEh9f0RmWoZyL3MOupBlLSA1cud99EbdPtWs66rABv+GIQRwUhUrMxWVw3avhgN8KbGcKhb2jHJ+C2c3TlyDWnrXKHfO7FZacyP4tu3sikstZWHYWioEVbZqOjYFBSBLJt+v2EZJsZnuPrNHASymTjAKinaKg6Lc8Ry62ZO5GkI7EHkq7CYAx1vNw86bJbdVLB6RwWvWsggvXoX2M7jBGVYT4A6KzzhW17KnoKq0xK6wNZGcS9zmstwX2vMNTDBPmDhhn/59RqguK/K3IwMtJDTtYPKqdqhasuSurOsuPJuMUcNTEoLm+Bs2aclNJNZLPPGy6S2F5JyzfBBxA8vJEe/ZvAQYAfI6/mqk2QpEAAAAASUVORK5CYII=");
|
||||
}
|
||||
|
||||
.enterprises {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAYAAABgDOogAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjUzMTcxRjY2OEY2MzExRUFBRjZFOEI5MTE1RkU0QTQ2IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjUzMTcxRjY3OEY2MzExRUFBRjZFOEI5MTE1RkU0QTQ2Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NTMxNzFGNjQ4RjYzMTFFQUFGNkU4QjkxMTVGRTRBNDYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NTMxNzFGNjU4RjYzMTFFQUFGNkU4QjkxMTVGRTRBNDYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6QjG2PAAAF3UlEQVR42txZC2xTVRi+bW/bPbqt7R7s/WbAFgdERVCCk+k0GhJFF4yiJkgkkihbWNQYQ5QoRgFFsqDBoGQjIYbFGCQhGI1EjagkvJnbZBt7dese7Vb6fvqdcjqPd7drt86181++3HvuOff0fvf85/v//06y5+A3HCwdeBeoBTTcwjULcAp4E+giF3ggAzgHFHML3xKBTUANcC/QRgi+LyD3G6BfoOTW0CPxwkbgQULwCWZQA7B/Aa/gYuAPQA2sJ0cps+fMwMcL3EX/Ar6l55IAwYCNAd7/wT40sA1+FhMkA08C9wFpIv1OYJC6ygnajprNlOBW4CMgKczxbwOPA9ejRVA6g7HPAp/PgByxUuBsNENQuCtYBHwmuDYKDIiMlQF5QAptEzc+Tl3aHYsEyQM3ASra9gDbgC8A3zTzvsqEnFXALgrWyEvoiZBDJdAbCUESG9cy7deAIyHucdO9mg/soNdI+nSaZk0cI+Up/+U2C0VwObCbaZ8JEiurgUKqmibm+hskmwAqqCcco3OaaT/xgIkICXojIXgQUDBxcouIW25j9ich+gzTZwc205Ahp2Kzn97DUXLqaKqogjl/CdCJjIlnzhNE+i/RcBGwe2JJZF6nLnYN+DqC3/mAljLZwMmoETxzx1lh/08UQe3hq1VciDkCyvuJyL0xoaKBh2nwSXwbJT7JKZDYE2SYHOOC7SkT7hMKQtRVlLW99FgOBCP4KGCcJtwIS7Goq+hc2johQaxoxCoq3CKR5KLB85bwrDXmqwmJf8tMa5eBuiB9F+aDkA9/7HPOtYuOw+3OzsC9SGXys+ByO+bYFDTrH8mrccs8D3kl3lQQcbZl37jEe/ijpfpCuz+zUDha45xKD/pk870HgyXyy0MNKhkuVNkUtmZjwsRj3el98ilu6OEPTcSbOlJsSS+W6osOW5TW7nhnXIvUJ406walZutTzL10oHM3bMKjWn7AqbMqg98jcktEkwxJj4sQvTpmrqVxX9gLaW5UupTSqBOGK4zQWihrIbezXDLYQAuHM55F6uL5U3fNw4bzKvmXrw3JR7JMSQRUvw7UVTDuHOVcJ+oTWB1Jj4Txs8XBBjk4z9FW45FjDij8g88r2VQyUNfAhyGnp9xTWPUjhezHILXdO00eMfFReE85DWuKsLXa5Y9YeNpw8Uq9wy/eGioOVAnKR2iq8NGkYoqIdUxlmVXUkOhLsWD3OybukeEEHQv3YFcAxhwTPi+SjU8wlc22H2MzINUnsyzFmfrm2Y1U8jjtue4Glhg8hAga88bs48e+fs7Eb4QwCwXUzJmfI/LRiYMl2Kjb+0GNR2DR8GEp3bb7V1SP1pk8+vE/CaSzqm3aFPUssVJB+rFgjyL1C2tdzOvbp1PotgfAh5WLTXIETrUXdaVAZi7LGF+Um25KMQnK5xqz3/iHXfmhAO7gTZd0sk+35SpA9fMekmipt+cUj+Us7M26Opt9KzVdbU/QsufKBsrdI+2pu2/F+7eDLPqYiQKB3swSTYoWg0q1onvxqJbfLh5JHLlKS5lSzphSr2ptnyG7o0+r85K7k/XkSMfNpEUXtl4JxQCW1EJTaWCDYnd57BnnlZCFsVdriWJKGxPGC3tQBf215Ob/1ewT2DWLzqBwJRyS7G1tO817+EebbyQ/c7f8ORcXwwp0u3lUPoXiqI7PrKLufEhzx9syJjLu7Mnr8wrfIlHZOnzy6WmyeJLvKnGFKS+HNcZZ3sHnXIfNOoNl9TTRXj0i+3C23tmd11sENn4MbVrMrqdPoL0A1jyGIV4Fckege9sp8abc0m1BCeWV8fWE/Nu+vSGtWYPLMWHBRPMfqkpGC81iBXbfizbUof9KZykGGayttCrsmGLlsY+bOpYOlzZPJ9u8lF0iRurK6dW0JFCybrmR0SfokpHgm/lmBFWvCam0OlXgn21QmiFBt2VDJd5Pz3P9jHbcQDNVFAYL9AbPSWmVVWlNIKkfcWelSuKGWPcDhZbrFHwrv+1uAAQCgZQwfwnBhuwAAAABJRU5ErkJggg==");
|
||||
}
|
||||
|
||||
.type-title {
|
||||
font-size: 22px;
|
||||
color: #333;
|
||||
margin-bottom: 15px;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.type-desc {
|
||||
color: #70757d;
|
||||
text-align: center;
|
||||
margin-bottom: 25px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.type-info {
|
||||
margin-bottom: 40px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.type-info li {
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.type-info li i {
|
||||
color: #007bfc;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/sourcesanspro/sourcesanspro-light.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url('../fonts/sourcesanspro/sourcesanspro.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../fonts/sourcesanspro/sourcesanspro-bold.woff') format('woff');
|
||||
}
|
||||
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
@@ -0,0 +1,227 @@
|
||||
{
|
||||
"dongxue": {
|
||||
"qrWidth": "364",
|
||||
"qrHeight": "364",
|
||||
"foreground": "#E3D6C6",
|
||||
"background": "#FFFFFF",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "#FFFFFF",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 270,
|
||||
"qrTop": 340,
|
||||
"url": "https://img.alicdn.com/imgextra/i2/2027555802/O1CN0178X3hU1sjMWfmkoh5_!!2027555802.png"
|
||||
},
|
||||
"pikaqiu": {
|
||||
"qrWidth": "316",
|
||||
"qrHeight": "316",
|
||||
"foreground": "#FBCE29",
|
||||
"background": "#FFFFFF",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "#FFFFFF",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 290,
|
||||
"qrTop": 367,
|
||||
"url": "https://img.alicdn.com/imgextra/i3/2027555802/O1CN01ETL8eZ1sjMWf7GHlX_!!2027555802.png"
|
||||
},
|
||||
"kanuobudingmao": {
|
||||
"qrWidth": "316",
|
||||
"qrHeight": "316",
|
||||
"foreground": "#E1C6B1",
|
||||
"background": "#FFFFFF",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "#E1C6B1",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 290,
|
||||
"qrTop": 367,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN01bFGxSs1sjMWcWW1uR_!!2027555802.png"
|
||||
},
|
||||
"niannianyouyu": {
|
||||
"qrWidth": "370",
|
||||
"qrHeight": "370",
|
||||
"foreground": "#E62601",
|
||||
"background": "#FFFFFF",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "60px '黑体'",
|
||||
"fontColor": "#FFFFFF",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 255,
|
||||
"qrLeft": 270,
|
||||
"qrTop": 320,
|
||||
"url": "https://img.alicdn.com/imgextra/i1/2027555802/O1CN01T0g4kQ1sjMWf7HUZP_!!2027555802.png"
|
||||
},
|
||||
"xiaohuangren": {
|
||||
"qrWidth": "520",
|
||||
"qrHeight": "520",
|
||||
"foreground": "#F7D25D",
|
||||
"background": "#FFFFFF",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 183,
|
||||
"qrTop": 98,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN019MNjbn1sjMWe1zPkK_!!2027555802.png"
|
||||
},
|
||||
"qitao": {
|
||||
"qrWidth": "520",
|
||||
"qrHeight": "520",
|
||||
"foreground": "#212121",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 93,
|
||||
"qrTop": 98,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN01vCBhEb1sjMWbLYdfv_!!2027555802.png"
|
||||
},
|
||||
"baobei": {
|
||||
"qrWidth": "500",
|
||||
"qrHeight": "500",
|
||||
"foreground": "#A95B5E",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 200,
|
||||
"qrTop": 370,
|
||||
"url": "https://img.alicdn.com/imgextra/i3/2027555802/O1CN01ABc7nR1sjMWbLWQRm_!!2027555802.png"
|
||||
},
|
||||
"toushi": {
|
||||
"qrWidth": "400",
|
||||
"qrHeight": "400",
|
||||
"foreground": "#FDA3B8",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 408,
|
||||
"qrTop": 605,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN01mO4EYP1sjMWeSZtzX_!!2027555802.png"
|
||||
},
|
||||
"gongzhu": {
|
||||
"qrWidth": "520",
|
||||
"qrHeight": "520",
|
||||
"foreground": "#F36C79",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 185,
|
||||
"qrTop": 370,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN01LDfMYs1sjMWhTHmPR_!!2027555802.png"
|
||||
},
|
||||
"qiuzanzhu": {
|
||||
"qrWidth": "460",
|
||||
"qrHeight": "460",
|
||||
"foreground": "#F36C79",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 220,
|
||||
"qrTop": 425,
|
||||
"url": "https://img.alicdn.com/imgextra/i2/2027555802/O1CN01EAhVdL1sjMWe1yXjJ_!!2027555802.png"
|
||||
},
|
||||
"huanyingdashang": {
|
||||
"qrWidth": "510",
|
||||
"qrHeight": "510",
|
||||
"foreground": "#F00",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 195,
|
||||
"qrTop": 625,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN01Yuipi71sjMWhTI32u_!!2027555802.png"
|
||||
},
|
||||
"yinlian": {
|
||||
"qrWidth": "330",
|
||||
"qrHeight": "330",
|
||||
"foreground": "#fff",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 190,
|
||||
"qrTop": 180,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN01DU5ECy1sjMWe205L5_!!2027555802.png"
|
||||
},
|
||||
"yitiji": {
|
||||
"qrWidth": "380",
|
||||
"qrHeight": "380",
|
||||
"foreground": "#FB7C2F",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 260,
|
||||
"qrTop": 190,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN01B4y11v1sjMWeSGuWy_!!2027555802.png"
|
||||
},
|
||||
"maomi": {
|
||||
"qrWidth": "480",
|
||||
"qrHeight": "480",
|
||||
"foreground": "#FDD699",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 210,
|
||||
"qrTop": 150,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN017OCNEy1sjMWfe9Z3U_!!2027555802.png"
|
||||
},
|
||||
"longmao": {
|
||||
"qrWidth": "464",
|
||||
"qrHeight": "464",
|
||||
"foreground": "#7394B6",
|
||||
"background": "transparent",
|
||||
"imgWidth": 900,
|
||||
"imgHeight": 1200,
|
||||
"font": "70px '黑体'",
|
||||
"fontColor": "transparent",
|
||||
"recNameLeft": "",
|
||||
"recNameTop": 178,
|
||||
"qrLeft": 218,
|
||||
"qrTop": 214,
|
||||
"url": "https://img.alicdn.com/imgextra/i4/2027555802/O1CN01Jb4sxE1sjMWWkB2GX_!!2027555802.png"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
var config;
|
||||
// 生成收款码
|
||||
function makeDiyBg(element, qrWidth, qrHeight, url, foreground, background, imgUrl, imgWidth, imgHeight, font, fontColor, recName, recNameLeft, recNameTop, qrLeft, qrTop) {
|
||||
$(element).qrcode({
|
||||
render: "canvas",
|
||||
width: qrWidth,
|
||||
height: qrHeight,
|
||||
text: url,
|
||||
foreground: foreground,
|
||||
background: background
|
||||
});
|
||||
var canvas = document.getElementById('canvas');
|
||||
canvas.width = imgWidth;
|
||||
canvas.height = imgHeight;
|
||||
var ctx = canvas.getContext("2d");
|
||||
var img = new Image();
|
||||
img.crossOrigin = "Anonymous"
|
||||
img.src = imgUrl;
|
||||
img.onload = function () {
|
||||
// 生成背景图
|
||||
var bg = ctx.createPattern(img, "no-repeat");
|
||||
ctx.fillStyle = bg;
|
||||
ctx.fillRect(0, 0, imgWidth, imgHeight);
|
||||
// 生成收款名
|
||||
ctx.textAlign = "center";
|
||||
ctx.font = font;
|
||||
ctx.fillStyle = fontColor;
|
||||
if (recName) {
|
||||
if (!recNameLeft) {
|
||||
recNameLeft = imgWidth / 2;
|
||||
}
|
||||
ctx.fillText("扫码向 " + recName + " 付款", recNameLeft, recNameTop);
|
||||
}
|
||||
// 在canvas上生成二维码
|
||||
var canvasOld = document.getElementsByTagName('canvas')[0];
|
||||
ctx.drawImage(canvasOld, qrLeft, qrTop);
|
||||
|
||||
|
||||
var image = new Image();
|
||||
image.crossOrigin = "Anonymous"
|
||||
image.src = canvas.toDataURL("image/png");
|
||||
$("#endImg").attr("src", image.src);
|
||||
$("#load").hide();
|
||||
$("#qrcode").show();
|
||||
}
|
||||
}
|
||||
function showQrCode(styleName){
|
||||
$("#load").show();
|
||||
$("#qrcode").hide();
|
||||
$("#code").empty();
|
||||
styleName = styleName || 'dongxue';
|
||||
var qrWidth = config[styleName].qrWidth;
|
||||
var qrHeight = config[styleName].qrHeight;
|
||||
var foreground = config[styleName].foreground;
|
||||
var background = config[styleName].background;
|
||||
var imgWidth = config[styleName].imgWidth;
|
||||
var imgHeight = config[styleName].imgHeight;
|
||||
var font = config[styleName].font;
|
||||
var fontColor = config[styleName].fontColor;
|
||||
var recNameLeft = config[styleName].recNameLeft;
|
||||
var recNameTop = config[styleName].recNameTop;
|
||||
var qrLeft = config[styleName].qrLeft;
|
||||
var qrTop = config[styleName].qrTop;
|
||||
var nowUrl = config[styleName].url;
|
||||
makeDiyBg("#code", qrWidth, qrHeight, $("#code_url").val(), foreground, background, nowUrl, imgWidth, imgHeight, font, fontColor, $("#recName").val(), recNameLeft, recNameTop, qrLeft, qrTop);
|
||||
}
|
||||
$(document).ready(function(){
|
||||
var clipboard = new Clipboard('.copy-btn');
|
||||
clipboard.on('success', function (e) {
|
||||
layer.msg('复制成功!', {icon: 1});
|
||||
});
|
||||
clipboard.on('error', function (e) {
|
||||
layer.msg('复制失败,请长按链接后手动复制', {icon: 2});
|
||||
});
|
||||
$("#editName").click(function(){
|
||||
var codename=$("input[name='codename']").val();
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_codename",
|
||||
data : {codename:codename},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert(data.msg, {icon: 1}, function(){window.location.reload()});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
//点击按钮保存图片
|
||||
$("#downImg").click(function () {
|
||||
var img = document.getElementById('endImg');
|
||||
var url = img.src;
|
||||
var a = document.createElement('a');
|
||||
var event = new MouseEvent('click');
|
||||
a.download = '聚合收款-' + document.getElementById("recName").value;
|
||||
a.href = url;
|
||||
a.dispatchEvent(event);
|
||||
});
|
||||
$("#styleName").change(function(){
|
||||
$.cookie('styleName',$(this).val());
|
||||
showQrCode($(this).val());
|
||||
});
|
||||
if($.cookie('styleName')){
|
||||
$("#styleName").val($.cookie('styleName'));
|
||||
}
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: "./assets/js/config.json",
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function (data) {
|
||||
config = data;
|
||||
$("#styleName").change();
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,169 @@
|
||||
var interval1,interval2;
|
||||
function setCookie(name,value)
|
||||
{
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + 30*1000);
|
||||
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
function getCookie(name)
|
||||
{
|
||||
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
|
||||
if(arr=document.cookie.match(reg))
|
||||
return unescape(arr[2]);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
function delCookie(name)
|
||||
{
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() - 1);
|
||||
var cval=getCookie(name);
|
||||
if(cval!=null){
|
||||
document.cookie= name + "="+cval+";expires="+exp.toGMTString();
|
||||
}
|
||||
}
|
||||
function getqrpic(force){
|
||||
force = force || false;
|
||||
cleartime();
|
||||
var qrsig = getCookie('qrsig');
|
||||
var qrimg = getCookie('qrimg');
|
||||
var qrurl = getCookie('qrurl');
|
||||
if(qrsig!=null && qrimg!=null && qrurl!=null && force==false){
|
||||
$('#qrimg').attr('qrsig',qrsig);
|
||||
$('#qrimg').attr('qrurl',qrurl);
|
||||
$('#qrimg').html('<img id="qrcodeimg" onclick="getqrpic(true)" src="data:image/png;base64,'+qrimg+'" title="点击刷新">');
|
||||
if( /Android|SymbianOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Phone|Midp/i.test(navigator.userAgent) && navigator.userAgent.indexOf("QQ/") == -1) {
|
||||
$('#mobile').show();
|
||||
}
|
||||
interval1=setInterval(loginload,1000);
|
||||
interval2=setInterval(qrlogin,3000);
|
||||
}else{
|
||||
var getvcurl='qrlogin.php?do=getqrpic&r='+Math.random(1);
|
||||
$.get(getvcurl, function(d) {
|
||||
if(d.saveOK ==0){
|
||||
setCookie('qrsig',d.qrsig);
|
||||
setCookie('qrimg',d.data);
|
||||
setCookie('qrurl',d.url);
|
||||
$('#qrimg').attr('qrsig',d.qrsig);
|
||||
$('#qrimg').attr('qrurl',d.url);
|
||||
$('#qrimg').html('<img id="qrcodeimg" onclick="getqrpic(true)" src="data:image/png;base64,'+d.data+'" title="点击刷新">');
|
||||
if( /Android|SymbianOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Phone|Midp/i.test(navigator.userAgent) && navigator.userAgent.indexOf("QQ/") == -1) {
|
||||
$('#mobile').show();
|
||||
}
|
||||
interval1=setInterval(loginload,1000);
|
||||
interval2=setInterval(qrlogin,3000);
|
||||
}else{
|
||||
alert(d.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
function qrlogin(){
|
||||
if ($('#login').attr("data-lock") === "true") return;
|
||||
var qrsig=$('#qrimg').attr('qrsig');
|
||||
var url = 'qrlogin.php?do=qrlogin&qrsig='+decodeURIComponent(qrsig)+'&r='+Math.random(1);
|
||||
$.get(url, function(d) {
|
||||
if(d.saveOK ==0){
|
||||
$('#loginmsg').html('QQ已成功登录!');
|
||||
$('#login').hide();
|
||||
$('#qrimg').hide();
|
||||
$('#submit').hide();
|
||||
$('#login').attr("data-lock", "true");
|
||||
cleartime();
|
||||
$.get("connect.php?act=qrlogin&r="+Math.random(1), function(arr) {
|
||||
if(arr.code==0) {
|
||||
layer.msg(arr.msg, {icon: 16,time: 10000,shade:[0.3, "#000"]});
|
||||
setTimeout(function(){ window.location.href=arr.url }, 1000);
|
||||
}else{
|
||||
layer.alert(arr.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}else if(d.saveOK ==1){
|
||||
getqrpic(true);
|
||||
$('#loginmsg').html('请重新扫描二维码');
|
||||
}else if(d.saveOK ==2){
|
||||
$('#loginmsg').html('使用QQ手机版扫描二维码');
|
||||
}else if(d.saveOK ==3){
|
||||
$('#loginmsg').html('扫描成功,请在手机上确认授权登录');
|
||||
}else if(d.saveOK ==4){
|
||||
cleartime();
|
||||
$('#loginmsg').html('QQ验证失败,请解除登录异常后重试!');
|
||||
}else{
|
||||
cleartime();
|
||||
$('#loginmsg').html(d.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
function loginload(){
|
||||
if ($('#login').attr("data-lock") === "true") return;
|
||||
var load=document.getElementById('loginload').innerHTML;
|
||||
var len=load.length;
|
||||
if(len>2){
|
||||
load='.';
|
||||
}else{
|
||||
load+='.';
|
||||
}
|
||||
document.getElementById('loginload').innerHTML=load;
|
||||
}
|
||||
function cleartime(){
|
||||
clearInterval(interval1);
|
||||
clearInterval(interval2);
|
||||
delCookie('qrsig');
|
||||
delCookie('qrimg');
|
||||
delCookie('qrurl');
|
||||
}
|
||||
function mloginurl(){
|
||||
var imagew = $('#qrcodeimg').attr('src');
|
||||
imagew = imagew.replace(/data:image\/png;base64,/, "");
|
||||
$('#mlogin').html("正在跳转...");
|
||||
$.post("connect.php?act=qrcode&r="+Math.random(1),"image="+encodeURIComponent(imagew), function(arr) {
|
||||
if(arr.code==0) {
|
||||
$('#loginmsg').html('跳转到QQ登录后请返回此页面');
|
||||
window.location.href='mqqapi://forward/url?version=1&src_type=web&url_prefix='+window.btoa(arr.url);
|
||||
}else{
|
||||
alert(arr.msg);
|
||||
}
|
||||
$('#mlogin').html("跳转QQ快捷登录");
|
||||
}, 'json');
|
||||
}
|
||||
function mloginurlnew(){
|
||||
var qrurl = $('#qrimg').attr('qrurl');
|
||||
$('#loginmsg').html('跳转到QQ登录后请返回此页面');
|
||||
var ua = window.navigator.userAgent.toLowerCase();
|
||||
var is_ios = ua.indexOf('iphone')>-1 || ua.indexOf('ipad')>-1;
|
||||
var schemacallback = '';
|
||||
if(is_ios){
|
||||
schemacallback = 'weixin://';
|
||||
}else if(ua.indexOf('ucbrowser')>-1){
|
||||
schemacallback = 'ucweb://';
|
||||
}else if(ua.indexOf('meizu')>-1){
|
||||
schemacallback = 'mzbrowser://';
|
||||
}else if(ua.indexOf('liebaofast')>-1){
|
||||
schemacallback = 'lb://';
|
||||
}else if(ua.indexOf('baidubrowser')>-1){
|
||||
schemacallback = 'bdbrowser://';
|
||||
}else if(ua.indexOf('baiduboxapp')>-1){
|
||||
schemacallback = 'bdapp://';
|
||||
}else if(ua.indexOf('mqqbrowser')>-1){
|
||||
schemacallback = 'mqqbrowser://';
|
||||
}else if(ua.indexOf('qihoobrowser')>-1){
|
||||
schemacallback = 'qihoobrowser://';
|
||||
}else if(ua.indexOf('chrome')>-1){
|
||||
schemacallback = 'googlechrome://';
|
||||
}else if(ua.indexOf('sogoumobilebrowser')>-1){
|
||||
schemacallback = 'SogouMSE://';
|
||||
}else if(ua.indexOf('xiaomi')>-1){
|
||||
schemacallback = 'miuibrowser://';
|
||||
}else{
|
||||
schemacallback = 'googlechrome://';
|
||||
}
|
||||
if(is_ios){
|
||||
alert('跳转到QQ登录后请手动返回当前浏览器');
|
||||
window.location.href='wtloginmqq3://ptlogin/qlogin?qrcode='+encodeURIComponent(qrurl)+'&schemacallback='+encodeURIComponent(schemacallback);
|
||||
}else{
|
||||
window.location.href='wtloginmqq://ptlogin/qlogin?qrcode='+encodeURIComponent(qrurl)+'&schemacallback='+encodeURIComponent(schemacallback);
|
||||
}
|
||||
}
|
||||
$(document).ready(function(){
|
||||
getqrpic();
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
// lazyload config
|
||||
|
||||
var jp_config = {
|
||||
easyPieChart: [ './assets/vendor/jquery.easy-pie-chart/dist/jquery.easypiechart.fill.js'],
|
||||
sparkline: [ './assets/vendor/jquery.sparkline/dist/jquery.sparkline.retina.js'],
|
||||
plot: [ './assets/vendor/flot/jquery.flot.js',
|
||||
'./assets/vendor/flot/jquery.flot.pie.js',
|
||||
'./assets/vendor/flot/jquery.flot.resize.js',
|
||||
'./assets/vendor/flot.tooltip/js/jquery.flot.tooltip.min.js',
|
||||
'./assets/vendor/flot.orderbars/js/jquery.flot.orderBars.js',
|
||||
'./assets/vendor/flot-spline/js/jquery.flot.spline.min.js'],
|
||||
moment: [ './assets/vendor/moment/moment.js'],
|
||||
screenfull: [ './assets/vendor/screenfull/dist/screenfull.min.js'],
|
||||
slimScroll: [ './assets/vendor/slimscroll/jquery.slimscroll.min.js'],
|
||||
sortable: [ './assets/vendor/html5sortable/jquery.sortable.js'],
|
||||
nestable: [ './assets/vendor/nestable/jquery.nestable.js',
|
||||
'./assets/vendor/nestable/jquery.nestable.css'],
|
||||
filestyle: [ './assets/vendor/bootstrap-filestyle/src/bootstrap-filestyle.js'],
|
||||
slider: [ './assets/vendor/bootstrap-slider/bootstrap-slider.js',
|
||||
'./assets/vendor/bootstrap-slider/bootstrap-slider.css'],
|
||||
chosen: [ './assets/vendor/chosen/chosen.jquery.min.js',
|
||||
'./assets/vendor/bootstrap-chosen/bootstrap-chosen.css'],
|
||||
TouchSpin: [ './assets/vendor/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js',
|
||||
'./assets/vendor/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.css'],
|
||||
wysiwyg: [ './assets/vendor/bootstrap-wysiwyg/bootstrap-wysiwyg.js',
|
||||
'./assets/vendor/bootstrap-wysiwyg/external/jquery.hotkeys.js'],
|
||||
dataTable: [ './assets/vendor/datatables/media/js/jquery.dataTables.min.js',
|
||||
'./assets/vendor/plugins/integration/bootstrap/3/dataTables.bootstrap.js',
|
||||
'./assets/vendor/plugins/integration/bootstrap/3/dataTables.bootstrap.css'],
|
||||
vectorMap: [ './assets/vendor/bower-jvectormap/jquery-jvectormap-1.2.2.min.js',
|
||||
'./assets/vendor/bower-jvectormap/jquery-jvectormap-world-mill-en.js',
|
||||
'./assets/vendor/bower-jvectormap/jquery-jvectormap-us-aea-en.js',
|
||||
'./assets/vendor/bower-jvectormap/jquery-jvectormap-1.2.2.css'],
|
||||
footable: [ './assets/vendor/footable/dist/footable.all.min.js',
|
||||
'./assets/vendor/footable/css/footable.core.css'],
|
||||
fullcalendar: [ './assets/vendor/moment/moment.js',
|
||||
'./assets/vendor/fullcalendar/dist/fullcalendar.min.js',
|
||||
'./assets/vendor/fullcalendar/dist/fullcalendar.css',
|
||||
'./assets/vendor/fullcalendar/dist/fullcalendar.theme.css'],
|
||||
daterangepicker:[ './assets/vendor/moment/moment.js',
|
||||
'./assets/vendor/bootstrap-daterangepicker/daterangepicker.js',
|
||||
'./assets/vendor/bootstrap-daterangepicker/daterangepicker-bs3.css'],
|
||||
tagsinput: [ './assets/vendor/bootstrap-tagsinput/dist/bootstrap-tagsinput.js',
|
||||
'./assets/vendor/bootstrap-tagsinput/dist/bootstrap-tagsinput.css']
|
||||
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
+function ($) {
|
||||
|
||||
$(function(){
|
||||
|
||||
$("[ui-jq]").each(function(){
|
||||
var self = $(this);
|
||||
var options = eval('[' + self.attr('ui-options') + ']');
|
||||
|
||||
if ($.isPlainObject(options[0])) {
|
||||
options[0] = $.extend({}, options[0]);
|
||||
}
|
||||
|
||||
uiLoad.load(jp_config[self.attr('ui-jq')]).then( function(){
|
||||
self[self.attr('ui-jq')].apply(self, options);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}(jQuery);
|
||||
@@ -0,0 +1,86 @@
|
||||
|
||||
/**
|
||||
* 0.1.0
|
||||
* Deferred load js/css file, used for ui-jq.js and Lazy Loading.
|
||||
*
|
||||
* @ flatfull.com All Rights Reserved.
|
||||
* Author url: http://themeforest.net/user/flatfull
|
||||
*/
|
||||
var uiLoad = uiLoad || {};
|
||||
|
||||
(function($, $document, uiLoad) {
|
||||
"use strict";
|
||||
|
||||
var loaded = [],
|
||||
promise = false,
|
||||
deferred = $.Deferred();
|
||||
|
||||
/**
|
||||
* Chain loads the given sources
|
||||
* @param srcs array, script or css
|
||||
* @returns {*} Promise that will be resolved once the sources has been loaded.
|
||||
*/
|
||||
uiLoad.load = function (srcs) {
|
||||
srcs = $.isArray(srcs) ? srcs : srcs.split(/\s+/);
|
||||
if(!promise){
|
||||
promise = deferred.promise();
|
||||
}
|
||||
|
||||
$.each(srcs, function(index, src) {
|
||||
promise = promise.then( function(){
|
||||
return src.indexOf('.css') >=0 ? loadCSS(src) : loadScript(src);
|
||||
} );
|
||||
});
|
||||
deferred.resolve();
|
||||
return promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* Dynamically loads the given script
|
||||
* @param src The url of the script to load dynamically
|
||||
* @returns {*} Promise that will be resolved once the script has been loaded.
|
||||
*/
|
||||
var loadScript = function (src) {
|
||||
if(loaded[src]) return loaded[src].promise();
|
||||
|
||||
var deferred = $.Deferred();
|
||||
var script = $document.createElement('script');
|
||||
script.src = src;
|
||||
script.onload = function (e) {
|
||||
deferred.resolve(e);
|
||||
};
|
||||
script.onerror = function (e) {
|
||||
deferred.reject(e);
|
||||
};
|
||||
$document.body.appendChild(script);
|
||||
loaded[src] = deferred;
|
||||
|
||||
return deferred.promise();
|
||||
};
|
||||
|
||||
/**
|
||||
* Dynamically loads the given CSS file
|
||||
* @param href The url of the CSS to load dynamically
|
||||
* @returns {*} Promise that will be resolved once the CSS file has been loaded.
|
||||
*/
|
||||
var loadCSS = function (href) {
|
||||
if(loaded[href]) return loaded[href].promise();
|
||||
|
||||
var deferred = $.Deferred();
|
||||
var style = $document.createElement('link');
|
||||
style.rel = 'stylesheet';
|
||||
style.type = 'text/css';
|
||||
style.href = href;
|
||||
style.onload = function (e) {
|
||||
deferred.resolve(e);
|
||||
};
|
||||
style.onerror = function (e) {
|
||||
deferred.reject(e);
|
||||
};
|
||||
$document.head.appendChild(style);
|
||||
loaded[href] = deferred;
|
||||
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
})(jQuery, document, uiLoad);
|
||||
@@ -0,0 +1,20 @@
|
||||
+function ($) {
|
||||
|
||||
$(function(){
|
||||
|
||||
// nav
|
||||
$(document).on('click', '[ui-nav] a', function (e) {
|
||||
var $this = $(e.target), $active;
|
||||
$this.is('a') || ($this = $this.closest('a'));
|
||||
|
||||
$active = $this.parent().siblings( ".active" );
|
||||
$active && $active.toggleClass('active').find('> ul:visible').slideUp(200);
|
||||
|
||||
($this.parent().hasClass('active') && $this.next().slideUp(200)) || $this.next().slideDown(200);
|
||||
$this.parent().toggleClass('active');
|
||||
|
||||
$this.next().is('ul') && e.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
}(jQuery);
|
||||
@@ -0,0 +1,14 @@
|
||||
+function ($) {
|
||||
|
||||
$(function(){
|
||||
|
||||
$(document).on('click', '[ui-toggle]', function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(e.target);
|
||||
$this.attr('ui-toggle') || ($this = $this.closest('[ui-toggle]'));
|
||||
var $target = $($this.attr('target')) || $this;
|
||||
$target.toggleClass($this.attr('ui-toggle'));
|
||||
});
|
||||
|
||||
});
|
||||
}(jQuery);
|
||||
@@ -0,0 +1,399 @@
|
||||
.chosen-select {
|
||||
width: 100%;
|
||||
}
|
||||
.chosen-select-deselect {
|
||||
width: 100%;
|
||||
}
|
||||
.chosen-container {
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.chosen-container .chosen-drop {
|
||||
background: #ffffff;
|
||||
border: 1px solid #cccccc;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
-webkit-box-shadow: 0 8px 8px rgba(0, 0, 0, .25);
|
||||
box-shadow: 0 8px 8px rgba(0, 0, 0, .25);
|
||||
margin-top: -1px;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: -9000px;
|
||||
z-index: 1060;
|
||||
}
|
||||
.chosen-container.chosen-with-drop .chosen-drop {
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.chosen-container .chosen-results {
|
||||
color: #555555;
|
||||
margin: 0 4px 4px 0;
|
||||
max-height: 240px;
|
||||
padding: 0 0 0 4px;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.chosen-container .chosen-results li {
|
||||
display: none;
|
||||
line-height: 1.42857143;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 5px 6px;
|
||||
}
|
||||
.chosen-container .chosen-results li em {
|
||||
background: #feffde;
|
||||
font-style: normal;
|
||||
}
|
||||
.chosen-container .chosen-results li.group-result {
|
||||
display: list-item;
|
||||
cursor: default;
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
.chosen-container .chosen-results li.group-option {
|
||||
padding-left: 15px;
|
||||
}
|
||||
.chosen-container .chosen-results li.active-result {
|
||||
cursor: pointer;
|
||||
display: list-item;
|
||||
}
|
||||
.chosen-container .chosen-results li.highlighted {
|
||||
background-color: #337ab7;
|
||||
background-image: none;
|
||||
color: white;
|
||||
}
|
||||
.chosen-container .chosen-results li.highlighted em {
|
||||
background: transparent;
|
||||
}
|
||||
.chosen-container .chosen-results li.disabled-result {
|
||||
display: list-item;
|
||||
color: #777777;
|
||||
}
|
||||
.chosen-container .chosen-results .no-results {
|
||||
background: #eeeeee;
|
||||
display: list-item;
|
||||
}
|
||||
.chosen-container .chosen-results-scroll {
|
||||
background: white;
|
||||
margin: 0 4px;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
width: 321px;
|
||||
z-index: 1;
|
||||
}
|
||||
.chosen-container .chosen-results-scroll span {
|
||||
display: inline-block;
|
||||
height: 1.42857143;
|
||||
text-indent: -5000px;
|
||||
width: 9px;
|
||||
}
|
||||
.chosen-container .chosen-results-scroll-down {
|
||||
bottom: 0;
|
||||
}
|
||||
.chosen-container .chosen-results-scroll-down span {
|
||||
background: url("chosen-sprite.png") no-repeat -4px -3px;
|
||||
}
|
||||
.chosen-container .chosen-results-scroll-up span {
|
||||
background: url("chosen-sprite.png") no-repeat -22px -3px;
|
||||
}
|
||||
.chosen-container-single .chosen-single {
|
||||
background-color: #ffffff;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #cccccc;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
color: #555555;
|
||||
display: block;
|
||||
height: 34px;
|
||||
overflow: hidden;
|
||||
line-height: 34px;
|
||||
padding: 0 0 0 8px;
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.chosen-container-single .chosen-single span {
|
||||
display: block;
|
||||
margin-right: 26px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.chosen-container-single .chosen-single abbr {
|
||||
background: url("chosen-sprite.png") right top no-repeat;
|
||||
display: block;
|
||||
font-size: 1px;
|
||||
height: 10px;
|
||||
position: absolute;
|
||||
right: 26px;
|
||||
top: 12px;
|
||||
width: 12px;
|
||||
}
|
||||
.chosen-container-single .chosen-single abbr:hover {
|
||||
background-position: right -11px;
|
||||
}
|
||||
.chosen-container-single .chosen-single.chosen-disabled .chosen-single abbr:hover {
|
||||
background-position: right 2px;
|
||||
}
|
||||
.chosen-container-single .chosen-single div {
|
||||
display: block;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 18px;
|
||||
}
|
||||
.chosen-container-single .chosen-single div b {
|
||||
background: url("chosen-sprite.png") no-repeat 0 7px;
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.chosen-container-single .chosen-default {
|
||||
color: #777777;
|
||||
}
|
||||
.chosen-container-single .chosen-search {
|
||||
margin: 0;
|
||||
padding: 3px 4px;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
z-index: 1000;
|
||||
}
|
||||
.chosen-container-single .chosen-search input[type="text"] {
|
||||
background: url("chosen-sprite.png") no-repeat 100% -20px, #ffffff;
|
||||
border: 1px solid #cccccc;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
margin: 1px 0;
|
||||
padding: 4px 20px 4px 4px;
|
||||
width: 100%;
|
||||
}
|
||||
.chosen-container-single .chosen-drop {
|
||||
margin-top: -1px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
.chosen-container-single-nosearch .chosen-search input {
|
||||
position: absolute;
|
||||
left: -9000px;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #cccccc;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
cursor: text;
|
||||
height: auto !important;
|
||||
height: 1%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices li {
|
||||
float: left;
|
||||
list-style: none;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices .search-field {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices .search-field input[type="text"] {
|
||||
background: transparent !important;
|
||||
border: 0 !important;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
color: #555555;
|
||||
height: 32px;
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
outline: 0;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices .search-field .default {
|
||||
color: #999;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices .search-choice {
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
background-color: #eeeeee;
|
||||
border: 1px solid #cccccc;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
|
||||
color: #333333;
|
||||
cursor: default;
|
||||
line-height: 13px;
|
||||
margin: 6px 0 3px 5px;
|
||||
padding: 3px 20px 3px 5px;
|
||||
position: relative;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices .search-choice .search-choice-close {
|
||||
background: url("chosen-sprite.png") right top no-repeat;
|
||||
display: block;
|
||||
font-size: 1px;
|
||||
height: 10px;
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
top: 5px;
|
||||
width: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices .search-choice .search-choice-close:hover {
|
||||
background-position: right -11px;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices .search-choice-focus {
|
||||
background: #d4d4d4;
|
||||
}
|
||||
.chosen-container-multi .chosen-choices .search-choice-focus .search-choice-close {
|
||||
background-position: right -11px;
|
||||
}
|
||||
.chosen-container-multi .chosen-results {
|
||||
margin: 0 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
.chosen-container-multi .chosen-drop .result-selected {
|
||||
display: none;
|
||||
}
|
||||
.chosen-container-active .chosen-single {
|
||||
border: 1px solid #66afe9;
|
||||
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
|
||||
-webkit-transition: border linear .2s, box-shadow linear .2s;
|
||||
-o-transition: border linear .2s, box-shadow linear .2s;
|
||||
transition: border linear .2s, box-shadow linear .2s;
|
||||
}
|
||||
.chosen-container-active.chosen-with-drop .chosen-single {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #66afe9;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
|
||||
-webkit-transition: border linear .2s, box-shadow linear .2s;
|
||||
-o-transition: border linear .2s, box-shadow linear .2s;
|
||||
transition: border linear .2s, box-shadow linear .2s;
|
||||
}
|
||||
.chosen-container-active.chosen-with-drop .chosen-single div {
|
||||
background: transparent;
|
||||
border-left: none;
|
||||
}
|
||||
.chosen-container-active.chosen-with-drop .chosen-single div b {
|
||||
background-position: -18px 7px;
|
||||
}
|
||||
.chosen-container-active .chosen-choices {
|
||||
border: 1px solid #66afe9;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
|
||||
-webkit-transition: border linear .2s, box-shadow linear .2s;
|
||||
-o-transition: border linear .2s, box-shadow linear .2s;
|
||||
transition: border linear .2s, box-shadow linear .2s;
|
||||
}
|
||||
.chosen-container-active .chosen-choices .search-field input[type="text"] {
|
||||
color: #111 !important;
|
||||
}
|
||||
.chosen-container-active.chosen-with-drop .chosen-choices {
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.chosen-disabled {
|
||||
cursor: default;
|
||||
opacity: 0.5 !important;
|
||||
}
|
||||
.chosen-disabled .chosen-single {
|
||||
cursor: default;
|
||||
}
|
||||
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
|
||||
cursor: default;
|
||||
}
|
||||
.chosen-rtl {
|
||||
text-align: right;
|
||||
}
|
||||
.chosen-rtl .chosen-single {
|
||||
padding: 0 8px 0 0;
|
||||
overflow: visible;
|
||||
}
|
||||
.chosen-rtl .chosen-single span {
|
||||
margin-left: 26px;
|
||||
margin-right: 0;
|
||||
direction: rtl;
|
||||
}
|
||||
.chosen-rtl .chosen-single div {
|
||||
left: 7px;
|
||||
right: auto;
|
||||
}
|
||||
.chosen-rtl .chosen-single abbr {
|
||||
left: 26px;
|
||||
right: auto;
|
||||
}
|
||||
.chosen-rtl .chosen-choices .search-field input[type="text"] {
|
||||
direction: rtl;
|
||||
}
|
||||
.chosen-rtl .chosen-choices li {
|
||||
float: right;
|
||||
}
|
||||
.chosen-rtl .chosen-choices .search-choice {
|
||||
margin: 6px 5px 3px 0;
|
||||
padding: 3px 5px 3px 19px;
|
||||
}
|
||||
.chosen-rtl .chosen-choices .search-choice .search-choice-close {
|
||||
background-position: right top;
|
||||
left: 4px;
|
||||
right: auto;
|
||||
}
|
||||
.chosen-rtl.chosen-container-single .chosen-results {
|
||||
margin: 0 0 4px 4px;
|
||||
padding: 0 4px 0 0;
|
||||
}
|
||||
.chosen-rtl .chosen-results .group-option {
|
||||
padding-left: 0;
|
||||
padding-right: 15px;
|
||||
}
|
||||
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
|
||||
border-right: none;
|
||||
}
|
||||
.chosen-rtl .chosen-search input[type="text"] {
|
||||
background: url("chosen-sprite.png") no-repeat -28px -20px, #ffffff;
|
||||
direction: rtl;
|
||||
padding: 4px 5px 4px 20px;
|
||||
}
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 2dppx) {
|
||||
.chosen-rtl .chosen-search input[type="text"],
|
||||
.chosen-container-single .chosen-single abbr,
|
||||
.chosen-container-single .chosen-single div b,
|
||||
.chosen-container-single .chosen-search input[type="text"],
|
||||
.chosen-container-multi .chosen-choices .search-choice .search-choice-close,
|
||||
.chosen-container .chosen-results-scroll-down span,
|
||||
.chosen-container .chosen-results-scroll-up span {
|
||||
background-image: url("chosen-sprite@2x.png") !important;
|
||||
background-size: 52px 37px !important;
|
||||
background-repeat: no-repeat !important;
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 646 B |
|
After Width: | Height: | Size: 872 B |
@@ -0,0 +1 @@
|
||||
!function(a){"use strict";function b(a,b,c,d,e,f,g){var j,k,l,m,n,o,p,q,h=Math.pow,i=Math.sqrt;return j=i(h(c-a,2)+h(d-b,2)),k=i(h(e-c,2)+h(f-d,2)),l=g*j/(j+k),m=g-l,n=c+l*(a-e),o=d+l*(b-f),p=c-m*(a-e),q=d-m*(b-f),[n,o,p,q]}function d(b,c,d,e,f){var g=a.color.parse(f);g.a="number"==typeof e?e:.3,g.normalize(),g=g.toString(),c.beginPath(),c.moveTo(b[0][0],b[0][1]);for(var h=b.length,i=0;h>i;i++)c[b[i][3]].apply(c,b[i][2]);c.stroke(),c.lineWidth=0,c.lineTo(b[h-1][0],d),c.lineTo(b[0][0],d),c.closePath(),e!==!1&&(c.fillStyle=g,c.fill())}function e(a,b,d,e){(void 0===b||"bezier"!==b&&"quadratic"!==b)&&(b="quadratic"),b+="CurveTo",0==c.length?c.push([d[0],d[1],e.concat(d.slice(2)),b]):"quadraticCurveTo"==b&&2==d.length?(e=e.slice(0,2).concat(d),c.push([d[0],d[1],e,b])):c.push([d[2],d[3],e.concat(d.slice(2)),b])}function f(f,g,h){if(h.splines.show===!0){var k,l,m,i=[],j=h.splines.tension||.5,n=h.datapoints.points,o=h.datapoints.pointsize,p=f.getPlotOffset(),q=n.length,r=[];if(c=[],4>q/o)return a.extend(h.lines,h.splines),void 0;for(k=0;q>k;k+=o)l=n[k],m=n[k+1],null==l||l<h.xaxis.min||l>h.xaxis.max||m<h.yaxis.min||m>h.yaxis.max||r.push(h.xaxis.p2c(l)+p.left,h.yaxis.p2c(m)+p.top);for(q=r.length,k=0;q-2>k;k+=2)i=i.concat(b.apply(this,r.slice(k,k+6).concat([j])));for(g.save(),g.strokeStyle=h.color,g.lineWidth=h.splines.lineWidth,e(g,"quadratic",r.slice(0,4),i.slice(0,2)),k=2;q-3>k;k+=2)e(g,"bezier",r.slice(k,k+4),i.slice(2*k-2,2*k+2));e(g,"quadratic",r.slice(q-2,q),[i[2*q-10],i[2*q-9],r[q-4],r[q-3]]),d(c,g,f.height()+10,h.splines.fill,h.color),g.restore()}}var c=[];a.plot.plugins.push({init:function(a){a.hooks.drawSeries.push(f)},options:{series:{splines:{show:!1,lineWidth:2,tension:.5,fill:!1}}},name:"spline",version:"0.8.2"})}(jQuery);
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Flot plugin to order bars side by side.
|
||||
*
|
||||
* Released under the MIT license by Benjamin BUFFET, 20-Sep-2010.
|
||||
* Modifications made by Steven Hall <github.com/emmerich>, 01-May-2013.
|
||||
*
|
||||
* This plugin is an alpha version.
|
||||
*
|
||||
* To activate the plugin you must specify the parameter "order" for the specific serie :
|
||||
*
|
||||
* $.plot($("#placeholder"), [{ data: [ ... ], bars :{ order = null or integer }])
|
||||
*
|
||||
* If 2 series have the same order param, they are ordered by the position in the array;
|
||||
*
|
||||
* The plugin adjust the point by adding a value depanding of the barwidth
|
||||
* Exemple for 3 series (barwidth : 0.1) :
|
||||
*
|
||||
* first bar décalage : -0.15
|
||||
* second bar décalage : -0.05
|
||||
* third bar décalage : 0.05
|
||||
*
|
||||
*/
|
||||
|
||||
// INFO: decalage/decallage is French for gap. It's used to denote the spacing applied to each
|
||||
// bar.
|
||||
(function($){
|
||||
function init(plot){
|
||||
var orderedBarSeries;
|
||||
var nbOfBarsToOrder;
|
||||
var borderWidth;
|
||||
var borderWidthInXabsWidth;
|
||||
var pixelInXWidthEquivalent = 1;
|
||||
var isHorizontal = false;
|
||||
|
||||
// A mapping of order integers to decallage.
|
||||
var decallageByOrder = {};
|
||||
|
||||
/*
|
||||
* This method add shift to x values
|
||||
*/
|
||||
function reOrderBars(plot, serie, datapoints){
|
||||
var shiftedPoints = null;
|
||||
|
||||
if(serieNeedToBeReordered(serie)){
|
||||
checkIfGraphIsHorizontal(serie);
|
||||
calculPixel2XWidthConvert(plot);
|
||||
retrieveBarSeries(plot);
|
||||
calculBorderAndBarWidth(serie);
|
||||
|
||||
if(nbOfBarsToOrder >= 2){
|
||||
var position = findPosition(serie);
|
||||
var decallage = 0;
|
||||
|
||||
var centerBarShift = calculCenterBarShift();
|
||||
|
||||
// If we haven't already calculated the decallage for this order value, do it.
|
||||
if(typeof decallageByOrder[serie.bars.order] === 'undefined') {
|
||||
if (isBarAtLeftOfCenter(position)){
|
||||
decallageByOrder[serie.bars.order] = -1*(sumWidth(orderedBarSeries,position-1,Math.floor(nbOfBarsToOrder / 2)-1)) - centerBarShift;
|
||||
}else{
|
||||
decallageByOrder[serie.bars.order] = sumWidth(orderedBarSeries,Math.ceil(nbOfBarsToOrder / 2),position-2) + centerBarShift + borderWidthInXabsWidth*2;
|
||||
}
|
||||
}
|
||||
|
||||
// Lookup the decallage based on the series' order value.
|
||||
decallage = decallageByOrder[serie.bars.order];
|
||||
|
||||
shiftedPoints = shiftPoints(datapoints,serie,decallage);
|
||||
datapoints.points = shiftedPoints;
|
||||
}
|
||||
}
|
||||
return shiftedPoints;
|
||||
}
|
||||
|
||||
function serieNeedToBeReordered(serie){
|
||||
return serie.bars != null
|
||||
&& serie.bars.show
|
||||
&& serie.bars.order != null;
|
||||
}
|
||||
|
||||
function calculPixel2XWidthConvert(plot){
|
||||
var gridDimSize = isHorizontal ? plot.getPlaceholder().innerHeight() : plot.getPlaceholder().innerWidth();
|
||||
var minMaxValues = isHorizontal ? getAxeMinMaxValues(plot.getData(),1) : getAxeMinMaxValues(plot.getData(),0);
|
||||
var AxeSize = minMaxValues[1] - minMaxValues[0];
|
||||
pixelInXWidthEquivalent = AxeSize / gridDimSize;
|
||||
}
|
||||
|
||||
function getAxeMinMaxValues(series,AxeIdx){
|
||||
var minMaxValues = new Array();
|
||||
for(var i = 0; i < series.length; i++){
|
||||
minMaxValues[0] = series[i].data[0][AxeIdx];
|
||||
minMaxValues[1] = series[i].data[series[i].data.length - 1][AxeIdx];
|
||||
}
|
||||
return minMaxValues;
|
||||
}
|
||||
|
||||
function retrieveBarSeries(plot){
|
||||
orderedBarSeries = findOthersBarsToReOrders(plot.getData());
|
||||
nbOfBarsToOrder = orderedBarSeries.length;
|
||||
}
|
||||
|
||||
function findOthersBarsToReOrders(series){
|
||||
var retSeries = new Array();
|
||||
var orderValuesSeen = [];
|
||||
|
||||
for(var i = 0; i < series.length; i++){
|
||||
if(series[i].bars.order != null && series[i].bars.show &&
|
||||
orderValuesSeen.indexOf(series[i].bars.order) < 0){
|
||||
|
||||
orderValuesSeen.push(series[i].bars.order);
|
||||
retSeries.push(series[i]);
|
||||
}
|
||||
}
|
||||
return retSeries.sort(sortByOrder);
|
||||
}
|
||||
|
||||
function sortByOrder(serie1,serie2){
|
||||
var x = serie1.bars.order;
|
||||
var y = serie2.bars.order;
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
}
|
||||
|
||||
function calculBorderAndBarWidth(serie){
|
||||
borderWidth = typeof serie.bars.lineWidth !== 'undefined' ? serie.bars.lineWidth : 2;
|
||||
borderWidthInXabsWidth = borderWidth * pixelInXWidthEquivalent;
|
||||
}
|
||||
|
||||
function checkIfGraphIsHorizontal(serie){
|
||||
if(serie.bars.horizontal){
|
||||
isHorizontal = true;
|
||||
}
|
||||
}
|
||||
|
||||
function findPosition(serie){
|
||||
var pos = 0
|
||||
for (var i = 0; i < orderedBarSeries.length; ++i) {
|
||||
if (serie == orderedBarSeries[i]){
|
||||
pos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return pos+1;
|
||||
}
|
||||
|
||||
function calculCenterBarShift(){
|
||||
var width = 0;
|
||||
|
||||
if(nbOfBarsToOrder%2 != 0)
|
||||
width = (orderedBarSeries[Math.ceil(nbOfBarsToOrder / 2)].bars.barWidth)/2;
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
function isBarAtLeftOfCenter(position){
|
||||
return position <= Math.ceil(nbOfBarsToOrder / 2);
|
||||
}
|
||||
|
||||
function sumWidth(series,start,end){
|
||||
var totalWidth = 0;
|
||||
|
||||
for(var i = start; i <= end; i++){
|
||||
totalWidth += series[i].bars.barWidth+borderWidthInXabsWidth*2;
|
||||
}
|
||||
|
||||
return totalWidth;
|
||||
}
|
||||
|
||||
function shiftPoints(datapoints,serie,dx){
|
||||
var ps = datapoints.pointsize;
|
||||
var points = datapoints.points;
|
||||
var j = 0;
|
||||
for(var i = isHorizontal ? 1 : 0;i < points.length; i += ps){
|
||||
points[i] += dx;
|
||||
//Adding the new x value in the serie to be abble to display the right tooltip value,
|
||||
//using the index 3 to not overide the third index.
|
||||
serie.data[j][3] = points[i];
|
||||
j++;
|
||||
}
|
||||
|
||||
return points;
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push(reOrderBars);
|
||||
|
||||
}
|
||||
|
||||
var options = {
|
||||
series : {
|
||||
bars: {order: null} // or number/string
|
||||
}
|
||||
};
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "orderBars",
|
||||
version: "0.2"
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,820 @@
|
||||
/* Flot plugin for rendering pie charts.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin assumes that each series has a single data value, and that each
|
||||
value is a positive integer or zero. Negative numbers don't make sense for a
|
||||
pie chart, and have unpredictable results. The values do NOT need to be
|
||||
passed in as percentages; the plugin will calculate the total and per-slice
|
||||
percentages internally.
|
||||
|
||||
* Created by Brian Medendorp
|
||||
|
||||
* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
pie: {
|
||||
show: true/false
|
||||
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
|
||||
innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
|
||||
startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
|
||||
tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
|
||||
offset: {
|
||||
top: integer value to move the pie up or down
|
||||
left: integer value to move the pie left or right, or 'auto'
|
||||
},
|
||||
stroke: {
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
|
||||
width: integer pixel width of the stroke
|
||||
},
|
||||
label: {
|
||||
show: true/false, or 'auto'
|
||||
formatter: a user-defined function that modifies the text/style of the label text
|
||||
radius: 0-1 for percentage of fullsize, or a specified pixel length
|
||||
background: {
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
|
||||
opacity: 0-1
|
||||
},
|
||||
threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
|
||||
},
|
||||
combine: {
|
||||
threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined
|
||||
label: any text value of what the combined slice should be labeled
|
||||
}
|
||||
highlight: {
|
||||
opacity: 0-1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
More detail and specific examples can be found in the included HTML file.
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
// Maximum redraw attempts when fitting labels within the plot
|
||||
|
||||
var REDRAW_ATTEMPTS = 10;
|
||||
|
||||
// Factor by which to shrink the pie when fitting labels within the plot
|
||||
|
||||
var REDRAW_SHRINK = 0.95;
|
||||
|
||||
function init(plot) {
|
||||
|
||||
var canvas = null,
|
||||
target = null,
|
||||
options = null,
|
||||
maxRadius = null,
|
||||
centerLeft = null,
|
||||
centerTop = null,
|
||||
processed = false,
|
||||
ctx = null;
|
||||
|
||||
// interactive variables
|
||||
|
||||
var highlights = [];
|
||||
|
||||
// add hook to determine if pie plugin in enabled, and then perform necessary operations
|
||||
|
||||
plot.hooks.processOptions.push(function(plot, options) {
|
||||
if (options.series.pie.show) {
|
||||
|
||||
options.grid.show = false;
|
||||
|
||||
// set labels.show
|
||||
|
||||
if (options.series.pie.label.show == "auto") {
|
||||
if (options.legend.show) {
|
||||
options.series.pie.label.show = false;
|
||||
} else {
|
||||
options.series.pie.label.show = true;
|
||||
}
|
||||
}
|
||||
|
||||
// set radius
|
||||
|
||||
if (options.series.pie.radius == "auto") {
|
||||
if (options.series.pie.label.show) {
|
||||
options.series.pie.radius = 3/4;
|
||||
} else {
|
||||
options.series.pie.radius = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// ensure sane tilt
|
||||
|
||||
if (options.series.pie.tilt > 1) {
|
||||
options.series.pie.tilt = 1;
|
||||
} else if (options.series.pie.tilt < 0) {
|
||||
options.series.pie.tilt = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.bindEvents.push(function(plot, eventHolder) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
if (options.grid.hoverable) {
|
||||
eventHolder.unbind("mousemove").mousemove(onMouseMove);
|
||||
}
|
||||
if (options.grid.clickable) {
|
||||
eventHolder.unbind("click").click(onClick);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
processDatapoints(plot, series, data, datapoints);
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.drawOverlay.push(function(plot, octx) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
drawOverlay(plot, octx);
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.draw.push(function(plot, newCtx) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
draw(plot, newCtx);
|
||||
}
|
||||
});
|
||||
|
||||
function processDatapoints(plot, series, datapoints) {
|
||||
if (!processed) {
|
||||
processed = true;
|
||||
canvas = plot.getCanvas();
|
||||
target = $(canvas).parent();
|
||||
options = plot.getOptions();
|
||||
plot.setData(combine(plot.getData()));
|
||||
}
|
||||
}
|
||||
|
||||
function combine(data) {
|
||||
|
||||
var total = 0,
|
||||
combined = 0,
|
||||
numCombined = 0,
|
||||
color = options.series.pie.combine.color,
|
||||
newdata = [];
|
||||
|
||||
// Fix up the raw data from Flot, ensuring the data is numeric
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
|
||||
var value = data[i].data;
|
||||
|
||||
// If the data is an array, we'll assume that it's a standard
|
||||
// Flot x-y pair, and are concerned only with the second value.
|
||||
|
||||
// Note how we use the original array, rather than creating a
|
||||
// new one; this is more efficient and preserves any extra data
|
||||
// that the user may have stored in higher indexes.
|
||||
|
||||
if ($.isArray(value) && value.length == 1) {
|
||||
value = value[0];
|
||||
}
|
||||
|
||||
if ($.isArray(value)) {
|
||||
// Equivalent to $.isNumeric() but compatible with jQuery < 1.7
|
||||
if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {
|
||||
value[1] = +value[1];
|
||||
} else {
|
||||
value[1] = 0;
|
||||
}
|
||||
} else if (!isNaN(parseFloat(value)) && isFinite(value)) {
|
||||
value = [1, +value];
|
||||
} else {
|
||||
value = [1, 0];
|
||||
}
|
||||
|
||||
data[i].data = [value];
|
||||
}
|
||||
|
||||
// Sum up all the slices, so we can calculate percentages for each
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
total += data[i].data[0][1];
|
||||
}
|
||||
|
||||
// Count the number of slices with percentages below the combine
|
||||
// threshold; if it turns out to be just one, we won't combine.
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
var value = data[i].data[0][1];
|
||||
if (value / total <= options.series.pie.combine.threshold) {
|
||||
combined += value;
|
||||
numCombined++;
|
||||
if (!color) {
|
||||
color = data[i].color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
var value = data[i].data[0][1];
|
||||
if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
|
||||
newdata.push(
|
||||
$.extend(data[i], { /* extend to allow keeping all other original data values
|
||||
and using them e.g. in labelFormatter. */
|
||||
data: [[1, value]],
|
||||
color: data[i].color,
|
||||
label: data[i].label,
|
||||
angle: value * Math.PI * 2 / total,
|
||||
percent: value / (total / 100)
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (numCombined > 1) {
|
||||
newdata.push({
|
||||
data: [[1, combined]],
|
||||
color: color,
|
||||
label: options.series.pie.combine.label,
|
||||
angle: combined * Math.PI * 2 / total,
|
||||
percent: combined / (total / 100)
|
||||
});
|
||||
}
|
||||
|
||||
return newdata;
|
||||
}
|
||||
|
||||
function draw(plot, newCtx) {
|
||||
|
||||
if (!target) {
|
||||
return; // if no series were passed
|
||||
}
|
||||
|
||||
var canvasWidth = plot.getPlaceholder().width(),
|
||||
canvasHeight = plot.getPlaceholder().height(),
|
||||
legendWidth = target.children().filter(".legend").children().width() || 0;
|
||||
|
||||
ctx = newCtx;
|
||||
|
||||
// WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!
|
||||
|
||||
// When combining smaller slices into an 'other' slice, we need to
|
||||
// add a new series. Since Flot gives plugins no way to modify the
|
||||
// list of series, the pie plugin uses a hack where the first call
|
||||
// to processDatapoints results in a call to setData with the new
|
||||
// list of series, then subsequent processDatapoints do nothing.
|
||||
|
||||
// The plugin-global 'processed' flag is used to control this hack;
|
||||
// it starts out false, and is set to true after the first call to
|
||||
// processDatapoints.
|
||||
|
||||
// Unfortunately this turns future setData calls into no-ops; they
|
||||
// call processDatapoints, the flag is true, and nothing happens.
|
||||
|
||||
// To fix this we'll set the flag back to false here in draw, when
|
||||
// all series have been processed, so the next sequence of calls to
|
||||
// processDatapoints once again starts out with a slice-combine.
|
||||
// This is really a hack; in 0.9 we need to give plugins a proper
|
||||
// way to modify series before any processing begins.
|
||||
|
||||
processed = false;
|
||||
|
||||
// calculate maximum radius and center point
|
||||
|
||||
maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;
|
||||
centerTop = canvasHeight / 2 + options.series.pie.offset.top;
|
||||
centerLeft = canvasWidth / 2;
|
||||
|
||||
if (options.series.pie.offset.left == "auto") {
|
||||
if (options.legend.position.match("w")) {
|
||||
centerLeft += legendWidth / 2;
|
||||
} else {
|
||||
centerLeft -= legendWidth / 2;
|
||||
}
|
||||
if (centerLeft < maxRadius) {
|
||||
centerLeft = maxRadius;
|
||||
} else if (centerLeft > canvasWidth - maxRadius) {
|
||||
centerLeft = canvasWidth - maxRadius;
|
||||
}
|
||||
} else {
|
||||
centerLeft += options.series.pie.offset.left;
|
||||
}
|
||||
|
||||
var slices = plot.getData(),
|
||||
attempts = 0;
|
||||
|
||||
// Keep shrinking the pie's radius until drawPie returns true,
|
||||
// indicating that all the labels fit, or we try too many times.
|
||||
|
||||
do {
|
||||
if (attempts > 0) {
|
||||
maxRadius *= REDRAW_SHRINK;
|
||||
}
|
||||
attempts += 1;
|
||||
clear();
|
||||
if (options.series.pie.tilt <= 0.8) {
|
||||
drawShadow();
|
||||
}
|
||||
} while (!drawPie() && attempts < REDRAW_ATTEMPTS)
|
||||
|
||||
if (attempts >= REDRAW_ATTEMPTS) {
|
||||
clear();
|
||||
target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>");
|
||||
}
|
||||
|
||||
if (plot.setSeries && plot.insertLegend) {
|
||||
plot.setSeries(slices);
|
||||
plot.insertLegend();
|
||||
}
|
||||
|
||||
// we're actually done at this point, just defining internal functions at this point
|
||||
|
||||
function clear() {
|
||||
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
||||
target.children().filter(".pieLabel, .pieLabelBackground").remove();
|
||||
}
|
||||
|
||||
function drawShadow() {
|
||||
|
||||
var shadowLeft = options.series.pie.shadow.left;
|
||||
var shadowTop = options.series.pie.shadow.top;
|
||||
var edge = 10;
|
||||
var alpha = options.series.pie.shadow.alpha;
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {
|
||||
return; // shadow would be outside canvas, so don't draw it
|
||||
}
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(shadowLeft,shadowTop);
|
||||
ctx.globalAlpha = alpha;
|
||||
ctx.fillStyle = "#000";
|
||||
|
||||
// center and rotate to starting position
|
||||
|
||||
ctx.translate(centerLeft,centerTop);
|
||||
ctx.scale(1, options.series.pie.tilt);
|
||||
|
||||
//radius -= edge;
|
||||
|
||||
for (var i = 1; i <= edge; i++) {
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, radius, 0, Math.PI * 2, false);
|
||||
ctx.fill();
|
||||
radius -= i;
|
||||
}
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function drawPie() {
|
||||
|
||||
var startAngle = Math.PI * options.series.pie.startAngle;
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
// center and rotate to starting position
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(centerLeft,centerTop);
|
||||
ctx.scale(1, options.series.pie.tilt);
|
||||
//ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
|
||||
|
||||
// draw slices
|
||||
|
||||
ctx.save();
|
||||
var currentAngle = startAngle;
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
slices[i].startAngle = currentAngle;
|
||||
drawSlice(slices[i].angle, slices[i].color, true);
|
||||
}
|
||||
ctx.restore();
|
||||
|
||||
// draw slice outlines
|
||||
|
||||
if (options.series.pie.stroke.width > 0) {
|
||||
ctx.save();
|
||||
ctx.lineWidth = options.series.pie.stroke.width;
|
||||
currentAngle = startAngle;
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
// draw donut hole
|
||||
|
||||
drawDonutHole(ctx);
|
||||
|
||||
ctx.restore();
|
||||
|
||||
// Draw the labels, returning true if they fit within the plot
|
||||
|
||||
if (options.series.pie.label.show) {
|
||||
return drawLabels();
|
||||
} else return true;
|
||||
|
||||
function drawSlice(angle, color, fill) {
|
||||
|
||||
if (angle <= 0 || isNaN(angle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fill) {
|
||||
ctx.fillStyle = color;
|
||||
} else {
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineJoin = "round";
|
||||
}
|
||||
|
||||
ctx.beginPath();
|
||||
if (Math.abs(angle - Math.PI * 2) > 0.000000001) {
|
||||
ctx.moveTo(0, 0); // Center of the pie
|
||||
}
|
||||
|
||||
//ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera
|
||||
ctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false);
|
||||
ctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false);
|
||||
ctx.closePath();
|
||||
//ctx.rotate(angle); // This doesn't work properly in Opera
|
||||
currentAngle += angle;
|
||||
|
||||
if (fill) {
|
||||
ctx.fill();
|
||||
} else {
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
function drawLabels() {
|
||||
|
||||
var currentAngle = startAngle;
|
||||
var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
|
||||
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
if (slices[i].percent >= options.series.pie.label.threshold * 100) {
|
||||
if (!drawLabel(slices[i], currentAngle, i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
currentAngle += slices[i].angle;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
function drawLabel(slice, startAngle, index) {
|
||||
|
||||
if (slice.data[0][1] == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// format label text
|
||||
|
||||
var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
|
||||
|
||||
if (lf) {
|
||||
text = lf(slice.label, slice);
|
||||
} else {
|
||||
text = slice.label;
|
||||
}
|
||||
|
||||
if (plf) {
|
||||
text = plf(text, slice);
|
||||
}
|
||||
|
||||
var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;
|
||||
var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
|
||||
var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
|
||||
|
||||
var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
|
||||
target.append(html);
|
||||
|
||||
var label = target.children("#pieLabel" + index);
|
||||
var labelTop = (y - label.height() / 2);
|
||||
var labelLeft = (x - label.width() / 2);
|
||||
|
||||
label.css("top", labelTop);
|
||||
label.css("left", labelLeft);
|
||||
|
||||
// check to make sure that the label is not outside the canvas
|
||||
|
||||
if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.series.pie.label.background.opacity != 0) {
|
||||
|
||||
// put in the transparent background separately to avoid blended labels and label boxes
|
||||
|
||||
var c = options.series.pie.label.background.color;
|
||||
|
||||
if (c == null) {
|
||||
c = slice.color;
|
||||
}
|
||||
|
||||
var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;";
|
||||
$("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>")
|
||||
.css("opacity", options.series.pie.label.background.opacity)
|
||||
.insertBefore(label);
|
||||
}
|
||||
|
||||
return true;
|
||||
} // end individual label function
|
||||
} // end drawLabels function
|
||||
} // end drawPie function
|
||||
} // end draw function
|
||||
|
||||
// Placed here because it needs to be accessed from multiple locations
|
||||
|
||||
function drawDonutHole(layer) {
|
||||
if (options.series.pie.innerRadius > 0) {
|
||||
|
||||
// subtract the center
|
||||
|
||||
layer.save();
|
||||
var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
|
||||
layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color
|
||||
layer.beginPath();
|
||||
layer.fillStyle = options.series.pie.stroke.color;
|
||||
layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
|
||||
layer.fill();
|
||||
layer.closePath();
|
||||
layer.restore();
|
||||
|
||||
// add inner stroke
|
||||
|
||||
layer.save();
|
||||
layer.beginPath();
|
||||
layer.strokeStyle = options.series.pie.stroke.color;
|
||||
layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
|
||||
layer.stroke();
|
||||
layer.closePath();
|
||||
layer.restore();
|
||||
|
||||
// TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
|
||||
}
|
||||
}
|
||||
|
||||
//-- Additional Interactive related functions --
|
||||
|
||||
function isPointInPoly(poly, pt) {
|
||||
for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
|
||||
((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))
|
||||
&& (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
|
||||
&& (c = !c);
|
||||
return c;
|
||||
}
|
||||
|
||||
function findNearbySlice(mouseX, mouseY) {
|
||||
|
||||
var slices = plot.getData(),
|
||||
options = plot.getOptions(),
|
||||
radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
|
||||
x, y;
|
||||
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
|
||||
var s = slices[i];
|
||||
|
||||
if (s.pie.show) {
|
||||
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 0); // Center of the pie
|
||||
//ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
|
||||
ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);
|
||||
ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);
|
||||
ctx.closePath();
|
||||
x = mouseX - centerLeft;
|
||||
y = mouseY - centerTop;
|
||||
|
||||
if (ctx.isPointInPath) {
|
||||
if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {
|
||||
ctx.restore();
|
||||
return {
|
||||
datapoint: [s.percent, s.data],
|
||||
dataIndex: 0,
|
||||
series: s,
|
||||
seriesIndex: i
|
||||
};
|
||||
}
|
||||
} else {
|
||||
|
||||
// excanvas for IE doesn;t support isPointInPath, this is a workaround.
|
||||
|
||||
var p1X = radius * Math.cos(s.startAngle),
|
||||
p1Y = radius * Math.sin(s.startAngle),
|
||||
p2X = radius * Math.cos(s.startAngle + s.angle / 4),
|
||||
p2Y = radius * Math.sin(s.startAngle + s.angle / 4),
|
||||
p3X = radius * Math.cos(s.startAngle + s.angle / 2),
|
||||
p3Y = radius * Math.sin(s.startAngle + s.angle / 2),
|
||||
p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),
|
||||
p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),
|
||||
p5X = radius * Math.cos(s.startAngle + s.angle),
|
||||
p5Y = radius * Math.sin(s.startAngle + s.angle),
|
||||
arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],
|
||||
arrPoint = [x, y];
|
||||
|
||||
// TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
|
||||
|
||||
if (isPointInPoly(arrPoly, arrPoint)) {
|
||||
ctx.restore();
|
||||
return {
|
||||
datapoint: [s.percent, s.data],
|
||||
dataIndex: 0,
|
||||
series: s,
|
||||
seriesIndex: i
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function onMouseMove(e) {
|
||||
triggerClickHoverEvent("plothover", e);
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
triggerClickHoverEvent("plotclick", e);
|
||||
}
|
||||
|
||||
// trigger click or hover event (they send the same parameters so we share their code)
|
||||
|
||||
function triggerClickHoverEvent(eventname, e) {
|
||||
|
||||
var offset = plot.offset();
|
||||
var canvasX = parseInt(e.pageX - offset.left);
|
||||
var canvasY = parseInt(e.pageY - offset.top);
|
||||
var item = findNearbySlice(canvasX, canvasY);
|
||||
|
||||
if (options.grid.autoHighlight) {
|
||||
|
||||
// clear auto-highlights
|
||||
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
var h = highlights[i];
|
||||
if (h.auto == eventname && !(item && h.series == item.series)) {
|
||||
unhighlight(h.series);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// highlight the slice
|
||||
|
||||
if (item) {
|
||||
highlight(item.series, eventname);
|
||||
}
|
||||
|
||||
// trigger any hover bind events
|
||||
|
||||
var pos = { pageX: e.pageX, pageY: e.pageY };
|
||||
target.trigger(eventname, [pos, item]);
|
||||
}
|
||||
|
||||
function highlight(s, auto) {
|
||||
//if (typeof s == "number") {
|
||||
// s = series[s];
|
||||
//}
|
||||
|
||||
var i = indexOfHighlight(s);
|
||||
|
||||
if (i == -1) {
|
||||
highlights.push({ series: s, auto: auto });
|
||||
plot.triggerRedrawOverlay();
|
||||
} else if (!auto) {
|
||||
highlights[i].auto = false;
|
||||
}
|
||||
}
|
||||
|
||||
function unhighlight(s) {
|
||||
if (s == null) {
|
||||
highlights = [];
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
//if (typeof s == "number") {
|
||||
// s = series[s];
|
||||
//}
|
||||
|
||||
var i = indexOfHighlight(s);
|
||||
|
||||
if (i != -1) {
|
||||
highlights.splice(i, 1);
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
function indexOfHighlight(s) {
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
var h = highlights[i];
|
||||
if (h.series == s)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function drawOverlay(plot, octx) {
|
||||
|
||||
var options = plot.getOptions();
|
||||
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
octx.save();
|
||||
octx.translate(centerLeft, centerTop);
|
||||
octx.scale(1, options.series.pie.tilt);
|
||||
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
drawHighlight(highlights[i].series);
|
||||
}
|
||||
|
||||
drawDonutHole(octx);
|
||||
|
||||
octx.restore();
|
||||
|
||||
function drawHighlight(series) {
|
||||
|
||||
if (series.angle <= 0 || isNaN(series.angle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
|
||||
octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor
|
||||
octx.beginPath();
|
||||
if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {
|
||||
octx.moveTo(0, 0); // Center of the pie
|
||||
}
|
||||
octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);
|
||||
octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);
|
||||
octx.closePath();
|
||||
octx.fill();
|
||||
}
|
||||
}
|
||||
} // end init (plugin body)
|
||||
|
||||
// define pie specific options and their default values
|
||||
|
||||
var options = {
|
||||
series: {
|
||||
pie: {
|
||||
show: false,
|
||||
radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
|
||||
innerRadius: 0, /* for donut */
|
||||
startAngle: 3/2,
|
||||
tilt: 1,
|
||||
shadow: {
|
||||
left: 5, // shadow left offset
|
||||
top: 15, // shadow top offset
|
||||
alpha: 0.02 // shadow alpha
|
||||
},
|
||||
offset: {
|
||||
top: 0,
|
||||
left: "auto"
|
||||
},
|
||||
stroke: {
|
||||
color: "#fff",
|
||||
width: 1
|
||||
},
|
||||
label: {
|
||||
show: "auto",
|
||||
formatter: function(label, slice) {
|
||||
return "<div style='font-size:x-small;text-align:center;padding:2px;color:" + slice.color + ";'>" + label + "<br/>" + Math.round(slice.percent) + "%</div>";
|
||||
}, // formatter function
|
||||
radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
|
||||
background: {
|
||||
color: null,
|
||||
opacity: 0
|
||||
},
|
||||
threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
|
||||
},
|
||||
combine: {
|
||||
threshold: -1, // percentage at which to combine little slices into one larger slice
|
||||
color: null, // color to give the new slice (auto-generated if null)
|
||||
label: "Other" // label to give the new slice
|
||||
},
|
||||
highlight: {
|
||||
//color: "#fff", // will add this functionality once parseColor is available
|
||||
opacity: 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "pie",
|
||||
version: "1.1"
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,59 @@
|
||||
/* Flot plugin for automatically redrawing plots as the placeholder resizes.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
It works by listening for changes on the placeholder div (through the jQuery
|
||||
resize event plugin) - if the size changes, it will redraw the plot.
|
||||
|
||||
There are no options. If you need to disable the plugin for some plots, you
|
||||
can just fix the size of their placeholders.
|
||||
|
||||
*/
|
||||
|
||||
/* Inline dependency:
|
||||
* jQuery resize event - v1.1 - 3/14/2010
|
||||
* http://benalman.com/projects/jquery-resize-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function($,e,t){"$:nomunge";var i=[],n=$.resize=$.extend($.resize,{}),a,r=false,s="setTimeout",u="resize",m=u+"-special-event",o="pendingDelay",l="activeDelay",f="throttleWindow";n[o]=200;n[l]=20;n[f]=true;$.event.special[u]={setup:function(){if(!n[f]&&this[s]){return false}var e=$(this);i.push(this);e.data(m,{w:e.width(),h:e.height()});if(i.length===1){a=t;h()}},teardown:function(){if(!n[f]&&this[s]){return false}var e=$(this);for(var t=i.length-1;t>=0;t--){if(i[t]==this){i.splice(t,1);break}}e.removeData(m);if(!i.length){if(r){cancelAnimationFrame(a)}else{clearTimeout(a)}a=null}},add:function(e){if(!n[f]&&this[s]){return false}var i;function a(e,n,a){var r=$(this),s=r.data(m)||{};s.w=n!==t?n:r.width();s.h=a!==t?a:r.height();i.apply(this,arguments)}if($.isFunction(e)){i=e;return a}else{i=e.handler;e.handler=a}}};function h(t){if(r===true){r=t||1}for(var s=i.length-1;s>=0;s--){var l=$(i[s]);if(l[0]==e||l.is(":visible")){var f=l.width(),c=l.height(),d=l.data(m);if(d&&(f!==d.w||c!==d.h)){l.trigger(u,[d.w=f,d.h=c]);r=t||true}}else{d=l.data(m);d.w=0;d.h=0}}if(a!==null){if(r&&(t==null||t-r<1e3)){a=e.requestAnimationFrame(h)}else{a=setTimeout(h,n[o]);r=false}}}if(!e.requestAnimationFrame){e.requestAnimationFrame=function(){return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t,i){return e.setTimeout(function(){t((new Date).getTime())},n[l])}}()}if(!e.cancelAnimationFrame){e.cancelAnimationFrame=function(){return e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout}()}})(jQuery,this);
|
||||
|
||||
(function ($) {
|
||||
var options = { }; // no options
|
||||
|
||||
function init(plot) {
|
||||
function onResize() {
|
||||
var placeholder = plot.getPlaceholder();
|
||||
|
||||
// somebody might have hidden us and we can't plot
|
||||
// when we don't have the dimensions
|
||||
if (placeholder.width() == 0 || placeholder.height() == 0)
|
||||
return;
|
||||
|
||||
plot.resize();
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
}
|
||||
|
||||
function bindEvents(plot, eventHolder) {
|
||||
plot.getPlaceholder().resize(onResize);
|
||||
}
|
||||
|
||||
function shutdown(plot, eventHolder) {
|
||||
plot.getPlaceholder().unbind("resize", onResize);
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(bindEvents);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'resize',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,209 @@
|
||||
// Generated by CoffeeScript 1.6.3
|
||||
/*
|
||||
Easy pie chart is a jquery plugin to display simple animated pie charts for only one value
|
||||
|
||||
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
|
||||
Built on top of the jQuery library (http://jquery.com)
|
||||
|
||||
@source: http://github.com/rendro/easy-pie-chart/
|
||||
@autor: Robert Fleischmann
|
||||
@version: 1.2.5
|
||||
|
||||
Inspired by: http://dribbble.com/shots/631074-Simple-Pie-Charts-II?list=popular&offset=210
|
||||
Thanks to Philip Thrasher for the jquery plugin boilerplate for coffee script
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.easyPieChart = function(el, options) {
|
||||
var addScaleLine, animateLine, drawLine, easeInOutQuad, rAF, renderBackground, renderScale, renderTrack,
|
||||
_this = this;
|
||||
this.el = el;
|
||||
this.$el = $(el);
|
||||
this.$el.data("easyPieChart", this);
|
||||
this.init = function() {
|
||||
var percent, scaleBy;
|
||||
_this.options = $.extend({}, $.easyPieChart.defaultOptions, options);
|
||||
percent = _this.options.percent || parseInt(_this.$el.data('percent'), 10);
|
||||
_this.percentage = 0;
|
||||
_this.canvas = $("<canvas width='" + _this.options.size + "' height='" + _this.options.size + "'></canvas>").get(0);
|
||||
_this.$el.append(_this.canvas);
|
||||
if (typeof G_vmlCanvasManager !== "undefined" && G_vmlCanvasManager !== null) {
|
||||
G_vmlCanvasManager.initElement(_this.canvas);
|
||||
}
|
||||
_this.ctx = _this.canvas.getContext('2d');
|
||||
if (window.devicePixelRatio > 1) {
|
||||
scaleBy = window.devicePixelRatio;
|
||||
$(_this.canvas).css({
|
||||
width: _this.options.size,
|
||||
height: _this.options.size
|
||||
});
|
||||
_this.canvas.width *= scaleBy;
|
||||
_this.canvas.height *= scaleBy;
|
||||
_this.ctx.scale(scaleBy, scaleBy);
|
||||
}
|
||||
_this.ctx.translate(_this.options.size / 2, _this.options.size / 2);
|
||||
_this.ctx.rotate(_this.options.rotate * Math.PI / 180);
|
||||
_this.$el.addClass('easyPieChart');
|
||||
_this.$el.css({
|
||||
width: _this.options.size,
|
||||
height: _this.options.size,
|
||||
lineHeight: "" + _this.options.size + "px"
|
||||
});
|
||||
_this.update(percent);
|
||||
return _this;
|
||||
};
|
||||
this.update = function(percent) {
|
||||
percent = parseFloat(percent) || 0;
|
||||
if (_this.options.animate === false) {
|
||||
drawLine(percent);
|
||||
} else {
|
||||
if (_this.options.delay) {
|
||||
animateLine(_this.percentage, 0);
|
||||
setTimeout(function() {
|
||||
return animateLine(_this.percentage, percent);
|
||||
}, _this.options.delay);
|
||||
} else {
|
||||
animateLine(_this.percentage, percent);
|
||||
}
|
||||
}
|
||||
return _this;
|
||||
};
|
||||
renderScale = function() {
|
||||
var i, _i, _results;
|
||||
_this.ctx.fillStyle = _this.options.scaleColor;
|
||||
_this.ctx.lineWidth = 1;
|
||||
_results = [];
|
||||
for (i = _i = 0; _i <= 24; i = ++_i) {
|
||||
_results.push(addScaleLine(i));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
addScaleLine = function(i) {
|
||||
var offset;
|
||||
offset = i % 6 === 0 ? 0 : _this.options.size * 0.017;
|
||||
_this.ctx.save();
|
||||
_this.ctx.rotate(i * Math.PI / 12);
|
||||
_this.ctx.fillRect(_this.options.size / 2 - offset, 0, -_this.options.size * 0.05 + offset, 1);
|
||||
_this.ctx.restore();
|
||||
};
|
||||
renderTrack = function() {
|
||||
var offset;
|
||||
offset = _this.options.size / 2 - _this.options.lineWidth / 2;
|
||||
if (_this.options.scaleColor !== false) {
|
||||
offset -= _this.options.size * 0.08;
|
||||
}
|
||||
_this.ctx.beginPath();
|
||||
_this.ctx.arc(0, 0, offset, 0, Math.PI * 2, true);
|
||||
_this.ctx.closePath();
|
||||
_this.ctx.strokeStyle = _this.options.trackColor;
|
||||
|
||||
if (_this.options.color) {
|
||||
_this.ctx.fillStyle = _this.options.color;
|
||||
_this.ctx.fill();
|
||||
}
|
||||
|
||||
_this.ctx.lineWidth = _this.options.lineWidth;
|
||||
_this.ctx.stroke();
|
||||
};
|
||||
renderBackground = function() {
|
||||
if (_this.options.scaleColor !== false) {
|
||||
renderScale();
|
||||
}
|
||||
if (_this.options.trackColor !== false) {
|
||||
renderTrack();
|
||||
}
|
||||
};
|
||||
drawLine = function(percent) {
|
||||
var offset;
|
||||
renderBackground();
|
||||
_this.ctx.strokeStyle = $.isFunction(_this.options.barColor) ? _this.options.barColor(percent) : _this.options.barColor;
|
||||
_this.ctx.lineCap = _this.options.lineCap;
|
||||
_this.ctx.lineWidth = _this.options.lineWidth;
|
||||
offset = _this.options.size / 2 - _this.options.lineWidth / 2;
|
||||
if (_this.options.scaleColor !== false) {
|
||||
offset -= _this.options.size * 0.08;
|
||||
}
|
||||
_this.ctx.save();
|
||||
_this.ctx.rotate(-Math.PI / 2);
|
||||
_this.ctx.beginPath();
|
||||
_this.ctx.arc(0, 0, offset, 0, Math.PI * 2 * percent / 100, false);
|
||||
_this.ctx.stroke();
|
||||
_this.ctx.restore();
|
||||
};
|
||||
rAF = (function() {
|
||||
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
|
||||
return window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
})();
|
||||
animateLine = function(from, to) {
|
||||
var anim, startTime;
|
||||
_this.options.onStart.call(_this);
|
||||
_this.percentage = to;
|
||||
Date.now || (Date.now = function() {
|
||||
return +(new Date);
|
||||
});
|
||||
startTime = Date.now();
|
||||
anim = function() {
|
||||
var currentValue, process;
|
||||
process = Math.min(Date.now() - startTime, _this.options.animate);
|
||||
_this.ctx.clearRect(-_this.options.size / 2, -_this.options.size / 2, _this.options.size, _this.options.size);
|
||||
renderBackground.call(_this);
|
||||
currentValue = [easeInOutQuad(process, from, to - from, _this.options.animate)];
|
||||
_this.options.onStep.call(_this, currentValue);
|
||||
drawLine.call(_this, currentValue);
|
||||
if (process >= _this.options.animate) {
|
||||
return _this.options.onStop.call(_this, currentValue, to);
|
||||
} else {
|
||||
return rAF(anim);
|
||||
}
|
||||
};
|
||||
rAF(anim);
|
||||
};
|
||||
easeInOutQuad = function(t, b, c, d) {
|
||||
var easeIn, easing;
|
||||
easeIn = function(t) {
|
||||
return Math.pow(t, 2);
|
||||
};
|
||||
easing = function(t) {
|
||||
if (t < 1) {
|
||||
return easeIn(t);
|
||||
} else {
|
||||
return 2 - easeIn((t / 2) * -2 + 2);
|
||||
}
|
||||
};
|
||||
t /= d / 2;
|
||||
return c / 2 * easing(t) + b;
|
||||
};
|
||||
return this.init();
|
||||
};
|
||||
$.easyPieChart.defaultOptions = {
|
||||
percent: 0,
|
||||
barColor: '#ef1e25',
|
||||
trackColor: '#f2f2f2',
|
||||
scaleColor: '#dfe0e0',
|
||||
lineCap: 'round',
|
||||
rotate: 0,
|
||||
size: 110,
|
||||
lineWidth: 3,
|
||||
animate: false,
|
||||
delay: false,
|
||||
onStart: $.noop,
|
||||
onStop: $.noop,
|
||||
onStep: $.noop
|
||||
};
|
||||
$.fn.easyPieChart = function(options) {
|
||||
return $.each(this, function(i, el) {
|
||||
var $el, instanceOptions;
|
||||
$el = $(el);
|
||||
if (!$el.data('easyPieChart')) {
|
||||
instanceOptions = $.extend({}, options, $el.data());
|
||||
return $el.data('easyPieChart', new $.easyPieChart(el, instanceOptions));
|
||||
} else{
|
||||
$el.data('easyPieChart').update(options['percent']);
|
||||
}
|
||||
});
|
||||
};
|
||||
return void 0;
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,441 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='实名认证';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
function showstar($num){
|
||||
$data = '';
|
||||
for($i=0;$i<$num;$i++){
|
||||
$data .= '*';
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
$isqrcode = false;
|
||||
if(isset($_GET['qrcode']) && $_GET['qrcode'] == '1'){
|
||||
if(!isset($_SESSION[$uid.'_certify'])){
|
||||
exit("<script language='javascript'>window.location.href='./certificate.php';</script>");
|
||||
}
|
||||
$isqrcode = true;
|
||||
}
|
||||
|
||||
if(strlen($userrow['phone'])==11){
|
||||
$userrow['phone']=substr($userrow['phone'],0,3).'****'.substr($userrow['phone'],7,10);
|
||||
}
|
||||
|
||||
$csrf_token = md5(mt_rand(0,999).time());
|
||||
$_SESSION['csrf_token'] = $csrf_token;
|
||||
|
||||
|
||||
if ($isqrcode && ($conf['cert_open']==1 || $conf['cert_open']==5)) {
|
||||
$page = 'alipayqrcode';
|
||||
}elseif($isqrcode && $conf['cert_open']==3){
|
||||
$page = 'alipayqrcode2';
|
||||
}elseif($isqrcode && $conf['cert_open']==4){
|
||||
$page = 'wxqrcode';
|
||||
}else{
|
||||
if($conf['cert_corpopen'] == 1){
|
||||
if(isset($_GET['certtype']) && $_GET['certtype']=='1'){
|
||||
$page = 'corpinput';
|
||||
}elseif(isset($_GET['certtype']) && $_GET['certtype']=='0'){
|
||||
$page = 'personinput';
|
||||
}else{
|
||||
$page = 'typeselect';
|
||||
}
|
||||
}else{
|
||||
$page = 'personinput';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<link rel="stylesheet" href="./assets/css/certificate.css" type="text/css" />
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">个人资料</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(!$conf['cert_open'])showmsg('未开启实名认证功能');?>
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="tab-container ng-isolate-scope">
|
||||
<ul class="nav nav-tabs">
|
||||
<li style="width: 25%;" align="center">
|
||||
<a href="userinfo.php?mod=api">API信息</a>
|
||||
</li>
|
||||
<li style="width: 25%;" align="center">
|
||||
<a href="editinfo.php">修改资料</a>
|
||||
</li>
|
||||
<li style="width: 25%;" align="center">
|
||||
<a href="userinfo.php?mod=account">修改密码</a>
|
||||
</li>
|
||||
<li style="width: 25%;" align="center" class="active">
|
||||
<a href="certificate.php">实名认证</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php
|
||||
if($conf['cert_open']==2 && $userrow['cert']!=1){
|
||||
include ROOT.'user/certificate_mobile.php';
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane ng-scope active">
|
||||
<div class="row step-line nav nav-pills nav-justified steps verified">
|
||||
<div id="tag1" class="col-sm-12 col-md-4 mt-step-col first fill complete-active">
|
||||
<div class="mt-step-col-cont row bg-primary">
|
||||
<div class="col-xs-3 bg-primary-l">
|
||||
<i class="icon glyphicon glyphicon-edit"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 bg-primary-r">
|
||||
<div class="mt-step-title uppercase font-grey-cascade ">填写认证信息
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tag2" class="col-sm-12 col-md-4 mt-step-col <?php if($userrow['cert']==1||$isqrcode)echo 'complete-active';?>">
|
||||
<div class="mt-step-col-cont row">
|
||||
<div class="col-xs-3 bg-primary-l">
|
||||
<i class="icon fa fa-qrcode"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 bg-primary-r">
|
||||
<div class="mt-step-title uppercase font-grey-cascade ">
|
||||
<?php if($conf['cert_open']==4){?>微信扫码快捷认证<?php }else{?>支付宝扫码快捷认证<?php }?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tag3" class="col-sm-12 col-md-4 mt-step-col last <?php if($userrow['cert']==1)echo 'complete-active';?>">
|
||||
<div class="mt-step-col-cont row ">
|
||||
<div class="col-xs-3 bg-primary-l">
|
||||
<i class="icon fa fa-check-circle-o"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 bg-primary-r">
|
||||
<div class="mt-step-title uppercase font-grey-cascade ">
|
||||
认证完成</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<?php if($userrow['cert']==1 && !isset($_GET['upgrade'])){?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<img src="https://imgcache.qq.com/open_proj/proj_qcloud_v2/mc_2014/user/auth/css/mod/img/sfz.jpg" class="pull-right">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<h4>恭喜您已通过<?php echo $conf['sitename']?>实名认证!</h4>
|
||||
<p>认证类型:<?php echo show_cert_type($userrow['certtype'])?><?php if($userrow['certtype']==0)echo ' <span class="text-muted">[<a href="certificate.php?certtype=1&upgrade=1" style="color: #98a6ad;">升级到企业认证</a></span>]';?></p>
|
||||
<p>认证方式:<?php echo show_cert_method($userrow['certmethod'])?></p>
|
||||
<p>真实姓名:<?php echo showstar((strlen($userrow['certname'])-3)/3).substr($userrow['certname'],-3)?></p>
|
||||
<p>身份证号:<?php echo substr($userrow['certno'],0,3).showstar(11).substr($userrow['certno'],-4)?></p>
|
||||
<p>认证时间:<?php echo $userrow['certtime']?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php }else{?>
|
||||
|
||||
<?php if($conf['cert_money']>0){?>
|
||||
<div class="alert alert-info alert-dismissible" role="alert" style="line-height: 26px;">
|
||||
<p>认证需要<b><?php echo $conf['cert_money']; ?></b>元,请确保你的账号内有<?php echo $conf['cert_money']; ?>元余额[<a href="recharge.php">点此充值</a>],认证成功会自动扣除,认证失败不扣费</p>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if($page=='alipayqrcode'){?>
|
||||
<div id="step2">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<center><div id="qrcode"></div>
|
||||
<p class="text-muted" style="line-height: 26px;">请使用支付宝APP扫描二维码</p>
|
||||
<?php if(checkmobile()){?><p><a href="javascript:openAlipay()" id="jumplink" class="btn btn-success">点此跳转到支付宝</a></p><p class="text-muted">到支付宝确认之后请返回此页面查看结果</p><?php }?>
|
||||
<p><a href="./certificate.php" class="btn btn-default btn-sm">返回重新填写</a></p>
|
||||
</center>
|
||||
</form>
|
||||
</div>
|
||||
<?php }elseif($page=='alipayqrcode2'){?>
|
||||
<div id="step2">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<center><div id="qrcode"></div>
|
||||
<p class="text-muted" style="line-height: 26px;">请使用支付宝APP扫描二维码</p>
|
||||
<p><a href="javascript:jumpAlipay()" id="jumplink" class="btn btn-success">点此跳转到支付宝</a></p>
|
||||
<p><a href="./certificate.php" class="btn btn-default btn-sm">返回重新填写</a></p>
|
||||
</center>
|
||||
</form>
|
||||
</div>
|
||||
<?php }elseif($page=='wxqrcode'){?>
|
||||
<div id="step2">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<center><div id="qrcode"></div>
|
||||
<p class="text-muted" style="line-height: 26px;">请使用微信扫描二维码</p>
|
||||
<?php if(checkmobile()){?><p class="text-muted" style="line-height: 26px;">手机用户可保存上方二维码到手机中</p><p class="text-muted" style="line-height: 26px;">微信扫一扫中选择“相册”即可</p><?php }?>
|
||||
<p><a href="./certificate.php" class="btn btn-default btn-sm">返回重新填写</a></p>
|
||||
</center>
|
||||
</form>
|
||||
</div>
|
||||
<?php }elseif($page=='personinput'){?>
|
||||
<div id="step1">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<input type="hidden" name="certtype" value="0">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">认证方式</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="certification_type">
|
||||
<?php if($conf['cert_open']==4){?><img src="/assets/icon/wxpay.ico" width="25"> 微信快捷认证<?php }else{?><img src="/assets/icon/alipay.ico" width="25"> 支付宝快捷认证<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">真实姓名</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="certname" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">身份证号</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="certno" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-9"><div class="input-group"><font color="red"><i class="fa fa-info-circle"></i> <?php if($conf['cert_open']==4){?>微信账号的实名信息需与所填身份证号码对应,否则无法认证成功<?php }else{?>支付宝账号的实名信息需与所填身份证号码对应,否则无法认证成功<?php }?></font></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="certSubmit" value="提交认证" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="alert alert-warning alert-dismissible" role="alert" style="line-height: 26px;font-size: 13px;margin-top: 50px;">
|
||||
<p>1、为了更好的享受<?php echo $conf['sitename']?>提供的服务,本人知晓并同意授权<?php if($conf['cert_open']==4){?>微信的实名认证<?php }else{?>支付宝的实名认证<?php }?>方式用于验证本人信息的真实性</p>
|
||||
<p>2、本站承诺任何在本网站提交的用户信息,仅限用于本站为用户提供服务,本站承诺为用户的隐私及其他个人信息采取严格保密措施,并在必要时销毁数据。</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php }elseif($page=='corpinput'){?>
|
||||
<div id="step1">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<input type="hidden" name="certtype" value="1">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">认证方式</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="certification_type">
|
||||
<?php if($conf['cert_open']==4){?><img src="/assets/icon/wxpay.ico" width="25"> 微信快捷认证<?php }else{?><img src="/assets/icon/alipay.ico" width="25"> 支付宝快捷认证<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">公司名称</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="certcorpname" value="" placeholder="填写公司名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">营业执照号码</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="certcorpno" value="" placeholder="填写统一社会信用代码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">法人姓名</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="certname" value="" placeholder="填写法人的姓名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">法人身份证号</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="certno" value="" placeholder="填写法人的身份证号">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-9"><div class="input-group"><p><font color="red"><i class="fa fa-info-circle"></i> <?php if($conf['cert_open']==4){?>微信账号的实名信息需与所填法人身份证号码对应,否则无法认证成功<?php }else{?>支付宝账号的实名信息需与所填法人身份证号码对应,否则无法认证成功<?php }?></font></p><p><font color="grey"><i class="fa fa-info-circle"></i> 建议先去 <a href="https://www.tianyancha.com/" target="_blank" rel="noopener noreferrer">天眼查</a> 查询自己企业的信息,直接复制填入,避免填错。</font></p></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="certSubmit" value="提交认证" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="alert alert-warning alert-dismissible" role="alert" style="line-height: 26px;font-size: 13px;margin-top: 50px;">
|
||||
<p>1、为了更好的享受<?php echo $conf['sitename']?>提供的服务,本人知晓并同意授权<?php if($conf['cert_open']==4){?>微信的实名认证<?php }else{?>支付宝的实名认证<?php }?>方式用于验证本人信息的真实性</p>
|
||||
<p>2、本站承诺任何在本网站提交的用户信息,仅限用于本站为用户提供服务,本站承诺为用户的隐私及其他个人信息采取严格保密措施,并在必要时销毁数据。</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php }elseif($page=='typeselect'){?>
|
||||
<div class="row" style="margin:10px 5px 15px -10px;">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="type-item" style="border-radius:20px">
|
||||
<div class="type-icon personal"></div>
|
||||
<div class="type-title">个人认证</div>
|
||||
<div class="type-desc">用个人身份信息进行认证</div>
|
||||
<ul class="list-unstyled type-info">
|
||||
<li><i class="fa fa-check-circle"></i> 全自动审核,即时通过</li>
|
||||
</ul>
|
||||
<a href="certificate.php?certtype=0" class="btn btn-primary">立即认证</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="type-item" style="border-radius:20px">
|
||||
<div class="type-icon enterprises"></div>
|
||||
<div class="type-title">企业认证</div>
|
||||
<div class="type-desc">用企业信息进行认证</div>
|
||||
<ul class="list-unstyled type-info">
|
||||
<li><i class="fa fa-check-circle"></i> 全自动审核,即时通过</li>
|
||||
</ul>
|
||||
<a href="certificate.php?certtype=1" class="btn btn-primary">立即认证</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
<?php if($isqrcode){?>
|
||||
var qrcode_url;
|
||||
$(document).ready(function(){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=cert_geturl",
|
||||
data : {csrf_token:csrf_token},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
qrcode_url = data.url;
|
||||
$('#qrcode').qrcode({
|
||||
text: qrcode_url,
|
||||
width: 280,
|
||||
height: 280,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
setTimeout(certQuery, 5000);
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
<?php }else{?>
|
||||
$(document).ready(function(){
|
||||
$("#certSubmit").click(function(){
|
||||
var certtype=$("input[name='certtype']").val();
|
||||
var certname=$("input[name='certname']").val();
|
||||
var certno=$("input[name='certno']").val();
|
||||
var certcorpname=$("input[name='certcorpname']").val();
|
||||
var certcorpno=$("input[name='certcorpno']").val();
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
if(certname=='' || certno==''){
|
||||
layer.alert('请确保各项不能为空');return false;
|
||||
}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=certificate",
|
||||
data : {certtype:certtype,certname:certname,certno:certno,certcorpname:certcorpname,certcorpno:certcorpno,csrf_token:csrf_token},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
window.location.href='./certificate.php?qrcode=1';
|
||||
}else if(data.code == 2){
|
||||
layer.alert(data.msg, {icon: 1}, function(){ window.location.href='./certificate.php'; });
|
||||
}else if(data.code == -2){
|
||||
var confirmobj = layer.confirm(data.msg, {
|
||||
icon: 0, btn: ['关联认证','取消']
|
||||
}, function(){
|
||||
certBind(data.uid);
|
||||
}, function(){
|
||||
layer.close(confirmobj);
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
<?php }?>
|
||||
function openAlipay(){
|
||||
var scheme = 'alipays://platformapi/startapp?appId=20000067&url=';
|
||||
scheme += encodeURIComponent(qrcode_url);
|
||||
window.location.href = scheme;
|
||||
}
|
||||
function jumpAlipay(){
|
||||
if( /Android|SymbianOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Phone|Midp/i.test(navigator.userAgent)) {
|
||||
var scheme = 'alipays://platformapi/startapp?appId=20000067&url=';
|
||||
scheme += encodeURIComponent(qrcode_url);
|
||||
window.location.href = scheme;
|
||||
}else{
|
||||
window.location.href = qrcode_url;
|
||||
}
|
||||
}
|
||||
function certBind(touid){
|
||||
var certname=$("input[name='certname']").val();
|
||||
var certno=$("input[name='certno']").val();
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
layer.prompt({title: '请输入商户ID'+uid+'的商户密钥', value: '', formType: 0}, function(text, index){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=cert_bind',
|
||||
data : {touid:touid,certname:certname,certno:certno,csrf_token:csrf_token},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert(data.msg, {icon: 1}, function(){window.location.reload()});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function certQuery(){
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=cert_query',
|
||||
data : {csrf_token:csrf_token},
|
||||
dataType : 'json',
|
||||
async: true,
|
||||
success : function(data) {
|
||||
if(data.code == 1){
|
||||
if(data.passed == true){
|
||||
layer.msg('实名认证成功!', {icon: 1,time: 10000,shade:[0.3, "#000"]});
|
||||
setTimeout(function(){ window.location.href='./certificate.php' }, 800);
|
||||
}else{
|
||||
setTimeout(certQuery, 3000)
|
||||
}
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
if(!defined('IN_CRONLITE'))exit;
|
||||
?>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane ng-scope active">
|
||||
<div class="row step-line nav nav-pills nav-justified steps verified">
|
||||
<div id="tag1" class="col-sm-12 col-md-6 mt-step-col first fill complete-active">
|
||||
<div class="mt-step-col-cont row bg-primary">
|
||||
<div class="col-xs-3 bg-primary-l">
|
||||
<i class="icon glyphicon glyphicon-edit"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 bg-primary-r">
|
||||
<div class="mt-step-title uppercase font-grey-cascade ">填写认证信息
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tag3" class="col-sm-12 col-md-6 mt-step-col last">
|
||||
<div class="mt-step-col-cont row ">
|
||||
<div class="col-xs-3 bg-primary-l">
|
||||
<i class="icon fa fa-check-circle-o"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 bg-primary-r">
|
||||
<div class="mt-step-title uppercase font-grey-cascade ">
|
||||
认证完成</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
|
||||
<?php if($conf['cert_money']>0){?>
|
||||
<div class="alert alert-info alert-dismissible" role="alert" style="line-height: 26px;">
|
||||
<p>认证需要<b><?php echo $conf['cert_money']; ?></b>元,请确保你的账号内有<?php echo $conf['cert_money']; ?>元余额[<a href="recharge.php">点此充值</a>],认证成功会自动扣除,认证失败不扣费</p>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<div id="step1">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">认证方式</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="certification_type">
|
||||
手机号三要素认证
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">真实姓名</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="certname" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">身份证号</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="certno" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">手机号码</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" name="phone" value="<?php echo $userrow['phone']?>" disabled><a class="input-group-addon" href="./editinfo.php">修改绑定</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-9"><div class="input-group"><font color="red"><i class="fa fa-info-circle"></i> 手机号码的实名信息需与所填身份证号码对应,否则无法认证成功</font></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="certSubmit" value="提交认证" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="alert alert-warning alert-dismissible" role="alert" style="line-height: 26px;font-size: 13px;margin-top: 50px;">
|
||||
<p>1、为了更好的享受<?php echo $conf['sitename']?>提供的服务,本人知晓并同意授权手机号实名认证方式用于验证本人信息的真实性</p>
|
||||
<p>2、本站承诺任何在本网站提交的用户信息,仅限用于本站为用户提供服务,本站承诺为用户的隐私及其他个人信息采取严格保密措施,并在必要时销毁数据。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#certSubmit").click(function(){
|
||||
var certname=$("input[name='certname']").val();
|
||||
var certno=$("input[name='certno']").val();
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
if(certname=='' || certno==''){
|
||||
layer.alert('请确保各项不能为空');return false;
|
||||
}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=certificate",
|
||||
data : {certname:certname,certno:certno,csrf_token:csrf_token},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 2){
|
||||
layer.alert(data.msg, {icon: 1}, function(){ window.location.href='./certificate.php'; });
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,211 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='完善账户资料';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">完善账户资料</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<h3 class="panel-title">完善账户资料</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-success">
|
||||
你已经注册成功了,请先填写你的收款账号与联系方式信息!
|
||||
</div>
|
||||
<form class="form-horizontal devform">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">结算方式</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="stype" default="<?php echo $userrow['settle_id']?>">
|
||||
<?php if($conf['settle_alipay']){?><option value="1" input="支付宝账号">支付宝结算</option>
|
||||
<?php }if($conf['settle_wxpay']){?><option value="2" input="<?php echo $conf['transfer_wxpay']?'微信OpenId':'微信号';?>">微信结算</option>
|
||||
<?php }if($conf['settle_qqpay']){?><option value="3" input="QQ号码">QQ钱包结算</option>
|
||||
<?php }if($conf['settle_bank']){?><option value="4" input="银行卡号">银行卡结算</option>
|
||||
<?php }?></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" id="typename">收款账号</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="account" value="<?php echo $userrow['account']?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php if($conf['transfer_wxpay']){?>
|
||||
<div class="form-group" style="display:none;" id="getopenid_form">
|
||||
<div class="col-sm-offset-2 col-sm-4">
|
||||
<a class="btn btn-sm btn-default" id="getopenid">点此获取微信OpenId</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">真实姓名</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="username" value="<?php echo $userrow['username']?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php if($conf['verifytype']==1){?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">邮箱</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="email" value="<?php echo $userrow['email']?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">QQ</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="qq" value="<?php echo $userrow['qq']?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">网站域名</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="url" value="<?php echo $userrow['url']?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="save" value="保存" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("select[name='stype']").change(function(){
|
||||
var input = $("select[name='stype'] option:selected").attr("input");
|
||||
$("#typename").html(input);
|
||||
if($(this).val() == 2){
|
||||
$("#getopenid_form").show();
|
||||
}else{
|
||||
$("#getopenid_form").hide();
|
||||
}
|
||||
});
|
||||
$("select[name='stype']").change();
|
||||
$("#save").click(function(){
|
||||
var stype=$("select[name='stype']").val();
|
||||
var account=$("input[name='account']").val();
|
||||
var username=$("input[name='username']").val();
|
||||
var email=$("input[name='email']").val();
|
||||
var qq=$("input[name='qq']").val();
|
||||
var url=$("input[name='url']").val();
|
||||
if(account=='' || username=='' || email=='' || qq=='' || url==''){layer.alert('请确保各项不能为空!');return false;}
|
||||
if($("input[name='email']").length>0){
|
||||
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
|
||||
if(!reg.test(email)){layer.alert('邮箱格式不正确!');return false;}
|
||||
}
|
||||
if (url.indexOf(" ")>=0){
|
||||
url = url.replace(/ /g,"");
|
||||
}
|
||||
if (url.toLowerCase().indexOf("http://")==0){
|
||||
url = url.slice(7);
|
||||
}
|
||||
if (url.toLowerCase().indexOf("https://")==0){
|
||||
url = url.slice(8);
|
||||
}
|
||||
if (url.slice(url.length-1)=="/"){
|
||||
url = url.slice(0,url.length-1);
|
||||
}
|
||||
$("input[name='url']").val(url);
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=completeinfo",
|
||||
data : {stype:stype,account:account,username:username,email:email,qq:qq,url:url},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('保存成功!', {icon:1}, function(){ window.location.href="./" });
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#getopenid').click(function () {
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
$(this).attr("data-lock", "true");
|
||||
$.ajax({
|
||||
type : "GET",
|
||||
url : "ajax.php?act=qrcode",
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
$('#getopenid').attr("data-lock", "false");
|
||||
if(data.code == 0){
|
||||
$.openidform = layer.open({
|
||||
type: 1,
|
||||
title: '请使用微信扫描以下二维码',
|
||||
skin: 'layui-layer-demo',
|
||||
anim: 2,
|
||||
shadeClose: true,
|
||||
content: '<div id="qrcode" class="list-group-item text-center"></div>',
|
||||
success: function(){
|
||||
$('#qrcode').qrcode({
|
||||
text: data.url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
$.ostart = true;
|
||||
setTimeout('checkopenid()', 2000);
|
||||
},
|
||||
end: function(){
|
||||
$.ostart = false;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 0});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function checkopenid(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "ajax.php?act=getopenid",
|
||||
success: function (data, textStatus) {
|
||||
if (data.code == 0) {
|
||||
layer.msg('Openid获取成功');
|
||||
layer.close($.openidform);
|
||||
$("input[name='account']").val(data.openid);
|
||||
}else if($.ostart==true){
|
||||
setTimeout('checkopenid()', 2000);
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/**
|
||||
* QQ互联
|
||||
**/
|
||||
include("../includes/common.php");
|
||||
|
||||
if(isset($_GET['act']) && $_GET['act']=='qrlogin' && $conf['login_qq']==2){
|
||||
if(isset($_SESSION['findpwd_qq']) && $qq=$_SESSION['findpwd_qq']){
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE qq_uid='$qq' LIMIT 1");
|
||||
unset($_SESSION['findpwd_qq']);
|
||||
if($userrow){
|
||||
$uid=$userrow['uid'];
|
||||
$key=$userrow['key'];
|
||||
if($islogin2==1){
|
||||
exit('{"code":-1,"msg":"当前QQ已绑定商户ID:'.$uid.',请勿重复绑定!"}');
|
||||
}
|
||||
$DB->insert('log', ['uid'=>$uid, 'type'=>'QQ快捷登录', 'date'=>'NOW()', 'ip'=>$clientip, 'city'=>$city]);
|
||||
$session=md5($uid.$key.$password_hash);
|
||||
$expiretime=time()+2592000;
|
||||
$token=authcode("{$uid}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
|
||||
setcookie("user_token", $token, time() + 2592000);
|
||||
$DB->exec("update `pre_user` set `lasttime`=NOW() where `uid`='$uid'");
|
||||
$result=array("code"=>0,"msg"=>"登录成功!正在跳转到用户中心","url"=>"./");
|
||||
}elseif($islogin2==1){
|
||||
$sds=$DB->exec("update `pre_user` set `qq_uid`='$qq' where `uid`='$uid'");
|
||||
$result=array("code"=>0,"msg"=>"已成功绑定QQ账号!","url"=>"./editinfo.php");
|
||||
}else{
|
||||
$_SESSION['Oauth_qq_uid']=$openId;
|
||||
$result=array("code"=>0,"msg"=>"请输入商户ID和密钥完成绑定和登录","url"=>"./login.php?connect=true");
|
||||
}
|
||||
}else{
|
||||
$result=array("code"=>-1, "msg"=>"验证失败,请重新扫码");
|
||||
}
|
||||
exit(json_encode($result));
|
||||
}
|
||||
|
||||
$QC_config['appid']=$conf['login_qq_appid'];
|
||||
$QC_config['appkey']=$conf['login_qq_appkey'];
|
||||
$QC_config['callback']=$siteurl.'user/connect.php';
|
||||
|
||||
$Oauth_config['apiurl']=$conf['login_apiurl'];
|
||||
$Oauth_config['appid']=$conf['login_appid'];
|
||||
$Oauth_config['appkey']=$conf['login_appkey'];
|
||||
$Oauth_config['callback']=$siteurl.'user/connect.php';
|
||||
|
||||
if($_GET['code'] && ($conf['login_qq']==1 || $conf['login_qq']==3 || $conf['login_wx']==-1 || $conf['login_alipay']==-1)){
|
||||
if($conf['login_qq']==1 && !isset($_GET['type'])){
|
||||
$QC=new \lib\QC($QC_config);
|
||||
$access_token=$QC->qq_callback();
|
||||
$openid=$QC->get_openid($access_token);
|
||||
$typename = 'QQ';
|
||||
$typecolumn = 'qq_uid';
|
||||
}else{
|
||||
$type = isset($_GET['type'])?$_GET['type']:exit('{"code":-1,"msg":"no type"}');
|
||||
if($type == 'qq'){
|
||||
$typename = 'QQ';
|
||||
$typecolumn = 'qq_uid';
|
||||
}elseif($type == 'wx'){
|
||||
$typename = '微信';
|
||||
$typecolumn = 'wx_uid';
|
||||
}elseif($type == 'alipay'){
|
||||
$typename = '支付宝';
|
||||
$typecolumn = 'alipay_uid';
|
||||
}
|
||||
$Oauth=new \lib\Oauth($Oauth_config);
|
||||
$arr = $Oauth->callback();
|
||||
if(isset($arr['code']) && $arr['code']==0){
|
||||
$openid=$arr['social_uid'];
|
||||
$access_token=$arr['access_token'];
|
||||
}elseif(isset($arr['code'])){
|
||||
sysmsg($arr['msg']);
|
||||
}else{
|
||||
sysmsg('获取登录数据失败');
|
||||
}
|
||||
}
|
||||
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE {$typecolumn}=:openid limit 1", [':openid'=>$openid]);
|
||||
if($userrow){
|
||||
$uid=$userrow['uid'];
|
||||
$key=$userrow['key'];
|
||||
if($islogin2==1){
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('当前{$typename}已绑定商户ID:{$uid},请勿重复绑定!');window.location.href='./editinfo.php';</script>");
|
||||
}
|
||||
$DB->insert('log', ['uid'=>$uid, 'type'=>$typename.'快捷登录', 'date'=>'NOW()', 'ip'=>$clientip, 'city'=>$city]);
|
||||
$session=md5($uid.$key.$password_hash);
|
||||
$expiretime=time()+2592000;
|
||||
$token=authcode("{$uid}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
|
||||
setcookie("user_token", $token, time() + 2592000);
|
||||
$DB->exec("update `pre_user` set `lasttime`=NOW() where `uid`='$uid'");
|
||||
exit("<script language='javascript'>window.location.href='./';</script>");
|
||||
}elseif($islogin2==1){
|
||||
$sds=$DB->exec("update `pre_user` set `{$typecolumn}`=:openid where `uid`='$uid'", [':openid'=>$openid]);
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('已成功绑定{$typename}!');window.location.href='./editinfo.php';</script>");
|
||||
}else{
|
||||
$_SESSION['Oauth_'.$typecolumn]=$openid;
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('请输入商户ID和密钥完成绑定和登录');window.location.href='./login.php?connect=true';</script>");
|
||||
}
|
||||
}elseif($islogin2==1 && isset($_GET['unbind'])){
|
||||
$DB->exec("update `pre_user` set `qq_uid`=NULL where `uid`='$uid'");
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('您已成功解绑QQ!');window.location.href='./editinfo.php';</script>");
|
||||
}elseif($islogin2==1 && !isset($_GET['bind'])){
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('您已登陆!');window.location.href='./';</script>");
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>QQ扫码登录 | <?php echo $conf['sitename']?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>animate.css/3.5.2/animate.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>simple-line-icons/2.4.1/css/simple-line-icons.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/font.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/app.css" type="text/css" />
|
||||
<style>input:-webkit-autofill{-webkit-box-shadow:0 0 0px 1000px white inset;-webkit-text-fill-color:#333;}img.logo{width:14px;height:14px;margin:0 5px 0 3px;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app app-header-fixed ">
|
||||
<div class="container w-xxl w-auto-xs" ng-controller="SigninFormController" ng-init="app.settings.container = false;">
|
||||
<span class="navbar-brand block m-t" id="sitename"><?php echo $conf['sitename']?></span>
|
||||
<div class="m-b-lg">
|
||||
<div class="wrapper text-center">
|
||||
<strong>QQ扫码登录</strong>
|
||||
</div>
|
||||
<form name="form" class="form-validation">
|
||||
<div class="text-danger wrapper text-center" ng-show="authError">
|
||||
</div>
|
||||
<div class="form-group" style="text-align: center;">
|
||||
<div class="list-group-item list-group-item-info" style="font-weight: bold;" id="login">
|
||||
<span id="loginmsg">请使用QQ手机版扫描二维码</span><span id="loginload" style="padding-left: 10px;color: #790909;">.</span>
|
||||
</div>
|
||||
<div id="qrimg" class="list-group-item">
|
||||
</div>
|
||||
<div class="list-group-item" id="mobile" style="display:none;"><button type="button" id="mlogin" onclick="mloginurlnew()" class="btn btn-warning btn-block">跳转QQ快捷登录</button><br/><button type="button" onclick="qrlogin()" class="btn btn-success btn-block">我已完成登录</button></div>
|
||||
<div class="list-group-item">
|
||||
<div class="btn-group">
|
||||
<a href="login.php" class="btn btn-primary btn-rounded"><i class="fa fa-user"></i> 返回登录</a>
|
||||
<a href="reg.php" class="btn btn-info btn-rounded"><i class="fa fa-user-plus"></i> 注册账号</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<p>
|
||||
<small class="text-muted"><a href="/"><?php echo $conf['sitename']?></a><br>© 2016~<?php echo date("Y")?></small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="./assets/js/qrlogin.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='保证金管理';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
$urow = $DB->getRow("SELECT uid,gid FROM pre_user WHERE uid='{$conf['reg_pay_uid']}' limit 1");
|
||||
if(!$urow)exit('充值收款商户不存在');
|
||||
$paytype = \lib\Channel::getTypes($urow['uid'], $urow['gid']);
|
||||
$csrf_token = md5(mt_rand(0,999).time());
|
||||
$_SESSION['csrf_token'] = $csrf_token;
|
||||
|
||||
if(!$userrow['deposit']) $userrow['deposit'] = 0;
|
||||
$money1 = null;
|
||||
if($conf['user_deposit_min']>$userrow['deposit']) $money1 = round($conf['user_deposit_min'] - $userrow['deposit'], 2);
|
||||
$money2 = null;
|
||||
if($userrow['deposit'] > 0) $money2 = $userrow['deposit'];
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">保证金管理</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 center-block" style="float: none;">
|
||||
<?php if(isset($_GET['ok']) && $_GET['ok']==1){
|
||||
$order = $DB->getRow("SELECT * FROM pre_order WHERE trade_no=:trade_no limit 1", [':trade_no'=>$_GET['trade_no']]);
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
恭喜你成功充值<strong><?php echo $order['money']?></strong>元保证金!
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-certificate"></i> 保证金管理
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php if($conf['user_deposit_min']>0){?><div class="alert alert-warning">
|
||||
<p>当前平台要求最低缴纳保证金<b><?php echo $conf['user_deposit_min']; ?></b>元,否则无法调用接口发起支付。</p>
|
||||
</div><?php }?>
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">当前保证金余额</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="deposit" value="<?php echo $userrow['deposit']?> 元" readonly="">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-cny"></i> 充值保证金
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">要充值的金额</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="money1" value="<?php echo $money1?>" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付方式</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio">
|
||||
<label class="i-checks"><input type="radio" name="type" value="0"><i></i>余额支付</label>
|
||||
<?php foreach($paytype as $row){?>
|
||||
<label class="i-checks"><input type="radio" name="type" value="<?php echo $row['id']?>"><i></i><?php echo $row['showname']?>
|
||||
</label>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-8"><input type="button" id="submit1" value="立即充值" class="btn btn-success form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="glyphicon glyphicon-edit"></i> 提取保证金
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">要提取的金额</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="money2" value="<?php echo $money2?>" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-8"><input type="button" id="submit2" value="提取到商户余额" class="btn btn-success form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("input[name=type]:first").attr("checked",true);
|
||||
$("#submit1").click(function(){
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
var money=$("input[name='money1']").val();
|
||||
var typeid=$("input[name=type]:checked").val();
|
||||
if(money==''){
|
||||
layer.alert("金额不能为空");
|
||||
return false;
|
||||
}
|
||||
var ii = layer.load();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {money:money, typeid:typeid, csrf_token:csrf_token},
|
||||
url: "ajax2.php?act=deposit_recharge",
|
||||
success: function (data, textStatus) {
|
||||
layer.close(ii);
|
||||
if (data.code == 0) {
|
||||
window.location.href=data.url;
|
||||
}else if (data.code == 1) {
|
||||
layer.alert(data.msg, {icon: 1}, function(){
|
||||
window.location.reload();
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
$("#submit2").click(function(){
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
var money=$("input[name='money2']").val();
|
||||
if(money==''){
|
||||
layer.alert("金额不能为空");
|
||||
return false;
|
||||
}
|
||||
var ii = layer.load();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {money:money, csrf_token:csrf_token},
|
||||
url: "ajax2.php?act=deposit_withdraw",
|
||||
success: function (data, textStatus) {
|
||||
layer.close(ii);
|
||||
if (data.code == 0) {
|
||||
layer.alert(data.msg, {icon: 1}, function(){
|
||||
window.location.reload();
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='授权支付域名';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
|
||||
function display_status($status){
|
||||
if($status == 1){
|
||||
return '<font color="green">正常</font>';
|
||||
}elseif($status == 2){
|
||||
return '<font color="red">拒绝</font>';
|
||||
}else{
|
||||
return '<font color="blue">审核中</font>';
|
||||
}
|
||||
}
|
||||
|
||||
$numrows=$DB->getColumn("SELECT count(*) from pre_domain WHERE uid={$uid}");
|
||||
|
||||
$list=$DB->getAll("SELECT * FROM pre_domain WHERE uid={$uid} order by id desc");
|
||||
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">授权支付域名</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
授权支付域名 (<?php echo $numrows?>)<a href="javascript:addDomain()" class="btn btn-success btn-xs pull-right">添加域名</a>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover table-bordered">
|
||||
<thead><tr><th>域名</th><th>状态</th><th>提交时间</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($list as $res){
|
||||
echo '<tr><td>'.$res['domain'].'</td><td>'.display_status($res['status']).'</td><td>'.$res['addtime'].'</td><td><a href="javascript:delDomain('.$res['id'].')" class="btn btn-xs btn-danger">删除</a></td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script>
|
||||
function addDomain(){
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['350px'],
|
||||
closeBtn: 2,
|
||||
title: '添加授权支付域名',
|
||||
content: '<div class="wrapper"><div class="alert alert-warning">域名添加后需要等管理员审核通过才能使用,请确保网站可以正常访问并且有明确的业务模式或在售商品。</div><input class="form-control" type="text" name="content" value="" autocomplete="off" placeholder="请输入域名,支持通配符*"></div>',
|
||||
btn: ['确认', '取消'],
|
||||
yes: function(){
|
||||
var content = $("input[name='content']").val();
|
||||
if(content == ''){
|
||||
$("input[name='content']").focus();return;
|
||||
}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=addDomain',
|
||||
data : {domain: content},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
layer.alert(data.msg, {icon:1}, function(){ window.location.reload() });
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:0});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.close(ii);
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function delDomain(id) {
|
||||
if(confirm('确定要删除此域名吗?')){
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=delDomain',
|
||||
data : {id: id},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
if(data.code == 0){
|
||||
layer.msg('删除成功');
|
||||
window.location.reload()
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
|
||||
$act=isset($_GET['act'])?daddslashes($_GET['act']):null;
|
||||
|
||||
switch($act){
|
||||
|
||||
case 'wximg':
|
||||
if(!checkRefererHost())exit();
|
||||
$channelid = intval($_GET['channel']);
|
||||
$subchannelid = intval($_GET['subchannel']);
|
||||
$media_id = $_GET['mediaid'];
|
||||
$channel = $subchannelid ? \lib\Channel::getSub($subchannelid) : \lib\Channel::get($channelid);
|
||||
$model = \lib\Complain\CommUtil::getModel($channel);
|
||||
$image = $model->getImage($media_id);
|
||||
if($image !== false){
|
||||
$seconds_to_cache = 3600*24*7;
|
||||
header("Cache-Control: max-age=$seconds_to_cache");
|
||||
header("Content-Type: image/jpeg");
|
||||
echo $image;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
exit('No Act');
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,866 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='个人资料';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
$mod=isset($_GET['mod'])?$_GET['mod']:'api';
|
||||
|
||||
if(strlen($userrow['phone'])==11){
|
||||
$userrow['phone']=substr($userrow['phone'],0,3).'****'.substr($userrow['phone'],7,10);
|
||||
}
|
||||
|
||||
?>
|
||||
<input type="hidden" id="situation" value="">
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
<div class="modal inmodal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">验证密保信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php if($conf['verifytype']==1){?>
|
||||
<div class="list-group-item">密保手机:<?php echo $userrow['phone']?></div>
|
||||
<div class="list-group-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="code" placeholder="输入短信验证码" class="form-control" required>
|
||||
<a class="input-group-addon" id="sendcode">获取验证码</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<div class="list-group-item">密保邮箱:<?php echo $userrow['email']?></div>
|
||||
<div class="list-group-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="code" placeholder="输入验证码" class="form-control" required>
|
||||
<a class="input-group-addon" id="sendcode">获取验证码</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<button type="button" id="verifycode" class="btn btn-primary btn-block">确定</button>
|
||||
<div id="embed-captcha"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal inmodal fade" id="myModal2" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">修改密保信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php if($conf['verifytype']==1){?>
|
||||
<div class="list-group-item">
|
||||
<input type="text" name="phone_n" placeholder="输入新的手机号码" class="form-control" required>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="code_n" placeholder="输入短信验证码" class="form-control" required>
|
||||
<a class="input-group-addon" id="sendcode2">获取验证码</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<div class="list-group-item">
|
||||
<input type="email" name="email_n" placeholder="输入新的邮箱" class="form-control" required>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="code_n" placeholder="输入验证码" class="form-control" required>
|
||||
<a class="input-group-addon" id="sendcode2">获取验证码</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<button type="button" id="editBind" class="btn btn-primary btn-block">确定</button>
|
||||
<div id="embed-captcha"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal inmodal fade" id="myModal3" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">修改手机号码</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="list-group-item">
|
||||
<input type="text" name="phone_s" placeholder="输入新的手机号码" class="form-control" required>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="code_s" placeholder="输入短信验证码" class="form-control" required>
|
||||
<a class="input-group-addon" id="sendcode3">获取验证码</a>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" id="editBindPhone" class="btn btn-primary btn-block">确定</button>
|
||||
<div id="embed-captcha"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">个人资料</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="tab-container ng-isolate-scope">
|
||||
<ul class="nav nav-tabs">
|
||||
<li style="width: 25%;" align="center">
|
||||
<a href="userinfo.php?mod=api">API信息</a>
|
||||
</li>
|
||||
<li style="width: 25%;" align="center" class="active">
|
||||
<a href="editinfo.php">修改资料</a>
|
||||
</li>
|
||||
<li style="width: 25%;" align="center">
|
||||
<a href="userinfo.php?mod=account">修改密码</a>
|
||||
</li>
|
||||
<?php if($conf['cert_open']>0){?>
|
||||
<li style="width: 25%;" align="center">
|
||||
<a href="certificate.php">实名认证</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane ng-scope active">
|
||||
<form class="form-horizontal devform">
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>收款账号设置:</h4></div></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">结算方式</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="stype" default="<?php echo $userrow['settle_id']?>">
|
||||
<?php if($conf['settle_alipay']){?><option value="1" input="支付宝账号">支付宝结算</option>
|
||||
<?php }if($conf['settle_wxpay']){?><option value="2" input="<?php echo $conf['transfer_wxpay']?'微信OpenId':'微信号';?>">微信结算</option>
|
||||
<?php }if($conf['settle_qqpay']){?><option value="3" input="QQ号码">QQ钱包结算</option>
|
||||
<?php }if($conf['settle_bank']){?><option value="4" input="银行卡号">银行卡结算</option>
|
||||
<?php }?></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" id="typename">收款账号</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="account" value="<?php echo $userrow['account']?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php if($conf['transfer_wxpay']){?>
|
||||
<div class="form-group" style="display:none;" id="getopenid_form">
|
||||
<div class="col-sm-offset-2 col-sm-4">
|
||||
<a class="btn btn-sm btn-default" id="getopenid">点此获取微信OpenId</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">真实姓名</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="username" value="<?php echo $userrow['username']?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="editSettle" value="确定修改" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>联系方式设置:</h4></div></div>
|
||||
<?php if($conf['verifytype']==1){?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">手机号码</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" name="phone" value="<?php echo $userrow['phone']?>" disabled>
|
||||
<a class="input-group-addon" id="checkbind">修改绑定</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">邮箱</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="email" value="<?php echo $userrow['email']?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">邮箱</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" name="email" value="<?php echo $userrow['email']?>" disabled>
|
||||
<a class="input-group-addon" id="checkbind">修改绑定</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(!empty($conf['sms_appkey'])){?><div class="form-group">
|
||||
<label class="col-sm-2 control-label">手机号码</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" name="phone" value="<?php echo $userrow['phone']?>" disabled>
|
||||
<a class="input-group-addon" id="bindphone">修改绑定</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }}?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">QQ</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="qq" value="<?php echo $userrow['qq']?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">网站域名</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="url" value="<?php echo $userrow['url']?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">开启密钥登录</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="keylogin" default="<?php echo $userrow['keylogin']?>"><option value="0">关闭</option><option value="1">开启</option></select>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($conf['user_refund']==1){?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">订单退款API接口</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="refund" default="<?php echo $userrow['refund']?>"><option value="0">关闭</option><option value="1">开启</option></select>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
<?php if($conf['user_transfer']==1){?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">代付API接口</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="transfer" default="<?php echo $userrow['transfer']?>"><option value="0">关闭</option><option value="1">开启</option></select>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
<?php if($conf['settle_open']==1 || $conf['settle_open']==3){?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预留余额</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" name="remain_money" value="<?php echo $userrow['remain_money']?>" placeholder="可设置预留部分商户余额不参与每日自动结算"><span class="input-group-addon">元</span></div>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="editInfo" value="确定修改" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($conf['wxnotice']==1 || $conf['mailnotice']==1){
|
||||
$userrow['msgconfig'] = unserialize($userrow['msgconfig']);
|
||||
?>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>消息提醒接收设置:</h4><?php if(!$userrow['wx_uid']&&$conf['wxnotice']==1){?><font color="#ff7373">微信公众号消息需要先绑定微信才可以收到消息提醒</font><?php }?></div></div>
|
||||
<?php if($conf['wxnotice_tpl_order'] || $conf['msgconfig_order']){?><div class="form-group">
|
||||
<label class="col-sm-2 control-label">新订单通知</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="notice_order" default="<?php echo $userrow['msgconfig']['order']?>"><option value="0">关闭</option><?php if($conf['wxnotice_tpl_order']){?><option value="1">开启 - 微信公众号</option><?php } if($conf['msgconfig_order']){?><option value="2">开启 - 邮件</option><?php } if($conf['login_wework']){?><option value="4">开启 - 企业微信</option><?php }?></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">通知订单金额大于</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" name="notice_order_money" value="<?php echo $userrow['msgconfig']['order_money']?>"><span class="input-group-addon">元</span></div>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
<?php if($conf['wxnotice_tpl_settle'] || $conf['msgconfig_settle']){?><div class="form-group">
|
||||
<label class="col-sm-2 control-label">结算通知</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="notice_settle" default="<?php echo $userrow['msgconfig']['settle']?>"><option value="0">关闭</option><?php if($conf['wxnotice_tpl_settle']){?><option value="1">开启 - 微信公众号</option><?php } if($conf['msgconfig_settle']){?><option value="2">开启 - 邮件</option><?php } if($conf['login_wework']){?><option value="4">开启 - 企业微信</option><?php }?></select>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
<?php if($conf['wxnotice_tpl_login']){?><div class="form-group">
|
||||
<label class="col-sm-2 control-label">登录通知</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="notice_login" default="<?php echo $userrow['msgconfig']['login']?>"><option value="0">关闭</option><?php if($conf['wxnotice_tpl_login']){?><option value="1">开启 - 微信公众号</option><?php } if($conf['login_wework']){?><option value="4">开启 - 企业微信</option><?php }?></select>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
<?php if($conf['wxnotice_tpl_complain'] || $conf['msgconfig_complain'] || $conf['sms_tpl_complain']){?><div class="form-group">
|
||||
<label class="col-sm-2 control-label">交易投诉通知</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="notice_complain" default="<?php echo $userrow['msgconfig']['complain']?>"><option value="0">关闭</option><?php if($conf['wxnotice_tpl_complain']){?><option value="1">开启 - 微信公众号</option><?php } if($conf['msgconfig_complain']){?><option value="2">开启 - 邮件</option><?php } if($conf['sms_tpl_complain']){?><option value="3">开启 - 短信</option><?php } if($conf['login_wework']){?><option value="4">开启 - 企业微信</option><?php }?></select>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
<?php if($conf['msgconfig_mchrisk']){?><div class="form-group">
|
||||
<label class="col-sm-2 control-label">渠道商户违规通知</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="notice_mchrisk" default="<?php echo $userrow['msgconfig']['mchrisk']?>"><option value="0">关闭</option><option value="2">开启 - 邮件</option></select>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
<?php if($conf['wxnotice_tpl_balance'] || $conf['msgconfig_balance'] || $conf['sms_tpl_balance']){?><div class="form-group">
|
||||
<label class="col-sm-2 control-label">余额不足提醒</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="notice_balance" default="<?php echo $userrow['msgconfig']['balance']?>"><option value="0">关闭</option><?php if($conf['wxnotice_tpl_balance']){?><option value="1">开启 - 微信公众号</option><?php } if($conf['msgconfig_balance']){?><option value="2">开启 - 邮件</option><?php } if($conf['sms_tpl_balance']){?><option value="3">开启 - 短信</option><?php } if($conf['login_wework']){?><option value="4">开启 - 企业微信</option><?php }?></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">余额小于多少时</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" name="notice_balance_money" value="<?php echo $userrow['msgconfig']['balance_money']?>" placeholder="如开启余额提醒则必填"><span class="input-group-addon">元</span></div>
|
||||
</div>
|
||||
</div><?php }?>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="editMsgConfig" value="确定修改" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php
|
||||
if($conf['user_settings_edit']){
|
||||
$group_settings=$DB->getColumn("SELECT settings FROM pre_group WHERE gid='{$userrow['gid']}' LIMIT 1");
|
||||
if(!$group_settings)$group_settings=$DB->getColumn("SELECT settings FROM pre_group WHERE gid=0 LIMIT 1");
|
||||
$channelinfo = json_decode($userrow['channelinfo'], true);
|
||||
if($group_settings){
|
||||
?>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>自定义接口信息设置:</h4></div></div>
|
||||
|
||||
<?php foreach(explode(',',$group_settings) as $row){
|
||||
$arr = explode(':', $row);
|
||||
echo '<div class="form-group">
|
||||
<label class="col-sm-2 control-label">'.$arr[1].'</label>
|
||||
<div class="col-sm-9"><input type="text" class="form-control" name="setting['.$arr[0].']" value="'.$channelinfo[$arr[0]].'" required></div>
|
||||
</div>';
|
||||
}?>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="editChannelInfo" value="确定修改" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
<?php }}?>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>支付手续费扣除模式选择:</h4></div></div>
|
||||
<div class="form-group has-success">
|
||||
<div class="col-sm-offset-2 col-sm-9">
|
||||
<div class="alert alert-success">
|
||||
1、余额扣费 (经典模式,默认):例如费率1%,客户购买100元商品,客户需支付100元,卖家到账99元,手续费1元由卖家支付<br> 2、订单加费 (奸商模式):例如费率1%,客户购买100元商品,客户需支付101元,卖家到账100元,手续费1元由买家支付
|
||||
</div>
|
||||
<select class="form-control" name="mode" default="<?php echo $userrow['mode']?>">
|
||||
<option value="0">余额扣费</option>
|
||||
<option value="1">订单加费</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="editMode" value="确定修改" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>第三方账号绑定:</h4></div></div>
|
||||
<?php if($conf['login_qq']>0){?>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-6"><span class="pull-right" style="margin-top:5px"><img src="assets/img/qqpay.png" style="margin-top: -6px;margin-bottom: -2px; height:30px"> QQ快捷登录 </span></div>
|
||||
<div class="col-xs-6">
|
||||
<?php if($userrow['qq_uid']){?>
|
||||
<a class="btn btn-sm btn-success" disabled title="<?php echo $userrow['qq_uid']?>">已绑定</a> <a class="btn btn-sm btn-danger" href="./connect.php?unbind=1" onclick="return confirm('解绑后将无法通过QQ一键登录,是否确定解绑?');">解绑</a>
|
||||
<?php }else{?>
|
||||
<a class="btn btn-sm btn-success" href="javascript:connect('qq')">立即绑定</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php if($conf['login_wx']!=0){?>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-6"><span class="pull-right" style="margin-top:5px"><img src="assets/img/wxpay.png" style="margin-top: -6px;margin-bottom: -2px; height:30px"> 微信快捷登录 </span></div>
|
||||
<div class="col-xs-6">
|
||||
<?php if($userrow['wx_uid']){?>
|
||||
<a class="btn btn-sm btn-success" disabled title="<?php echo $userrow['wx_uid']?>">已绑定</a> <a class="btn btn-sm btn-danger" href="./wxlogin.php?unbind=1" onclick="return confirm('解绑后将无法通过微信一键登录,是否确定解绑?');">解绑</a>
|
||||
<?php }else{?>
|
||||
<a class="btn btn-sm btn-success" href="javascript:connect('wx')">立即绑定</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php if($conf['login_alipay']!=0){?>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-6"><span class="pull-right" style="margin-top:5px"><img src="assets/img/alipay.png" style="margin-top: -6px;margin-bottom: -2px; height:30px"> 支付宝快捷登录</span></div>
|
||||
<div class="col-xs-6">
|
||||
<?php if($userrow['alipay_uid']){?>
|
||||
<a class="btn btn-sm btn-success" disabled title="<?php echo $userrow['alipay_uid']?>">已绑定</a> <a class="btn btn-sm btn-danger" href="./oauth.php?unbind=1" onclick="return confirm('解绑后将无法通过支付宝一键登录,是否确定解绑?');">解绑</a>
|
||||
<?php }else{?>
|
||||
<a class="btn btn-sm btn-success" href="javascript:connect('alipay')">立即绑定</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script src="//static.geetest.com/static/tools/gt.js"></script>
|
||||
<script>
|
||||
window.appendChildOrg = Element.prototype.appendChild;
|
||||
Element.prototype.appendChild = function() {
|
||||
if(arguments[0].tagName == 'SCRIPT'){
|
||||
arguments[0].setAttribute('referrerpolicy', 'no-referrer');
|
||||
}
|
||||
return window.appendChildOrg.apply(this, arguments);
|
||||
};
|
||||
</script>
|
||||
<script src="//static.geetest.com/v4/gt4.js"></script>
|
||||
<script>
|
||||
function invokeSettime(obj){
|
||||
var countdown=60;
|
||||
settime(obj);
|
||||
function settime(obj) {
|
||||
if (countdown == 0) {
|
||||
$(obj).attr("data-lock", "false");
|
||||
$(obj).attr("disabled",false);
|
||||
$(obj).text("获取验证码");
|
||||
countdown = 60;
|
||||
return;
|
||||
} else {
|
||||
$(obj).attr("data-lock", "true");
|
||||
$(obj).attr("disabled",true);
|
||||
$(obj).text("(" + countdown + ") s 重新发送");
|
||||
countdown--;
|
||||
}
|
||||
setTimeout(function() {
|
||||
settime(obj) }
|
||||
,1000)
|
||||
}
|
||||
}
|
||||
var handlerEmbed = function (captchaObj) {
|
||||
var target;
|
||||
captchaObj.onReady(function () {
|
||||
$("#wait").hide();
|
||||
}).onSuccess(function () {
|
||||
var result = captchaObj.getValidate();
|
||||
if (!result) {
|
||||
return alert('请完成验证');
|
||||
}
|
||||
var situation=$("#situation").val();
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=sendcode",
|
||||
data : {situation:situation,target:target, ...result},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
new invokeSettime("#sendcode");
|
||||
new invokeSettime("#sendcode2");
|
||||
new invokeSettime("#sendcode3");
|
||||
layer.msg('发送成功,请注意查收!');
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
captchaObj.reset();
|
||||
}
|
||||
}
|
||||
});
|
||||
}).onError(function(){
|
||||
layer.msg('验证码加载失败,请刷新页面重试', {icon: 5});
|
||||
});
|
||||
$('#sendcode').click(function () {
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
if(typeof captchaObj.showCaptcha === 'function'){
|
||||
captchaObj.showCaptcha();
|
||||
}else{
|
||||
captchaObj.verify();
|
||||
}
|
||||
});
|
||||
$('#sendcode2').click(function () {
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
if($("input[name='phone_n']").length>0){
|
||||
target=$("input[name='phone_n']").val();
|
||||
if(target==''){layer.alert('手机号码不能为空!');return false;}
|
||||
if(target.length!=11){layer.alert('手机号码不正确!');return false;}
|
||||
}else{
|
||||
target=$("input[name='email_n']").val();
|
||||
if(target==''){layer.alert('邮箱不能为空!');return false;}
|
||||
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
|
||||
if(!reg.test(target)){layer.alert('邮箱格式不正确!');return false;}
|
||||
}
|
||||
if(typeof captchaObj.showCaptcha === 'function'){
|
||||
captchaObj.showCaptcha();
|
||||
}else{
|
||||
captchaObj.verify();
|
||||
}
|
||||
});
|
||||
$('#sendcode3').click(function () {
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
target=$("input[name='phone_s']").val();
|
||||
if(target==''){layer.alert('手机号码不能为空!');return false;}
|
||||
if(target.length!=11){layer.alert('手机号码不正确!');return false;}
|
||||
if(typeof captchaObj.showCaptcha === 'function'){
|
||||
captchaObj.showCaptcha();
|
||||
}else{
|
||||
captchaObj.verify();
|
||||
}
|
||||
})
|
||||
};
|
||||
$(document).ready(function(){
|
||||
var items = $("select[default]");
|
||||
for (i = 0; i < items.length; i++) {
|
||||
$(items[i]).val($(items[i]).attr("default")||0);
|
||||
}
|
||||
$("select[name='stype']").change(function(){
|
||||
var input = $("select[name='stype'] option:selected").attr("input");
|
||||
$("#typename").html(input);
|
||||
if($(this).val() == 2){
|
||||
$("#getopenid_form").show();
|
||||
}else{
|
||||
$("#getopenid_form").hide();
|
||||
}
|
||||
});
|
||||
$("select[name='stype']").change();
|
||||
$("#editSettle").click(function(){
|
||||
var stype=$("select[name='stype']").val();
|
||||
var account=$("input[name='account']").val();
|
||||
var username=$("input[name='username']").val();
|
||||
if(account=='' || username==''){layer.alert('请确保各项不能为空!');return false;}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_settle",
|
||||
data : {stype:stype,account:account,username:username},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('修改成功!', {icon:1});
|
||||
}else if(data.code == 2){
|
||||
$("#situation").val("settle");
|
||||
$('#myModal').modal('show');
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#editInfo").click(function(){
|
||||
var email=$("input[name='email']").val();
|
||||
var qq=$("input[name='qq']").val();
|
||||
var url=$("input[name='url']").val();
|
||||
var keylogin=$("select[name='keylogin']").val();
|
||||
var refund=$("select[name='refund']").val();
|
||||
var transfer=$("select[name='transfer']").val();
|
||||
var remain_money=$("input[name='remain_money']").val();
|
||||
if(email=='' || qq=='' || url==''){layer.alert('请确保各项不能为空!');return false;}
|
||||
if(email.length>0){
|
||||
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
|
||||
if(!reg.test(email)){layer.alert('邮箱格式不正确!');return false;}
|
||||
}
|
||||
if (url.indexOf(" ")>=0){
|
||||
url = url.replace(/ /g,"");
|
||||
}
|
||||
if (url.toLowerCase().indexOf("http://")==0){
|
||||
url = url.slice(7);
|
||||
}
|
||||
if (url.toLowerCase().indexOf("https://")==0){
|
||||
url = url.slice(8);
|
||||
}
|
||||
if (url.slice(url.length-1)=="/"){
|
||||
url = url.slice(0,url.length-1);
|
||||
}
|
||||
$("input[name='url']").val(url);
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_info",
|
||||
data : {email:email,qq:qq,url:url,keylogin:keylogin,refund:refund,transfer:transfer,remain_money:remain_money},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('修改成功!', {icon:1});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#editChannelInfo").click(function(){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
var setting = {};
|
||||
$("input[name^='setting']").each(function(i, el) {
|
||||
setting[el.name] =$(this).val();
|
||||
});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_channel_info",
|
||||
data : setting,
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('修改成功!', {icon:1});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#editMode").click(function(){
|
||||
var mode=$("select[name='mode']").val();
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_mode",
|
||||
data : {mode:mode},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('修改成功!', {icon:1});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#editMsgConfig").click(function(){
|
||||
var notice_order=$("select[name='notice_order']").val();
|
||||
var notice_settle=$("select[name='notice_settle']").val();
|
||||
var notice_login=$("select[name='notice_login']").val();
|
||||
var notice_complain=$("select[name='notice_complain']").val();
|
||||
var notice_mchrisk=$("select[name='notice_mchrisk']").val();
|
||||
var notice_order_money=$("input[name='notice_order_money']").val();
|
||||
var notice_balance=$("select[name='notice_balance']").val();
|
||||
var notice_balance_money=$("input[name='notice_balance_money']").val();
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_msgconfig",
|
||||
data : {notice_order:notice_order, notice_settle:notice_settle, notice_login:notice_login, notice_complain:notice_complain, notice_mchrisk:notice_mchrisk, notice_order_money:notice_order_money, notice_balance:notice_balance, notice_balance_money:notice_balance_money},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('修改成功!', {icon:1});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#checkbind").click(function(){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "GET",
|
||||
url : "ajax2.php?act=checkbind",
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
$("#situation").val("bind");
|
||||
$('#myModal2').modal('show');
|
||||
}else if(data.code == 2){
|
||||
$("#situation").val("mibao");
|
||||
$('#myModal').modal('show');
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#editBind").click(function(){
|
||||
var phone=$("input[name='phone_n']").val();
|
||||
var email=$("input[name='email_n']").val();
|
||||
var code=$("input[name='code_n']").val();
|
||||
if(code==''){layer.alert('请输入验证码!');return false;}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_bind",
|
||||
data : {phone:phone,email:email,code:code},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('修改绑定成功!', {icon:1}, function(){window.location.reload()});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#editBindPhone").click(function(){
|
||||
var phone=$("input[name='phone_s']").val();
|
||||
var code=$("input[name='code_s']").val();
|
||||
if(code==''){layer.alert('请输入验证码!');return false;}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_bind",
|
||||
data : {phone:phone,code:code},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('修改绑定成功!', {icon:1}, function(){window.location.reload()});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#verifycode").click(function(){
|
||||
var code=$("input[name='code']").val();
|
||||
var situation=$("#situation").val();
|
||||
if(code==''){layer.alert('请输入验证码!');return false;}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=verifycode",
|
||||
data : {code:code},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.msg('验证成功!', {icon:1});
|
||||
$('#myModal').modal('hide');
|
||||
if(situation=='settle'){
|
||||
$("#editSettle").click();
|
||||
}else if(situation=='mibao'){
|
||||
$("#situation").val("bind");
|
||||
$('#myModal2').modal('show');
|
||||
}else if(situation=='bind'){
|
||||
$('#myModal2').modal('hide');
|
||||
window.location.reload();
|
||||
}
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#bindphone").click(function(){
|
||||
$("#situation").val("bindphone");
|
||||
$('#myModal3').modal('show');
|
||||
});
|
||||
$('#getopenid').click(function () {
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
$(this).attr("data-lock", "true");
|
||||
$.ajax({
|
||||
type : "GET",
|
||||
url : "ajax.php?act=qrcode",
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
$('#getopenid').attr("data-lock", "false");
|
||||
if(data.code == 0){
|
||||
$.openidform = layer.open({
|
||||
type: 1,
|
||||
title: '请使用微信扫描以下二维码',
|
||||
skin: 'layui-layer-demo',
|
||||
anim: 2,
|
||||
shadeClose: true,
|
||||
content: '<div id="qrcode" class="list-group-item text-center"></div>',
|
||||
success: function(){
|
||||
$('#qrcode').qrcode({
|
||||
text: data.url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
$.ostart = true;
|
||||
setTimeout('checkopenid()', 2000);
|
||||
},
|
||||
end: function(){
|
||||
$.ostart = false;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 0});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
$.ajax({
|
||||
url: "ajax.php?act=captcha",
|
||||
type: "get",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if(data.version == 1){
|
||||
initGeetest4({
|
||||
captchaId: data.gt,
|
||||
product: 'bind',
|
||||
protocol: 'https://',
|
||||
riskType: 'slide',
|
||||
hideSuccess: true,
|
||||
}, handlerEmbed);
|
||||
}else{
|
||||
initGeetest({
|
||||
width: '100%',
|
||||
gt: data.gt,
|
||||
challenge: data.challenge,
|
||||
new_captcha: data.new_captcha,
|
||||
product: "bind",
|
||||
offline: !data.success
|
||||
}, handlerEmbed);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
function checkopenid(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "ajax.php?act=getopenid",
|
||||
success: function (data, textStatus) {
|
||||
if (data.code == 0) {
|
||||
layer.msg('Openid获取成功');
|
||||
layer.close($.openidform);
|
||||
$("input[name='account']").val(data.openid);
|
||||
}else if($.ostart==true){
|
||||
setTimeout('checkopenid()', 2000);
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
function connect(type){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax.php?act=connect",
|
||||
data : {type:type, bind:'1'},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
window.location.href = data.url;
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 7});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
|
||||
include("../includes/common.php");
|
||||
|
||||
//if($conf['reg_open']==0)sysmsg('未开放商户申请');
|
||||
|
||||
$csrf_token = md5(mt_rand(0,999).time());
|
||||
$_SESSION['csrf_token'] = $csrf_token;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>找回密码 | <?php echo $conf['sitename']?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>animate.css/3.5.2/animate.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>simple-line-icons/2.4.1/css/simple-line-icons.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/font.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/app.css" type="text/css" />
|
||||
<style>input:-webkit-autofill{-webkit-box-shadow:0 0 0px 1000px white inset;-webkit-text-fill-color:#333;}img.logo{width:14px;height:14px;margin:0 5px 0 3px;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app app-header-fixed ">
|
||||
<div class="container w-xxl w-auto-xs" ng-controller="SigninFormController" ng-init="app.settings.container = false;">
|
||||
<span class="navbar-brand block m-t" id="sitename"><?php echo $conf['sitename']?></span>
|
||||
<div class="m-b-lg">
|
||||
<div class="wrapper text-center">
|
||||
<strong>找回密码</strong>
|
||||
</div>
|
||||
<form name="form" class="form-validation">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<div class="text-danger wrapper text-center" ng-show="authError">
|
||||
</div>
|
||||
<div class="list-group list-group-sm swaplogin">
|
||||
<div class="list-group-item">
|
||||
<select class="form-control" name="type">
|
||||
<option value="email">使用邮箱找回</option><option value="phone">使用手机找回</option></select>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<input type="text" name="account" placeholder="邮箱/手机号" class="form-control no-border" required>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="code" placeholder="输入验证码" class="form-control no-border" required>
|
||||
<a class="input-group-addon" id="sendcode">获取验证码</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<input type="password" name="pwd" placeholder="请输入新密码" class="form-control no-border" required>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<input type="password" name="pwd2" placeholder="请重新输入密码" class="form-control no-border" required>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" id="submit" class="btn btn-lg btn-primary btn-block" ng-click="login()" ng-disabled='form.$invalid'>确认提交</button>
|
||||
<a href="login.php" ui-sref="access.signup" class="btn btn-lg btn-default btn-block">返回登录</a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<p>
|
||||
<small class="text-muted"><a href="/"><?php echo $conf['sitename']?></a><br>© 2016~<?php echo date("Y")?></small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script src="//static.geetest.com/static/tools/gt.js"></script>
|
||||
<script>
|
||||
window.appendChildOrg = Element.prototype.appendChild;
|
||||
Element.prototype.appendChild = function() {
|
||||
if(arguments[0].tagName == 'SCRIPT'){
|
||||
arguments[0].setAttribute('referrerpolicy', 'no-referrer');
|
||||
}
|
||||
return window.appendChildOrg.apply(this, arguments);
|
||||
};
|
||||
</script>
|
||||
<script src="//static.geetest.com/v4/gt4.js"></script>
|
||||
<script>
|
||||
function invokeSettime(obj){
|
||||
var countdown=60;
|
||||
settime(obj);
|
||||
function settime(obj) {
|
||||
if (countdown == 0) {
|
||||
$(obj).attr("data-lock", "false");
|
||||
$(obj).text("获取验证码");
|
||||
countdown = 60;
|
||||
return;
|
||||
} else {
|
||||
$(obj).attr("data-lock", "true");
|
||||
$(obj).attr("disabled",true);
|
||||
$(obj).text("(" + countdown + ") s 重新发送");
|
||||
countdown--;
|
||||
}
|
||||
setTimeout(function() {
|
||||
settime(obj) }
|
||||
,1000)
|
||||
}
|
||||
}
|
||||
var handlerEmbed = function (captchaObj) {
|
||||
var sendto,type;
|
||||
captchaObj.onReady(function () {
|
||||
$("#wait").hide();
|
||||
}).onSuccess(function () {
|
||||
var result = captchaObj.getValidate();
|
||||
if (!result) {
|
||||
return alert('请完成验证');
|
||||
}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax.php?act=sendcode2",
|
||||
data : {type:type,sendto:sendto,...result},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
new invokeSettime("#sendcode");
|
||||
layer.msg('发送成功,请注意查收!');
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
captchaObj.reset();
|
||||
}
|
||||
}
|
||||
});
|
||||
}).onError(function(){
|
||||
layer.msg('验证码加载失败,请刷新页面重试', {icon: 5});
|
||||
});
|
||||
$('#sendcode').click(function () {
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
type = $("select[name='type']").val();
|
||||
sendto=$("input[name='account']").val();
|
||||
if(type=='phone'){
|
||||
if(sendto==''){layer.alert('手机号码不能为空!');return false;}
|
||||
if(sendto.length!=11){layer.alert('手机号码不正确!');return false;}
|
||||
}else{
|
||||
if(sendto==''){layer.alert('邮箱不能为空!');return false;}
|
||||
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
|
||||
if(!reg.test(sendto)){layer.alert('邮箱格式不正确!');return false;}
|
||||
}
|
||||
if(typeof captchaObj.showCaptcha === 'function'){
|
||||
captchaObj.showCaptcha();
|
||||
}else{
|
||||
captchaObj.verify();
|
||||
}
|
||||
});
|
||||
};
|
||||
$(document).ready(function(){
|
||||
$("select[name='type']").change(function(){
|
||||
if($(this).val() == 'email'){
|
||||
$("input[name='account']").attr('placeholder','邮箱');
|
||||
}else{
|
||||
$("input[name='account']").attr('placeholder','手机号码');
|
||||
}
|
||||
});
|
||||
$("select[name='type']").change();
|
||||
$("#submit").click(function(){
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
var type=$("select[name='type']").val();
|
||||
var account=$("input[name='account']").val();
|
||||
var code=$("input[name='code']").val();
|
||||
var pwd=$("input[name='pwd']").val();
|
||||
var pwd2=$("input[name='pwd2']").val();
|
||||
if(account=='' || code=='' || pwd=='' || pwd2==''){layer.alert('请确保各项不能为空!');return false;}
|
||||
if(pwd!=pwd2){layer.alert('两次输入密码不一致!');return false;}
|
||||
if(type=='phone'){
|
||||
if(account.length!=11){layer.alert('手机号码不正确!');return false;}
|
||||
}else{
|
||||
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
|
||||
if(!reg.test(account)){layer.alert('邮箱格式不正确!');return false;}
|
||||
}
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$(this).attr("data-lock", "true");
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax.php?act=findpwd",
|
||||
data : {type:type,account:account,code:code,pwd:pwd,csrf_token:csrf_token},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
$("#submit").attr("data-lock", "false");
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert(data.msg, {icon: 1}, function(){window.location.href="login.php"});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$.ajax({
|
||||
url: "ajax.php?act=captcha",
|
||||
type: "get",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if(data.version == 1){
|
||||
initGeetest4({
|
||||
captchaId: data.gt,
|
||||
product: 'bind',
|
||||
protocol: 'https://',
|
||||
riskType: 'slide',
|
||||
hideSuccess: true,
|
||||
}, handlerEmbed);
|
||||
}else{
|
||||
initGeetest({
|
||||
width: '100%',
|
||||
gt: data.gt,
|
||||
challenge: data.challenge,
|
||||
new_captcha: data.new_captcha,
|
||||
product: "bind",
|
||||
offline: !data.success
|
||||
}, handlerEmbed);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!-- / content -->
|
||||
|
||||
<!-- footer -->
|
||||
<footer id="footer" class="app-footer" role="footer">
|
||||
<div class="wrapper b-t bg-light">
|
||||
<span class="pull-right">Powered by <a href="/" target="_blank"><?php echo $conf['sitename']?></a></span>
|
||||
© 2016-<?php echo date("Y")?> Copyright.
|
||||
</div>
|
||||
</footer>
|
||||
<!-- / footer -->
|
||||
|
||||
</div>
|
||||
|
||||
<script src="<?php echo $cdnpublic?>jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||
<script src="./assets/js/ui-load.js"></script>
|
||||
<script src="./assets/js/ui-jp.config.js"></script>
|
||||
<script src="./assets/js/ui-jp.js"></script>
|
||||
<script src="./assets/js/ui-nav.js"></script>
|
||||
<script src="./assets/js/ui-toggle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,277 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='购买会员';
|
||||
include './head.php';
|
||||
?>
|
||||
<style>
|
||||
.table>tbody>tr>td{vertical-align: middle;}
|
||||
</style>
|
||||
<?php
|
||||
|
||||
if($conf['group_buy']==0)exit('未开启购买会员');
|
||||
|
||||
$paytype = [];
|
||||
$paytypes = [];
|
||||
$rs = $DB->getAll("SELECT * FROM pre_type ORDER BY id ASC");
|
||||
foreach($rs as $row){
|
||||
$paytype[$row['id']] = $row['showname'];
|
||||
$paytypes[$row['id']] = $row['name'];
|
||||
}
|
||||
unset($rs);
|
||||
|
||||
function display_info($info){
|
||||
global $paytype,$paytypes;
|
||||
$result = '';
|
||||
$arr = json_decode($info, true);
|
||||
foreach($arr as $k=>$v){
|
||||
if($v['channel']==0)continue;
|
||||
$result .= '<label><img src="/assets/icon/'.$paytypes[$k].'.ico" width="18px" title="'.$v['channel'].'"> '.$paytype[$k].'('.round(100-$v['rate'],2).'%)</label> ';
|
||||
}
|
||||
return substr($result,0,-1);
|
||||
}
|
||||
|
||||
$urow = $DB->getRow("SELECT uid,gid FROM pre_user WHERE uid='{$conf['reg_pay_uid']}' limit 1");
|
||||
if(!$urow)exit('购买会员收款商户不存在');
|
||||
$paytypem = \lib\Channel::getTypes($urow['uid'], $urow['gid']);
|
||||
|
||||
$list = $DB->getAll("SELECT * FROM pre_group WHERE isbuy=1 ORDER BY SORT ASC");
|
||||
$group=[];
|
||||
foreach($list as $row){
|
||||
$group[$row['gid']] = $row['name'];
|
||||
}
|
||||
$csrf_token = md5(mt_rand(0,999).time());
|
||||
$_SESSION['csrf_token'] = $csrf_token;
|
||||
|
||||
$mygroup = $DB->getRow("SELECT * FROM pre_group WHERE gid='{$userrow['gid']}'");
|
||||
$mygroupname = $mygroup['name'] ? $mygroup['name'] : '默认用户组';
|
||||
$gexpire = $userrow['endtime'] ? date("Y-m-d", strtotime($userrow['endtime'])) : '永久';
|
||||
if($userrow['endtime'] && $mygroup['isbuy']==1) $gexpire.=' [<a href="javascript:buy('.$userrow['gid'].',1)">续期</a>]';
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">购买会员</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="row" id="listFrame">
|
||||
<div class="col-xs-12">
|
||||
|
||||
<?php if(isset($_GET['ok']) && $_GET['ok']==1){
|
||||
$order_param = $DB->getColumn("SELECT `param` FROM pre_order WHERE trade_no=:trade_no limit 1", [':trade_no'=>$_GET['trade_no']]);
|
||||
if($order_param){
|
||||
$order_param = json_decode($order_param, true);
|
||||
$groupname = $DB->getColumn("SELECT name FROM pre_group WHERE gid=:gid", [':gid'=>$order_param['gid']]);
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
会员等级 <b><?php echo $groupname?></b> 购买成功!
|
||||
</div>
|
||||
<?php }}?>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-shopping-cart"></i> 购买会员
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="list-group-item">
|
||||
<b>当前会员等级:<font color="#f35a1f"><?php echo $mygroupname?></b></font>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<b>到期时间:</b><font color="green"><?php echo $gexpire?></font>
|
||||
</div>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<table class="table table-striped table-hover">
|
||||
<thead><tr><th>会员等级</th><th>可用支付通道及费率</th><th>售价</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($list as $res){
|
||||
if(!isNullOrEmpty($res['visible'])){
|
||||
$visible = explode(',',$res['visible']);
|
||||
if(!in_array($userrow['gid'], $visible))continue;
|
||||
}
|
||||
echo '<tr><td><b>'.$res['name'].'</b></td><td>'.display_info($res['info']).'</td><td><span style="font-size:20px;font-weight:700;color:#f40;">'.$res['price'].'</span> / '.($res['expire']==0?'永久':$res['expire'].'个月').'</td><td>'.($userrow['gid']==$res['gid']?'<a class="btn btn-sm btn-info" href="javascript:;" disabled>当前等级</a>':'<a class="btn btn-sm btn-info" href="javascript:buy('.$res['gid'].')">立即购买</a>').'</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="infoFrame" style="display:none;">
|
||||
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 center-block" style="float: none;">
|
||||
<button class="btn btn-default btn-block" onclick="back()"><i class="fa fa-reply"></i> 返回列表</button>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-shopping-cart"></i> <span id="buy_title">购买会员</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<input type="hidden" name="group_id" value="">
|
||||
<input type="hidden" name="group_expire" value="">
|
||||
<input type="hidden" name="group_price" value="">
|
||||
<input id="num" name="num" type="hidden" value="1"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">会员等级</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="group_name" value="" readonly="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">有效期</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group" id="num_form1" style="display:none;">
|
||||
<span class="input-group-btn"><input id="num_min" type="button" class="btn btn-info" style="border-radius: 0px;" value="━"></span>
|
||||
<input class="form-control" type="text" name="group_expire_show" value="" readonly="">
|
||||
<span class="input-group-btn"><input id="num_add" type="button" class="btn btn-info" style="border-radius: 0px;" value="✚"></span>
|
||||
</div>
|
||||
<input class="form-control" id="num_form2" type="text" value="永久" readonly="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">售价</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="group_price_show" value="" readonly="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付方式</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio">
|
||||
<label class="i-checks"><input type="radio" name="type" value="0"><i></i>余额支付</label>
|
||||
<?php foreach($paytypem as $row){?>
|
||||
<label class="i-checks"><input type="radio" name="type" value="<?php echo $row['id']?>" rate="<?php echo $row['rate']?>"><i></i><?php echo $row['showname']?>
|
||||
</label>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-8"><input type="button" id="submit" value="立即购买" class="btn btn-success form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script>
|
||||
function buy(gid, type){
|
||||
var ii = layer.load();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {gid:gid},
|
||||
url: "ajax2.php?act=groupinfo",
|
||||
success: function (data, textStatus) {
|
||||
layer.close(ii);
|
||||
if (data.code == 0) {
|
||||
$("#buy_title").text(type==1?'续期会员':'购买会员');
|
||||
$("input[name='group_id']").val(gid);
|
||||
$("input[name='group_name']").val(data.name);
|
||||
$("input[name='group_expire']").val(data.expire);
|
||||
$("input[name='group_expire_show']").val(data.expire==0?'永久':data.expire+'个月');
|
||||
$("input[name='group_price']").val(data.price);
|
||||
$("input[name='group_price_show']").val(data.price+'元');
|
||||
$("input[name='num']").val(1);
|
||||
if(data.expire==0){
|
||||
$("#num_form1").hide();
|
||||
$("#num_form2").show();
|
||||
}else{
|
||||
$("#num_form1").show();
|
||||
$("#num_form2").hide();
|
||||
}
|
||||
$("#listFrame").slideUp();
|
||||
$("#infoFrame").slideDown();
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 0});
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
}
|
||||
});
|
||||
}
|
||||
function back(){
|
||||
$("#listFrame").slideDown();
|
||||
$("#infoFrame").slideUp();
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$("input[name=type]:first").attr("checked",true);
|
||||
$("#submit").click(function(){
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
var gid=$("input[name='group_id']").val();
|
||||
var typeid=$("input[name=type]:checked").val();
|
||||
var num=$("input[name='num']").val();
|
||||
var ii = layer.load();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {gid:gid, num:num, typeid:typeid, csrf_token:csrf_token},
|
||||
url: "ajax2.php?act=groupbuy",
|
||||
success: function (data, textStatus) {
|
||||
layer.close(ii);
|
||||
if (data.code == 0) {
|
||||
window.location.href=data.url;
|
||||
}else if (data.code == 1) {
|
||||
layer.alert(data.msg, {icon: 1}, function(){ window.location.reload() });
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
$("#num_add").click(function () {
|
||||
var i = parseInt($("#num").val());
|
||||
i++;
|
||||
$("#num").val(i);
|
||||
var price = parseFloat($("input[name='group_price']").val());
|
||||
var count = parseInt($("input[name='group_expire']").val());
|
||||
if(count==0){
|
||||
layer.alert('不支持选择数量');
|
||||
return false;
|
||||
}
|
||||
price = price * i;
|
||||
count = count * i;
|
||||
$("input[name='group_expire_show']").val(count+'个月');
|
||||
$("input[name='group_price_show']").val(price.toFixed(2)+'元');
|
||||
});
|
||||
$("#num_min").click(function (){
|
||||
var i = parseInt($("#num").val());
|
||||
if(i<=1){
|
||||
return false;
|
||||
}
|
||||
var price = parseFloat($("input[name='group_price']").val());
|
||||
var count = parseInt($("input[name='group_expire']").val());
|
||||
if(count==0){
|
||||
layer.alert('不支持选择数量');
|
||||
return false;
|
||||
}
|
||||
i--;
|
||||
if (i <= 0) i = 1;
|
||||
$("#num").val(i);
|
||||
price = price * i;
|
||||
count = count * i;
|
||||
$("input[name='group_expire_show']").val(count+'个月');
|
||||
$("input[name='group_price_show']").val(price.toFixed(2)+'元');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,307 @@
|
||||
<?php
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
if($userrow['status']==0){
|
||||
sysmsg('你的商户由于违反相关法律法规与《<a href="/?mod=agreement">'.$conf['sitename'].'用户协议</a>》,已被禁用!');
|
||||
}
|
||||
switch($conf['user_style']){
|
||||
case 1: $style=['bg-black','bg-black','bg-white']; break;
|
||||
case 2: $style=['bg-dark','bg-white','bg-dark']; break;
|
||||
case 3: $style=['bg-dark','bg-dark','bg-light']; break;
|
||||
case 4: $style=['bg-info','bg-info','bg-black']; break;
|
||||
case 5: $style=['bg-info','bg-info','bg-white']; break;
|
||||
case 6: $style=['bg-primary','bg-primary','bg-dark']; break;
|
||||
case 7: $style=['bg-primary','bg-primary','bg-white']; break;
|
||||
default: $style=['bg-black','bg-white','bg-black']; break;
|
||||
}
|
||||
$groupconfig = getGroupConfig($userrow['gid']);
|
||||
$conf = array_merge($conf, $groupconfig);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $title?> | <?php echo $conf['sitename']?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>twitter-bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>animate.css/3.5.2/animate.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>simple-line-icons/2.4.1/css/simple-line-icons.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/font.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/app.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../assets/css/bootstrap-table.css?v=1"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app app-header-fixed ">
|
||||
<!-- header -->
|
||||
<header id="header" class="app-header navbar" role="menu">
|
||||
<!-- navbar header -->
|
||||
<div class="navbar-header <?php echo $style[0]?>">
|
||||
<button class="pull-right visible-xs dk" ui-toggle="show" target=".navbar-collapse">
|
||||
<i class="glyphicon glyphicon-cog"></i>
|
||||
</button>
|
||||
<button class="pull-right visible-xs" ui-toggle="off-screen" target=".app-aside" ui-scroll="app">
|
||||
<i class="glyphicon glyphicon-align-justify"></i>
|
||||
</button>
|
||||
<!-- brand -->
|
||||
<a href="./" class="navbar-brand text-lt">
|
||||
<i class="fa fa-btc"></i>
|
||||
<span class="hidden-folded m-l-xs"><?php echo $conf['sitename']?></span>
|
||||
</a>
|
||||
<!-- / brand -->
|
||||
</div>
|
||||
<!-- / navbar header -->
|
||||
|
||||
<!-- navbar collapse -->
|
||||
<div class="collapse pos-rlt navbar-collapse box-shadow <?php echo $style[1]?>">
|
||||
<!-- buttons -->
|
||||
<div class="nav navbar-nav hidden-xs">
|
||||
<a href="#" class="btn no-shadow navbar-btn" ui-toggle="app-aside-folded" target=".app">
|
||||
<i class="fa fa-dedent fa-fw text"></i>
|
||||
<i class="fa fa-indent fa-fw text-active"></i>
|
||||
</a>
|
||||
</div>
|
||||
<!-- / buttons -->
|
||||
|
||||
<!-- nabar right -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle clear" data-toggle="dropdown">
|
||||
<span class="thumb-sm avatar pull-right m-t-n-sm m-b-n-sm m-l-sm">
|
||||
<img src="<?php echo ($userrow['qq'])?'//q2.qlogo.cn/headimg_dl?bs=qq&dst_uin='.$userrow['qq'].'&src_uin='.$userrow['qq'].'&fid='.$userrow['qq'].'&spec=100&url_enc=0&referer=bu_interface&term_type=PC':'assets/img/user.png'?>">
|
||||
<i class="on md b-white bottom"></i>
|
||||
</span>
|
||||
<span class="hidden-sm hidden-md" style="text-transform:uppercase;"><?php echo $uid?></span> <b class="caret"></b>
|
||||
</a>
|
||||
<!-- dropdown -->
|
||||
<ul class="dropdown-menu animated fadeInRight w">
|
||||
<li>
|
||||
<a href="index.php">
|
||||
<span>用户中心</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="editinfo.php">
|
||||
<span>修改资料</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="userinfo.php?mod=account">
|
||||
<span>修改密码</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li>
|
||||
<a ui-sref="access.signin" href="login.php?logout">退出登录</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- / dropdown -->
|
||||
</li>
|
||||
</ul>
|
||||
<!-- / navbar right -->
|
||||
</div>
|
||||
<!-- / navbar collapse -->
|
||||
</header>
|
||||
<!-- / header -->
|
||||
<!-- aside -->
|
||||
<aside id="aside" class="app-aside hidden-xs <?php echo $style[2]?>">
|
||||
<div class="aside-wrap">
|
||||
<div class="navi-wrap">
|
||||
|
||||
<!-- nav -->
|
||||
<nav ui-nav class="navi clearfix">
|
||||
<ul class="nav">
|
||||
<li class="hidden-folded padder m-t m-b-sm text-muted text-xs">
|
||||
<span>导航</span>
|
||||
</li>
|
||||
<li class="<?php echo checkIfActive('index,')?>">
|
||||
<a href="./">
|
||||
<i class="glyphicon glyphicon-home icon text-primary-dker"></i>
|
||||
<b class="label bg-info pull-right">N</b>
|
||||
<span class="font-bold">用户中心</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php echo checkIfActive('userinfo,editinfo,certificate,deposit')?>">
|
||||
<a href class="auto">
|
||||
<span class="pull-right text-muted">
|
||||
<i class="fa fa-fw fa-angle-right text"></i>
|
||||
<i class="fa fa-fw fa-angle-down text-active"></i>
|
||||
</span>
|
||||
<i class="glyphicon glyphicon-leaf icon text-success-lter"></i>
|
||||
<span>个人资料</span>
|
||||
</a>
|
||||
<ul class="nav nav-sub dk">
|
||||
<li>
|
||||
<a href="userinfo.php?mod=api">
|
||||
<span>API信息</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="editinfo.php">
|
||||
<span>修改资料</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="userinfo.php?mod=account">
|
||||
<span>修改密码</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if($conf['cert_open']>0){?>
|
||||
<li>
|
||||
<a href="certificate.php">
|
||||
<span>实名认证</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if($conf['user_deposit']>0){?>
|
||||
<li>
|
||||
<a href="deposit.php">
|
||||
<span>保证金</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="line dk"></li>
|
||||
<li class="hidden-folded padder m-t m-b-sm text-muted text-xs">
|
||||
<span>查询</span>
|
||||
</li>
|
||||
<li class="<?php echo checkIfActive('order')?>">
|
||||
<a href="order.php">
|
||||
<i class="glyphicon glyphicon-list-alt"></i>
|
||||
<span>订单记录</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php echo checkIfActive('settle')?>">
|
||||
<a href="settle.php">
|
||||
<i class="glyphicon glyphicon-check"></i>
|
||||
<span>结算记录</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php echo checkIfActive('record')?>">
|
||||
<a href="record.php">
|
||||
<i class="glyphicon glyphicon-calendar"></i>
|
||||
<span>资金明细</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if($conf['settle_open']==2||$conf['settle_open']==3){?>
|
||||
<li class="<?php echo checkIfActive('apply')?>">
|
||||
<a href="apply.php">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<span>申请提现</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if($conf['recharge']==1){?>
|
||||
<li class="<?php echo checkIfActive('recharge')?>">
|
||||
<a href="recharge.php">
|
||||
<i class="glyphicon glyphicon-yen"></i>
|
||||
<span>余额充值</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if($conf['group_buy']==1){?>
|
||||
<li class="<?php echo checkIfActive('groupbuy')?>">
|
||||
<a href="groupbuy.php">
|
||||
<i class="glyphicon glyphicon-shopping-cart"></i>
|
||||
<span>购买会员</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if($conf['pay_domain_open']==1){?>
|
||||
<li class="<?php echo checkIfActive('domain')?>">
|
||||
<a href="domain.php">
|
||||
<i class="glyphicon glyphicon-globe"></i>
|
||||
<span>授权域名</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if($conf['complain_open']==1){?>
|
||||
<li class="<?php echo checkIfActive('complain,complain_info')?>">
|
||||
<a href="complain.php">
|
||||
<?php $complain_total = $DB->getColumn("SELECT count(*) from pre_complain WHERE uid=$uid AND status=0"); if($complain_total>0){echo '<b class="label bg-danger pull-right">'.$complain_total.'</b>';}?>
|
||||
<i class="fa fa-commenting fa-fw"></i>
|
||||
<span>交易投诉</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<li class="line dk hidden-folded"></li>
|
||||
|
||||
<li class="hidden-folded padder m-t m-b-sm text-muted text-xs">
|
||||
<span>其他</span>
|
||||
</li>
|
||||
<?php if($conf['user_transfer']==1){?>
|
||||
<li class="<?php echo checkIfActive('transfer,transfer_add')?>">
|
||||
<a href="transfer.php">
|
||||
<i class="fa fa-send-o fa-fw"></i>
|
||||
<span>代付管理</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if($conf['onecode']==1 || $userrow['open_code'] == 1){?>
|
||||
<li class="<?php echo checkIfActive('onecode')?>">
|
||||
<a href="onecode.php">
|
||||
<i class="fa fa-qrcode fa-fw"></i>
|
||||
<span>聚合收款</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if($conf['invite_open']==1){?>
|
||||
<li class="<?php echo checkIfActive('invite')?>">
|
||||
<a href="invite.php">
|
||||
<i class="fa fa-share-alt fa-fw"></i>
|
||||
<span>邀请返现</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<li>
|
||||
<a href="/doc.html" target="_blank">
|
||||
<i class="fa fa-book"></i>
|
||||
<span>开发文档</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if(!empty($conf['qqqun'])){?>
|
||||
<li>
|
||||
<a href="<?php echo $conf['qqqun']?>" target="blank">
|
||||
<i class="fa fa-qq"></i>
|
||||
<span>产品QQ群</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if(!empty($conf['appurl'])){?>
|
||||
<li>
|
||||
<a href="<?php echo $conf['appurl']?>" target="blank">
|
||||
<i class="fa fa-android"></i>
|
||||
<span>APP下载</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- nav -->
|
||||
|
||||
<!-- aside footer -->
|
||||
<div class="wrapper m-t">
|
||||
<div class="text-center-folded">
|
||||
<span class="pull-right pull-none-folded">60%</span>
|
||||
<span class="hidden-folded">Milestone</span>
|
||||
</div>
|
||||
<div class="progress progress-xxs m-t-sm dk">
|
||||
<div class="progress-bar progress-bar-info" style="width: 60%;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center-folded">
|
||||
<span class="pull-right pull-none-folded">35%</span>
|
||||
<span class="hidden-folded">Release</span>
|
||||
</div>
|
||||
<div class="progress progress-xxs m-t-sm dk">
|
||||
<div class="progress-bar progress-bar-primary" style="width: 35%;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- / aside footer -->
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
<!-- / aside -->
|
||||
<!-- content -->
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='使用说明';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">使用说明</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
使用说明
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<h3>1分钟读懂<?php echo $conf['sitename']?>交易规则</h3>
|
||||
<div style="line-height:26px"><span style="white-space:nowrap;">
|
||||
<p style="white-space:normal;margin-bottom:14px;color:#333333;font-family:'microsoft yahei';font-size:14px;line-height:24px;">
|
||||
<strong>一、交易即时到账</strong>
|
||||
</p>
|
||||
<p style="white-space:normal;margin-bottom:14px;color:#333333;font-family:'microsoft yahei';font-size:14px;line-height:24px;">
|
||||
你的客户通过<?php echo $conf['sitename']?>中任意一种付款方式(支付宝、微信支付、财付通、QQ钱包)付款成功后均会时时到账于你的<?php echo $conf['sitename']?>账户,你可以在用户中心或订单记录中查看。
|
||||
</p>
|
||||
<p style="white-space:normal;margin-bottom:14px;color:#333333;font-family:'microsoft yahei';font-size:14px;line-height:24px;">
|
||||
<strong>二、T+1提现方案详解</strong>
|
||||
</p>
|
||||
<p style="white-space:normal;margin-top:0px;margin-bottom:10px;padding:0px;border:0px;font-size:14px;line-height:25px;color:#79848E;font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;text-indent:2em;background-color:#FFFFFF;">
|
||||
1、星期一、<span style="font-size:13px;line-height:20px;text-indent:26px;">星期</span>二、<span style="font-size:13px;line-height:20px;text-indent:26px;">星期</span>三、<span style="font-size:13px;line-height:20px;text-indent:26px;">星期</span>四、<span style="color:#79848E;font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;font-size:14px;line-height:25px;text-indent:28px;white-space:normal;background-color:#FFFFFF;">星期五、</span><span style="color:#79848E;font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;white-space:normal;font-size:13px;line-height:20px;text-indent:26px;">星期</span><span style="color:#79848E;font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;font-size:14px;line-height:25px;text-indent:28px;white-space:normal;background-color:#FFFFFF;">六、</span><span style="color:#79848E;font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;white-space:normal;font-size:13px;line-height:20px;text-indent:26px;">星期</span><span style="color:#79848E;font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;font-size:14px;line-height:25px;text-indent:28px;white-space:normal;background-color:#FFFFFF;">日</span>,0点~23点59分59秒间提现的资金将于次日23点前到账。
|
||||
</p>
|
||||
<!--p style="white-space:normal;margin-top:0px;margin-bottom:10px;padding:0px;border:0px;font-size:14px;line-height:25px;color:#79848E;font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;text-indent:2em;background-color:#FFFFFF;">
|
||||
<span style="font-size:13px;line-height:20px;text-indent:26px;">2、国家法定节假日期间提现的资金将于 节假日后第一个工作日23点前到账。</span>
|
||||
</p-->
|
||||
<p style="white-space:normal;margin-bottom:14px;color:#333333;font-family:'microsoft yahei';font-size:14px;line-height:24px;">
|
||||
<strong>三、提现费率</strong>
|
||||
</p>
|
||||
<table class="table table-striped table-condensed" width="735" style="color:#666666;font-family:'Helvetica Neue', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', 'Microsoft Yahei', sans-serif;font-size:15.54px;line-height:24.864px;">
|
||||
<tbody style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;">
|
||||
<tr class="info firstRow" style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;">
|
||||
<td style="box-sizing:border-box;margin:0px;padding-top:11px;padding-right:0px;padding-bottom:11px;border:none;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:17px;font-family:inherit;vertical-align:top;background-color:#D9EDF7;">
|
||||
<p style="box-sizing:border-box;margin-bottom:10px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:#000000;text-indent:2em;">
|
||||
<strong style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;">单笔提现金额</strong>
|
||||
</p>
|
||||
</td>
|
||||
<td style="box-sizing:border-box;margin:0px;padding-top:11px;padding-right:0px;padding-bottom:11px;border:none;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:17px;font-family:inherit;vertical-align:top;background-color:#D9EDF7;">
|
||||
<p style="box-sizing:border-box;margin-bottom:10px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:#000000;text-indent:2em;">
|
||||
<strong style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;">提现费率</strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;background-color:#F4F6F8;">
|
||||
<td style="box-sizing:border-box;margin:0px;padding-top:11px;padding-right:0px;padding-bottom:11px;border:none;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:17px;font-family:inherit;vertical-align:top;">
|
||||
<p style="box-sizing:border-box;margin-bottom:10px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:#000000;text-indent:2em;">
|
||||
大于10元起提上不封顶
|
||||
</p>
|
||||
</td>
|
||||
<td style="box-sizing:border-box;margin:0px;padding-top:11px;padding-right:0px;padding-bottom:11px;border:none;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:17px;font-family:inherit;vertical-align:top;">
|
||||
<p style="box-sizing:border-box;margin-bottom:10px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:#000000;text-indent:2em;">
|
||||
0.5%(最高25元)
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p style="white-space:normal;margin-bottom:14px;color:#333333;font-family:'microsoft yahei';font-size:14px;line-height:24px;">
|
||||
提现时手续费不足1元按1元收取
|
||||
</p>
|
||||
<p style="white-space:normal;margin-bottom:14px;color:#333333;font-family:'microsoft yahei';font-size:14px;line-height:24px;">
|
||||
<strong>四、多种结算方式</strong>
|
||||
</p>
|
||||
<p style="white-space:normal;margin-bottom:14px;color:#333333;font-family:'microsoft yahei';font-size:14px;line-height:24px;">
|
||||
<span style="font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;font-size:13px;line-height:20px;text-indent:26px;background-color:#FFFFFF;"><?php echo $conf['sitename']?></span>官方企业支付宝 -> 您的个人支付宝(小额)
|
||||
</p>
|
||||
<p style="white-space:normal;margin-bottom:14px;color:#333333;font-family:'microsoft yahei';font-size:14px;line-height:24px;">
|
||||
<span style="font-family:'Microsoft YaHei', 'Heiti SC', simhei, 'Lucida Sans Unicode', 'Myriad Pro', 'Hiragino Sans GB', Verdana;font-size:13px;line-height:20px;text-indent:26px;background-color:#FFFFFF;"><?php echo $conf['sitename']?></span>官方对公账户 -> 您的个人银行卡(大额)
|
||||
</p>
|
||||
</span></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
@@ -0,0 +1,256 @@
|
||||
<?php
|
||||
$is_defend=true;
|
||||
include("../includes/common.php");
|
||||
|
||||
if(isset($_GET['invite'])){
|
||||
$invite_code = trim($_GET['invite']);
|
||||
$uid = get_invite_uid($invite_code);
|
||||
if($uid && is_numeric($uid)){
|
||||
$_SESSION['invite_uid'] = intval($uid);
|
||||
}
|
||||
}
|
||||
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
|
||||
if(!$conf['reg_input_settle'] && (empty($userrow['account']) || empty($userrow['username']))){
|
||||
exit("<script language='javascript'>window.location.href='./completeinfo.php';</script>");
|
||||
}
|
||||
|
||||
if($userrow['status']==0){
|
||||
$status = '<font color="red">已封禁</font>';
|
||||
}elseif($userrow['pay']==0 && $userrow['settle']==0){
|
||||
$status = '<font color="red">关闭支付、结算</font>';
|
||||
}elseif($userrow['pay']==0){
|
||||
$status = '<font color="red">关闭支付</font>';
|
||||
}elseif($userrow['settle']==0){
|
||||
$status = '<font color="red">关闭结算</font>';
|
||||
}elseif($conf['cert_force']==1 && $userrow['cert']==0){
|
||||
$status = '<a href="certificate.php"><font color="red">未实名认证</font></a>';
|
||||
}elseif($userrow['pay']==2){
|
||||
$status = '<font color="orange">待审核</font>';
|
||||
}else{
|
||||
$status = '<font color="green">正常</font>';
|
||||
}
|
||||
$title='用户中心';
|
||||
include './head.php';
|
||||
?>
|
||||
<style>
|
||||
.round {
|
||||
line-height: 53px;
|
||||
color: #7266ba;
|
||||
width: 58px;
|
||||
height: 58px;
|
||||
font-size: 26px;
|
||||
margin-left:15px;
|
||||
display: inline-block;
|
||||
font-weight: 400;
|
||||
border: 3px solid #f8f8fe;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
background: #e3dff9;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
$rs=$DB->query("SELECT * FROM pre_settle WHERE uid={$uid} AND status=1 ORDER BY id DESC LIMIT 9");
|
||||
$max_settle=0;
|
||||
$chart='';
|
||||
$i=0;
|
||||
while($row = $rs->fetch())
|
||||
{
|
||||
if($row['money']>$max_settle)$max_settle=$row['money'];
|
||||
$chart.='['.$i++.','.$row['money'].'],';
|
||||
}
|
||||
$chart=substr($chart,0,-1);
|
||||
|
||||
$list = $DB->getAll("SELECT * FROM pre_anounce WHERE status=1 ORDER BY sort ASC");
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
<div class="modal inmodal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">欢迎回来</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $conf['modal']?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">用户中心</h1>
|
||||
<small class="text-muted">欢迎使用<?php echo $conf['sitename']?></small>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<!-- stats -->
|
||||
<?php
|
||||
if($conf['cert_force']==1 && $userrow['cert']==0){
|
||||
echo '<div class="alert alert-danger"><span class="btn-sm btn-danger">重要</span> 请完成实名认证,否则您的商户无法正常收款! <a href="./certificate.php" class="btn btn-default btn-xs">立即实名认证</a></div>';
|
||||
}
|
||||
if($conf['verifytype']==1 && empty($userrow['phone'])){
|
||||
echo '<div class="alert alert-warning"><span class="btn-sm btn-warning">提示</span> 您还没有绑定密保手机,请 <a href="editinfo.php" class="btn btn-default btn-xs">尽快绑定</a></div>';
|
||||
}elseif($conf['verifytype']==0 && empty($userrow['email'])){
|
||||
echo '<div class="alert alert-warning"><span class="btn-sm btn-warning">提示</span> 您还没有绑定密保邮箱,请 <a href="editinfo.php" class="btn btn-default btn-xs">尽快绑定</a></div>';
|
||||
}
|
||||
if(empty($userrow['pwd'])){
|
||||
echo '<div class="alert alert-warning"><span class="btn-sm btn-warning">提示</span> 您还没有设置登录密码,请 <a href="userinfo.php?mod=account" class="btn btn-default btn-xs">点此设置</a>,设置登录密码之后你就可以使用手机号/邮箱+密码登录</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="row row-sm text-center">
|
||||
<div class="col-xs-6 col-sm-3">
|
||||
<div class="panel padder-v item">
|
||||
<div class="top text-right w-full"><i class="fa fa-caret-down text-warning m-r-sm"></i></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3"><div class="round"><i class="fa fa-money fa-fw"></i></div></div>
|
||||
<div class="col-xs-9"><div class="h1 text-primary-dk font-thin h1"><span class="text-muted text-md">¥</span><?php echo $userrow['money']?></div><span class="text-muted">商户当前余额</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3">
|
||||
<div class="panel padder-v item">
|
||||
<div class="top text-right w-full"><i class="fa fa-caret-down text-warning m-r-sm"></i></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3"><div class="round"><i class="fa fa-check-square-o fa-fw"></i></div></div>
|
||||
<div class="col-xs-9"><div class="h1 text-dark-dk font-thin h1"><span class="text-muted text-md">¥</span><span id="settle_money"></span></div><span class="text-muted">已结算余额</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3">
|
||||
<div class="panel padder-v item">
|
||||
<div class="top text-right w-full"><i class="fa fa-caret-down text-warning m-r-sm"></i></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3"><div class="round"><i class="fa fa-area-chart fa-fw"></i></div></div>
|
||||
<div class="col-xs-9"><div class="h1 text-success-dk font-thin h1"><span id="orders"></span><span class="text-muted text-md">个</span></div><span class="text-muted">订单总数</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3">
|
||||
<div class="panel padder-v item">
|
||||
<div class="top text-right w-full"><i class="fa fa-caret-down text-warning m-r-sm"></i></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3"><div class="round"><i class="fa fa-cart-plus fa-fw"></i></div></div>
|
||||
<div class="col-xs-9"><div class="h1 text-info-dk font-thin h1"><span id="orders_today"></span><span class="text-muted text-md">个</span></div><span class="text-muted">今日订单</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="panel b-a">
|
||||
<div class="panel-heading bg-info dk no-border wrapper-lg">
|
||||
<a class="btn btn-sm btn-rounded btn-info pull-right m-r" href="./editinfo.php"><i class="fa fa-cog fa-fw"></i> 修改资料</a>
|
||||
<a class="btn btn-sm btn-rounded btn-info m-l" href="./userinfo.php?mod=api"><i class="fa fa-lock fa-fw"></i> API信息</a>
|
||||
</div>
|
||||
<div class="text-center m-b clearfix">
|
||||
<div class="thumb-lg avatar m-t-n-xxl">
|
||||
<img src="<?php echo ($userrow['qq'])?'//q2.qlogo.cn/headimg_dl?bs=qq&dst_uin='.$userrow['qq'].'&src_uin='.$userrow['qq'].'&fid='.$userrow['qq'].'&spec=100&url_enc=0&referer=bu_interface&term_type=PC':'assets/img/user.png'?>" alt="..." class="b b-3x b-white">
|
||||
</div>
|
||||
<div class="h2 font-thin m-t-sm">欢迎您,<?php echo $userrow['username']?></div>
|
||||
<div class="h4 font-thin m-t-sm">商户状态:<?php echo $status;?></div>
|
||||
</div>
|
||||
<div class="hbox text-center b-t b-light bg-light">
|
||||
<a class="col padder-v text-muted b-r b-light">
|
||||
<div class="h3"><span id="order_today_all"></span></div>
|
||||
<i class="fa fa-plus fa-fw"></i><span>今日收入</span>
|
||||
</a>
|
||||
<a class="col padder-v text-muted">
|
||||
<div class="h3"><span id="order_lastday_all"></span></div>
|
||||
<i class="fa fa-plus-circle fa-fw"></i><span>昨日收入</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default text-center">
|
||||
<div class="panel-heading font-bold">
|
||||
收入统计与通道费率
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead><tr id="paytypes"></tr></thead>
|
||||
<tbody><tr id="order_today"></tr><tr id="order_lastday"></tr><tr id="success_rate"></tr><tr id="payrates"></tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold text-center">
|
||||
公告通知
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<?php foreach($list as $row){?>
|
||||
<a class="list-group-item"><em class="fa fa-fw fa-volume-up"></em><font color="<?php echo $row['color']?$row['color']:null?>"><?php echo $row['content']?></font><span class="text-xs text-muted"> -<?php echo $row['addtime']?></span></a>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel wrapper">
|
||||
<label class="i-switch bg-warning pull-right" ng-init="showSpline=true">
|
||||
<input type="checkbox" ng-model="showSpline">
|
||||
<i></i>
|
||||
</label>
|
||||
<h4 class="font-thin m-t-none m-b text-muted">结算统计表</h4>
|
||||
<div ui-jq="plot" ui-refresh="showSpline" ui-options="
|
||||
[
|
||||
{ data: [ <?php echo $chart?> ], label:'结算金额', points: { show: true, radius: 1}, splines: { show: true, tension: 0.4, lineWidth: 1, fill: 0.8 } }
|
||||
],
|
||||
{
|
||||
colors: ['#23b7e5', '#7266ba'],
|
||||
series: { shadowSize: 3 },
|
||||
xaxis:{ font: { color: '#a1a7ac' } },
|
||||
yaxis:{ font: { color: '#a1a7ac' }, max:<?php echo ($max_settle+10)?> },
|
||||
grid: { hoverable: true, clickable: true, borderWidth: 0, color: '#dce5ec' },
|
||||
tooltip: true,
|
||||
tooltipOpts: { content: '结算金额¥%y', defaultTheme: false, shifts: { x: 10, y: -25 } }
|
||||
}
|
||||
" style="height:246px" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- / stats -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
type : "GET",
|
||||
url : "ajax2.php?act=getcount",
|
||||
dataType : 'json',
|
||||
async: true,
|
||||
success : function(data) {
|
||||
$('#orders').html(data.orders);
|
||||
$('#orders_today').html(data.orders_today);
|
||||
$('#settle_money').html(data.settle_money);
|
||||
$('#order_today_all').html(data.order_today_all);
|
||||
$('#order_lastday_all').html(data.order_lastday_all);
|
||||
$.each(data.channels, function (i, item) {
|
||||
$('#paytypes').append('<th style="text-align:center;"><img src="/assets/icon/'+item.name+'.ico" width="18px"> '+item.showname+'</th>');
|
||||
});
|
||||
$.each(data.channels, function (i, item) {
|
||||
$('#order_today').append('<td>今日:'+item.order_today+' 元</td>');
|
||||
$('#order_lastday').append('<td>昨日:'+item.order_lastday+' 元</td>');
|
||||
$('#success_rate').append('<td>成功率:'+item.success_rate+' %</td>');
|
||||
$('#payrates').append('<td>费率:'+item.rate+' %</td>');
|
||||
});
|
||||
}
|
||||
});
|
||||
<?php if(!empty($conf['modal'])){?>
|
||||
$('#myModal').modal('show');
|
||||
<?php }?>
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='邀请返现';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
if(!$conf['invite_open'])exit('未开启邀请返现功能');
|
||||
|
||||
$invite_url = $siteurl.'?invite='.urlencode(get_invite_code($uid));
|
||||
if($conf['homepage']>0){
|
||||
$invite_url = $siteurl.'user/?invite='.urlencode(get_invite_code($uid));
|
||||
}
|
||||
$money_get = round(100*$conf['invite_rate']/100,2);
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">邀请返现</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-volume-up"></i> 邀请返现介绍
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>● 用户通过下方推广链接注册成为商户后,每支付一笔订单,都会给你订单金额固定比例的分成。(分成金额最多不会超过订单手续费)</p>
|
||||
<p>● 当前邀请返现比例:<span style="font-weight:700;color:#f05050;"><?php echo $conf['invite_rate']?>%</span>,即用户支付100元的<?php echo $conf['invite_order_type']==1?'手续费':'订单'?>,你会得到<?php echo $money_get?>元奖励</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-share-alt"></i> 推广链接
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<h4 class="text-center">属于您的唯一推广链接</h4>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" id="invite_url" value="<?php echo $invite_url?>" readonly>
|
||||
</div>
|
||||
<p class="text-center"><a href="javascript:;" class="btn btn-success copy-btn" data-clipboard-text="<?php echo $invite_url?>" title="点击复制">点击复制</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-area-chart"></i> 邀请统计
|
||||
</div>
|
||||
<div class="list-group no-radius alt">
|
||||
<a class="list-group-item">
|
||||
<span class="badge bg-primary" id="invite_users">0</span>
|
||||
<i class="fa fa-users fa-fw text-muted"></i>
|
||||
已邀请用户数量
|
||||
</a>
|
||||
<a class="list-group-item">
|
||||
<span class="badge bg-success" id="income_today">0</span>
|
||||
<i class="fa fa-plus fa-fw text-muted"></i>
|
||||
今日邀请收入
|
||||
</a>
|
||||
<a class="list-group-item">
|
||||
<span class="badge bg-info" id="income_lastday">0</span>
|
||||
<i class="fa fa-plus-circle fa-fw text-muted"></i>
|
||||
昨日邀请收入
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="tab-container">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="" >已邀请的用户</a></li>
|
||||
<li class=""><a href="./record.php?type=1&kw=邀请返现">邀请返现记录</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active">
|
||||
<table id="listTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>clipboard.js/1.7.1/clipboard.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table-page-jump-to.min.js"></script>
|
||||
<script src="../assets/js/custom.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var clipboard = new Clipboard('.copy-btn');
|
||||
clipboard.on('success', function (e) {
|
||||
layer.msg('复制成功!', {icon: 1});
|
||||
});
|
||||
clipboard.on('error', function (e) {
|
||||
layer.msg('复制失败,请长按链接后手动复制', {icon: 2});
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type : "GET",
|
||||
url : "ajax2.php?act=inviteStat",
|
||||
dataType : 'json',
|
||||
async: true,
|
||||
success : function(data) {
|
||||
$('#invite_users').html(data.invite_users);
|
||||
$('#income_today').html(data.income_today);
|
||||
$('#income_lastday').html(data.income_lastday);
|
||||
}
|
||||
});
|
||||
|
||||
updateToolbar();
|
||||
const defaultPageSize = 10;
|
||||
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
|
||||
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
|
||||
|
||||
$("#listTable").bootstrapTable({
|
||||
url: 'ajax2.php?act=inviteList',
|
||||
pageNumber: pageNumber,
|
||||
pageSize: pageSize,
|
||||
classes: 'table table-striped table-hover table-bordered',
|
||||
showColumns: false,
|
||||
showFullscreen: false,
|
||||
columns: [
|
||||
{
|
||||
field: 'uid',
|
||||
title: '商户ID'
|
||||
},
|
||||
{
|
||||
field: 'addtime',
|
||||
title: '注册时间'
|
||||
},
|
||||
],
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
/**
|
||||
* 登录
|
||||
**/
|
||||
$is_defend=true;
|
||||
include("../includes/common.php");
|
||||
|
||||
if(isset($_GET['logout'])){
|
||||
if(!checkRefererHost())exit();
|
||||
setcookie("user_token", "", time() - 2592000);
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('您已成功注销本次登录!');window.location.href='./login.php';</script>");
|
||||
}elseif($islogin2==1){
|
||||
exit("<script language='javascript'>alert('您已登录!');window.location.href='./';</script>");
|
||||
}
|
||||
$csrf_token = md5(mt_rand(0,999).time());
|
||||
$_SESSION['csrf_token'] = $csrf_token;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>登录 | <?php echo $conf['sitename']?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>animate.css/3.5.2/animate.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>simple-line-icons/2.4.1/css/simple-line-icons.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/font.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/app.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/captcha.css" type="text/css" />
|
||||
<style>input:-webkit-autofill{-webkit-box-shadow:0 0 0px 1000px white inset;-webkit-text-fill-color:#333;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app app-header-fixed ">
|
||||
<div class="container w-xxl w-auto-xs" ng-controller="SigninFormController" ng-init="app.settings.container = false;">
|
||||
<span class="navbar-brand block m-t"><?php echo $conf['sitename']?></span>
|
||||
<div class="m-b-lg">
|
||||
<div class="wrapper text-center">
|
||||
<strong>请输入您的商户信息</strong>
|
||||
</div>
|
||||
<form name="form" class="form-validation" method="post" action="login.php">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<div class="text-danger wrapper text-center" ng-show="authError">
|
||||
</div>
|
||||
<?php if(!$conf['close_keylogin']){?>
|
||||
<ul class="nav nav-tabs">
|
||||
<li style="width: 50%;" align="center" class="<?php echo $_GET['m']!='key'?'active':null;?>">
|
||||
<a href="./login.php">密码登录(New)</a>
|
||||
</li>
|
||||
<li style="width: 50%;" align="center" class="<?php echo $_GET['m']=='key'?'active':null;?>">
|
||||
<a href="./login.php?m=key">密钥登录</a>
|
||||
</li>
|
||||
</ul><?php }?>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active">
|
||||
<div class="list-group list-group-sm swaplogin">
|
||||
<?php if($_GET['m']=='key'){?>
|
||||
<input type="hidden" name="type" value="0"/>
|
||||
<div class="list-group-item">
|
||||
<input type="text" name="user" placeholder="商户ID" value="" class="form-control no-border" onkeydown="if(event.keyCode==13){$('#submit').click()}">
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<input type="password" name="pass" placeholder="商户密钥" value="" class="form-control no-border" onkeydown="if(event.keyCode==13){$('#submit').click()}">
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<input type="hidden" name="type" value="1"/>
|
||||
<div class="list-group-item">
|
||||
<input type="text" name="user" placeholder="邮箱/手机号" value="" class="form-control no-border" onkeydown="if(event.keyCode==13){$('#submit').click()}">
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<input type="password" name="pass" placeholder="密码" value="" class="form-control no-border" onkeydown="if(event.keyCode==13){$('#submit').click()}">
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php if($conf['captcha_open_login']==1){?>
|
||||
<div class="list-group-item" id="captcha" style="margin: auto;"><div id="captcha_text">
|
||||
正在加载验证码
|
||||
</div>
|
||||
<div id="captcha_wait">
|
||||
<div class="loading">
|
||||
<div class="loading-dot"></div>
|
||||
<div class="loading-dot"></div>
|
||||
<div class="loading-dot"></div>
|
||||
<div class="loading-dot"></div>
|
||||
</div>
|
||||
</div></div>
|
||||
<div id="captchaform"></div>
|
||||
<?php }?>
|
||||
</div>
|
||||
<button type="button" class="btn btn-lg btn-primary btn-block" id="submit">立即登录</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<a href="findpwd.php" class="btn btn-info btn-rounded"><i class="fa fa-unlock"></i> 找回密码</a>
|
||||
<a href="reg.php" class="btn btn-danger btn-rounded <?php echo $conf['reg_open']==0?'hide':null;?>" style="float:right;"><i class="fa fa-user-plus"></i> 注册商户</a>
|
||||
</div>
|
||||
<?php if(!isset($_GET['connect'])){?>
|
||||
<div class="wrapper text-center">
|
||||
<?php if($conf['login_alipay']>0 || $conf['login_alipay']==-1){?>
|
||||
<button type="button" class="btn btn-rounded btn-lg btn-icon btn-default" title="支付宝快捷登录" onclick="connect('alipay')"><img src="../assets/icon/alipay.ico" style="border-radius:50px;"></button>
|
||||
<?php }?>
|
||||
<?php if($conf['login_qq']>0){?>
|
||||
<button type="button" class="btn btn-rounded btn-lg btn-icon btn-default" title="QQ快捷登录" onclick="connect('qq')"><i class="fa fa-qq fa-lg" style="color: #0BB2FF"></i></button>
|
||||
<?php }?>
|
||||
<?php if($conf['login_wx']>0 || $conf['login_wx']==-1){?>
|
||||
<button type="button" class="btn btn-rounded btn-lg btn-icon btn-default" title="微信快捷登录" onclick="connect('wx')"><i class="fa fa-wechat fa-lg" style="color: green"></i></button>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</form>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<p>
|
||||
<small class="text-muted"><a href="/"><?php echo $conf['sitename']?></a><br>© 2016~<?php echo date("Y")?></small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="//static.geetest.com/static/tools/gt.js"></script>
|
||||
<script>
|
||||
window.appendChildOrg = Element.prototype.appendChild;
|
||||
Element.prototype.appendChild = function() {
|
||||
if(arguments[0].tagName == 'SCRIPT'){
|
||||
arguments[0].setAttribute('referrerpolicy', 'no-referrer');
|
||||
}
|
||||
return window.appendChildOrg.apply(this, arguments);
|
||||
};
|
||||
</script>
|
||||
<script src="//static.geetest.com/v4/gt4.js"></script>
|
||||
<script>
|
||||
var captcha_open = 0;
|
||||
var handlerEmbed = function (captchaObj) {
|
||||
captchaObj.appendTo('#captcha');
|
||||
captchaObj.onReady(function () {
|
||||
$("#captcha_wait").hide();
|
||||
}).onSuccess(function () {
|
||||
var result = captchaObj.getValidate();
|
||||
if (!result) {
|
||||
return alert('请完成验证');
|
||||
}
|
||||
$.captchaResult = result;
|
||||
$.captchaObj = captchaObj;
|
||||
});
|
||||
};
|
||||
$(document).ready(function(){
|
||||
if($("#captcha").length>0) captcha_open=1;
|
||||
$("#submit").click(function(){
|
||||
var type=$("input[name='type']").val();
|
||||
var user=$("input[name='user']").val();
|
||||
var pass=$("input[name='pass']").val();
|
||||
if(user=='' || pass==''){layer.alert(type==1?'账号和密码不能为空!':'ID和密钥不能为空!');return false;}
|
||||
submitLogin(type,user,pass);
|
||||
});
|
||||
if(captcha_open==1){
|
||||
$.ajax({
|
||||
url: "ajax.php?act=captcha",
|
||||
type: "get",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#captcha_text').hide();
|
||||
$('#captcha_wait').show();
|
||||
if(data.version == 1){
|
||||
initGeetest4({
|
||||
captchaId: data.gt,
|
||||
product: 'popup',
|
||||
protocol: 'https://',
|
||||
riskType: 'slide',
|
||||
hideSuccess: true,
|
||||
nativeButton: {width: '100%'}
|
||||
}, handlerEmbed);
|
||||
}else{
|
||||
initGeetest({
|
||||
gt: data.gt,
|
||||
challenge: data.challenge,
|
||||
new_captcha: data.new_captcha,
|
||||
product: "popup",
|
||||
width: "100%",
|
||||
offline: !data.success,
|
||||
}, handlerEmbed);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
function submitLogin(type,user,pass){
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
if(captcha_open == 1 && !$.captchaResult){
|
||||
layer.alert('请先完成滑动验证!'); return false;
|
||||
}
|
||||
var ii = layer.load();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {type:type, user:user, pass:pass, csrf_token:csrf_token, ...$.captchaResult},
|
||||
url: "ajax.php?act=login",
|
||||
success: function (data, textStatus) {
|
||||
layer.close(ii);
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg, {icon: 16,time: 10000,shade:[0.3, "#000"]});
|
||||
setTimeout(function(){ window.location.href=data.url }, 1000);
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
$.captchaObj.reset();
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
function connect(type){
|
||||
var ii = layer.load();
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax.php?act=connect",
|
||||
data : {type:type},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
window.location.href = data.url;
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 7});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
/**
|
||||
* 登录
|
||||
**/
|
||||
$nosession=true;
|
||||
include("../includes/common.php");
|
||||
if($conf['login_alipay']==0)sysmsg("未开启支付宝快捷登录");
|
||||
|
||||
if(isset($_GET['sid'])){
|
||||
$sid = trim(daddslashes($_GET['sid']));
|
||||
if(!preg_match('/^(.[a-zA-Z0-9]+)$/',$sid))exit("Access Denied");
|
||||
session_id($sid);
|
||||
}
|
||||
session_start();
|
||||
|
||||
if(isset($_GET['act']) && $_GET['act']=='login'){
|
||||
if(isset($_SESSION['alipay_uid']) && !empty($_SESSION['alipay_uid'])){
|
||||
$alipay_uid = daddslashes($_SESSION['alipay_uid']);
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE alipay_uid='{$alipay_uid}' limit 1");
|
||||
if($userrow){
|
||||
$uid=$userrow['uid'];
|
||||
$key=$userrow['key'];
|
||||
if($islogin2==1){
|
||||
exit('{"code":-1,"msg":"当前支付宝已绑定商户ID:'.$uid.',请勿重复绑定!"}');
|
||||
}
|
||||
$session=md5($uid.$key.$password_hash);
|
||||
$expiretime=time()+2592000;
|
||||
$token=authcode("{$uid}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
|
||||
setcookie("user_token", $token, time() + 2592000);
|
||||
$DB->exec("update `pre_user` set `lasttime`=NOW() where `uid`='$uid'");
|
||||
$result=array("code"=>0,"msg"=>"登录成功!正在跳转到用户中心","url"=>"./");
|
||||
}elseif($islogin2==1){
|
||||
$sds=$DB->exec("update `pre_user` set `alipay_uid`='$alipay_uid' where `uid`='$uid'");
|
||||
$result=array("code"=>0,"msg"=>"已成功绑定支付宝账号!","url"=>"./editinfo.php");
|
||||
}else{
|
||||
$_SESSION['Oauth_alipay_uid']=$alipay_uid;
|
||||
$result=array("code"=>0,"msg"=>"请输入商户ID和密钥完成绑定和登录","url"=>"./login.php?connect=true");
|
||||
}
|
||||
unset($_SESSION['alipay_uid']);
|
||||
}else{
|
||||
$result=array("code"=>1);
|
||||
}
|
||||
exit(json_encode($result));
|
||||
}
|
||||
|
||||
if(isset($_GET['auth_code'])){
|
||||
|
||||
$channel = \lib\Channel::get($conf['login_alipay']);
|
||||
if(!$channel)sysmsg('当前支付通道信息不存在');
|
||||
|
||||
$alipay_config = require(PLUGIN_ROOT.$channel['plugin'].'/inc/config.php');
|
||||
try{
|
||||
$oauth = new \Alipay\AlipayOauthService($alipay_config);
|
||||
$result = $oauth->getToken($_GET['auth_code']);
|
||||
}catch(Exception $e){
|
||||
sysmsg('支付宝快捷登录失败!'.$e->getMessage());
|
||||
}
|
||||
|
||||
//支付宝用户号
|
||||
if(!empty($result['user_id'])){
|
||||
$user_id = $result['user_id'];
|
||||
$user_type = 'userid';
|
||||
}else{
|
||||
$user_id = $result['open_id'];
|
||||
$user_type = 'openid';
|
||||
}
|
||||
if(isset($_GET['state'])){
|
||||
$redirect_uri = authcode(str_replace(' ', '+', $_GET['state']), 'DECODE', SYS_KEY);
|
||||
if($redirect_uri && substr($redirect_uri, 0, 1) == '/'){
|
||||
exit("<script language='javascript'>window.location.replace('{$redirect_uri}?userid={$user_id}&usertype={$user_type}&appid={$channel['appid']}');</script>");
|
||||
}
|
||||
}
|
||||
$_SESSION['alipay_uid'] = $user_id;
|
||||
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE alipay_uid=:user_id limit 1", [':user_id'=>$user_id]);
|
||||
if($userrow){
|
||||
$uid=$userrow['uid'];
|
||||
$key=$userrow['key'];
|
||||
if($islogin2==1){
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('当前支付宝已绑定商户ID:{$uid},请勿重复绑定!');window.location.href='./editinfo.php';</script>");
|
||||
}
|
||||
$DB->insert('log', ['uid'=>$uid, 'type'=>'支付宝快捷登录', 'date'=>'NOW()', 'ip'=>$clientip, 'city'=>$city]);
|
||||
$session=md5($uid.$key.$password_hash);
|
||||
$expiretime=time()+2592000;
|
||||
$token=authcode("{$uid}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
|
||||
setcookie("user_token", $token, time() + 2592000);
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>window.location.href='./';</script>");
|
||||
}elseif($islogin2==1){
|
||||
$sds=$DB->exec("update `pre_user` set `alipay_uid`=:user_id where `uid`='$uid'", [':user_id'=>$user_id]);
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('已成功绑定支付宝账号!');window.location.href='./editinfo.php';</script>");
|
||||
}else{
|
||||
$_SESSION['Oauth_alipay_uid']=$user_id;
|
||||
exit("<script language='javascript'>alert('请输入商户ID和密钥完成绑定和登录');window.location.href='./login.php?connect=true';</script>");
|
||||
}
|
||||
|
||||
}elseif($islogin2==1 && isset($_GET['unbind'])){
|
||||
$DB->exec("update `pre_user` set `alipay_uid`=NULL where `uid`='$uid'");
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('您已成功解绑支付宝账号!');window.location.href='./editinfo.php';</script>");
|
||||
}elseif($islogin2==1 && !isset($_GET['bind']) && !isset($_GET['state'])){
|
||||
exit("<script language='javascript'>alert('您已登陆!');window.location.href='./';</script>");
|
||||
}elseif(checkmobile()==false || strpos($_SERVER['HTTP_USER_AGENT'], 'AlipayClient')){
|
||||
$channel = \lib\Channel::get($conf['login_alipay']);
|
||||
if(!$channel)sysmsg('当前支付通道信息不存在');
|
||||
$alipay_config = require(PLUGIN_ROOT.$channel['plugin'].'/inc/config.php');
|
||||
$oauth = new \Alipay\AlipayOauthService($alipay_config);
|
||||
$redirect_uri = $siteurl.'user/oauth.php';
|
||||
$oauth->oauth($redirect_uri, isset($_GET['state'])?trim($_GET['state']):null);
|
||||
}else{
|
||||
|
||||
$code_url = $siteurl.'user/oauth.php?sid='.session_id();
|
||||
if(isset($_GET['bind'])){
|
||||
$code_url .= '&bind=1';
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>支付宝快捷登录 | <?php echo $conf['sitename']?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>animate.css/3.5.2/animate.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>simple-line-icons/2.4.1/css/simple-line-icons.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/font.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/app.css" type="text/css" />
|
||||
<style>input:-webkit-autofill{-webkit-box-shadow:0 0 0px 1000px white inset;-webkit-text-fill-color:#333;}img.logo{width:14px;height:14px;margin:0 5px 0 3px;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app app-header-fixed ">
|
||||
<div class="container w-xxl w-auto-xs" ng-controller="SigninFormController" ng-init="app.settings.container = false;">
|
||||
<span class="navbar-brand block m-t" id="sitename"><?php echo $conf['sitename']?></span>
|
||||
<div class="m-b-lg">
|
||||
<div class="wrapper text-center">
|
||||
支付宝快捷登录
|
||||
</div>
|
||||
<form name="form" class="form-validation">
|
||||
<div class="text-center">
|
||||
<button type="button" class="btn btn-lg btn-primary btn-block" onclick="jump()" ng-disabled='form.$invalid'>跳转到支付宝</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<p>
|
||||
<small class="text-muted"><a href="/"><?php echo $conf['sitename']?></a><br>© 2016~<?php echo date("Y")?></small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
function jump(){
|
||||
var url = '<?php echo $code_url?>';
|
||||
window.location.href='alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode='+encodeURIComponent(url);
|
||||
}
|
||||
$(document).ready(function(){
|
||||
jump();
|
||||
setTimeout('checkopenid()', 2000);
|
||||
});
|
||||
function checkopenid(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "oauth.php?act=login",
|
||||
success: function (data, textStatus) {
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg, {icon: 16,time: 10000,shade:[0.3, "#000"]});
|
||||
setTimeout(function(){ window.location.href=data.url }, 1000);
|
||||
}else if (data.code == 1) {
|
||||
setTimeout('checkopenid()', 2000);
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='聚合收款';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
if(!$conf['onecode'] && $userrow['open_code']!=1)exit('未开启聚合收款');
|
||||
|
||||
$merchant = authcode($uid, 'ENCODE', SYS_KEY);
|
||||
$code_url = $siteurl.'paypage/?merchant='.urlencode($merchant);
|
||||
/*if(isset($_SESSION['onecode_url'])){
|
||||
$code_url = $_SESSION['onecode_url'];
|
||||
}else{
|
||||
$code_url = getdwz($code_url);
|
||||
if($code_url){
|
||||
$_SESSION['onecode_url'] = $code_url;
|
||||
}
|
||||
}*/
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">聚合收款</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-list"></i> 产品介绍
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>聚合收款是基于一个收款二维码,支持支付宝、微信、QQ等主流支付方式的收款产品。</p>
|
||||
<p>商家只需要一个固定的二维码,就可以完成支付宝、微信、QQ等主流支付方式的收款,方便快捷。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-qrcode"></i> 聚合收款配置
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal devform">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">收款方名称</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="codename" value="<?php echo $userrow['codename']?>" placeholder="留空默认显示“<?php echo $userrow['username']?>”" onkeydown="if(event.keyCode==13){$('#editName').click()}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-8"><input type="button" id="editName" value="保存" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-qrcode"></i> 你的聚合收款链接
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>你可以将收款链接发到QQ、微信等聊天工具,别人点击后可以直接输入金额付款。</p>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" id="code_url" value="<?php echo $code_url?>" readonly>
|
||||
</div>
|
||||
<p class="text-center"><a href="javascript:;" class="btn btn-success copy-btn" data-clipboard-text="<?php echo $code_url?>" title="点击复制">点击复制</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-qrcode"></i> 你的聚合收款码
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<input type="hidden" id="recName" value="<?php echo $userrow['codename']?$userrow['codename']:$userrow['username']?>">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">选择收款码风格</span>
|
||||
<select class="form-control" id="styleName">
|
||||
<option value="dongxue">风格1-冬雪</option>
|
||||
<option value="pikaqiu">风格2-皮卡丘</option>
|
||||
<option value="kanuobudingmao">风格3-布叮猫</option>
|
||||
<option value="niannianyouyu">风格4-年年有余</option>
|
||||
<option value="xiaohuangren">风格5-小黄人</option>
|
||||
<option value="qitao">风格6-乞讨</option>
|
||||
<option value="baobei">风格7-宝贝</option>
|
||||
<option value="toushi">风格8-投食</option>
|
||||
<option value="gongzhu">风格9-公主</option>
|
||||
<option value="qiuzanzhu">风格10-求赞助</option>
|
||||
<option value="huanyingdashang">风格11-欢迎打赏</option>
|
||||
<option value="yinlian">风格12-银联</option>
|
||||
<option value="yitiji">风格13-一体机</option>
|
||||
<option value="maomi">风格14-猫咪</option>
|
||||
<option value="longmao">风格15-龙猫</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="load"><img src="/assets/img/loading.gif"> 正在生成中</div>
|
||||
<div id="qrcode" style="display:none;"><img class="img-responsive center-block" alt="收款码" id="endImg" style="max-width: 300px;"/><br/><a href="javascript:;" id="downImg" class="btn btn-success btn-sm">长按图片或点我保存</a></div>
|
||||
<div class="hide">
|
||||
<div id="code"></div>
|
||||
<canvas id="canvas"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>clipboard.js/1.7.1/clipboard.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
|
||||
<script src="./assets/js/onecode.js"></script>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
$nosession=true;
|
||||
include("../includes/common.php");
|
||||
if(isset($_GET['sid'])){
|
||||
$sid = trim(daddslashes($_GET['sid']));
|
||||
if(!preg_match('/^(.[a-zA-Z0-9]+)$/',$sid))exit("Access Denied");
|
||||
session_id($sid);
|
||||
session_start();
|
||||
}
|
||||
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
$is_alipay = false;
|
||||
|
||||
if(isset($_GET['wechatid'])){
|
||||
$wechatid = intval($_GET['wechatid']);
|
||||
}elseif(isset($_GET['channel'])){
|
||||
$channelid = intval($_GET['channel']);
|
||||
}else{
|
||||
if(!$conf['transfer_wxpay'])sysmsg("未开启微信转账接口");
|
||||
$channelid = $conf['transfer_wxpay'];
|
||||
}
|
||||
if($wechatid){
|
||||
$wxinfo = \lib\Channel::getWeixin($wechatid);
|
||||
if(!$wxinfo)sysmsg('该微信公众号不存在');
|
||||
}else{
|
||||
$channel = \lib\Channel::get($channelid);
|
||||
if(!$channel)sysmsg('当前支付通道信息不存在');
|
||||
if($channel['plugin'] == 'alipay' || $channel['plugin'] == 'alipaysl' || $channel['plugin'] == 'alipayd' || $channel['plugin'] == 'alipayrp'){
|
||||
$is_alipay = true;
|
||||
}else{
|
||||
$wxinfo = \lib\Channel::getWeixin($channel['appwxmp']);
|
||||
if(!$wxinfo)sysmsg('支付通道绑定的微信公众号不存在');
|
||||
}
|
||||
}
|
||||
|
||||
if($is_alipay){
|
||||
$alipay_config = require(PLUGIN_ROOT.$channel['plugin'].'/inc/config.php');
|
||||
$oauth = new \Alipay\AlipayOauthService($alipay_config);
|
||||
$redirect_uri = $siteurl.'user/openid.php?channel='.$channelid;
|
||||
if($sid) $redirect_uri .= '&sid='.$sid;
|
||||
if(isset($_GET['app_auth_code'])){
|
||||
try{
|
||||
$result = $oauth->getAppToken($_GET['app_auth_code']);
|
||||
$_SESSION['alipay_app_token'] = $result['app_auth_token'];
|
||||
$_SESSION['alipay_app_id'] = $result['auth_app_id'];
|
||||
$_SESSION['alipay_user_id'] = $result['user_id'];
|
||||
$openid_name = 'AppAuthToken';
|
||||
$openid_content = $result['app_auth_token'];
|
||||
}catch(Exception $e){
|
||||
sysmsg('支付宝获取授权Token失败!'.$e->getMessage());
|
||||
}
|
||||
}elseif(isset($_GET['auth_code'])){
|
||||
try{
|
||||
$result = $oauth->getToken($_GET['auth_code']);
|
||||
if(!empty($result['user_id'])){
|
||||
$user_id = $result['user_id'];
|
||||
$openid_name = '支付宝UID';
|
||||
}else{
|
||||
$user_id = $result['open_id'];
|
||||
$openid_name = '支付宝OpenId';
|
||||
}
|
||||
$_SESSION['alipay_user_id'] = $user_id;
|
||||
$openid_content = $user_id;
|
||||
}catch(Exception $e){
|
||||
sysmsg('支付宝快捷登录失败!'.$e->getMessage());
|
||||
}
|
||||
}elseif(isset($_GET['act']) && $_GET['act']=='app_auth'){
|
||||
$oauth->appOauth($redirect_uri);
|
||||
}elseif(isset($_GET['act']) && $_GET['act']=='app_auth_assign'){
|
||||
[$pc_url, $app_url] = $oauth->appOauthAssign($redirect_uri, ['MOBILEAPP','WEBAPP','PUBLICAPP','TINYAPP','BASEAPP']);
|
||||
if(checkmobile()){
|
||||
header("Location: $app_url");
|
||||
}else{
|
||||
header("Location: $pc_url");
|
||||
}
|
||||
exit;
|
||||
}else{
|
||||
$oauth->oauth($redirect_uri);
|
||||
}
|
||||
}else{
|
||||
try{
|
||||
$tools = new \WeChatPay\JsApiTool($wxinfo['appid'], $wxinfo['appsecret']);
|
||||
$openId = $tools->GetOpenid();
|
||||
}catch(Exception $e){
|
||||
sysmsg($e->getMessage());
|
||||
}
|
||||
|
||||
$_SESSION['openid'] = $openId;
|
||||
|
||||
$openid_name = 'OpenId';
|
||||
$openid_content = $openId;
|
||||
}
|
||||
include PAYPAGE_ROOT.'openid.php';
|
||||
@@ -0,0 +1,466 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='订单记录';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
|
||||
$type_select = '<option value="0">所有支付方式</option>';
|
||||
$rs = $DB->getAll("SELECT * FROM pre_type WHERE status=1 ORDER BY id ASC");
|
||||
foreach($rs as $row){
|
||||
$type_select .= '<option value="'.$row['id'].'">'.$row['showname'].'</option>';
|
||||
}
|
||||
unset($rs);
|
||||
|
||||
?>
|
||||
<style>
|
||||
#orderItem .orderTitle{word-break:keep-all;}
|
||||
#orderItem .orderContent{word-break:break-all;}
|
||||
.dates{max-width: 120px;}
|
||||
.fixed-table-toolbar,.fixed-table-pagination{padding: 15px;}
|
||||
</style>
|
||||
<link href="../assets/css/datepicker.css" rel="stylesheet">
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">订单记录</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<h3 class="panel-title">订单记录</h3>
|
||||
</div>
|
||||
|
||||
<form onsubmit="return searchSubmit()" method="GET" class="form-inline" id="searchToolbar">
|
||||
<input type="hidden" name="channel" value="">
|
||||
<input type="hidden" name="subchannel" value="">
|
||||
<div class="form-group">
|
||||
<select class="form-control" name="type">
|
||||
<option value="1">系统订单号</option>
|
||||
<option value="2">商户订单号</option>
|
||||
<option value="9">接口订单号</option>
|
||||
<option value="10">用户交易单号</option>
|
||||
<option value="3">商品名称</option>
|
||||
<option value="4">商品金额</option>
|
||||
<option value="5">实付金额</option>
|
||||
<option value="6">网站域名</option>
|
||||
<option value="7">支付IP</option>
|
||||
<option value="8">支付账号</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="searchword">
|
||||
<input type="text" class="form-control" name="kw" placeholder="搜索内容" style="min-width: 200px;">
|
||||
</div>
|
||||
<div class="input-group input-daterange">
|
||||
<input type="text" id="starttime" name="starttime" class="form-control dates" placeholder="开始日期" autocomplete="off" title="留空则不限时间范围">
|
||||
<span class="input-group-addon" onclick="$('#starttime').val('');$('#endtime').val('');" title="清除"><i class="fa fa-chevron-right"></i></span>
|
||||
<input type="text" id="endtime" name="endtime" class="form-control dates" placeholder="结束日期" autocomplete="off" title="留空则不限时间范围">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select name="paytype" class="form-control"><?php echo $type_select?></select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select name="dstatus" class="form-control"><option value="-1">全部状态</option><option value="0">状态未支付</option><option value="1">状态已支付</option><option value="2">状态已退款</option><option value="3">状态已冻结</option></select>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit"><i class="fa fa-search"></i> 搜索</button>
|
||||
<a href="javascript:searchClear()" class="btn btn-default"><i class="fa fa-refresh"></i> 重置</a>
|
||||
<button type="button" onclick="statistics()" class="btn btn-default"> 统计 </button>
|
||||
</form>
|
||||
<table id="listTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a style="display: none;" href="" id="vurl" rel="noreferrer" target="_blank"></a>
|
||||
|
||||
<div class="modal" id="modal-statistics" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span
|
||||
aria-hidden="true">×</span><span
|
||||
class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title" id="modal-title">订单统计概况</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template id="statistics">
|
||||
<ul class="list-inline" style="margin-bottom: 0;padding-bottom: 10px;border-bottom: 1px solid #dddddd;">
|
||||
<li>订单总金额:<span style="font-weight: 600;">¥ {totalMoney}</span></li>
|
||||
<li>已支付金额:<span style="font-weight: 600;">¥ {successMoney}</span></li>
|
||||
<li>未支付金额:<span style="font-weight: 600;">¥ {unpaidMoney}</span></li>
|
||||
<li>已退款金额:<span style="font-weight: 600;">¥ {refundMoney}</span></li>
|
||||
<li>总收入利润: <span style="font-weight: 600;">¥ {platformProfit}</li>
|
||||
</ul>
|
||||
<ul class="list-inline" style="padding-top:10px;margin-bottom: 0;">
|
||||
<li>订单总数:<span style="font-weight: 600;">{totalCount}</span></li>
|
||||
<li>已支付订单:<span style="font-weight: 600;">{successCount}</span></li>
|
||||
<li>未支付订单:<span style="font-weight: 600;">{unpaidCount}</span></li>
|
||||
<li>已退款订单:<span style="font-weight: 600;">{refundCount}</span></li>
|
||||
<li>订单成功率:<span style="font-weight: 600;">{successRate}%</span></li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>bootstrap-datepicker/1.9.0/locales/bootstrap-datepicker.zh-CN.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table-page-jump-to.min.js"></script>
|
||||
<script src="../assets/js/custom.js"></script>
|
||||
<script>
|
||||
var is_user_refund = '<?php echo $conf['user_refund']?>';
|
||||
$(document).ready(function(){
|
||||
updateToolbar();
|
||||
const defaultPageSize = 20;
|
||||
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
|
||||
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
|
||||
|
||||
$("#listTable").bootstrapTable({
|
||||
url: 'ajax2.php?act=orderList',
|
||||
pageNumber: pageNumber,
|
||||
pageSize: pageSize,
|
||||
classes: 'table table-striped table-hover table-bordered',
|
||||
columns: [
|
||||
{
|
||||
field: 'trade_no',
|
||||
title: '系统订单号/商户订单号',
|
||||
formatter: function(value, row, index) {
|
||||
return '<a href="javascript:showOrder(\''+value+'\')" title="点击查看详情">'+value+'</a></b><br/>'+row.out_trade_no;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '商品名称'
|
||||
},
|
||||
{
|
||||
field: 'money',
|
||||
title: '商品金额',
|
||||
formatter: function(value, row, index) {
|
||||
return '¥<b>'+value+'</b>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'realmoney',
|
||||
title: '实际支付',
|
||||
formatter: function(value, row, index) {
|
||||
return '¥<b>'+value+'</b>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'typename',
|
||||
title: '支付方式',
|
||||
formatter: function(value, row, index) {
|
||||
return value ? '<b><img src="/assets/icon/'+value+'.ico" width="16" onerror="this.style.display=\'none\'">'+row.typeshowname+'</b>' : '';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'addtime',
|
||||
title: '创建时间/完成时间',
|
||||
formatter: function(value, row, index) {
|
||||
return value+'<br/>'+(row.endtime??' ');
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '支付状态',
|
||||
formatter: function(value, row, index) {
|
||||
if(value == '1'){
|
||||
text = '<font color=green>已支付</font>';
|
||||
}else if(value == '2'){
|
||||
text = '<font color=red>已退款</font>';
|
||||
if(row.refundmoney > 0 && row.refundmoney < row.realmoney){
|
||||
text += '<br/><font color=red>('+row.refundmoney+'元)</font>';
|
||||
}
|
||||
}else if(value == '3'){
|
||||
text = '<font color=red>已冻结</font>';
|
||||
}else if(value == '4'){
|
||||
text = '<font color=orange>预授权</font>';
|
||||
}else{
|
||||
text = '<font color=blue>未支付</font>';
|
||||
}
|
||||
if(row.plugin=='alipayd'){
|
||||
if(row.settle == '1'){
|
||||
text += '<br/><font color=#8c8f93>待结算</font>';
|
||||
}else if(row.settle == '2'){
|
||||
text += '<br/><font color=#37db3c>结算成功</font>';
|
||||
}else if(row.settle == '3'){
|
||||
text += '<br/><font color=#ed6565>结算失败</font>';
|
||||
}
|
||||
}else if(row.plugin=='alipayrp'){
|
||||
if(row.settle == '1'){
|
||||
text += '<br/><font color=#8c8f93>待转账</font>';
|
||||
}else if(row.settle == '2'){
|
||||
text += '<br/><font color=#37db3c>转账成功</font>';
|
||||
}else if(row.settle == '3'){
|
||||
text += '<br/><font color=#ed6565>转账失败</font>';
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: '',
|
||||
title: '操作',
|
||||
formatter: function(value, row, index) {
|
||||
var html = '<a href="./record.php?type=3&kw='+row.trade_no+'" class="btn btn-info btn-xs">明细</a> <a href="javascript:callnotify(\''+row.trade_no+'\')" class="btn btn-success btn-xs">补单</a>';
|
||||
if(is_user_refund=='1' && (row.status=='1' || row.status=='3' || row.status=='2' && row.refundmoney > 0 && row.refundmoney < row.realmoney)){
|
||||
html += ' <a href="javascript:refund(\''+row.trade_no+'\')" class="btn btn-danger btn-xs">退款</a>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
$('.input-datepicker, .input-daterange').datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
autoclose: true,
|
||||
clearBtn: true,
|
||||
language: 'zh-CN'
|
||||
});
|
||||
})
|
||||
|
||||
function callnotify(trade_no){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=notify',
|
||||
data : {trade_no:trade_no},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
$("#vurl").attr("href",data.url);
|
||||
document.getElementById("vurl").click();
|
||||
listTable();
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
function callreturn(trade_no){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=notify',
|
||||
data : {trade_no:trade_no,isreturn:1},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
$("#vurl").attr("href",data.url);
|
||||
document.getElementById("vurl").click();
|
||||
listTable();
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
function refund(trade_no) {
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=refund_query',
|
||||
data : {trade_no:trade_no},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
layer.open({
|
||||
area: ['360px'],
|
||||
title: '退款确认',
|
||||
content: '<p>此操作将直接原路退款该订单,每个订单只能操作一次退款,退款金额不能大于订单金额。</p><div class="form-group"><div class="input-group"><div class="input-group-addon">退款金额</div><input type="text" class="form-control" name="refund2" value="'+data.money+'" placeholder="请输入退款金额" autocomplete="off"/></div></div><div class="form-group"><div class="input-group"><div class="input-group-addon">登录密码</div><input type="text" class="form-control" name="paypwd" value="" placeholder="请输入用户登录密码" autocomplete="off"/></div></div>',
|
||||
yes: function(){
|
||||
var money = $("input[name='refund2']").val();
|
||||
var paypwd = $("input[name='paypwd']").val();
|
||||
if(money == '' || paypwd == ''){
|
||||
layer.alert('金额或密码不能为空');return;
|
||||
}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=refund_submit',
|
||||
data : {trade_no:trade_no, money:money, pwd:paypwd},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
layer.alert(data.msg, {icon:1}, function(){ layer.closeAll();searchSubmit(); });
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:7});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.close(ii);
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:7});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.close(ii);
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
function showOrder(trade_no) {
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
var status = ['<span class="label label-primary">未支付</span>','<span class="label label-success">已支付</span>','<span class="label label-danger">已退款</span>','<span class="label label-info">已冻结</span>','<span class="label label-warning">预授权</span>'];
|
||||
$.ajax({
|
||||
type : 'GET',
|
||||
url : 'ajax2.php?act=order&trade_no='+trade_no,
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
var data = data.data;
|
||||
var item = '<table class="table table-condensed table-hover" id="orderItem">';
|
||||
item += '<tr><td colspan="6" style="text-align:center" class="orderTitle"><b>订单信息</b></td></tr>';
|
||||
item += '<tr class="orderTitle"><td class="info" class="orderTitle">系统订单号</td><td colspan="5" class="orderContent">'+data.trade_no+'</td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">商户订单号</td><td colspan="5" class="orderContent">'+data.out_trade_no+'</td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">接口订单号</td><td colspan="5" class="orderContent">'+data.api_trade_no+'</td></tr>';
|
||||
if(data.bill_trade_no){
|
||||
item += '<tr><td class="info" class="orderTitle">用户交易单号</td><td colspan="5" class="orderContent">'+data.bill_trade_no+'</td></tr>';
|
||||
}
|
||||
item += '<tr><td class="info" class="orderTitle">支付方式</td><td colspan="5" class="orderContent">'+data.typename+'</td></tr>';
|
||||
if(data.subchannel > 0){
|
||||
item += '<tr><td class="info" class="orderTitle">自定义子通道</td><td colspan="5" class="orderContent">'+data.subchannelname+'</td></tr>';
|
||||
}
|
||||
item += '<tr><td class="info" class="orderTitle">商品名称</td><td colspan="5" class="orderContent">'+data.name+'</td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">订单金额</td><td colspan="5" class="orderContent">'+data.money+'</td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">实际支付金额</td><td colspan="5" class="orderContent">'+data.realmoney+'</td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">商户分成金额</td><td colspan="5" class="orderContent">'+data.getmoney+'</td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">创建时间</td><td colspan="5" class="orderContent">'+data.addtime+'</td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">完成时间</td><td colspan="5" class="orderContent">'+data.endtime+'</td></tr>';
|
||||
if(data.status==2){
|
||||
item += '<tr><td class="info" class="orderTitle">退款时间</td><td colspan="5" class="orderContent">'+data.refundtime+'</td></tr>';
|
||||
}
|
||||
item += '<tr><td class="info" class="orderTitle" title="只有在官方通道支付完成后才能显示">支付账号</td><td colspan="5" class="orderContent">'+data.buyer+'</td></tr>';
|
||||
if(data.mobile){
|
||||
item += '<tr><td class="info" class="orderTitle">手机号码</td><td colspan="5" class="orderContent">'+data.mobile+'</td></tr>';
|
||||
}
|
||||
item += '<tr><td class="info" class="orderTitle">网站域名</td><td colspan="5" class="orderContent"><a href="http://'+data.domain+'" target="_blank" rel="noreferrer">'+data.domain+'</a></td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">支付IP</td><td colspan="5" class="orderContent"><a href="https://m.ip138.com/iplookup.asp?ip='+data.ip+'" target="_blank" rel="noreferrer">'+data.ip+'</a></td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">扩展参数</td><td colspan="5" class="orderContent">'+data.param+'</td></tr>';
|
||||
item += '<tr><td class="info" class="orderTitle">订单状态</td><td colspan="5" class="orderContent">'+status[data.status]+'</td></tr>';
|
||||
if(data.status>0){
|
||||
item += '<tr><td class="info" class="orderTitle">通知状态</td><td colspan="5" class="orderContent">'+(data.notify==0?'<span class="label label-success">通知成功</span>':'<span class="label label-danger">通知失败</span>(已通知'+data.notify+'次)')+'</td></tr>';
|
||||
}
|
||||
item += '<tr><td colspan="6" style="text-align:center" class="orderTitle"><b>订单操作</b></td></tr>';
|
||||
item += '<tr><td colspan="6"><a href="javascript:callnotify(\''+data.trade_no+'\')" class="btn btn-xs btn-default">重新通知(异步)</a> <a href="javascript:callreturn(\''+data.trade_no+'\')" class="btn btn-xs btn-default">重新通知(同步)</a>'+(data.combine==1?' <a href="javascript:showSubOrders(\''+data.trade_no+'\')" class="btn btn-xs btn-default">查看子订单列表</a>':'')+'</td></tr>';
|
||||
item += '</table>';
|
||||
var area = [$(window).width() > 480 ? '480px' : '100%', ';max-height:100%'];
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: area,
|
||||
title: '订单详细信息',
|
||||
skin: 'layui-layer-rim',
|
||||
content: item
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
function statistics(){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=statistics',
|
||||
data: $('#searchToolbar').serializeArray(),
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
var element = $('#modal-statistics');
|
||||
var htmlContent = $("#statistics").html().replace(/\{(\w+)\}/g, function (match, key) {
|
||||
return data.data[key] || '';
|
||||
});
|
||||
element.find('.modal-body').html(htmlContent);
|
||||
element.modal('show');
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.close(ii);
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
function showSubOrders(trade_no){
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'GET',
|
||||
url : 'ajax2.php?act=subOrders&trade_no='+trade_no,
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
var list = data.data;
|
||||
var status = ['<span class="label label-primary">未支付</span>','<span class="label label-success">已支付</span>','<span class="label label-danger">已退款</span>'];
|
||||
var settle = ['<span class="label label-info">未结算</span>','<span class="label label-success">已结算</span>'];
|
||||
var item = '<table class="table table-condensed table-hover" id="orderItem">';
|
||||
item += '<thead><th class="orderTitle">系统订单号</th><th class="orderTitle">接口订单号</th><th class="orderTitle">订单金额</th class="orderTitle"><th class="orderTitle">订单状态</th><th class="orderTitle">结算状态</th></thead><tbody>';
|
||||
for(var i=0; i<list.length; i++){
|
||||
var statustext = status[list[i].status];
|
||||
if(list[i].status == 2 && list[i].refundmoney > 0 && list[i].refundmoney < list[i].money){
|
||||
statustext += '<font color=red>('+list[i].refundmoney+')</font>';
|
||||
}
|
||||
item += '<tr><td>'+list[i].sub_trade_no+'</td><td>'+list[i].api_trade_no+'</td><td>¥<b>'+list[i].money+'</b></td><td>'+statustext+'</td><td>'+(data.settle>0?settle[list[i].settle]:'')+'</td></tr>';
|
||||
}
|
||||
item += '</tbody></table>';
|
||||
var area = [$(window).width() > 680 ? '680px' : '100%'];
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: area,
|
||||
title: '合单支付 - 子订单列表',
|
||||
skin: 'layui-layer-rim',
|
||||
shadeClose: true,
|
||||
content: item
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
error_reporting(0);
|
||||
|
||||
session_start();
|
||||
header('Content-type: application/json');
|
||||
require '../includes/qrcodedecoder/bootstrap.php';
|
||||
class qq_qrlogin{
|
||||
public function getqrpic(){
|
||||
$url='https://ssl.ptlogin2.qq.com/ptqrshow?appid=716027609&e=2&l=M&s=4&d=72&v=4&t=0.5409099'.time().'&daid=383&pt_3rd_aid=101487368';
|
||||
$arr=$this->get_curl($url,0,'https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&daid=383&style=33&theme=2&login_text=%E6%8E%88%E6%9D%83%E5%B9%B6%E7%99%BB%E5%BD%95&hide_title_bar=1&hide_border=1&target=self&s_url=https%3A%2F%2Fgraph.qq.com%2Foauth2.0%2Flogin_jump&pt_3rd_aid=101487368&pt_feedback_link=https%3A%2F%2Fsupport.qq.com%2Fproducts%2F77942%3FcustomInfo%3Dwww.qq.com.appid101487368',0,1,0,0,1);
|
||||
preg_match('/qrsig=(.*?);/',$arr['header'],$match);
|
||||
if($qrsig=$match[1]){
|
||||
$qrcode = new Zxing\QrReader($arr['body'], Zxing\QrReader::SOURCE_TYPE_BLOB);
|
||||
$code_url = $qrcode->text();
|
||||
return array('saveOK'=>0,'qrsig'=>$qrsig,'data'=>base64_encode($arr['body']),'url'=>$code_url);
|
||||
}else{
|
||||
return array('saveOK'=>1,'msg'=>'二维码获取失败');
|
||||
}
|
||||
}
|
||||
public function qrlogin($qrsig){
|
||||
if(empty($qrsig))return array('saveOK'=>-1,'msg'=>'qrsig不能为空');
|
||||
$url='https://ssl.ptlogin2.qq.com/ptqrlogin?u1=https%3A%2F%2Fgraph.qq.com%2Foauth2.0%2Flogin_jump&ptqrtoken='.$this->getqrtoken($qrsig).'&ptredirect=0&h=1&t=1&g=1&from_ui=1&ptlang=2052&action=0-0-'.time().'0000&js_ver=21020514&js_type=1&login_sig='.$sig.'&pt_uistyle=40&aid=716027609&daid=383&pt_3rd_aid=101487368&';
|
||||
$ret = $this->get_curl($url,0,$url,'qrsig='.$qrsig.'; ',1);
|
||||
if(preg_match("/ptuiCB\('(.*?)'\)/", $ret, $arr)){
|
||||
$r=explode("','",str_replace("', '","','",$arr[1]));
|
||||
if($r[0]==0){
|
||||
preg_match('/uin=(\d+)&/',$ret,$uin);
|
||||
$uin=$uin[1];
|
||||
preg_match('/skey=@(.{9});/',$ret,$skey);
|
||||
if($uin && $skey[1]){
|
||||
$_SESSION['findpwd_qq']=$uin;
|
||||
return array('saveOK'=>0,'uin'=>$uin,'nickname'=>$r[5]);
|
||||
}else{
|
||||
return array('saveOK'=>4,'msg'=>'QQ验证未通过!');
|
||||
}
|
||||
}elseif($r[0]==65){
|
||||
return array('saveOK'=>1,'msg'=>'二维码已失效。');
|
||||
}elseif($r[0]==66){
|
||||
return array('saveOK'=>2,'msg'=>'二维码未失效。');
|
||||
}elseif($r[0]==67){
|
||||
return array('saveOK'=>3,'msg'=>'正在验证二维码。');
|
||||
}else{
|
||||
return array('saveOK'=>6,'msg'=>$r[4]);
|
||||
}
|
||||
}else{
|
||||
return array('saveOK'=>6,'msg'=>$ret);
|
||||
}
|
||||
}
|
||||
private function getqrtoken($qrsig){
|
||||
$len = strlen($qrsig);
|
||||
$hash = 0;
|
||||
for($i = 0; $i < $len; $i++){
|
||||
$hash += (($hash << 5) & 2147483647) + ord($qrsig[$i]) & 2147483647;
|
||||
$hash &= 2147483647;
|
||||
}
|
||||
return $hash & 2147483647;
|
||||
}
|
||||
private function get_curl($url,$post=0,$referer=0,$cookie=0,$header=0,$ua=0,$nobaody=0,$split=0){
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL,$url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
$httpheader[] = "Accept: application/json";
|
||||
$httpheader[] = "Accept-Encoding: gzip,deflate,sdch";
|
||||
$httpheader[] = "Accept-Language: zh-CN,zh;q=0.8";
|
||||
$httpheader[] = "Connection: close";
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
|
||||
if($post){
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
|
||||
}
|
||||
if($header){
|
||||
curl_setopt($ch, CURLOPT_HEADER, TRUE);
|
||||
}
|
||||
if($cookie){
|
||||
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
|
||||
}
|
||||
if($referer){
|
||||
curl_setopt($ch, CURLOPT_REFERER, $referer);
|
||||
}
|
||||
if($ua){
|
||||
curl_setopt($ch, CURLOPT_USERAGENT,$ua);
|
||||
}else{
|
||||
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36');
|
||||
}
|
||||
if($nobaody){
|
||||
curl_setopt($ch, CURLOPT_NOBODY,1);
|
||||
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
||||
$ret = curl_exec($ch);
|
||||
if ($split) {
|
||||
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
|
||||
$header = substr($ret, 0, $headerSize);
|
||||
$body = substr($ret, $headerSize);
|
||||
$ret=array();
|
||||
$ret['header']=$header;
|
||||
$ret['body']=$body;
|
||||
}
|
||||
curl_close($ch);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
if(strpos($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST'])===false)exit('{"saveOK":-1}');
|
||||
|
||||
$login=new qq_qrlogin();
|
||||
if($_GET['do']=='qrlogin'){
|
||||
$array=$login->qrlogin($_GET['qrsig']);
|
||||
}
|
||||
if($_GET['do']=='getqrpic'){
|
||||
$array=$login->getqrpic();
|
||||
}
|
||||
echo json_encode($array);
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='余额充值';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
$urow = $DB->getRow("SELECT uid,gid FROM pre_user WHERE uid='{$conf['reg_pay_uid']}' limit 1");
|
||||
if(!$urow)exit('充值收款商户不存在');
|
||||
$paytype = \lib\Channel::getTypes($urow['uid'], $urow['gid']);
|
||||
$csrf_token = md5(mt_rand(0,999).time());
|
||||
$_SESSION['csrf_token'] = $csrf_token;
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">余额充值</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 center-block" style="float: none;">
|
||||
<?php if(isset($_GET['ok']) && $_GET['ok']==1){
|
||||
$order = $DB->getRow("SELECT * FROM pre_order WHERE trade_no=:trade_no limit 1", [':trade_no'=>$_GET['trade_no']]);
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
恭喜你成功充值<strong><?php echo $order['money']?></strong>元余额!
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="alert alert-info text-md">
|
||||
<p>充值的余额仅限用于平台消费或订单退款资金,严禁频繁大额充值后提现,否则封禁商户并冻结余额!</p>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<i class="fa fa-cny"></i> 余额充值
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal devform">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">当前余额</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="rmoney" value="<?php echo $userrow['money']?> 元" readonly="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">充值金额</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="money" value="" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付方式</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio">
|
||||
<?php foreach($paytype as $row){?>
|
||||
<label class="i-checks"><input type="radio" name="type" value="<?php echo $row['id']?>" rate="<?php echo $row['rate']?>"><i></i><?php echo $row['showname']?>
|
||||
</label>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">共需支付</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="need" value="" readonly="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-8"><input type="button" id="submit" value="充值" class="btn btn-success form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script>
|
||||
function showneed(){
|
||||
var money = parseFloat($("input[name='money']").val());
|
||||
var rate = parseFloat($("input[name=type]:checked").attr('rate'));
|
||||
if(isNaN(money) || isNaN(rate))return;
|
||||
var need = (money + money * (1-rate/100)).toFixed(2);
|
||||
$("input[name='need']").val(need)
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$("input[name=type]:first").attr("checked",true);
|
||||
$("input[name='money']").blur(function(){
|
||||
showneed()
|
||||
});
|
||||
$("input[name='type']").click(function(){
|
||||
showneed()
|
||||
});
|
||||
$("#submit").click(function(){
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
var money=$("input[name='money']").val();
|
||||
var typeid=$("input[name=type]:checked").val();
|
||||
if(money==''){
|
||||
layer.alert("金额不能为空");
|
||||
return false;
|
||||
}
|
||||
var ii = layer.load();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {money:money, typeid:typeid, csrf_token:csrf_token},
|
||||
url: "ajax2.php?act=recharge",
|
||||
success: function (data, textStatus) {
|
||||
layer.close(ii);
|
||||
if (data.code == 0) {
|
||||
window.location.href=data.url;
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='资金明细';
|
||||
include './head.php';
|
||||
?>
|
||||
<style>
|
||||
.fixed-table-toolbar,.fixed-table-pagination{padding: 15px;}
|
||||
</style>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">资金明细</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
<h3 class="panel-title">资金明细</h3>
|
||||
</div>
|
||||
<form onsubmit="return searchSubmit()" method="GET" class="form-inline" id="searchToolbar">
|
||||
<div class="form-group">
|
||||
<select class="form-control" name="type">
|
||||
<option value="1">操作类型</option>
|
||||
<option value="2">变更金额</option>
|
||||
<option value="3">关联订单号</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="searchword">
|
||||
<input type="text" class="form-control" name="kw" placeholder="搜索内容" style="min-width: 300px;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary" type="submit"><i class="fa fa-search"></i> 搜索</button>
|
||||
<a href="javascript:searchClear()" class="btn btn-default"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</div>
|
||||
</form>
|
||||
<table id="listTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table-page-jump-to.min.js"></script>
|
||||
<script src="../assets/js/custom.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
updateToolbar();
|
||||
const defaultPageSize = 30;
|
||||
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
|
||||
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
|
||||
|
||||
$("#listTable").bootstrapTable({
|
||||
url: 'ajax2.php?act=recordList',
|
||||
pageNumber: pageNumber,
|
||||
pageSize: pageSize,
|
||||
classes: 'table table-striped table-hover table-bordered',
|
||||
columns: [
|
||||
{
|
||||
field: 'type',
|
||||
title: '操作类型',
|
||||
formatter: function(value, row, index) {
|
||||
return row.action==2?'<font color="red">'+value+'</font>':'<font color="green">'+value+'</font>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'money',
|
||||
title: '变更金额',
|
||||
formatter: function(value, row, index) {
|
||||
return (row.action==2?'- ':'+ ')+value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'oldmoney',
|
||||
title: '变更前金额'
|
||||
},
|
||||
{
|
||||
field: 'newmoney',
|
||||
title: '变更后金额'
|
||||
},
|
||||
{
|
||||
field: 'date',
|
||||
title: '时间'
|
||||
},
|
||||
{
|
||||
field: 'trade_no',
|
||||
title: '关联订单号',
|
||||
formatter: function(value, row, index) {
|
||||
return value?'<a href="./order.php?type=1&kw='+value+'">'+value+'</a>':'无';
|
||||
}
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
$is_defend=true;
|
||||
include("../includes/common.php");
|
||||
if(isset($_GET['regok'])){
|
||||
exit("<script language='javascript'>alert('恭喜你,商户注册成功!');window.location.href='./login.php';</script>");
|
||||
}
|
||||
if($islogin2==1){
|
||||
exit("<script language='javascript'>alert('您已登录!');window.location.href='./';</script>");
|
||||
}
|
||||
|
||||
if($conf['reg_open']==0)sysmsg('未开放商户申请');
|
||||
|
||||
if(isset($_GET['invite'])){
|
||||
$invite_code = trim($_GET['invite']);
|
||||
$uid = get_invite_uid($invite_code);
|
||||
if($uid && is_numeric($uid)){
|
||||
$_SESSION['invite_uid'] = intval($uid);
|
||||
}
|
||||
}
|
||||
|
||||
$csrf_token = md5(mt_rand(0,999).time());
|
||||
$_SESSION['csrf_token'] = $csrf_token;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>申请商户 | <?php echo $conf['sitename']?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>animate.css/3.5.2/animate.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>simple-line-icons/2.4.1/css/simple-line-icons.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/font.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/app.css" type="text/css" />
|
||||
<style>input:-webkit-autofill{-webkit-box-shadow:0 0 0px 1000px white inset;-webkit-text-fill-color:#333;}img.logo{width:14px;height:14px;margin:0 5px 0 3px;}</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="modal inmodal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">注册须知</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $conf['zhuce']?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="app app-header-fixed ">
|
||||
<div class="container w-xxl w-auto-xs" ng-controller="SigninFormController" ng-init="app.settings.container = false;">
|
||||
<span class="navbar-brand block m-t" id="sitename"><?php echo $conf['sitename']?></span>
|
||||
<div class="m-b-lg">
|
||||
<div class="wrapper text-center">
|
||||
<strong>自助申请商户</strong>
|
||||
</div>
|
||||
<form name="form" class="form-validation"><input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>"><input type="hidden" name="verifytype" value="<?php echo $conf['verifytype']?>">
|
||||
<?php if($conf['reg_pay']){?><div class="wrapper">商户申请价格为:<b><?php echo $conf['reg_pay_price']?></b>元</div><?php }?>
|
||||
<div class="list-group list-group-sm swaplogin">
|
||||
<?php if($conf['verifytype']==1){?>
|
||||
<div class="list-group-item">
|
||||
<input type="text" name="phone" placeholder="手机号码(同时作为登录账号)" class="form-control no-border" required>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="code" placeholder="短信验证码" class="form-control no-border" required>
|
||||
<a class="input-group-addon" id="sendcode">获取验证码</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<div class="list-group-item">
|
||||
<input type="email" name="email" placeholder="邮箱(同时作为登录账号)" class="form-control no-border" required>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="input-group">
|
||||
<input type="text" name="code" placeholder="邮箱验证码" class="form-control no-border" required>
|
||||
<a class="input-group-addon" id="sendcode">获取验证码</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="list-group-item">
|
||||
<input type="password" name="pwd" placeholder="请输入你的密码" class="form-control no-border" required>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<input type="password" name="pwd2" placeholder="请再次输入密码" class="form-control no-border" required>
|
||||
</div>
|
||||
<?php if($conf['reg_open']==2){?><div class="list-group-item">
|
||||
<input type="text" name="invitecode" placeholder="邀请码" class="form-control no-border" required>
|
||||
</div><?php }?>
|
||||
<div class="checkbox m-b-md m-t-none">
|
||||
<label class="i-checks">
|
||||
<input type="checkbox" ng-model="agree" checked required><i></i> 同意<a href="../agreement.html" target="_blank">我们的条款</a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" id="submit" class="btn btn-lg btn-primary btn-block" ng-click="login()" ng-disabled='form.$invalid'>立即注册</button>
|
||||
<a href="login.php" ui-sref="access.signup" class="btn btn-lg btn-default btn-block">返回登录</a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<p>
|
||||
<small class="text-muted"><a href="/"><?php echo $conf['sitename']?></a><br>© 2016~<?php echo date("Y")?></small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="//static.geetest.com/static/tools/gt.js"></script>
|
||||
<script>
|
||||
window.appendChildOrg = Element.prototype.appendChild;
|
||||
Element.prototype.appendChild = function() {
|
||||
if(arguments[0].tagName == 'SCRIPT'){
|
||||
arguments[0].setAttribute('referrerpolicy', 'no-referrer');
|
||||
}
|
||||
return window.appendChildOrg.apply(this, arguments);
|
||||
};
|
||||
</script>
|
||||
<script src="//static.geetest.com/v4/gt4.js"></script>
|
||||
<script>
|
||||
function invokeSettime(obj){
|
||||
var countdown=60;
|
||||
settime(obj);
|
||||
function settime(obj) {
|
||||
if (countdown == 0) {
|
||||
$(obj).attr("data-lock", "false");
|
||||
$(obj).attr("disabled",false);
|
||||
$(obj).text("获取验证码");
|
||||
countdown = 60;
|
||||
return;
|
||||
} else {
|
||||
$(obj).attr("data-lock", "true");
|
||||
$(obj).attr("disabled",true);
|
||||
$(obj).text("(" + countdown + ") s 重新发送");
|
||||
countdown--;
|
||||
}
|
||||
setTimeout(function() {
|
||||
settime(obj) }
|
||||
,1000)
|
||||
}
|
||||
}
|
||||
var handlerEmbed = function (captchaObj) {
|
||||
var sendto;
|
||||
captchaObj.onReady(function () {
|
||||
$("#wait").hide();
|
||||
}).onSuccess(function () {
|
||||
var result = captchaObj.getValidate();
|
||||
if (!result) {
|
||||
return alert('请完成验证');
|
||||
}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax.php?act=sendcode",
|
||||
data : {sendto:sendto, ...result},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
new invokeSettime("#sendcode");
|
||||
layer.msg('发送成功,请注意查收!');
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
captchaObj.reset();
|
||||
}
|
||||
}
|
||||
});
|
||||
}).onError(function(){
|
||||
layer.msg('验证码加载失败,请刷新页面重试', {icon: 5});
|
||||
});
|
||||
$('#sendcode').click(function () {
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
if($("input[name='verifytype']").val()=='1'){
|
||||
sendto=$("input[name='phone']").val();
|
||||
if(sendto==''){layer.alert('手机号码不能为空!');return false;}
|
||||
if(sendto.length!=11){layer.alert('手机号码不正确!');return false;}
|
||||
}else{
|
||||
sendto=$("input[name='email']").val();
|
||||
if(sendto==''){layer.alert('邮箱不能为空!');return false;}
|
||||
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
|
||||
if(!reg.test(sendto)){layer.alert('邮箱格式不正确!');return false;}
|
||||
}
|
||||
if(typeof captchaObj.showCaptcha === 'function'){
|
||||
captchaObj.showCaptcha();
|
||||
}else{
|
||||
captchaObj.verify();
|
||||
}
|
||||
});
|
||||
};
|
||||
$(document).ready(function(){
|
||||
$("#submit").click(function(){
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
var email=$("input[name='email']").val();
|
||||
var phone=$("input[name='phone']").val();
|
||||
var code=$("input[name='code']").val();
|
||||
var pwd=$("input[name='pwd']").val();
|
||||
var pwd2=$("input[name='pwd2']").val();
|
||||
var invitecode=$("input[name='invitecode']").val();
|
||||
if(email=='' || phone=='' || code=='' || pwd=='' || pwd2==''){layer.alert('请确保各项不能为空!');return false;}
|
||||
if($("input[name='invitecode']").length>0 && invitecode==''){layer.alert('邀请码不能为空!');return false;}
|
||||
if(pwd!=pwd2){layer.alert('两次输入密码不一致!');return false;}
|
||||
if($("input[name='verifytype']").val()=='1'){
|
||||
if(phone.length!=11){layer.alert('手机号码不正确!');return false;}
|
||||
}else{
|
||||
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
|
||||
if(!reg.test(email)){layer.alert('邮箱格式不正确!');return false;}
|
||||
}
|
||||
var ii = layer.load();
|
||||
$(this).attr("data-lock", "true");
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax.php?act=reg",
|
||||
data : {email:email,phone:phone,code:code,pwd:pwd,invitecode:invitecode,csrf_token:csrf_token},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
$("#submit").attr("data-lock", "false");
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('恭喜你,商户申请成功!', {icon: 1}, function(){
|
||||
window.location.href="./login.php";
|
||||
});
|
||||
}else if(data.code == 2){
|
||||
var paymsg = '';
|
||||
$.each(data.paytype, function(key, value) {
|
||||
paymsg+='<button class="btn btn-default btn-block" onclick="window.location.href=\'../submit2.php?typeid='+key+'&trade_no='+data.trade_no+'\'" style="margin-top:10px;"><img width="20" src="../assets/icon/'+value.name+'.ico" class="logo">'+value.showname+'</button>';
|
||||
});
|
||||
layer.alert('<center><h2>¥ '+data.need+'</h2><hr>'+paymsg+'<hr>提示:支付完成后即可直接登录</center>',{
|
||||
btn:[],
|
||||
title:'支付确认页面',
|
||||
closeBtn: false
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$.ajax({
|
||||
url: "ajax.php?act=captcha",
|
||||
type: "get",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if(data.version == 1){
|
||||
initGeetest4({
|
||||
captchaId: data.gt,
|
||||
product: 'bind',
|
||||
protocol: 'https://',
|
||||
riskType: 'slide',
|
||||
hideSuccess: true,
|
||||
}, handlerEmbed);
|
||||
}else{
|
||||
initGeetest({
|
||||
width: '100%',
|
||||
gt: data.gt,
|
||||
challenge: data.challenge,
|
||||
new_captcha: data.new_captcha,
|
||||
product: "bind",
|
||||
offline: !data.success
|
||||
}, handlerEmbed);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php if(!empty($conf['zhuce'])){?>
|
||||
$('#myModal').modal('show');
|
||||
<?php }?>
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='结算记录';
|
||||
include './head.php';
|
||||
?>
|
||||
<style>
|
||||
.fixed-table-toolbar,.fixed-table-pagination{padding: 15px;}
|
||||
</style>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">结算记录</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
结算记录
|
||||
</div>
|
||||
<form onsubmit="return searchSubmit()" method="GET" class="form-inline" id="searchToolbar">
|
||||
<div class="form-group">
|
||||
<select name="dstatus" class="form-control"><option value="-1">全部状态</option><option value="0">状态待结算</option><option value="1">状态已完成</option><option value="2">状态正在结算</option><option value="3">状态结算失败</option></select>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit"><i class="fa fa-search"></i> 搜索</button>
|
||||
<a href="javascript:searchClear()" class="btn btn-default"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</form>
|
||||
<table id="listTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table-page-jump-to.min.js"></script>
|
||||
<script src="../assets/js/custom.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
updateToolbar();
|
||||
const defaultPageSize = 30;
|
||||
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
|
||||
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
|
||||
|
||||
$("#listTable").bootstrapTable({
|
||||
url: 'ajax2.php?act=settleList',
|
||||
pageNumber: pageNumber,
|
||||
pageSize: pageSize,
|
||||
classes: 'table table-striped table-hover',
|
||||
columns: [
|
||||
{
|
||||
field: 'type',
|
||||
title: '结算方式',
|
||||
formatter: function(value, row, index) {
|
||||
let typename = '';
|
||||
if(value == '1'){
|
||||
typename='支付宝';
|
||||
}else if(value == '2'){
|
||||
typename='微信';
|
||||
}else if(value == '3'){
|
||||
typename='QQ钱包';
|
||||
}else if(value == '4'){
|
||||
typename='银行卡';
|
||||
}else if(value == '5'){
|
||||
typename='支付机构';
|
||||
}
|
||||
if(row.auto!=1) typename+='<small>[手动]</small>'
|
||||
return typename;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'account',
|
||||
title: '结算账号'
|
||||
},
|
||||
{
|
||||
field: 'money',
|
||||
title: '结算金额',
|
||||
formatter: function(value, row, index) {
|
||||
return '¥<b>'+value+'</b>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'realmoney',
|
||||
title: '实际到账',
|
||||
formatter: function(value, row, index) {
|
||||
return '¥<b>'+value+'</b>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'addtime',
|
||||
title: '结算时间'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
formatter: function(value, row, index) {
|
||||
if(value == '1'){
|
||||
return '<font color=green>已完成</font>' + (row.jumpurl ? '<br/><a href="javascript:showQrcode(\''+row.jumpurl+'\')" class="btn btn-xs btn-success"><i class="fa fa-qrcode"></i> 确认收款</a>' : '');
|
||||
}else if(value == '2'){
|
||||
return '<font color=orange>正在结算</font>';
|
||||
}else if(value == '3'){
|
||||
return '<a href="javascript:showResult('+row.id+')" title="点此查看失败原因"><font color=red>结算失败</font></a>';
|
||||
}else{
|
||||
return '<font color=blue>待结算</font>';
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
function showResult(id) {
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'GET',
|
||||
url : 'ajax2.php?act=settle_result&id='+id,
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
layer.alert(data.msg, {icon:0, title:'失败原因'});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:2});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
function showQrcode(url){
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '收款方使用微信扫描以下二维码',
|
||||
skin: 'layui-layer-demo',
|
||||
shadeClose: true,
|
||||
content: '<div id="qrcode" class="list-group-item text-center"></div>',
|
||||
success: function(){
|
||||
$('#qrcode').qrcode({
|
||||
text: url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
$is_defend=true;
|
||||
include("../includes/common.php");
|
||||
if(!$conf['test_open'])sysmsg("未开启测试支付");
|
||||
if(isset($_GET['ok']) && isset($_GET['trade_no'])){
|
||||
$trade_no=daddslashes($_GET['trade_no']);
|
||||
$row=$DB->getRow("SELECT * FROM pre_order WHERE trade_no='{$trade_no}' AND uid='{$conf['test_pay_uid']}' limit 1");
|
||||
if(!$row)sysmsg('订单号不存在');
|
||||
if($row['status']!=1)sysmsg('订单未完成支付');
|
||||
$money = $row['money'];
|
||||
}else{
|
||||
$trade_no=date("YmdHis").rand(111,999);
|
||||
$userrow = $DB->getRow("SELECT uid,gid FROM pre_user WHERE uid='{$conf['test_pay_uid']}' limit 1");
|
||||
if(!$userrow)sysmsg("测试支付商户不存在");
|
||||
$paytype = \lib\Channel::getTypes($userrow['uid'], $userrow['gid']);
|
||||
$csrf_token = md5(mt_rand(0,999).time());
|
||||
$_SESSION['csrf_token'] = $csrf_token;
|
||||
$money = 1;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<body>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<title><?php echo $conf['sitename']?> - 测试支付</title>
|
||||
<link href="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"/>
|
||||
<link rel="stylesheet" href="./assets/css/captcha.css" type="text/css" />
|
||||
<style>.form-group{margin-bottom:18px} #captcha{margin: auto;margin-bottom:16px}</style>
|
||||
</head>
|
||||
<div class="container">
|
||||
<div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
|
||||
<div class="page-header">
|
||||
<h4><?php echo $conf['sitename']?> - 测试支付<a href="/" class="pull-right"><small>返回首页</small></a></h4>
|
||||
</div>
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-body">
|
||||
|
||||
<form name="alipayment">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $csrf_token?>">
|
||||
<div class="form-group"><div class="input-group">
|
||||
<span class="input-group-addon"><span class="glyphicon glyphicon-barcode"></span></span>
|
||||
<input class="form-control" placeholder="商户订单号" value="<?php echo $trade_no?>" name="trade_no" type="text" disabled="">
|
||||
</div></div>
|
||||
<div class="form-group"><div class="input-group">
|
||||
<span class="input-group-addon"><span class="glyphicon glyphicon-shopping-cart"></span></span>
|
||||
<input class="form-control" placeholder="商品名称" value="支付测试" name="name" type="text" disabled="" >
|
||||
</div></div>
|
||||
<div class="form-group"><div class="input-group">
|
||||
<span class="input-group-addon"><span class="glyphicon glyphicon-yen"></span></span>
|
||||
<input class="form-control" placeholder="付款金额" value="<?php echo $money?>" name="money" type="text" <?php echo isset($_GET['ok'])?'disabled=""':'required=""'?>>
|
||||
</div></div>
|
||||
<center>
|
||||
<?php if(isset($_GET['ok'])){?>
|
||||
<div class="alert alert-success"><i class="glyphicon glyphicon-ok-circle"></i> 订单已支付成功!</div>
|
||||
<?php }else{?>
|
||||
<?php if($conf['captcha_open_test']==1){?>
|
||||
<div class="list-group-item" id="captcha"><div id="captcha_text">
|
||||
正在加载验证码
|
||||
</div>
|
||||
<div id="captcha_wait">
|
||||
<div class="loading">
|
||||
<div class="loading-dot"></div>
|
||||
<div class="loading-dot"></div>
|
||||
<div class="loading-dot"></div>
|
||||
<div class="loading-dot"></div>
|
||||
</div>
|
||||
</div></div>
|
||||
<div id="captchaform"></div>
|
||||
<?php }?>
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<?php foreach($paytype as $rows){?>
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" name="type" value="<?php echo $rows['id']?>" class="btn btn-default" onclick="submitPay(this)"><img src="/assets/icon/<?php echo $rows['name']?>.ico" height="18"> <?php echo $rows['showname']?></button>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</center>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel-footer text-center">
|
||||
<?php echo $conf['sitename']?> © <?php echo date("Y")?> All Rights Reserved.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="//static.geetest.com/static/tools/gt.js"></script>
|
||||
<script>
|
||||
window.appendChildOrg = Element.prototype.appendChild;
|
||||
Element.prototype.appendChild = function() {
|
||||
if(arguments[0].tagName == 'SCRIPT'){
|
||||
arguments[0].setAttribute('referrerpolicy', 'no-referrer');
|
||||
}
|
||||
return window.appendChildOrg.apply(this, arguments);
|
||||
};
|
||||
</script>
|
||||
<script src="//static.geetest.com/v4/gt4.js"></script>
|
||||
<script>
|
||||
var captcha_open = 0;
|
||||
var handlerEmbed = function (captchaObj) {
|
||||
captchaObj.appendTo('#captcha');
|
||||
captchaObj.onReady(function () {
|
||||
$("#captcha_wait").hide();
|
||||
}).onSuccess(function () {
|
||||
var result = captchaObj.getValidate();
|
||||
if (!result) {
|
||||
return alert('请完成验证');
|
||||
}
|
||||
$.captchaResult = result;
|
||||
$.captchaObj = captchaObj;
|
||||
});
|
||||
};
|
||||
function submitPay(obj){
|
||||
var csrf_token=$("input[name='csrf_token']").val();
|
||||
var money=$("input[name='money']").val();
|
||||
var typeid=$(obj).val();
|
||||
if(money==''){
|
||||
layer.alert("金额不能为空");
|
||||
return false;
|
||||
}
|
||||
if(captcha_open == 1 && !$.captchaResult){
|
||||
layer.alert('请先完成滑动验证!'); return false;
|
||||
}
|
||||
var ii = layer.load();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {money:money, typeid:typeid, csrf_token:csrf_token, ...$.captchaResult},
|
||||
url: "ajax.php?act=testpay",
|
||||
success: function (data, textStatus) {
|
||||
layer.close(ii);
|
||||
if (data.code == 0) {
|
||||
window.location.href=data.url;
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2});
|
||||
$.captchaObj.reset();
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
$(document).ready(function(){
|
||||
if($("#captcha").length>0) captcha_open=1;
|
||||
if(captcha_open==1){
|
||||
$.ajax({
|
||||
url: "ajax.php?act=captcha",
|
||||
type: "get",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#captcha_text').hide();
|
||||
$('#captcha_wait').show();
|
||||
if(data.version == 1){
|
||||
initGeetest4({
|
||||
captchaId: data.gt,
|
||||
product: 'popup',
|
||||
protocol: 'https://',
|
||||
riskType: 'ai',
|
||||
hideSuccess: true,
|
||||
nativeButton: {width: '100%'}
|
||||
}, handlerEmbed);
|
||||
}else{
|
||||
initGeetest({
|
||||
gt: data.gt,
|
||||
challenge: data.challenge,
|
||||
new_captcha: data.new_captcha,
|
||||
product: "popup",
|
||||
width: "100%",
|
||||
offline: !data.success,
|
||||
}, handlerEmbed);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
@@ -0,0 +1,214 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='代付管理';
|
||||
include './head.php';
|
||||
?>
|
||||
<style>
|
||||
.fixed-table-toolbar,.fixed-table-pagination{padding: 15px;}
|
||||
</style>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">代付管理</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php if(!$conf['user_transfer']) showmsg('未开启代付功能');?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
代付记录
|
||||
</div>
|
||||
<form onsubmit="return searchSubmit()" method="GET" class="form-inline" id="searchToolbar">
|
||||
<div class="form-group">
|
||||
<label>搜索</label>
|
||||
<input type="text" class="form-control" name="value" placeholder="收款账号/姓名">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select name="type" class="form-control"><option value="">所有付款方式</option><option value="alipay">支付宝</option><option value="wxpay">微信</option><option value="qqpay">QQ钱包</option><option value="bank">银行卡</option></select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select name="dstatus" class="form-control"><option value="-1">全部状态</option><option value="0">状态正在处理</option><option value="1">状态转账成功</option><option value="2">状态转账失败</option></select>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit"><i class="fa fa-search"></i> 搜索</button>
|
||||
<a href="javascript:searchClear()" class="btn btn-default"><i class="fa fa-refresh"></i> 重置</a>
|
||||
<a href="./transfer_add.php" class="btn btn-success"><i class="fa fa-plus"></i> 新增代付</a>
|
||||
</form>
|
||||
<table id="listTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table.min.js"></script>
|
||||
<script src="../assets/js/bootstrap-table-page-jump-to.min.js"></script>
|
||||
<script src="../assets/js/custom.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
updateToolbar();
|
||||
const defaultPageSize = 30;
|
||||
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
|
||||
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
|
||||
|
||||
$("#listTable").bootstrapTable({
|
||||
url: 'ajax2.php?act=transferList',
|
||||
pageNumber: pageNumber,
|
||||
pageSize: pageSize,
|
||||
classes: 'table table-striped table-hover table-bordered',
|
||||
columns: [
|
||||
{
|
||||
field: 'biz_no',
|
||||
title: '交易号/第三方交易号',
|
||||
formatter: function(value, row, index) {
|
||||
return '<b>'+value+'</b><br/>'+row.pay_order_no;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
title: '付款方式/备注',
|
||||
formatter: function(value, row, index) {
|
||||
let typename = '';
|
||||
if(value == 'alipay'){
|
||||
typename='<img src="/assets/icon/alipay.ico" width="16" onerror="this.style.display=\'none\'">支付宝';
|
||||
}else if(value == 'wxpay'){
|
||||
typename='<img src="/assets/icon/wxpay.ico" width="16" onerror="this.style.display=\'none\'">微信';
|
||||
}else if(value == 'qqpay'){
|
||||
typename='<img src="/assets/icon/qqpay.ico" width="16" onerror="this.style.display=\'none\'">QQ钱包';
|
||||
}else if(value == 'bank'){
|
||||
typename='<img src="/assets/icon/bank.ico" width="16" onerror="this.style.display=\'none\'">银行卡';
|
||||
}
|
||||
return typename+'<br/>'+(row.desc?'<font color="#bf7fef">'+row.desc+'</font>':'')+'';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'account',
|
||||
title: '付款账号/姓名',
|
||||
formatter: function(value, row, index) {
|
||||
return ''+value+'<br/>'+row.username+'';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'money',
|
||||
title: '付款金额/花费金额',
|
||||
formatter: function(value, row, index) {
|
||||
return '¥<b>'+value+'</b><br/>¥<b>'+row.costmoney+'</b>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'paytime',
|
||||
title: '提交时间/付款时间',
|
||||
formatter: function(value, row, index) {
|
||||
return (row.addtime ? row.addtime : value)+'<br/>'+value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
formatter: function(value, row, index) {
|
||||
if(value == '1'){
|
||||
return '<font color=green>转账成功</font>';
|
||||
}else if(value == '2'){
|
||||
return '<a href="javascript:showResult(\''+row.biz_no+'\')" title="点此查看失败原因"><font color=red>转账失败</font></a>';
|
||||
}else{
|
||||
return '<a href="javascript:queryStatus(\''+row.biz_no+'\')" title="点此查询转账状态"><font color=orange>正在处理</font></a>' + (row.jumpurl ? '<br/><a href="javascript:showQrcode(\''+row.jumpurl+'\')" class="btn btn-xs btn-success"><i class="fa fa-qrcode"></i> 确认收款</a>' : '');
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
function showResult(biz_no) {
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'GET',
|
||||
url : 'ajax2.php?act=transfer_result&biz_no='+biz_no,
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
layer.alert(data.msg, {icon:0, title:'失败原因', shadeClose:true});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:2});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
function queryStatus(biz_no) {
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'GET',
|
||||
url : 'ajax2.php?act=transfer_query&biz_no='+biz_no,
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
searchSubmit();
|
||||
layer.alert(data.msg, {title:'查询结果'});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:2, title:'查询失败'});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.close(ii);
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
function getProof(biz_no) {
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=transfer_proof',
|
||||
data : {biz_no:biz_no},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 0){
|
||||
if(data.download_url){
|
||||
layer.alert('获取转账凭证成功!<a href="'+data.download_url+'" target="_blank">点击下载凭证</a>', {icon:1, title:'获取凭证'});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:1, title:'获取凭证'});
|
||||
}
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:2, title:'获取失败'});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.close(ii);
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
function showQrcode(url){
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '收款方使用微信扫描以下二维码',
|
||||
skin: 'layui-layer-demo',
|
||||
shadeClose: true,
|
||||
content: '<div id="qrcode" class="list-group-item text-center"></div>',
|
||||
success: function(){
|
||||
$('#qrcode').qrcode({
|
||||
text: url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,287 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='新增代付';
|
||||
include './head.php';
|
||||
?>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">新增代付</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-10 col-lg-8 center-block" style="float: none;">
|
||||
<?php
|
||||
|
||||
if(!$conf['user_transfer']) showmsg('未开启代付功能');
|
||||
|
||||
if($conf['settle_type']==1){
|
||||
$today=date("Y-m-d").' 00:00:00';
|
||||
$order_today=$DB->getColumn("SELECT SUM(realmoney) from pre_order where uid={$uid} and tid<>2 and status=1 and endtime>='$today'");
|
||||
if(!$order_today) $order_today = 0;
|
||||
$enable_money=round($userrow['money']-$order_today,2);
|
||||
if($enable_money<0)$enable_money=0;
|
||||
}else{
|
||||
$enable_money=$userrow['money'];
|
||||
}
|
||||
if(!$conf['transfer_rate'])$conf['transfer_rate'] = $conf['settle_rate'];
|
||||
|
||||
$app = isset($_GET['app'])?$_GET['app']:'alipay';
|
||||
|
||||
if(isset($_POST['submit'])){
|
||||
if(!checkRefererHost())exit();
|
||||
$out_biz_no = trim($_POST['out_biz_no']);
|
||||
$payee_account = htmlspecialchars(trim($_POST['payee_account']));
|
||||
$payee_real_name = htmlspecialchars(trim($_POST['payee_real_name']));
|
||||
$money = trim($_POST['money']);
|
||||
$desc = htmlspecialchars(trim($_POST['desc']));
|
||||
$pwd = trim($_POST['paypwd']);
|
||||
$pwdenc = getMd5Pwd($pwd, $userrow['uid']);
|
||||
if(empty($pwd) || $pwdenc!==$userrow['pwd'])showmsg('登录密码输入错误',3);
|
||||
if(empty($out_biz_no) || empty($payee_account) || empty($money))showmsg('必填项不能为空',3);
|
||||
if(strlen($out_biz_no)!=19 || !is_numeric($out_biz_no))showmsg('交易号输入不规范',3);
|
||||
if($desc && mb_strlen($desc)>32)showmsg('转账备注最多32个字',3);
|
||||
if(!is_numeric($money) || !preg_match('/^[0-9.]+$/', $money) || $money<=0)showmsg('转账金额输入不规范',3);
|
||||
$need_money = round($money + $money*$conf['transfer_rate']/100,2);
|
||||
if($need_money>$enable_money)showmsg('需支付金额大于可转账余额',3);
|
||||
if($conf['transfer_minmoney']>0 && $money<$conf['transfer_minmoney'])showmsg('单笔最小代付金额限制为'.$conf['transfer_minmoney'].'元',3);
|
||||
if($conf['transfer_maxmoney']>0 && $money>$conf['transfer_maxmoney'])showmsg('单笔最大代付金额限制为'.$conf['transfer_maxmoney'].'元',3);
|
||||
if($userrow['settle']==0)showmsg('您的商户出现异常,无法使用代付功能',3);
|
||||
if($conf['transfer_maxlimit']>0){
|
||||
$a_count = $DB->getColumn('SELECT count(*) FROM pre_transfer WHERE uid=:uid AND type=:type AND account=:account AND paytime>=:paytime', [':uid'=>$uid, ':type'=>$app, ':account'=>$account, ':paytime'=>date('Y-m-d').' 00:00:00']);
|
||||
if($a_count >= $conf['transfer_maxlimit']){
|
||||
showmsg('您今天向该账号的转账次数已达到上限',3);
|
||||
}
|
||||
}
|
||||
|
||||
if($app=='alipay'){
|
||||
$channelid = $conf['transfer_alipay'];
|
||||
}elseif($app=='wxpay'){
|
||||
$channelid = $conf['transfer_wxpay'];
|
||||
}elseif($app=='qqpay'){
|
||||
if (!is_numeric($payee_account) || strlen($payee_account)<6 || strlen($payee_account)>10)showmsg('QQ号码格式错误',3);
|
||||
$channelid = $conf['transfer_qqpay'];
|
||||
}elseif($app=='bank'){
|
||||
$channelid = $conf['transfer_bank'];
|
||||
}else{
|
||||
showmsg('参数错误',4);
|
||||
}
|
||||
|
||||
$channel = \lib\Channel::get($channelid, $userrow['channelinfo']);
|
||||
if(!$channel)showmsg('当前支付通道信息不存在',4);
|
||||
|
||||
$result = \lib\Transfer::submit($app, $channel, $out_biz_no, $payee_account, $payee_real_name, $money, $desc);
|
||||
|
||||
if($result['code']==0){
|
||||
$paytime = $result['status'] == 1 ? 'NOW()' : null;
|
||||
$data = ['biz_no'=>$out_biz_no, 'uid'=>$uid, 'type'=>$app, 'channel'=>$channelid, 'account'=>$payee_account, 'username'=>$payee_real_name, 'money'=>$money, 'costmoney'=>$need_money, 'addtime'=>'NOW()', 'paytime'=>$paytime, 'pay_order_no'=>$result['orderid'], 'status'=>$result['status'], 'desc'=>$desc];
|
||||
if(isset($result['wxpackage'])) $data['ext'] = $result['wxpackage'];
|
||||
if($DB->insert('transfer', $data)!==false){
|
||||
changeUserMoney($uid, $need_money, false, '代付');
|
||||
}
|
||||
if($result['status'] == 1){
|
||||
$result='转账成功!转账单据号:'.$result['orderid'].' 支付时间:'.$result['paydate'];
|
||||
}elseif(isset($result['wxpackage'])){
|
||||
$result='提交成功!请在付款记录页面扫描二维码确认收款,1天内未确认,将退还给商家。转账单据号:'.$result['orderid'].' 支付时间:'.$result['paydate'];
|
||||
}else{
|
||||
$result='提交成功!转账处理中,请稍后在代付管理页面查看结果。转账单据号:'.$result['orderid'].' 支付时间:'.$result['paydate'];
|
||||
}
|
||||
$_SESSION['transfer_desc'] = $desc;
|
||||
showmsg($result,1,'./transfer.php');
|
||||
}else{
|
||||
$result='转账失败,'.$result['msg'];
|
||||
showmsg($result,4);
|
||||
}
|
||||
}
|
||||
|
||||
$out_biz_no = date("YmdHis").rand(11111,99999);
|
||||
$desc = $_SESSION['transfer_desc'];
|
||||
|
||||
$copy = [];
|
||||
if(isset($_GET['copy'])){
|
||||
$copy = $DB->find('transfer', '*', ['biz_no'=>trim($_GET['copy'])]);
|
||||
}
|
||||
?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading font-bold">
|
||||
新增代付
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ul class="nav nav-tabs">
|
||||
<?php if($conf['transfer_alipay']>0){?><li class="<?php echo $app=='alipay'?'active':null;?>"><a href="?app=alipay">支付宝</a></li><?php }?>
|
||||
<?php if($conf['transfer_wxpay']>0){?><li class="<?php echo $app=='wxpay'?'active':null;?>"><a href="?app=wxpay">微信</a></li><?php }?>
|
||||
<?php if($conf['transfer_qqpay']>0){?><li class="<?php echo $app=='qqpay'?'active':null;?>"><a href="?app=qqpay">QQ钱包</a></li><?php }?>
|
||||
<?php if($conf['transfer_bank']>0){?><li class="<?php echo $app=='bank'?'active':null;?>"><a href="?app=bank">银行卡</a></li><?php }?>
|
||||
</ul>
|
||||
|
||||
<div class="tab-pane active" id="alipay">
|
||||
<form action="?app=<?php echo $app?>" method="POST" role="form">
|
||||
<input type="hidden" name="rate" value="<?php echo $conf['transfer_rate']?>"/>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">交易号</div>
|
||||
<input type="text" name="out_biz_no" value="<?php echo $out_biz_no?>" class="form-control" required/>
|
||||
</div></div>
|
||||
<?php if($app=='alipay'){?>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">支付宝账号</div>
|
||||
<input type="text" name="payee_account" value="<?php echo $copy['account']?>" class="form-control" required placeholder="支付宝登录账号或支付宝UID"/>
|
||||
</div></div>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">支付宝姓名</div>
|
||||
<input type="text" name="payee_real_name" value="<?php echo $copy['username']?>" class="form-control" placeholder="不填写则不校验真实姓名"/>
|
||||
</div></div>
|
||||
<?php }elseif($app=='wxpay'){?>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">Openid</div>
|
||||
<input type="text" name="payee_account" value="<?php echo $copy['account']?>" class="form-control" required placeholder="只能填写微信Openid"/>
|
||||
<div class="input-group-btn"><a id="getopenid" class="btn btn-default">获取</a></div>
|
||||
</div></div>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">真实姓名</div>
|
||||
<input type="text" name="payee_real_name" value="<?php echo $copy['username']?>" class="form-control" placeholder="不填写则不校验真实姓名"/>
|
||||
</div></div>
|
||||
<?php }elseif($app=='qqpay'){?>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">收款方QQ</div>
|
||||
<input type="text" name="payee_account" value="<?php echo $copy['account']?>" class="form-control" required/>
|
||||
</div></div>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">真实姓名</div>
|
||||
<input type="text" name="payee_real_name" value="<?php echo $copy['username']?>" class="form-control" placeholder="不填写则不校验真实姓名"/>
|
||||
</div></div>
|
||||
<?php }elseif($app=='bank'){?>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">银行卡号</div>
|
||||
<input type="text" name="payee_account" value="<?php echo $copy['account']?>" class="form-control" required placeholder="收款方银行卡号"/>
|
||||
</div></div>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">姓名</div>
|
||||
<input type="text" name="payee_real_name" value="<?php echo $copy['username']?>" class="form-control" placeholder="收款方银行账户名称"/>
|
||||
</div></div>
|
||||
<?php }?>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">可转账余额</div>
|
||||
<input type="text" value="<?php echo $enable_money?>" class="form-control" disabled/>
|
||||
<?php if($conf['recharge']==1){?><div class="input-group-btn"><a href="./recharge.php" class="btn btn-default">充值</a></div><?php }?>
|
||||
</div></div>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">转账金额</div>
|
||||
<input type="text" name="money" value="" class="form-control" placeholder="RMB/元" required/>
|
||||
</div></div>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">需支付金额</div>
|
||||
<input type="text" name="need" value="" class="form-control" disabled/>
|
||||
</div></div>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">转账备注</div>
|
||||
<input type="text" name="desc" value="<?php echo $desc?>" class="form-control" placeholder="选填,默认为:<?php echo $conf['transfer_desc']?>"/>
|
||||
</div></div>
|
||||
<div class="form-group">
|
||||
<div class="input-group"><div class="input-group-addon">验证登录密码</div>
|
||||
<input type="text" name="paypwd" value="" class="form-control" required/>
|
||||
</div></div>
|
||||
<p><input type="submit" name="submit" value="立即转账" class="btn btn-primary form-control"/></p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<h4><span class="glyphicon glyphicon-info-sign"></span>注意事项</h4>
|
||||
交易号可以防止重复转账,同一个交易号只能提交同一次转账。<br/>
|
||||
代付手续费是<?php echo $conf['transfer_rate']; ?>%<?php if($conf['transfer_minmoney']>0)echo ',单笔最小代付'.$conf['transfer_minmoney'].'元'; if($conf['transfer_maxmoney']>0)echo ',单笔最大代付'.$conf['transfer_maxmoney'].'元';?>
|
||||
<?php if($conf['settle_type']==1){?><br/>可转账余额为截止到前一天你的收入+充值的余额。<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
function showneed(){
|
||||
var money = parseFloat($("input[name='money']").val());
|
||||
var rate = parseFloat($("input[name='rate']").val());
|
||||
if(isNaN(money) || isNaN(rate))return;
|
||||
var need = (money + money * (rate/100)).toFixed(2);
|
||||
$("input[name='need']").val(need)
|
||||
}
|
||||
function checkopenid(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "ajax.php?act=getopenid",
|
||||
success: function (data, textStatus) {
|
||||
if (data.code == 0) {
|
||||
layer.msg('Openid获取成功');
|
||||
layer.close($.openidform);
|
||||
$("input[name='payee_account']").val(data.openid);
|
||||
}else if($.ostart==true){
|
||||
setTimeout('checkopenid()', 2000);
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$("input[name='money']").blur(function(){
|
||||
showneed()
|
||||
});
|
||||
$('#getopenid').click(function () {
|
||||
if ($(this).attr("data-lock") === "true") return;
|
||||
$(this).attr("data-lock", "true");
|
||||
$.ajax({
|
||||
type : "GET",
|
||||
url : "ajax.php?act=qrcode",
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
$('#getopenid').attr("data-lock", "false");
|
||||
if(data.code == 0){
|
||||
$.openidform = layer.open({
|
||||
type: 1,
|
||||
title: '请收款方使用微信扫描以下二维码',
|
||||
skin: 'layui-layer-demo',
|
||||
anim: 2,
|
||||
shadeClose: true,
|
||||
content: '<div id="qrcode" class="list-group-item text-center" style="height:250px"></div>',
|
||||
success: function(){
|
||||
$('#qrcode').qrcode({
|
||||
text: data.url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
$.ostart = true;
|
||||
setTimeout('checkopenid()', 2000);
|
||||
},
|
||||
end: function(){
|
||||
$.ostart = false;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 0});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,285 @@
|
||||
<?php
|
||||
include("../includes/common.php");
|
||||
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$title='个人资料';
|
||||
include './head.php';
|
||||
?>
|
||||
<?php
|
||||
$mod=isset($_GET['mod'])?$_GET['mod']:'api';
|
||||
|
||||
if(strlen($userrow['phone'])==11){
|
||||
$userrow['phone']=substr($userrow['phone'],0,3).'****'.substr($userrow['phone'],7,10);
|
||||
}
|
||||
|
||||
if(!$conf['apiurl'])$conf['apiurl'] = $siteurl;
|
||||
|
||||
?>
|
||||
<div class="modal inmodal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">商户私钥查看窗口</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group"><font color="red"><i class="fa fa-info-circle"></i> 请及时复制保存商户私钥!当前窗口关闭后,无法再次查询商户私钥,本站也不会保存。如遗失商户私钥,可重新生成进行替换。</font></div>
|
||||
<div class="form-group">
|
||||
<label>商户私钥</label>
|
||||
<textarea class="form-control" name="merchant_private_key" rows="5" readonly></textarea>
|
||||
<center><a href="javascript:;" class="btn btn-default" data-clipboard-text="" title="点击复制" id="merchant_private_key_copy"><i class="fa fa-copy"></i> 复制</a></center>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" onclick="if(confirm('关闭后无法再次查询商户私钥,是否关闭?'))$('#myModal').modal('hide');">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content" class="app-content" role="main">
|
||||
<div class="app-content-body ">
|
||||
<div class="bg-light lter b-b wrapper-md hidden-print">
|
||||
<h1 class="m-n font-thin h3">个人资料</h1>
|
||||
</div>
|
||||
<div class="wrapper-md control">
|
||||
<?php if(isset($msg)){?>
|
||||
<div class="alert alert-info">
|
||||
<?php echo $msg?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="tab-container ng-isolate-scope">
|
||||
<ul class="nav nav-tabs">
|
||||
<li style="width: 25%;" align="center" class="<?php echo $mod=='api'?'active':null?>">
|
||||
<a href="userinfo.php?mod=api">API信息</a>
|
||||
</li>
|
||||
<li style="width: 25%;" align="center" class="<?php echo $mod=='info'?'active':null?>">
|
||||
<a href="editinfo.php">修改资料</a>
|
||||
</li>
|
||||
<li style="width: 25%;" align="center" class="<?php echo $mod=='account'?'active':null?>">
|
||||
<a href="userinfo.php?mod=account">修改密码</a>
|
||||
</li>
|
||||
<?php if($conf['cert_open']>0){?>
|
||||
<li style="width: 25%;" align="center">
|
||||
<a href="certificate.php">实名认证</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane ng-scope active">
|
||||
<?php if($mod=='api'){?>
|
||||
<form class="form-horizontal devform">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">接口地址</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" value="<?php echo $conf['apiurl']?>" readonly><div class="input-group-addon"><a href="javascript:;" class="copy-btn" data-clipboard-text="<?php echo $conf['apiurl']?>" title="点击复制"><i class="fa fa-copy"></i></a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">商户ID</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" value="<?php echo $uid?>" readonly><div class="input-group-addon"><a href="javascript:;" class="copy-btn" data-clipboard-text="<?php echo $uid?>" title="点击复制"><i class="fa fa-copy"></i></a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>V1接口(MD5签名方式):</h4></div></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">商户MD5密钥</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><input class="form-control" type="text" value="<?php echo $userrow['key']?>" readonly><div class="input-group-addon"><a href="javascript:;" class="copy-btn" data-clipboard-text="<?php echo $userrow['key']?>" title="点击复制"><i class="fa fa-copy"></i></a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><a href="/doc_old.html" class="btn btn-sm btn-info" target="_blank">查看V1开发文档</a> <a href="javascript:resetKey()" class="btn btn-sm btn-danger">重置商户MD5密钥</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>V2接口(RSA签名方式):</h4></div></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">平台公钥</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><textarea class="form-control" name="platform_public_key" rows="3" readonly><?php echo $conf['public_key']?></textarea><div class="input-group-addon"><a href="javascript:;" class="copy-btn" data-clipboard-text="<?php echo $conf['public_key']?>" title="点击复制"><i class="fa fa-copy"></i></a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">商户公钥</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group"><textarea class="form-control" name="merchant_public_key" rows="3" readonly><?php echo $userrow['publickey']?></textarea><div class="input-group-addon"><a href="javascript:;" class="copy-btn" title="点击复制" onclick="alert('请仔细分清各种密钥区别,只需要复制平台公钥和商户私钥即可!如商户私钥遗失请重新生成。')"><i class="fa fa-copy"></i></a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><a href="/doc.html" class="btn btn-sm btn-info" target="_blank">查看V2开发文档</a> <?php if($userrow['publickey']){?><a href="javascript:createRsaPair()" class="btn btn-sm btn-danger">重置商户RSA密钥对</a><?php }else{?><a href="javascript:createRsaPair()" class="btn btn-sm btn-success">生成商户RSA密钥对</a><?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line line-dashed b-b line-lg pull-in"></div>
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>签名方式开关设置:</h4></div></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">签名方式开关</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="form-control" name="keytype" default="<?php echo $userrow['keytype']?>"><option value="0">开启MD5+RSA签名(兼容模式)</option><option value="1">仅开启RSA签名(安全模式)</option></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="editKeyType" value="确定修改" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php }elseif($mod=='account'){?>
|
||||
<form class="form-horizontal devform">
|
||||
<div class="form-group"><div class="col-sm-offset-2 col-sm-4"><h4>修改登录密码:</h4></div></div>
|
||||
<?php if(!empty($userrow['pwd'])){?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">旧密码</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="password" name="oldpwd" value="">
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新密码</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="password" name="newpwd" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">重复密码</label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="password" name="newpwd2" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-4"><input type="button" id="changePwd" value="修改密码" class="btn btn-primary form-control"/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'foot.php';?>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>clipboard.js/1.7.1/clipboard.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var items = $("select[default]");
|
||||
for (i = 0; i < items.length; i++) {
|
||||
$(items[i]).val($(items[i]).attr("default")||0);
|
||||
}
|
||||
var clipboard = new Clipboard('.copy-btn');
|
||||
clipboard.on('success', function (e) {
|
||||
layer.msg('复制成功!', {icon: 1});
|
||||
});
|
||||
clipboard.on('error', function (e) {
|
||||
layer.msg('复制失败,请长按链接后手动复制', {icon: 2});
|
||||
});
|
||||
var clipboard = new Clipboard('#merchant_private_key_copy', {
|
||||
container: document.getElementById('myModal')
|
||||
});
|
||||
clipboard.on('success', function (e) {
|
||||
layer.msg('复制成功!', {icon: 1});
|
||||
});
|
||||
clipboard.on('error', function (e) {
|
||||
layer.msg('复制失败,请长按链接后手动复制', {icon: 2});
|
||||
});
|
||||
$("#changePwd").click(function(){
|
||||
var oldpwd=$("input[name='oldpwd']").val();
|
||||
var newpwd=$("input[name='newpwd']").val();
|
||||
var newpwd2=$("input[name='newpwd2']").val();
|
||||
if(oldpwd==''){layer.alert('旧密码不能为空');return false;}
|
||||
if(newpwd==''||newpwd2==''){layer.alert('新密码不能为空');return false;}
|
||||
if(newpwd!=newpwd2){layer.alert('两次输入密码不一致!');return false;}
|
||||
if(oldpwd==newpwd){layer.alert('旧密码和新密码相同!');return false;}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_pwd",
|
||||
data : {oldpwd:oldpwd,newpwd:newpwd,newpwd2:newpwd2},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert(data.msg, {icon: 1}, function(){window.location.reload()});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#editKeyType").click(function(){
|
||||
var keytype=$("select[name='keytype']").val();
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "ajax2.php?act=edit_keytype",
|
||||
data : {keytype:keytype},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == 1){
|
||||
layer.alert('修改成功!', {icon:1});
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function resetKey(){
|
||||
var confirmobj = layer.confirm('是否确认重置对接密钥?重置后需要重新登录', {
|
||||
btn: ['确定','取消']
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=resetKey',
|
||||
data : 'submit=do',
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
if(data.code == 0){
|
||||
layer.alert('重置密钥成功!', {icon:1}, function(){window.location.reload()});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:2});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close(confirmobj);
|
||||
});
|
||||
}
|
||||
function createRsaPair(){
|
||||
var confirmobj = layer.confirm('是否确定生成商户RSA密钥对?', {
|
||||
btn: ['确定','取消']
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax2.php?act=createRsaPair',
|
||||
data : 'submit=do',
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
if(data.code == 0){
|
||||
$("textarea[name='merchant_private_key']").val(data.private_key);
|
||||
$("textarea[name='merchant_public_key']").val(data.public_key);
|
||||
$("#merchant_private_key_copy").attr('data-clipboard-text', data.private_key);
|
||||
layer.alert('商户RSA密钥对生成成功', {icon:1}, function(){
|
||||
layer.closeAll();
|
||||
$('#myModal').modal('show');
|
||||
});
|
||||
}else{
|
||||
layer.alert(data.msg, {icon:2});
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close(confirmobj);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,195 @@
|
||||
<?php
|
||||
/**
|
||||
* 微信登录
|
||||
**/
|
||||
$is_defend=true;
|
||||
$nosession=true;
|
||||
include("../includes/common.php");
|
||||
if($conf['login_wx']==0)sysmsg("未开启微信快捷登录");
|
||||
|
||||
if(isset($_GET['sid'])){
|
||||
$sid = trim(daddslashes($_GET['sid']));
|
||||
if(!preg_match('/^(.[a-zA-Z0-9]+)$/',$sid))exit("Access Denied");
|
||||
session_id($sid);
|
||||
}
|
||||
session_start();
|
||||
|
||||
if(isset($_GET['act']) && $_GET['act']=='login'){
|
||||
if(isset($_SESSION['openid']) && !empty($_SESSION['openid'])){
|
||||
$openId = daddslashes($_SESSION['openid']);
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE wx_uid='{$openId}' LIMIT 1");
|
||||
if($userrow){
|
||||
$uid=$userrow['uid'];
|
||||
$key=$userrow['key'];
|
||||
if($islogin2==1){
|
||||
exit('{"code":-1,"msg":"当前微信已绑定商户ID:'.$uid.',请勿重复绑定!"}');
|
||||
}
|
||||
$session=md5($uid.$key.$password_hash);
|
||||
$expiretime=time()+2592000;
|
||||
$token=authcode("{$uid}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
|
||||
setcookie("user_token", $token, time() + 2592000);
|
||||
$DB->exec("update `pre_user` set `lasttime`=NOW() where `uid`='$uid'");
|
||||
$result=array("code"=>0,"msg"=>"登录成功!正在跳转到用户中心","url"=>"./");
|
||||
}elseif($islogin2==1){
|
||||
$sds=$DB->exec("update `pre_user` set `wx_uid`='$openId' where `uid`='$uid'");
|
||||
$result=array("code"=>0,"msg"=>"已成功绑定微信账号!","url"=>"./editinfo.php");
|
||||
}else{
|
||||
$_SESSION['Oauth_wx_uid']=$openId;
|
||||
$result=array("code"=>0,"msg"=>"请输入商户ID和密钥完成绑定和登录","url"=>"./login.php?connect=true");
|
||||
}
|
||||
unset($_SESSION['openid']);
|
||||
}else{
|
||||
$result=array("code"=>1);
|
||||
}
|
||||
exit(json_encode($result));
|
||||
}
|
||||
|
||||
if(!empty($conf['localurl_wxpay']) && !strpos($conf['localurl_wxpay'],$_SERVER['HTTP_HOST'])){
|
||||
$code_url = $conf['localurl_wxpay'].'user/wxlogin.php?sid='.session_id();
|
||||
}else{
|
||||
$code_url = $siteurl.'user/wxlogin.php?sid='.session_id();
|
||||
}
|
||||
if(isset($_GET['bind'])){
|
||||
$code_url .= '&bind=1';
|
||||
}
|
||||
|
||||
if($islogin2==1 && isset($_GET['unbind'])){
|
||||
$DB->exec("update `pre_user` set `wx_uid`=NULL where `uid`='$uid'");
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('您已成功解绑微信账号!');window.location.href='./editinfo.php';</script>");
|
||||
}
|
||||
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false){
|
||||
|
||||
$redirect_url = isset($_GET['url'])?$_GET['url']:null;
|
||||
if($islogin2==1 && !isset($_GET['bind']) && !isset($_GET['code'])){
|
||||
exit("<script language='javascript'>window.location.href='./{$redirect_url}';</script>");
|
||||
}
|
||||
|
||||
if($conf['login_wx']==0)sysmsg("未开启微信快捷登录");
|
||||
$wxinfo = \lib\Channel::getWeixin($conf['login_wx']);
|
||||
if(!$wxinfo)sysmsg("当前微信公众号不存在");
|
||||
|
||||
try{
|
||||
$tools = new \WeChatPay\JsApiTool($wxinfo['appid'], $wxinfo['appsecret']);
|
||||
$openId = $tools->GetOpenid();
|
||||
}catch(Exception $e){
|
||||
sysmsg($e->getMessage());
|
||||
}
|
||||
$_SESSION['openid'] = $openId;
|
||||
|
||||
$userrow=$DB->getRow("SELECT * FROM pre_user WHERE wx_uid='{$openId}' limit 1");
|
||||
if($userrow){
|
||||
$uid=$userrow['uid'];
|
||||
$key=$userrow['key'];
|
||||
$DB->insert('log', ['uid'=>$uid, 'type'=>'微信快捷登录', 'date'=>'NOW()', 'ip'=>$clientip, 'city'=>$city]);
|
||||
$session=md5($uid.$key.$password_hash);
|
||||
$expiretime=time()+604800;
|
||||
$token=authcode("{$uid}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
|
||||
setcookie("user_token", $token, time() + 604800);
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>window.location.href='./{$redirect_url}';</script>");
|
||||
}elseif($islogin2==1){
|
||||
$sds=$DB->exec("update `pre_user` set `wx_uid`='$openId' where `uid`='$uid'");
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('已成功绑定微信账号!');window.location.href='./editinfo.php';</script>");
|
||||
}else{
|
||||
if(!isset($_GET['bind'])){
|
||||
$_SESSION['Oauth_wx_uid']=$openId;
|
||||
exit("<script language='javascript'>alert('请输入商户ID和密钥完成绑定和登录');window.location.href='./login.php?connect=true';</script>");
|
||||
}else{
|
||||
exit("<script language='javascript'>alert('微信账号绑定成功');</script>");
|
||||
}
|
||||
}
|
||||
}elseif($islogin2==1 && !isset($_GET['bind'])){
|
||||
exit("<script language='javascript'>window.location.href='./';</script>");
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>微信登录 | <?php echo $conf['sitename']?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>animate.css/3.5.2/animate.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic?>simple-line-icons/2.4.1/css/simple-line-icons.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/font.css" type="text/css" />
|
||||
<link rel="stylesheet" href="./assets/css/app.css" type="text/css" />
|
||||
<style>input:-webkit-autofill{-webkit-box-shadow:0 0 0px 1000px white inset;-webkit-text-fill-color:#333;}img.logo{width:14px;height:14px;margin:0 5px 0 3px;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app app-header-fixed ">
|
||||
<div class="container w-xxl w-auto-xs" ng-controller="SigninFormController" ng-init="app.settings.container = false;">
|
||||
<span class="navbar-brand block m-t" id="sitename"><?php echo $conf['sitename']?></span>
|
||||
<div class="m-b-lg">
|
||||
<div class="wrapper text-center">
|
||||
<strong>微信扫码登录</strong>
|
||||
</div>
|
||||
<form name="form" class="form-validation">
|
||||
<div class="text-danger wrapper text-center" ng-show="authError">
|
||||
</div>
|
||||
<div class="form-group" style="text-align: center;">
|
||||
<div class="list-group-item list-group-item-success" style="font-weight: bold;" id="login">
|
||||
<span id="loginmsg">请使用微信扫描二维码登录</span>
|
||||
</div>
|
||||
<div id="qrcode" class="qr-image list-group-item">
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="btn-group">
|
||||
<a href="login.php" class="btn btn-primary btn-rounded"><i class="fa fa-user"></i> 返回登录</a>
|
||||
<a href="reg.php" class="btn btn-info btn-rounded"><i class="fa fa-user-plus"></i> 注册账号</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<p>
|
||||
<small class="text-muted"><a href="/"><?php echo $conf['sitename']?></a><br>© 2016~<?php echo date("Y")?></small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#qrcode').qrcode({
|
||||
text: "<?php echo $code_url?>",
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
setTimeout('checkopenid()', 2000);
|
||||
});
|
||||
function checkopenid(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "wxlogin.php?act=login",
|
||||
success: function (data, textStatus) {
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg, {icon: 16,time: 10000,shade:[0.3, "#000"]});
|
||||
setTimeout(function(){ window.location.href=data.url }, 1000);
|
||||
}else if (data.code == 1) {
|
||||
setTimeout('checkopenid()', 2000);
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('服务器错误', {icon: 2});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||