Merge from upstream

nimaqu_dev
Sukka 8 years ago committed by GitHub
commit 0ac899ae62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,28 +18,10 @@ class Auth
$newResponse = $response->withStatus(302)->withHeader('Location', '/auth/login');
return $newResponse;
}
if ($user->enable == 0 && $_SERVER["REQUEST_URI"] != "/user/disable") {
$newResponse = $response->withStatus(302)->withHeader('Location', '/user/disable');
return $newResponse;
}
if (Config::get('enable_duoshuo')=='true') {
$token = array(
"short_name"=>Config::get('duoshuo_shortname'),
"user_key"=>$user->id,
"name"=>$user->user_name,
"email"=>$user->email
);
$duoshuoToken = JWT::encode_withkey($token, Config::get('duoshuo_apptoken'));
setcookie('duoshuo_token', $duoshuoToken);
}
$response = $next($request, $response);
return $response;
}

@ -614,16 +614,10 @@ class URL
}
public static function getUserTraffic($user, $is_mu = 0){
if(!Config::get('mergeSub')){
if($is_mu == 1){
$group_name = Config::get('appName').' - 单端口';
}else{
$group_name = Config::get('appName');
}
}else{
$group_name = Config::get('appName');
$group_name = Config::get('appName');
if(!Config::get('mergeSub') and $is_mu == 1){
$group_name .= ' - 单端口';
}
if($user->class !=0){
$ssurl = "www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("剩余流量:".number_format(($user->transfer_enable-($user->u+$user->d))/$user->transfer_enable*100,2)."% ".$user->unusedTraffic())."&group=".Tools::base64_url_encode($group_name);
}else{
@ -637,7 +631,6 @@ class URL
if(!Config::get('mergeSub') and $is_mu == 1){
$group_name .= ' - 单端口';
}
if($user->class !=0){
$ssurl = "www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("过期时间:".$user->class_expire)."&group=".Tools::base64_url_encode($group_name);
}else{

7581
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -6191,158 +6191,6 @@ html.no-touchevents .tile-action-show,html.no-touchevents .tile:hover .tile-acti
min-height: 30px;
} */
/* 卡片式商店样式 */
.ui-switch {
display: flex;
flex-direction: row-reverse;
}
.ui-switch.node-switch {
position: absolute;
right: 2.5em;
top: 1.5em;
z-index: 1;
}
.switch-btn {
width: 50%;
box-sizing: border-box;
}
.ui-switch a {
color: #000;
display: inline-block;
padding: 0 10px;
}
.ui-switch div.switch-btn:first-of-type a {
border-radius: 0 15px 15px 0;
}
.ui-switch div.switch-btn:first-of-type a:hover {
border-radius: 0 5px 5px 0;
transition-duration: 0.4s;
}
.ui-switch div.switch-btn:last-of-type a {
border-radius: 15px 0 0 15px;
}
.ui-switch div.switch-btn:last-of-type a:hover {
border-radius: 5px 0 0 5px;
transition-duration: 0.4s;
}
.ui-switch a:hover {
color: white;
background: gray;
}
.ui-switch a i {
position: relative;
top: 3px;
}
.ui-switch .card,.ui-switch .card-inner {
margin: 0;
}
.shop-flex,.label-flex {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
opacity: 1;
}
.shop-table,.shop-flex {
opacity: 1;
display: none;
/* display:flex;原本的display方式 */
/* display:flex; */
}
.shop-flex .card {
width: 24%;
text-align: center;
min-height: 380px;
}
.shop-flex .card-main {
position: relative;
}
.shop-name,.shop-price {
padding: .8em 0;
}
.shop-price {
border-top: 1px solid #a7a7a7;
border-bottom: 1px solid #a7a7a7;
background: #f6f9fc;
font-size: 13px;
}
.shop-price code {
font-size: 24px;
background: none;
font-style: italic;
color: #ffa100;
}
.shop-content div {
margin: 0 15px .7em 15px;
}
.shop-content-div:before,.shop-content-div:after {
content: " - ";
}
.shop-content {
margin-top: 1.5em;
font-size: 13px;
}
.shop-name {
margin-top: .3em;
font-size: 24px;
}
.shop-btn {
margin-top: 1em;
padding: 10px 2em;
width: 70%;
margin-bottom: 2em;
}
.flex-fix3,.flex-fix4 {
width: 24%;
}
.page-course img {
width: 60%;
}
@media screen and (max-width: 1600px) {
.shop-flex .card,.flex-fix3 {
width: 32%;
}
.flex-fix4 {
display: none;
}
}
@media screen and (max-width: 1440px) {
.shop-flex .card {
width: 48%;
}
.page-course img {
width: 80%;
}
}
@media screen and (max-width: 715px) {
.shop-flex .card {
width: 100%;
}
.page-course img {
width: 100%;
}
}
.bgc-fix {
background: white;
}

@ -1,3 +1,246 @@
/* 卡片式商店样式 */
.ui-switch {
display: flex;
flex-direction: row-reverse;
}
.ui-switch.node-switch {
position: absolute;
right: 2.5em;
top: 1.5em;
z-index: 1;
}
.switch-btn {
width: 50%;
box-sizing: border-box;
}
.ui-switch a {
color: #000;
display: inline-block;
padding: 0 10px;
}
.ui-switch div.switch-btn:first-of-type a {
border-radius: 0 15px 15px 0;
}
.ui-switch div.switch-btn:first-of-type a:hover {
border-radius: 0 5px 5px 0;
transition-duration: 0.4s;
}
.ui-switch div.switch-btn:last-of-type a {
border-radius: 15px 0 0 15px;
}
.ui-switch div.switch-btn:last-of-type a:hover {
border-radius: 5px 0 0 5px;
transition-duration: 0.4s;
}
.ui-switch a:hover {
color: white;
background: gray;
}
.ui-switch a i {
position: relative;
top: 3px;
}
.ui-switch .card,.ui-switch .card-inner {
margin: 0;
}
.shop-flex,.label-flex,.shop-drop {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
opacity: 1;
}
.shop-table,.shop-flex {
opacity: 1;
display: none;
/* display:flex;原本的display方式 */
/* display:flex; */
}
.shop-table {
margin-top: 14px;
position: relative;
}
.shop-table .card {
width: 100%;
margin: 10px 0 0 0;
padding: 1em 1em;
border-radius: 10px 10px 0 0;
cursor: pointer;
grid-area: main;
}
.shop-table .shop-btn {
width: 100%;
margin-top: 0;
margin-bottom: 0;
border-radius: 0 0 10px 10px;
padding: 8px 2em;
grid-area: button;
}
.shop-drop {
grid-area: drop;
background: white;
padding: 1em 1.5em;
box-shadow: 0 0px 0 #e5e5e5, 0 2px 5px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.05);
}
.shop-table .shop-name {
padding: 0;
margin: 0;
font-size: 18px;
}
.shop-table,.shop-table .card {
flex-wrap: wrap;
justify-content: space-between;
}
.shop-table .card-tag {
margin-right: 8px;
}
.shop-table .card>div {
display: flex;
flex-wrap: wrap;
flex-basis: 80%;
align-items: center;
}
.shop-table .card>div:last-of-type {
flex-basis: 10%;
}
.shop-table span {
font-size: 18px;
margin: 2px 8px 0 8px;
}
.shop-gridarea {
display: grid;
width: 100%;
position: relative;
transition: .3s all;
grid-template-columns: 100%;
grid-template-rows: auto 0px auto;
grid-template-areas:
"main"
"drop"
"button"
}
.shop-drop .card-tag {
flex-basis: 49%;
margin: 5px 0 0 0;
text-align: center;
}
.shop-flex .card {
width: 24%;
text-align: center;
min-height: 380px;
}
.shop-flex .card-main {
position: relative;
}
.shop-name,.shop-price {
padding: .8em 0;
}
.shop-price {
border-top: 1px solid #a7a7a7;
border-bottom: 1px solid #a7a7a7;
background: #f6f9fc;
font-size: 13px;
}
.shop-price code {
font-size: 24px;
background: none;
font-style: italic;
color: #ffa100;
}
.shop-content div {
margin: 0 15px .7em 15px;
}
.shop-content-div:before,.shop-content-div:after {
content: " - ";
}
.shop-content {
margin-top: 1.5em;
font-size: 13px;
}
.shop-name {
margin-top: .3em;
font-size: 24px;
}
.shop-btn {
margin-top: 1em;
padding: 10px 2em;
width: 70%;
margin-bottom: 2em;
}
.flex-fix3,.flex-fix4 {
width: 24%;
}
.page-course img {
width: 60%;
}
@media screen and (max-width: 1600px) {
.shop-flex .card,.flex-fix3 {
width: 32%;
}
.flex-fix4 {
display: none;
}
}
@media screen and (max-width: 1440px) {
.shop-flex .card {
width: 48%;
}
.page-course img {
width: 80%;
}
}
@media screen and (max-width: 715px) {
.shop-flex .card {
width: 100%;
}
.page-course img {
width: 100%;
}
}
@media screen and (max-width:400px) {
.nodemain {
max-width: 240px;
}
.shop-table .card-tag,.shop-table span {
flex-basis: 40%;
text-align: center;
margin: 5px 8px 0 0;
}
.shop-table .shop-name {
flex-basis: 100%;
}
.shop-drop .card-tag {
flex-basis: 49%;
margin: 5px 0;
}
}
/* 面板原样式 */
.ui-card-wrap:after,.ui-picker-lib:after {
clear: both
}
@ -290,6 +533,10 @@ ul.dropdown-menu {
min-width: 130px;
}
.modal-inner p {
word-break: break-word;
}
/* 卡片节点 */
.nodelist {
@ -606,23 +853,38 @@ div.nodetitle:first-of-type>a {
position: relative;
top: 1px;
}
a.card-tag {
/* 仿iview标签 */
a.card-tag,.card-tag {
font-size: 12px;
text-decoration: none;
padding: 1px 6px 0;
border-radius: 3px;
border: 1px solid;
height: 23px;
}
.card-tag:hover {
opacity: .85;
}
a.tag-orange {
a.tag-orange,.tag-orange {
background: #fff2e8;
color: #fa541c;
border-color: #ffd591;
}
a.tag-green {
a.tag-green,.tag-green {
background: #f6ffed;
color: #52c41a;
border-color: #b7eb8f;
}
a.tag-black,.tag-black {
background: #f7f7f7;
color: #515a6e;
border-color: #a6a7a9;
}
a.tag-gold,.tag-gold {
background: #fffbe6;
color: #faad14;
border-color: #ffe58f;
}
.card-invite .form-group-label {
margin-bottom: 16px;
@ -663,13 +925,24 @@ a.tag-green {
.fade-delay {
transition-delay: .3s
}
/* */
@media screen and (max-width:400px) {
.nodemain {
max-width: 240px;
}
/* 下拉菜单插件 */
/* .dropdown-hide {
display: none;
} */
.dropdown-area {
height: 0;
opacity: 0;
transform: scale(1,0);
transition: .3s all;
transform-origin: top;
}
.dropdown-area.dropdown-active {
transform: scale(1,1);
opacity: 1;
height: auto;
}
@media screen and (max-width:320px) {
.card-heading {
font-size: 18px;
@ -697,6 +970,40 @@ a.tag-green {
}
}
@media only screen and (min-width:480px) {
.shop-table .card {
flex-basis: 80%;
border-radius: 10px 0 0 10px;
}
.shop-table .shop-btn {
border-radius: 0 30px 30px 0;
flex-basis: 20%;
margin-top: 10px;
padding: 16px 2em 16px 1.5em;
}
.shop-table .shop-btn:hover {
border-radius: 0 10px 10px 0;
}
.shop-table .card>div:last-of-type {
flex-basis: 2%;
}
.shop-gridarea {
width: 100%;
grid-template-columns: 80% 20%;
grid-template-rows: auto 0px;
grid-template-areas:
"main button"
"drop block"
}
.shop-drop {
border-radius: 10px;
padding: 1em 1.5em;
margin: 5px 0 1em 0;
box-shadow: 0 0px 0 #e5e5e5, 0 0 15px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.05);
}
}
@media only screen and (min-width:768px) {
.ui-card-pre {
min-height: 189px
@ -711,7 +1018,7 @@ a.tag-green {
.nodetitle {
grid-column-end: 3;
grid-column-start: 1;
}
}
}
@media only screen and (min-width:992px) {
@ -738,4 +1045,8 @@ a.tag-green {
.card-invite {
min-height: 266px;
}
.shop-gridarea {
width: 100%;
grid-template-columns: 87% 13%;
}
}

@ -92,5 +92,29 @@ $(function(){
},600);
}
}
}
//传入两个对象,分别为下拉按钮和菜单
function custDropdown(button,dropdownarea) {
listenDown();
function listenDown() {
button.addEventListener("click",()=>{
if (!dropdownarea.classList.contains('dropdown-active')) {
// dropdownarea.classList.remove('dropdown-hide');
requestAnimationFrame(()=>{
dropdownarea.classList.add('dropdown-active');
});
} else {
requestAnimationFrame(()=>{
dropdownarea.classList.remove('dropdown-active');
})
// setTimeout(()=>{
// dropdownarea.classList.add('dropdown-hide');
// },100);
}
});
}
}

@ -1,4 +1,4 @@
{include file='header.tpl'}
{include file='header.tpl'}
{* <main class="content">
<div class="container">
@ -142,7 +142,7 @@
<p id="telegram-alert">正在载入 Telegram,如果长时间未显示请刷新页面或检查代理</p>
<div class="text-center" id="telegram-login-box"></div>
<p>或者添加机器人账号 <a href="https://t.me/{$telegram_bot}">@{$telegram_bot}</a>,发送下面的数字给它。
</p>
</p>
<div class="text-center">
<h2><code id="code_number">{$login_number}</code></h2>
</div>
@ -250,7 +250,7 @@
</div>
</div>
<div class="card-inner">
<div class="text-center">
<p>一键登陆</p>
</div>
@ -261,7 +261,7 @@
<div class="text-center">
<h2><code id="code_number">{$login_number}</code></h2>
</div>
</div>
</div>
<div class="tab-pane fade" id="qrcode_login">
@ -271,7 +271,7 @@
</div>
</div>
<div class="card-inner">
<p>添加机器人账号 <a href="https://t.me/{$telegram_bot}">@{$telegram_bot}</a>,拍下下面这张二维码发给它。
</p>
<div class="form-group form-group-label">
@ -279,14 +279,14 @@
<div id="telegram-qr"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -389,6 +389,11 @@
</script>
<script>
$(document).ready(function () {
$("#calltgauth").click(
function(){
f();
}
);
function f() {
$.ajax({
type: "GET",
@ -437,10 +442,10 @@
}
}
});
tid = setTimeout(f, 1000); //循环调用触发setTimeout
tid = setTimeout(f, 2500); //循环调用触发setTimeout
}
setTimeout(f, 1000);
})
</script>
{/if}

@ -78,36 +78,46 @@
<div class="flex-fix4"></div>
</div>
<div class="card shop-table">
<div class="card-main">
<div class="card-inner">
<div class="card-table">
<div class="table-responsive table-user">
{$shops->render()}
<table class="table">
<tr>
<th>套餐</th>
<th>价格</th>
<th>套餐详情</th>
<th>操作</th>
</tr>
{foreach $shops as $shop}
<tr>
<td>{$shop->name}</td>
<td>{$shop->price} 元</td>
<td>{$shop->content()}</td>
<td>
<a class="btn btn-brand-accent" href="javascript:void(0);" onClick="buy('{$shop->id}',{$shop->auto_renew})">购买</a>
</td>
</tr>
{/foreach}
</table>
{$shops->render()}
</div>
</div>
</div>
</div>
<div class="shop-table">
{$shops->render()}
{foreach $shops as $shop}
<div class="shop-gridarea">
<div class="card">
<div>
<div class="shop-name"> <span>{$shop->name}</span></div>
<div class="card-tag tag-gold">VIP {$shop->user_class()}</div>
<div class="card-tag tag-orange">{$shop->price} 元</div>
</div>
<div>
<i class="material-icons">expand_more</i>
</div>
</div>
<a class="btn btn-brand-accent shop-btn" href="javascript:void(0);" onClick="buy('{$shop->id}',{$shop->auto_renew})">购买</a>
<div class="shop-drop dropdown-area">
<div class="card-tag tag-black">添加流量</div> <div class="card-tag tag-green">{$shop->bandwidth()} G</div>
<div class="card-tag tag-black">等级有效期</div> <div class="card-tag tag-green">{$shop->class_expire()} 天</div>
<div class="card-tag tag-black">账号有效期</div> <div class="card-tag tag-green">{$shop->expire()} 天</div>
{if {$shop->reset()} == '0' }
<div class="card-tag tag-black">重置周期</div> <div class="card-tag tag-green">N/A</div>
{else}
<div class="card-tag tag-black">重置周期</div> <div class="card-tag tag-green">{$shop->reset_exp()} 天</div>
<div class="card-tag tag-black">重置频率</div><div class="card-tag tag-green">{$shop->reset_value()}G/{$shop->reset()}天</div>
{/if}
{if {$shop->speedlimit()} == '0' }
<div class="card-tag tag-black">端口速率</div> <div class="card-tag tag-green">无限制</div>
{else}
<div class="card-tag tag-black">端口限速</div> <div class="card-tag tag-green">{$shop->speedlimit()} Mbps</div>
{/if}
{if {$shop->connector()} == '0' }
<div class="card-tag tag-black">客户端数量</div> <div class="card-tag tag-green">无限制</div>
{else}
<div class="card-tag tag-black">客户端限制</div> <div class="card-tag tag-green">{$shop->connector()} 个</div>
{/if}
</div>
</div>
{/foreach}
{$shops->render()}
</div>
@ -253,7 +263,25 @@ function buy(id,auto) {
};
defaultUI = JSON.stringify(defaultUI);
localStorage.setItem("tempUIshop",defaultUI);
});
});
let dropDownGridArea = document.querySelectorAll('.shop-gridarea');
let dropDownButton = document.querySelectorAll('.shop-table .card');
let dropDownArea = document.querySelectorAll('.dropdown-area');
let buyButton = document.querySelectorAll('.btn.shop-btn');
for (let i=0;i<dropDownButton.length;i++) {
dropDownButton[i].addEventListener('click',()=>{
if (window.getComputedStyle(dropDownGridArea[i]).gridTemplateRows == dropDownButton[i].offsetHeight + 10 + 'px 0px 36px') {
dropDownGridArea[i].style.gridTemplateRows = 'auto auto';
} else if (window.getComputedStyle(dropDownGridArea[i]).gridTemplateRows == dropDownButton[i].offsetHeight + 10 + 'px 0px') {
dropDownGridArea[i].style.gridTemplateRows = 'auto auto';
} else {
dropDownGridArea[i].style.gridTemplateRows = 'auto 0px';
}
});
custDropdown(dropDownButton[i], dropDownArea[i]);
}
})();

Loading…
Cancel
Save