first commit

This commit is contained in:
云泽网 2025-04-27 10:56:38 +08:00
commit 4c3e17d851
796 changed files with 115572 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/.idea
/.vscode
*.log
.env

1
.htaccess Normal file
View File

@ -0,0 +1 @@

42
.travis.yml Normal file
View File

@ -0,0 +1,42 @@
sudo: false
language: php
branches:
only:
- stable
cache:
directories:
- $HOME/.composer/cache
before_install:
- composer self-update
install:
- composer install --no-dev --no-interaction --ignore-platform-reqs
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
- composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
- composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
script:
- php think unit
deploy:
provider: releases
api_key:
secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
file:
- ThinkPHP_Core.zip
- ThinkPHP_Full.zip
skip_cleanup: true
on:
tags: true

1
.user.ini Normal file
View File

@ -0,0 +1 @@
open_basedir=/www/wwwroot/zf.yunzer.cn/:/tmp/

View File

@ -0,0 +1 @@
cwqBZcZwyBKeAsUuItwL0D5iMVB3HlsnsMNeLJ03e48.AYcoB9mjvyHsMDRQrxEJvsZaIEtDHEkl0Hqed5s-LUI

9
404.html Normal file
View File

@ -0,0 +1,9 @@
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

220
README.md Normal file
View File

@ -0,0 +1,220 @@
V免签 —— 个人开发者收款解决方案
===============
V免签(PHP) 是基于Thinkphp5.1 + mysql 实现的一套免签支付程序,主要包含以下特色:
+ 收款即时到账,无需进入第三方账户,收款更安全
+ 提供示例代码简单接入
+ 超简单Api使用提供统一Api实现收款回调
+ 免费、开源,无后门风险
+ 支持监听店员收款信息,可使用支付宝微信小号/模拟器挂机方便IOS用户
+ 免root免xp框架不修改支付宝/微信客户端,防封更安全
> 如果您不熟悉PHP环境的配置您可以使用Java版本的服务端 https://github.com/szvone/Vmq
> 监控端的开源地址位于: https://github.com/szvone/VmqApk
> V免签的运行环境为PHP版本>=5.6。
> V免签仅供个人开发者调试测试使用请勿用于非法用途商用请您申请官方商户接口
> v免签开发交流群992029073 群已被封作者QQ7876632【问功能怎样的别加我不回答免费开源系统自行搭建测试不提供技术支持】
> bug反馈请建立issues
## 前言
V免签为完全开源项目开源项目意味着作者没有任何收入来源仅凭个人空闲时间开发如果您有经济条件您可以赞助本项目的开发下方收款码如果您不想赞助也请您点击上面的Star给一个星星也是对我莫大的认同感谢各位的支持。
![微信赞助](wx.jpg)![支付宝赞助](zfb.jpg)
## 原理
+ 用户扫码付款 -> 收到款项后手机通知栏会有提醒 -> V免签监控端监听到提醒推送至服务端->服务端根据金额判断是哪笔订单
## 安装
+ 推荐使用宝塔面板安装,以下教程为宝塔面板安装教程,其他环境请参考自行配置
1、下载源代码,Clone or download->Download ZIP
2、宝塔面板中新建网站设置
+ 网站目录->运行目录 设置为public并保存
+ 伪静态 设置为thinkphp并保存
+ 默认文档 设置将index.html放在第一行并保存
3、打开网站目录 config/database.php 设置好您的mysql账号密码。
4、导入数据库文件位于根目录vmq.sql到您的数据库。
5、至此网站搭建完毕请访问后自行修改配置信息默认后台账号和密码均为admin
> 升级说明:请您直接下载新版本覆盖旧版本即可!
## 调用
+ 请部署完成后访问后台有详细的Api说明
## 注意
+ 本系统原理为监控收款后手机的通知栏推送消息,所以请保持微信/支付宝/V免签监控端后台正常运行且添加到内存清理白名单
+ v免签面向用户是个人开发者如果您不懂如何开发网站那么v免签不适合您的使用
+ v免签的原理是监控手机收到收款后的通知栏推送信息所以不适合于商用多用户的情况如果您想用于商用请二次开发
+ v免签是免费开源产品所有程序均开放源代码所以不会有收费计划因此作者不可能教会每个人部署安装请参考文档多百度谷歌v免签使用具有一定的技术门槛请见谅
+ v免签的监控端并不适配所有手机遇到手机无法正常使用的时候请您更换手机或使用模拟器挂机
+ v免签拥有双语言服务端当您使用php版本服务端遇到问题的时候请您尝试使用java版本服务端php版本服务端配置略复杂需要配置伪静态规则请知悉
+ 正常的安装步骤简略如下
+ 下载服务端部署(GitHub中下载的为最新版)
+ 登录网站后台更改系统设置
+ 打开网站后台监控端设置
+ 下载监控端
+ 安装监控端后使用手动配置或扫码配置
+ 监控端中点击开启服务跳转到辅助功能中开启服务
+ 开启服务后返回v免签点击检测监听权限
+ 如果显示监听权限正常,至此安装完毕,如果只收到通知栏推送的测试通知,则系统不兼容无法正常监听
+ 如果显示监听权限正常,还是无法正常运行,那么请确定微信是否关注 “微信支付” 和 “微信收款助手” 这两个公众号
+ 手机设置步骤教程为MIUI系统非MIUI系统请参考教程进行设置
+ 关闭系统神隐模式
旧版MIUI系统在系统【设置】 - 【其他高级设置】 - 【电量与性能】 - 【神隐模式】 - 【V免签监控端】设置为关闭
新版MIUI系统在系统【设置】 - 【其他高级设置】 - 【电量与性能】 - 【省电优化】 - 【应用智能省电】将V免签监控端、微信、支付宝的3个APP全都改为无限制
+ 添加内存清理白名单
+ 关闭WIFI优化
旧版MIUI系统在系统【设置】 - 【WLAN】 -【高级设置】 -【WLAN优化】关闭它。
新版MIUI系统在系统【设置】 - 【WLAN】 -【高级设置】 - 【在休眠状态下保持WLAN网络连接】改为“始终”
+ 开启推送通知
系统【设置】 - 【通知和状态栏】 - 【通知管理】中找到这3个App把里面的开关全部打开
+ 在微信的【设置】 - 【勿扰模式】中,关闭勿扰模式
+ 在微信的公众号,关注 【微信收款助手】 这个公众号
+ 在支付宝的主页,上方搜索框 搜索 【支付助手】 ,进入支付助手,右上角小齿轮,打开【接收付款消息提醒】
+ v免签支持的通知有
+ 支付宝个人收款的推送通知
+ 支付宝商家二维码的收款推送通知
+ 支付宝店员通绑定的店员账号收款的推送通知
+ 微信二维码收款推送通知
+ 微信店员收款推送通知
## 更新记录
+ v1.122020.01.30
+ 增加一些提示信息
+ v1.112019.10.28
+ 修复上传二维码一直卡在处理中
+ 如二维码无法正常识别,请给/public/qr-code/test.php设置777权限
+ v1.10.12019.09.16
+ 增加版本更新提示
+ v1.102019.09.15
+ 调整二维码识别方案,提升二维码识别率
+ 增加第一次安装时,系统自动生成通讯密钥的功能
+ v1.9.12019.09.15
+ 二维码识别出错增加解决方法:在其他网站(草料二维码识别)识别二维码内容后,将内容重新生成成二维码图片上传。
+ v1.92019.09.11
+ 修复一些已知的BUG
+ 因为很多人的服务器时间不准确,因此删除时间校验,不会出现客户端时间错误了
+ 增加主页服务器基本配置的显示列表
+ v1.8.12019.05.22
+ 增加详细的手机端设置教程
+ 同步最新版监控端App
+ v1.82019.05.16
+ 更新监控端APP到1.6版本,理论支持更多手机
+ 尝试修复偶然情况下锁定金额无法被释放的问题
+ v1.7.22019.05.12
+ 修复当通知地址带有GET参数的时候无法正常通知的问题
+ v1.7.12019.05.07
+ 修复上个版本更新后订单金额异常的问题
+ v1.72019.05.06
+ 修复部分情况下无法自动释放被锁定金额的情况本版本数据库有变动旧版升级请覆盖文件后将tmp_price表中增加一列字段名为oid类型varchar(255),如果您不会增加请删除原有数据库并重新导入vmq.sql
+ v1.6.22019.04.30
+ 修复部分情况下出现订单已过期,但是页面还在倒计时的问题
+ v1.6.12019.04.26
+ 再次优化二维码识别使用js解析二维码如果失败则使用PHP解析
+ v1.62019.04.25
+ 优化二维码识别使用js解析二维码解决部分二维码识别返回false问题
+ v1.52019.04.24
+ 同步最新版APP
+ 添加注意事项说明完善README.md文档
+ v1.4.12019.04.22
+ 修复删除未支付状态的订单时不自动释放锁定金额的问题
+ 修复创建订单时返回的二维码与支付方式不符合的问题
+ v1.42019.04.21
+ 修复订单过期不自动释放锁定金额的问题
+ 修复订单超出负荷问题
+ v1.32019.04.20
+ 删除数据库文件中的默认系统设置,防止误导用户
+ 更新监控App到v1.3版本,趋于稳定,可以正常使用
+ v1.22019.04.19
+ 整理代码重新优化APP兼容性
+ 添加店员到账支持,添加后可以实现安卓备用机/模拟器 挂小号取收款通知方便IOS用户
+ 微信绑定店员方式=>微信->收付款->二维码收款->收款小账本->添加店员接收通知
+ 支付宝绑定店员方式=>我的->商家服务->店员通->立即添加
+ 服务端修复一堆BUG建议更新到此版本
+ v1.1.12019.04.19
+ 修复后台点击补单,补单成功订单未设置成成功状态
+ 修复后台首页金额统计保留两位小数
+ 修复修改系统设置引发的监控端状态重置问题
+ 新增创建订单API接口增加notifyUrl和returnUrl参数可以在创建订单的时候设置回调接口
+ v1.12019.04.18
+ 打包thinkphp框架上传
+ v1.02019.04.18
+ PHP初版发布
## 版本预告
+ 待v免签测试稳定后将会着手开发对接v免签的发卡平台也是开源免费敬请期待
## 版权信息
V免签遵循 MIT License 开源协议发布,并提供免费使用,请勿用于非法用途。
版权所有Copyright © 2019 by vone (http://szvone.cn)
All rights reserved。

1
application/.htaccess Normal file
View File

@ -0,0 +1 @@
deny from all

View File

@ -0,0 +1,406 @@
<?php
namespace app\admin\controller;
use think\App;
use think\Db;
use think\facade\Session;
use app\service\QrcodeServer;
use Zxing\QrReader;
class Index
{
public function index()
{
return 'by:vone';
}
public function getReturn($code = 1,$msg = "成功",$data = null){
return array("code"=>$code,"msg"=>$msg,"data"=>$data);
}
public function getMain(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$today = strtotime(date("Y-m-d"),time());
$todayOrder = Db::name("pay_order")
->where("create_date >=".$today)
->where("create_date <=".($today+86400))
->count();
$todaySuccessOrder = Db::name("pay_order")
->where("state >=1")
->where("create_date >=".$today)
->where("create_date <=".($today+86400))
->count();
$todayCloseOrder = Db::name("pay_order")
->where("state",-1)
->where("create_date >=".$today)
->where("create_date <=".($today+86400))
->count();
$todayMoney = Db::name("pay_order")
->where("state >=1")
->where("create_date >=".$today)
->where("create_date <=".($today+86400))
->sum("price");
$countOrder = Db::name("pay_order")
->count();
$countMoney = Db::name("pay_order")
->where("state >=1")
->sum("price");
$v = Db::query("SELECT VERSION();");
$v=$v[0]['VERSION()'];
if(function_exists("gd_info")) {
$gd_info = @gd_info();
$gd = $gd_info["GD Version"];
}else{
$gd = '<font color="red">GD库未开启</font>';
}
return json($this->getReturn(1,"成功",array(
"todayOrder"=>$todayOrder,
"todaySuccessOrder"=>$todaySuccessOrder,
"todayCloseOrder"=>$todayCloseOrder,
"todayMoney"=>round($todayMoney,2),
"countOrder"=>$countOrder,
"countMoney"=>round($countMoney),
"PHP_VERSION"=>PHP_VERSION,
"PHP_OS"=>PHP_OS,
"SERVER"=>$_SERVER ['SERVER_SOFTWARE'],
"MySql"=>$v,
"Thinkphp"=>"v".App::VERSION,
"RunTime"=>$this->sys_uptime(),
"ver"=>"v".config("ver"),
"gd"=>$gd,
)));
}
private function sys_uptime() {
$output='';
if (false === ($str = @file("/proc/uptime"))) return false;
$str = explode(" ", implode("", $str));
$str = trim($str[0]);
$min = $str / 60;
$hours = $min / 60;
$days = floor($hours / 24);
$hours = floor($hours - ($days * 24));
$min = floor($min - ($days * 60 * 24) - ($hours * 60));
if ($days !== 0) $output .= $days."";
if ($hours !== 0) $output .= $hours."小时";
if ($min !== 0) $output .= $min."分钟";
return $output;
}
public function checkUpdate(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$ver = $this->getCurl("https://raw.githubusercontent.com/szvone/vmqphp/master/ver");
$ver = explode("|",$ver);
if (sizeof($ver)==2 && $ver[0]!=config("ver")){
return json($this->getReturn(1,"[v".$ver[0]."已于".$ver[1]."发布]","https://github.com/szvone/vmqphp"));
}else{
return json($this->getReturn(0,"程序是最新版"));
}
}
public function getSettings(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$user = Db::name("setting")->where("vkey","user")->find();
$pass = Db::name("setting")->where("vkey","pass")->find();
$notifyUrl = Db::name("setting")->where("vkey","notifyUrl")->find();
$returnUrl = Db::name("setting")->where("vkey","returnUrl")->find();
$key = Db::name("setting")->where("vkey","key")->find();
$lastheart = Db::name("setting")->where("vkey","lastheart")->find();
$lastpay = Db::name("setting")->where("vkey","lastpay")->find();
$jkstate = Db::name("setting")->where("vkey","jkstate")->find();
$close = Db::name("setting")->where("vkey","close")->find();
$payQf = Db::name("setting")->where("vkey","payQf")->find();
$wxpay = Db::name("setting")->where("vkey","wxpay")->find();
$zfbpay = Db::name("setting")->where("vkey","zfbpay")->find();
if ($key['vvalue']==""){
$key['vvalue'] = md5(time());
Db::name("setting")->where("vkey","key")->update(array(
"vvalue"=>$key['vvalue']
));
}
return json($this->getReturn(1,"成功",array(
"user"=>$user['vvalue'],
"pass"=>$pass['vvalue'],
"notifyUrl"=>$notifyUrl['vvalue'],
"returnUrl"=>$returnUrl['vvalue'],
"key"=>$key['vvalue'],
"lastheart"=>$lastheart['vvalue'],
"lastpay"=>$lastpay['vvalue'],
"jkstate"=>$jkstate['vvalue'],
"close"=>$close['vvalue'],
"payQf"=>$payQf['vvalue'],
"wxpay"=>$wxpay['vvalue'],
"zfbpay"=>$zfbpay['vvalue'],
)));
}
public function saveSetting(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
Db::name("setting")->where("vkey","user")->update(array("vvalue"=>input("user")));
Db::name("setting")->where("vkey","pass")->update(array("vvalue"=>input("pass")));
Db::name("setting")->where("vkey","notifyUrl")->update(array("vvalue"=>input("notifyUrl")));
Db::name("setting")->where("vkey","returnUrl")->update(array("vvalue"=>input("returnUrl")));
Db::name("setting")->where("vkey","key")->update(array("vvalue"=>input("key")));
Db::name("setting")->where("vkey","close")->update(array("vvalue"=>input("close")));
Db::name("setting")->where("vkey","payQf")->update(array("vvalue"=>input("payQf")));
Db::name("setting")->where("vkey","wxpay")->update(array("vvalue"=>input("wxpay")));
Db::name("setting")->where("vkey","zfbpay")->update(array("vvalue"=>input("zfbpay")));
return json($this->getReturn());
}
public function addPayQrcode(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$db = Db::name("pay_qrcode")->insert(array(
"type"=>input("type"),
"pay_url"=>input("pay_url"),
"price"=>input("price"),
));
return json($this->getReturn());
}
public function getPayQrcodes(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$page = input("page");
$size = input("limit");
$obj = Db::table('pay_qrcode')->page($page,$size);
$obj = $obj->where("type",input("type"));
$array = $obj->order("id","desc")->select();
//echo $obj->getLastSql();
return json(array(
"code"=>0,
"msg"=>"获取成功",
"data"=>$array,
"count"=> $obj->count()
));
}
public function delPayQrcode(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
Db::name("pay_qrcode")->where("id",input("id"))->delete();
return json($this->getReturn());
}
public function getOrders(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$page = input("page");
$size = input("limit");
$obj = Db::table('pay_order')->page($page,$size);
if (input("type")){
$obj = $obj->where("type",input("type"));
}
if (input("state")){
$obj = $obj->where("state",input("state"));
}
$array = $obj->order("id","desc")->select();
//echo $obj->getLastSql();
return json(array(
"code"=>0,
"msg"=>"获取成功",
"data"=>$array,
"count"=> $obj->count()
));
}
public function delOrder(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$res = Db::name("pay_order")->where("id",input("id"))->find();
Db::name("pay_order")->where("id",input("id"))->delete();
if ($res['state']==0){
Db::name("tmp_price")
->where("oid",$res['order_id'])
->delete();
}
return json($this->getReturn());
}
public function setBd(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$res = Db::name("pay_order")->where("id",input("id"))->find();
if ($res){
$url = $res['notify_url'];
$res2 = Db::name("setting")->where("vkey","key")->find();
$key = $res2['vvalue'];
$p = "payId=".$res['pay_id']."&param=".$res['param']."&type=".$res['type']."&price=".$res['price']."&reallyPrice=".$res['really_price'];
$sign = $res['pay_id'].$res['param'].$res['type'].$res['price'].$res['really_price'].$key;
$p = $p . "&sign=".md5($sign);
if (strpos($url,"?")===false){
$url = $url."?".$p;
}else{
$url = $url."&".$p;
}
$re = $this->getCurl($url);
if ($re=="success"){
if ($res['state']==0){
Db::name("tmp_price")
->where("oid",$res['order_id'])
->delete();
}
Db::name("pay_order")->where("id",$res['id'])->update(array("state"=>1));
return json($this->getReturn());
}else{
return json($this->getReturn(-2,"补单失败",$re));
}
}else{
return json($this->getReturn(-1,"订单不存在"));
}
}
public function delGqOrder(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
Db::name("pay_order")->where("state","-1")->delete();
return json($this->getReturn());
}
public function delLastOrder(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
Db::name("pay_order")->where("create_date <".(time()-604800))->delete();
return json($this->getReturn());
}
public function enQrcode($url){
$qr_code = new QrcodeServer(['generate'=>"display","size",200]);
$content = $qr_code->createServer($url);
return response($content,200,['Content-Length'=>strlen($content)])->contentType('image/png');
}
//获取客户IP
public function ip() {
return $_SERVER['REMOTE_ADDR'];
}
//发送Http请求
function getCurl($url, $post = 0, $cookie = 0, $header = 0, $nobaody = 0)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$klsf[] = 'Accept:*/*';
$klsf[] = 'Accept-Language:zh-cn';
//$klsf[] = 'Content-Type:application/json';
$klsf[] = 'User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C153 MicroMessenger/6.6.1 NetType/WIFI Language/zh_CN';
$klsf[] = 'Referer:'.$url;
curl_setopt($ch, CURLOPT_HTTPHEADER, $klsf);
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 ($nobaody) {
curl_setopt($ch, CURLOPT_NOBODY, 1);
}
curl_setopt($ch, CURLOPT_TIMEOUT,60);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
}

12
application/command.php Normal file
View File

@ -0,0 +1,12 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
return [];

12
application/common.php Normal file
View File

@ -0,0 +1,12 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 应用公共文件

View File

@ -0,0 +1,615 @@
<?php
namespace app\index\controller;
use think\Db;
use think\facade\Session;
class Index
{
public function index()
{
$url = "http://www.5cctv.net/wp-content/plugins/erphpdown/payment/vmq/notify.php?payId=190717101020112222981&param=order[7876632]&type=1&price=1&reallyPrice=1&sign=2398a2492db0616381a85c1fedc51a11";
return $this->getCurl($url);
//return 'by:vone';
}
public function getReturn($code = 1, $msg = "成功", $data = null)
{
return array("code" => $code, "msg" => $msg, "data" => $data);
}
//后台用户登录
public function login()
{
$user = input("user");
$pass = input("pass");
$_user = Db::name("setting")->where("vkey", "user")->find();
if ($user != $_user["vvalue"]) {
return json($this->getReturn(-1, "账号或密码错误"));
}
$_pass = Db::name("setting")->where("vkey", "pass")->find();
if ($pass != $_pass["vvalue"]) {
return json($this->getReturn(-1, "账号或密码错误"));
}
Session::set("admin", 1);
return json($this->getReturn());
}
//后台菜单
public function getMenu()
{
if (!Session::has("admin")) {
return json($this->getReturn(-1, "没有登录"));
}
$menu = array(
array(
"name" => "系统设置",
"type" => "url",
"url" => "admin/setting.html?t=" . time(),
),
array(
"name" => "监控端设置",
"type" => "url",
"url" => "admin/jk.html?t=" . time(),
),
array(
"name" => "微信二维码",
"type" => "menu",
"node" => array(
array(
"name" => "添加",
"type" => "url",
"url" => "admin/addwxqrcode.html?t=" . time(),
),
array(
"name" => "管理",
"type" => "url",
"url" => "admin/wxqrcodelist.html?t=" . time(),
)
),
), array(
"name" => "支付宝二维码",
"type" => "menu",
"node" => array(
array(
"name" => "添加",
"type" => "url",
"url" => "admin/addzfbqrcode.html?t=" . time(),
),
array(
"name" => "管理",
"type" => "url",
"url" => "admin/zfbqrcodelist.html?t=" . time(),
)
),
), array(
"name" => "订单列表",
"type" => "url",
"url" => "admin/orderlist.html?t=" . time(),
), array(
"name" => "Api说明",
"type" => "url",
"url" => "api.html?t=" . time(),
)
);
return json($menu);
}
//创建订单
public function createOrder()
{
$this->closeEndOrder();
$payId = input("payId");
if (!$payId || $payId == "") {
return json($this->getReturn(-1, "请传入商户订单号"));
}
$type = input("type");
if (!$type || $type == "") {
return json($this->getReturn(-1, "请传入支付方式=>1|微信 2|支付宝"));
}
if ($type != 1 && $type != 2) {
return json($this->getReturn(-1, "支付方式错误=>1|微信 2|支付宝"));
}
$price = input("price");
if (!$price || $price == "") {
return json($this->getReturn(-1, "请传入订单金额"));
}
if ($price <= 0) {
return json($this->getReturn(-1, "订单金额必须大于0"));
}
$sign = input("sign");
if (!$sign || $sign == "") {
return json($this->getReturn(-1, "请传入签名"));
}
$isHtml = input("isHtml");
if (!$isHtml || $isHtml == "") {
$isHtml = 0;
}
$param = input("param");
if (!$param) {
$param = "";
}
$res = Db::name("setting")->where("vkey", "key")->find();
$key = $res['vvalue'];
if (input("notifyUrl")) {
$notify_url = input("notifyUrl");
} else {
$res = Db::name("setting")->where("vkey", "notifyUrl")->find();
$notify_url = $res['vvalue'];
}
if (input("returnUrl")) {
$return_url = input("returnUrl");
} else {
$res = Db::name("setting")->where("vkey", "returnUrl")->find();
$return_url = $res['vvalue'];
}
$_sign = md5($payId . $param . $type . $price . $key);
if ($sign != $_sign) {
return json($this->getReturn(-1, "签名错误"));
}
$jkstate = Db::name("setting")->where("vkey", "jkstate")->find();
$jkstate = $jkstate['vvalue'];
if ($jkstate!="1"){
return json($this->getReturn(-1, "监控端状态异常,请检查"));
}
$reallyPrice = bcmul($price ,100);
$payQf = Db::name("setting")->where("vkey", "payQf")->find();
$payQf = $payQf['vvalue'];
$orderId = date("YmdHms") . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9);
$ok = false;
for ($i = 0; $i < 10; $i++) {
$tmpPrice = $reallyPrice . "-" . $type;
$row = Db::execute("INSERT IGNORE INTO tmp_price (price,oid) VALUES ('" . $tmpPrice . "','".$orderId."')");
if ($row) {
$ok = true;
break;
}
if ($payQf == 1) {
$reallyPrice++;
} else if ($payQf == 2) {
$reallyPrice--;
}
}
if (!$ok) {
return json($this->getReturn(-1, "订单超出负荷,请稍后重试"));
}
//echo $reallyPrice;
$reallyPrice = bcdiv($reallyPrice, 100,2);
if ($type == 1) {
$payUrl = Db::name("setting")->where("vkey", "wxpay")->find();
$payUrl = $payUrl['vvalue'];
} else if ($type == 2) {
$payUrl = Db::name("setting")->where("vkey", "zfbpay")->find();
$payUrl = $payUrl['vvalue'];
}
if ($payUrl == "") {
return json($this->getReturn(-1, "请您先进入后台配置程序"));
}
$isAuto = 1;
$_payUrl = Db::name("pay_qrcode")
->where("price", $reallyPrice)
->where("type", $type)
->find();
if ($_payUrl) {
$payUrl = $_payUrl['pay_url'];
$isAuto = 0;
}
$res = Db::name("pay_order")->where("pay_id", $payId)->find();
if ($res) {
return json($this->getReturn(-1, "商户订单号已存在"));
}
$createDate = time();
$data = array(
"close_date" => 0,
"create_date" => $createDate,
"is_auto" => $isAuto,
"notify_url" => $notify_url,
"order_id" => $orderId,
"param" => $param,
"pay_date" => 0,
"pay_id" => $payId,
"pay_url" => $payUrl,
"price" => $price,
"really_price" => $reallyPrice,
"return_url" => $return_url,
"state" => 0,
"type" => $type
);
Db::name("pay_order")->insert($data);
//return "<script>window.location.href = '/payPage/pay.html?orderId=" + c.getOrderId() + "'</script>";
if ($isHtml == 1) {
echo "<script>window.location.href = 'payPage/pay.html?orderId=" . $orderId . "'</script>";
} else {
$time = Db::name("setting")->where("vkey", "close")->find();
$data = array(
"payId" => $payId,
"orderId" => $orderId,
"payType" => $type,
"price" => $price,
"reallyPrice" => $reallyPrice,
"payUrl" => $payUrl,
"isAuto" => $isAuto,
"state" => 0,
"timeOut" => $time['vvalue'],
"date" => $createDate
);
return json($this->getReturn(1, "成功", $data));
}
}
//获取订单信息
public function getOrder()
{
$res = Db::name("pay_order")->where("order_id", input("orderId"))->find();
if ($res){
$time = Db::name("setting")->where("vkey", "close")->find();
$data = array(
"payId" => $res['pay_id'],
"orderId" => $res['order_id'],
"payType" => $res['type'],
"price" => $res['price'],
"reallyPrice" => $res['really_price'],
"payUrl" => $res['pay_url'],
"isAuto" => $res['is_auto'],
"state" => $res['state'],
"timeOut" => $time['vvalue'],
"date" => $res['create_date']
);
return json($this->getReturn(1, "成功", $data));
}else{
return json($this->getReturn(-1, "云端订单编号不存在"));
}
}
//查询订单状态
public function checkOrder()
{
$res = Db::name("pay_order")->where("order_id", input("orderId"))->find();
if ($res){
if ($res['state']==0){
return json($this->getReturn(-1, "订单未支付"));
}
if ($res['state']==-1){
return json($this->getReturn(-1, "订单已过期"));
}
$res2 = Db::name("setting")->where("vkey","key")->find();
$key = $res2['vvalue'];
$res['price'] = number_format($res['price'],2,".","");
$res['really_price'] = number_format($res['really_price'],2,".","");
$p = "payId=".$res['pay_id']."&param=".$res['param']."&type=".$res['type']."&price=".$res['price']."&reallyPrice=".$res['really_price'];
$sign = $res['pay_id'].$res['param'].$res['type'].$res['price'].$res['really_price'].$key;
$p = $p . "&sign=".md5($sign);
$url = $res['return_url'];
if (strpos($url,"?")===false){
$url = $url."?".$p;
}else{
$url = $url."&".$p;
}
return json($this->getReturn(1, "成功", $url));
}else{
return json($this->getReturn(-1, "云端订单编号不存在"));
}
}
//关闭订单
public function closeOrder(){
$res2 = Db::name("setting")->where("vkey","key")->find();
$key = $res2['vvalue'];
$orderId = input("orderId");
$_sign = $orderId.$key;
if (md5($_sign)!=input("sign")){
return json($this->getReturn(-1, "签名校验不通过"));
}
$res = Db::name("pay_order")->where("order_id",$orderId)->find();
if ($res){
if ($res['state']!=0){
return json($this->getReturn(-1, "订单状态不允许关闭"));
}
Db::name("pay_order")->where("order_id",$orderId)->update(array("state"=>-1,"close_date"=>time()));
Db::name("tmp_price")
->where("oid",$res['order_id'])
->delete();
return json($this->getReturn(1, "成功"));
}else{
return json($this->getReturn(-1, "云端订单编号不存在"));
}
}
//获取监控端状态
public function getState(){
$res2 = Db::name("setting")->where("vkey","key")->find();
$key = $res2['vvalue'];
$t = input("t");
$_sign = $t.$key;
if (md5($_sign)!=input("sign")){
return json($this->getReturn(-1, "签名校验不通过"));
}
$res = Db::name("setting")->where("vkey","lastheart")->find();
$lastheart = $res['vvalue'];
$res = Db::name("setting")->where("vkey","lastpay")->find();
$lastpay = $res['vvalue'];
$res = Db::name("setting")->where("vkey","jkstate")->find();
$jkstate = $res['vvalue'];
return json($this->getReturn(1, "成功",array("lastheart"=>$lastheart,"lastpay"=>$lastpay,"jkstate"=>$jkstate)));
}
//App心跳接口
public function appHeart(){
$this->closeEndOrder();
$res2 = Db::name("setting")->where("vkey","key")->find();
$key = $res2['vvalue'];
$t = input("t");
$_sign = $t.$key;
if (md5($_sign)!=input("sign")){
return json($this->getReturn(-1, "签名校验不通过"));
}
// $jg = time()*1000 - $t;
// if ($jg>50000 || $jg<-50000){
// return json($this->getReturn(-1, "客户端时间错误"));
// }
Db::name("setting")->where("vkey","lastheart")->update(array("vvalue"=>time()));
Db::name("setting")->where("vkey","jkstate")->update(array("vvalue"=>1));
return json($this->getReturn());
}
//App推送付款数据接口
public function appPush(){
$this->closeEndOrder();
$res2 = Db::name("setting")->where("vkey","key")->find();
$key = $res2['vvalue'];
$t = input("t");
$type = input("type");
$price = input("price");
$_sign = $type.$price.$t.$key;
if (md5($_sign)!=input("sign")){
return json($this->getReturn(-1, "签名校验不通过"));
}
// $jg = time()*1000 - $t;
// if ($jg>50000 || $jg<-50000){
// return json($this->getReturn(-1, "客户端时间错误"));
// }
Db::name("setting")
->where("vkey","lastpay")
->update(
array(
"vvalue"=>time()
)
);
$res = Db::name("pay_order")
->where("really_price",$price)
->where("state",0)
->where("type",$type)
->find();
if ($res){
Db::name("tmp_price")
->where("oid",$res['order_id'])
->delete();
Db::name("pay_order")->where("id",$res['id'])->update(array("state"=>1,"pay_date"=>time(),"close_date"=>time()));
$url = $res['notify_url'];
$res2 = Db::name("setting")->where("vkey","key")->find();
$key = $res2['vvalue'];
$p = "payId=".$res['pay_id']."&param=".$res['param']."&type=".$res['type']."&price=".$res['price']."&reallyPrice=".$res['really_price'];
$sign = $res['pay_id'].$res['param'].$res['type'].$res['price'].$res['really_price'].$key;
$p = $p . "&sign=".md5($sign);
if (strpos($url,"?")===false){
$url = $url."?".$p;
}else{
$url = $url."&".$p;
}
$re = $this->getCurl($url);
if ($re=="success"){
return json($this->getReturn());
}else{
Db::name("pay_order")->where("id",$res['id'])->update(array("state"=>2));
return json($this->getReturn(-1,"异步通知失败"));
}
}else{
$data = array(
"close_date" => 0,
"create_date" => time(),
"is_auto" => 0,
"notify_url" => "",
"order_id" => "无订单转账",
"param" => "无订单转账",
"pay_date" => 0,
"pay_id" => "无订单转账",
"pay_url" => "",
"price" => $price,
"really_price" => $price,
"return_url" => "",
"state" => 1,
"type" => $type
);
Db::name("pay_order")->insert($data);
return json($this->getReturn());
}
}
//关闭过期订单接口(请用定时器至少1分钟调用一次)
public function closeEndOrder(){
$res = Db::name("setting")->where("vkey","lastheart")->find();
$lastheart = $res['vvalue'];
if ((time()-$lastheart)>60){
Db::name("setting")->where("vkey","jkstate")->update(array("vvalue"=>0));
}
$time = Db::name("setting")->where("vkey", "close")->find();
$closeTime = time()-60*$time['vvalue'];
$close_date = time();
$res = Db::name("pay_order")
->where("create_date <=".$closeTime)
->where("state",0)
->update(array("state"=>-1,"close_date"=>$close_date));
if ($res){
$rows = Db::name("pay_order")->where("close_date",$close_date)->select();
foreach ($rows as $row){
Db::name("tmp_price")
->where("oid",$row['order_id'])
->delete();
}
$rows = Db::name("tmp_price")->select();
foreach ($rows as $row){
$re = Db::name("pay_order")->where("order_id",$row['oid'])->find();
if ($re){
}else{
Db::name("tmp_price")
->where("oid",$row['oid'])
->delete();
}
}
return json($this->getReturn(1,"成功清理".$res."条订单"));
}else{
return json($this->getReturn(1,"没有等待清理的订单"));
}
}
//发送Http请求
private function getCurl($url, $post = 0, $cookie = 0, $header = 0, $nobaody = 0)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$klsf[] = 'Accept:*/*';
$klsf[] = 'Accept-Language:zh-cn';
//$klsf[] = 'Content-Type:application/json';
$klsf[] = 'User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C153 MicroMessenger/6.6.1 NetType/WIFI Language/zh_CN';
$klsf[] = 'Referer:'.$url;
curl_setopt($ch, CURLOPT_HTTPHEADER, $klsf);
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 ($nobaody) {
curl_setopt($ch, CURLOPT_NOBODY, 1);
}
curl_setopt($ch, CURLOPT_TIMEOUT,60);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
}

14
application/provider.php Normal file
View File

@ -0,0 +1,14 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 应用容器绑定定义
return [
];

View File

@ -0,0 +1,109 @@
<?php
/**
* Created by PhpStorm.
* User: vone
* Date: 2019/4/16
* Time: 22:13
*/
namespace app\service;
use Endroid\QrCode\ErrorCorrectionLevel;
use Endroid\QrCode\LabelAlignment;
use Endroid\QrCode\QrCode;
class QrcodeServer
{
protected $_qr;
protected $_encoding = 'UTF-8'; // 编码类型
protected $_size = 180; // 二维码大小
protected $_logo = false; // 是否需要带logo的二维码
protected $_logo_url = ''; // logo图片路径
protected $_logo_size = 80; // logo大小
protected $_title = false; // 是否需要二维码title
protected $_title_content = ''; // title内容
protected $_generate = 'display'; // display-直接显示 writefile-写入文件
protected $_file_name = './static/qrcode'; // 写入文件路径
const MARGIN = 10; // 二维码内容相对于整张图片的外边距
const WRITE_NAME = 'png'; // 写入文件的后缀名
const FOREGROUND_COLOR = ['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]; // 前景色
const BACKGROUND_COLOR = ['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]; // 背景色
public function __construct($config) {
isset($config['generate']) && $this->_generate = $config['generate'];
isset($config['encoding']) && $this->_encoding = $config['encoding'];
isset($config['size']) && $this->_size = $config['size'];
isset($config['logo']) && $this->_logo = $config['logo'];
isset($config['logo_url']) && $this->_logo_url = $config['logo_url'];
isset($config['logo_size']) && $this->_logo_size = $config['logo_size'];
isset($config['title']) && $this->_title = $config['title'];
isset($config['title_content']) && $this->_title_content = $config['title_content'];
isset($config['file_name']) && $this->_file_name = $config['file_name'];
}
/**
* 生成二维码
* @param $content //需要写入的内容
* @return array | page input
*/
public function createServer($content) {
$this->_qr = new QrCode($content);
$this->_qr->setSize($this->_size);
$this->_qr->setWriterByName(self::WRITE_NAME);
$this->_qr->setMargin(self::MARGIN);
$this->_qr->setEncoding($this->_encoding);
$this->_qr->setErrorCorrectionLevel(ErrorCorrectionLevel::HIGH); // 容错率
$this->_qr->setForegroundColor(self::FOREGROUND_COLOR);
$this->_qr->setBackgroundColor(self::BACKGROUND_COLOR);
// 是否需要title
if ($this->_title) {
$this->_qr->setLabel($this->_title_content, 16, null, LabelAlignment::CENTER);
}
// 是否需要logo
if ($this->_logo) {
$this->_qr->setLogoPath($this->_logo_url);
$this->_qr->setLogoWidth($this->_logo_size);
}
$this->_qr->setValidateResult(false);
if ($this->_generate == 'display') {
// 展示二维码
// 前端调用 例:<img src="http://localhost/qr.php?url=base64_url_string">
header('Content-Type: ' . $this->_qr->getContentType());
return $this->_qr->writeString();
} else if ($this->_generate == 'writefile') {
// 写入文件
$file_name = $this->_file_name;
return $this->generateImg($file_name);
} else {
return ['success' => false, 'message' => 'the generate type not found', 'data' => ''];
}
}
/**
* 生成文件
* @param $file_name //目录文件 例: /tmp
* @return array
*/
public function generateImg($file_name) {
$file_path = $file_name . DIRECTORY_SEPARATOR . uniqid() . '.' . self::WRITE_NAME;
if (!file_exists($file_name)) {
mkdir($file_name, 0777, true);
}
try {
$this->_qr->writeFile($file_path);
$data = [
'url' => $file_path,
'ext' => self::WRITE_NAME,
];
return ['success' => true, 'message' => 'write qrimg success', 'data' => $data];
} catch (\Exception $e) {
return ['success' => false, 'message' => $e->getMessage(), 'data' => ''];
}
}
}

28
application/tags.php Normal file
View File

@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 应用行为扩展定义文件
return [
// 应用初始化
'app_init' => [],
// 应用开始
'app_begin' => [],
// 模块初始化
'module_init' => [],
// 操作开始执行
'action_begin' => [],
// 视图内容过滤
'view_filter' => [],
// 日志写入
'log_write' => [],
// 应用结束
'app_end' => [],
];

26
build.php Normal file
View File

@ -0,0 +1,26 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
return [
// 生成应用公共文件
'__file__' => ['common.php'],
// 定义demo模块的自动生成 (按照实际定义的文件名生成)
'demo' => [
'__file__' => ['common.php'],
'__dir__' => ['behavior', 'controller', 'model', 'view'],
'controller' => ['Index', 'Test', 'UserType'],
'model' => ['User', 'UserType'],
'view' => ['index/index'],
],
// 其他更多的模块定义
];

36
composer.json Normal file
View File

@ -0,0 +1,36 @@
{
"name": "topthink/think",
"description": "the new thinkphp framework",
"type": "project",
"keywords": [
"framework",
"thinkphp",
"ORM"
],
"homepage": "http://thinkphp.cn/",
"license": "Apache-2.0",
"authors": [
{
"name": "liu21st",
"email": "liu21st@gmail.com"
}
],
"require": {
"php": ">=5.6.0",
"topthink/framework": "5.1.*",
"endroid/qrcode": "^2.5",
"endroid/qr-code": "^2.5",
"khanamiryan/qrcode-detector-decoder": "^1.0"
},
"autoload": {
"psr-4": {
"app\\": "application"
}
},
"extra": {
"think-path": "thinkphp"
},
"config": {
"preferred-install": "dist"
}
}

625
composer.lock generated Normal file
View File

@ -0,0 +1,625 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ec45aa9c45b84ff153bf9509eb28eba3",
"packages": [
{
"name": "bacon/bacon-qr-code",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/Bacon/BaconQrCode.git",
"reference": "5a91b62b9d37cee635bbf8d553f4546057250bee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee",
"reference": "5a91b62b9d37cee635bbf8d553f4546057250bee",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-iconv": "*",
"php": "^5.4|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
},
"suggest": {
"ext-gd": "to generate QR code images"
},
"type": "library",
"autoload": {
"psr-0": {
"BaconQrCode": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "http://www.dasprids.de",
"role": "Developer"
}
],
"description": "BaconQrCode is a QR code generator for PHP.",
"homepage": "https://github.com/Bacon/BaconQrCode",
"time": "2017-10-17T09:59:25+00:00"
},
{
"name": "endroid/qr-code",
"version": "2.5.1",
"source": {
"type": "git",
"url": "https://github.com/endroid/qr-code.git",
"reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/6062677d3404e0ded40647b8f62ec55ff9722eb7",
"reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"bacon/bacon-qr-code": "^1.0.3",
"ext-gd": "*",
"khanamiryan/qrcode-detector-decoder": "1",
"myclabs/php-enum": "^1.5",
"php": ">=5.6",
"symfony/options-resolver": "^2.7",
"symfony/property-access": "^2.7"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"symfony/asset": "^2.7",
"symfony/browser-kit": "^2.7",
"symfony/finder": "^2.7",
"symfony/framework-bundle": "^2.7",
"symfony/http-kernel": "^2.7",
"symfony/templating": "^2.7",
"symfony/twig-bundle": "^2.7",
"symfony/yaml": "^2.7"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Endroid\\QrCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jeroen van den Enden",
"email": "info@endroid.nl",
"homepage": "http://endroid.nl/"
}
],
"description": "Endroid QR Code",
"homepage": "https://github.com/endroid/QrCode",
"keywords": [
"bundle",
"code",
"endroid",
"flex",
"qr",
"qrcode",
"symfony"
],
"time": "2018-05-09T20:26:30+00:00"
},
{
"name": "endroid/qrcode",
"version": "2.5.1",
"source": {
"type": "git",
"url": "https://github.com/endroid/qr-code.git",
"reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/6062677d3404e0ded40647b8f62ec55ff9722eb7",
"reference": "6062677d3404e0ded40647b8f62ec55ff9722eb7",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"bacon/bacon-qr-code": "^1.0.3",
"ext-gd": "*",
"khanamiryan/qrcode-detector-decoder": "1",
"myclabs/php-enum": "^1.5",
"php": ">=5.6",
"symfony/options-resolver": "^2.7",
"symfony/property-access": "^2.7"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"symfony/asset": "^2.7",
"symfony/browser-kit": "^2.7",
"symfony/finder": "^2.7",
"symfony/framework-bundle": "^2.7",
"symfony/http-kernel": "^2.7",
"symfony/templating": "^2.7",
"symfony/twig-bundle": "^2.7",
"symfony/yaml": "^2.7"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Endroid\\QrCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jeroen van den Enden",
"email": "info@endroid.nl",
"homepage": "http://endroid.nl/"
}
],
"description": "Endroid QR Code",
"homepage": "https://github.com/endroid/QrCode",
"keywords": [
"bundle",
"code",
"endroid",
"flex",
"qr",
"qrcode",
"symfony"
],
"abandoned": "endroid/qr-code",
"time": "2018-05-09T20:26:30+00:00"
},
{
"name": "khanamiryan/qrcode-detector-decoder",
"version": "1",
"source": {
"type": "git",
"url": "https://github.com/khanamiryan/php-qrcode-detector-decoder.git",
"reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/96d5f80680b04803c4f1b69d6e01735e876b80c7",
"reference": "96d5f80680b04803c4f1b69d6e01735e876b80c7",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^5.6|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"type": "library",
"autoload": {
"classmap": [
"lib/"
],
"files": [
"lib/common/customFunctions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ashot Khanamiryan",
"email": "a.khanamiryan@gmail.com",
"homepage": "https://github.com/khanamiryan",
"role": "Developer"
}
],
"description": "QR code decoder / reader",
"homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder",
"keywords": [
"barcode",
"qr",
"zxing"
],
"time": "2017-01-13T09:11:46+00:00"
},
{
"name": "myclabs/php-enum",
"version": "1.6.6",
"source": {
"type": "git",
"url": "https://github.com/myclabs/php-enum.git",
"reference": "32c4202886c51fbe5cc3a7c34ec5c9a4a790345e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/32c4202886c51fbe5cc3a7c34ec5c9a4a790345e",
"reference": "32c4202886c51fbe5cc3a7c34ec5c9a4a790345e",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-json": "*",
"php": ">=5.4"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35|^5.7|^6.0",
"squizlabs/php_codesniffer": "1.*"
},
"type": "library",
"autoload": {
"psr-4": {
"MyCLabs\\Enum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP Enum contributors",
"homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
}
],
"description": "PHP Enum implementation",
"homepage": "http://github.com/myclabs/php-enum",
"keywords": [
"enum"
],
"time": "2019-02-04T21:18:49+00:00"
},
{
"name": "symfony/options-resolver",
"version": "v2.8.49",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/7aaab725bb58f0e18aa12c61bdadd4793ab4c32b",
"reference": "7aaab725bb58f0e18aa12c61bdadd4793ab4c32b",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\OptionsResolver\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony OptionsResolver Component",
"homepage": "https://symfony.com",
"keywords": [
"config",
"configuration",
"options"
],
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "82ebae02209c21113908c229e9883c419720738a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a",
"reference": "82ebae02209c21113908c229e9883c419720738a",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
},
{
"name": "Gert de Pagter",
"email": "backendtea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/property-access",
"version": "v2.8.49",
"source": {
"type": "git",
"url": "https://github.com/symfony/property-access.git",
"reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/c8f10191183be9bb0d5a1b8364d3891f1bde07b6",
"reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.9",
"symfony/polyfill-ctype": "~1.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\PropertyAccess\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony PropertyAccess Component",
"homepage": "https://symfony.com",
"keywords": [
"access",
"array",
"extraction",
"index",
"injection",
"object",
"property",
"property path",
"reflection"
],
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "topthink/framework",
"version": "v5.1.35",
"source": {
"type": "git",
"url": "https://github.com/top-think/framework.git",
"reference": "c53c0c6132022a87e8ee9c4109939eaf9a8a7adb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/c53c0c6132022a87e8ee9c4109939eaf9a8a7adb",
"reference": "c53c0c6132022a87e8ee9c4109939eaf9a8a7adb",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.6.0",
"topthink/think-installer": "2.*"
},
"require-dev": {
"johnkary/phpunit-speedtrap": "^1.0",
"mikey179/vfsstream": "~1.6",
"phpdocumentor/reflection-docblock": "^2.0",
"phploc/phploc": "2.*",
"phpunit/phpunit": "^5.0|^6.0",
"sebastian/phpcpd": "2.*",
"squizlabs/php_codesniffer": "2.*"
},
"type": "think-framework",
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "liu21st",
"email": "liu21st@gmail.com"
},
{
"name": "yunwuxin",
"email": "448901948@qq.com"
}
],
"description": "the new thinkphp framework",
"homepage": "http://thinkphp.cn/",
"keywords": [
"framework",
"orm",
"thinkphp"
],
"time": "2019-03-03T00:44:44+00:00"
},
{
"name": "topthink/think-installer",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-installer.git",
"reference": "f5400a12c60e513911aef41fe443fa6920952675"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-installer/zipball/f5400a12c60e513911aef41fe443fa6920952675",
"reference": "f5400a12c60e513911aef41fe443fa6920952675",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"composer-plugin-api": "^1.0"
},
"require-dev": {
"composer/composer": "1.0.*@dev"
},
"type": "composer-plugin",
"extra": {
"class": "think\\composer\\Plugin"
},
"autoload": {
"psr-4": {
"think\\composer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "yunwuxin",
"email": "448901948@qq.com"
}
],
"time": "2018-05-11T06:45:42+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.6.0"
},
"platform-dev": []
}

BIN
composer.phar Normal file

Binary file not shown.

146
config/app.php Normal file
View File

@ -0,0 +1,146 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 应用设置
// +----------------------------------------------------------------------
return [
// 应用名称
'app_name' => '',
// 应用地址
'app_host' => '',
// 应用调试模式
'app_debug' => true,
// 应用Trace
'app_trace' => false,
// 是否支持多模块
'app_multi_module' => true,
// 入口自动绑定模块
'auto_bind_module' => false,
// 注册的根命名空间
'root_namespace' => [],
// 默认输出类型
'default_return_type' => 'html',
// 默认AJAX 数据返回格式,可选json xml ...
'default_ajax_return' => 'json',
// 默认JSONP格式返回的处理方法
'default_jsonp_handler' => 'jsonpReturn',
// 默认JSONP处理方法
'var_jsonp_handler' => 'callback',
// 默认时区
'default_timezone' => 'Asia/Shanghai',
// 是否开启多语言
'lang_switch_on' => false,
// 默认全局过滤方法 用逗号分隔多个
'default_filter' => '',
// 默认语言
'default_lang' => 'zh-cn',
// 应用类库后缀
'class_suffix' => false,
// 控制器类后缀
'controller_suffix' => false,
// +----------------------------------------------------------------------
// | 模块设置
// +----------------------------------------------------------------------
// 默认模块名
'default_module' => 'index',
// 禁止访问模块
'deny_module_list' => ['common'],
// 默认控制器名
'default_controller' => 'Index',
// 默认操作名
'default_action' => 'index',
// 默认验证器
'default_validate' => '',
// 默认的空模块名
'empty_module' => '',
// 默认的空控制器名
'empty_controller' => 'Error',
// 操作方法前缀
'use_action_prefix' => false,
// 操作方法后缀
'action_suffix' => '',
// 自动搜索控制器
'controller_auto_search' => false,
// +----------------------------------------------------------------------
// | URL设置
// +----------------------------------------------------------------------
// PATHINFO变量名 用于兼容模式
'var_pathinfo' => 's',
// 兼容PATH_INFO获取
'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
// pathinfo分隔符
'pathinfo_depr' => '/',
// HTTPS代理标识
'https_agent_name' => '',
// IP代理获取标识
'http_agent_ip' => 'X-REAL-IP',
// URL伪静态后缀
'url_html_suffix' => 'html',
// URL普通方式参数 用于自动生成
'url_common_param' => false,
// URL参数方式 0 按名称成对解析 1 按顺序解析
'url_param_type' => 0,
// 是否开启路由延迟解析
'url_lazy_route' => false,
// 是否强制使用路由
'url_route_must' => false,
// 合并路由规则
'route_rule_merge' => false,
// 路由是否完全匹配
'route_complete_match' => false,
// 使用注解路由
'route_annotation' => false,
// 域名根如thinkphp.cn
'url_domain_root' => '',
// 是否自动转换URL中的控制器和操作名
'url_convert' => true,
// 默认的访问控制器层
'url_controller_layer' => 'controller',
// 表单请求类型伪装变量
'var_method' => '_method',
// 表单ajax伪装变量
'var_ajax' => '_ajax',
// 表单pjax伪装变量
'var_pjax' => '_pjax',
// 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
'request_cache' => false,
// 请求缓存有效期
'request_cache_expire' => null,
// 全局请求缓存排除规则
'request_cache_except' => [],
// 是否开启路由缓存
'route_check_cache' => false,
// 路由缓存的Key自定义设置闭包默认为当前URL和请求类型的md5
'route_check_cache_key' => '',
// 路由缓存类型及参数
'route_cache_option' => [],
// 默认跳转页面对应的模板文件
'dispatch_success_tmpl' => Env::get('think_path') . 'tpl/dispatch_jump.tpl',
'dispatch_error_tmpl' => Env::get('think_path') . 'tpl/dispatch_jump.tpl',
// 异常页面的模板文件
'exception_tmpl' => Env::get('think_path') . 'tpl/think_exception.tpl',
// 错误显示信息,非调试模式有效
'error_message' => '页面错误!请稍后再试~',
// 显示错误信息
'show_error_msg' => false,
// 异常处理handle类 留空使用 \think\exception\Handle
'exception_handle' => '',
'ver' => '1.12',
];

25
config/cache.php Normal file
View File

@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 缓存设置
// +----------------------------------------------------------------------
return [
// 驱动方式
'type' => 'File',
// 缓存保存目录
'path' => '',
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
];

19
config/console.php Normal file
View File

@ -0,0 +1,19 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 控制台配置
// +----------------------------------------------------------------------
return [
'name' => 'Think Console',
'version' => '0.1',
'user' => null,
];

30
config/cookie.php Normal file
View File

@ -0,0 +1,30 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Cookie设置
// +----------------------------------------------------------------------
return [
// cookie 名称前缀
'prefix' => '',
// cookie 保存时间
'expire' => 0,
// cookie 保存路径
'path' => '/',
// cookie 有效域名
'domain' => '',
// cookie 启用安全传输
'secure' => false,
// httponly设置
'httponly' => '',
// 是否使用 setcookie
'setcookie' => true,
];

63
config/database.php Normal file
View File

@ -0,0 +1,63 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
return [
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => '127.0.0.1',
// 数据库名
'database' => 'zf',
// 用户名
'username' => 'zf',
// 密码
'password' => 'tB5PMM7aD8TApNym',
// 端口
'hostport' => '3306',
// 连接dsn
'dsn' => '',
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => 'utf8',
// 数据库表前缀
'prefix' => '',
// 数据库调试模式
'debug' => true,
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 自动读取主库数据
'read_master' => false,
// 是否严格检查字段是否存在
'fields_strict' => true,
// 数据集返回类型
'resultset_type' => 'array',
// 自动写入时间戳字段
'auto_timestamp' => false,
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 是否需要进行SQL性能分析
'sql_explain' => false,
// Builder类
'builder' => '',
// Query类
'query' => '\\think\\db\\Query',
// 是否需要断线重连
'break_reconnect' => false,
// 断线标识字符串
'break_match_str' => [],
];

30
config/log.php Normal file
View File

@ -0,0 +1,30 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 日志设置
// +----------------------------------------------------------------------
return [
// 日志记录方式,内置 file socket 支持扩展
'type' => 'File',
// 日志保存目录
'path' => '',
// 日志记录级别
'level' => [],
// 单文件日志写入
'single' => false,
// 独立日志级别
'apart_level' => [],
// 最大日志文件数量
'max_files' => 0,
// 是否关闭日志写入
'close' => false,
];

18
config/middleware.php Normal file
View File

@ -0,0 +1,18 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 中间件配置
// +----------------------------------------------------------------------
return [
// 默认中间件命名空间
'default_namespace' => 'app\\http\\middleware\\',
];

26
config/session.php Normal file
View File

@ -0,0 +1,26 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 会话设置
// +----------------------------------------------------------------------
return [
'id' => '',
// SESSION_ID的提交变量,解决flash上传跨域
'var_session_id' => '',
// SESSION 前缀
'prefix' => 'think',
// 驱动方式 支持redis memcache memcached
'type' => '',
// 是否自动开启 SESSION
'auto_start' => true,
];

35
config/template.php Normal file
View File

@ -0,0 +1,35 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
return [
// 模板引擎类型 支持 php think 支持扩展
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板路径
'view_path' => '',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
];

18
config/trace.php Normal file
View File

@ -0,0 +1,18 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Trace设置 开启 app_trace 后 有效
// +----------------------------------------------------------------------
return [
// 内置Html Console 支持扩展
'type' => 'Html',
];

2
extend/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

19
index.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>存在搭建问题</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
</head>
<body class="body">
<div style="padding: 15px;color: red;">
<h1 style="text-align: center">检测到运行目录未设定成public</h1><br><br>
<h1 style="text-align: center">请在宝塔面板-网站-设置-网站目录->修改运行目录为public并保存同时关闭防跨站攻击</h1><br><br>
</div>
</body>
</html>

9
public/.htaccess Normal file
View File

@ -0,0 +1,9 @@
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
</IfModule>

View File

@ -0,0 +1 @@
0R0p-0IhSrZMKiookruKlRGMKn8GkDZTPQx4b4UK6Lo.AYcoB9mjvyHsMDRQrxEJvsZaIEtDHEkl0Hqed5s-LUI

26
public/404.html Normal file
View File

@ -0,0 +1,26 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>404</title>
<style>
body{
background-color:#444;
font-size:14px;
}
h3{
font-size:60px;
color:#eee;
text-align:center;
padding-top:30px;
font-weight:normal;
}
</style>
</head>
<body>
<h3>404锛屾偍璇锋眰鐨勬枃浠朵笉瀛樺湪!</h3>
</body>
</html>

177
public/aaa.html Normal file
View File

@ -0,0 +1,177 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>后台管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<link rel="stylesheet" href="css/global.css?t=1531663423583-6" media="all">
<style type="text/css">ins.adsbygoogle{display:none!important;display:none}</style></head>
<body>
<div class="layui-layout layui-layout-admin">
<div class="layui-header header header-demo" summer>
<div class="layui-main">
<span style="color: white;font-size: 30px;font-weight:100;line-height: 58px;font-family:Microsoft JhengHei">后台管理</span>
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item">
<a href="javascript:;">
管理员
</a>
<dl class="layui-nav-child">
<dd><a href="index.html">退出</a></dd>
</dl>
</li>
<!-- <li class="layui-nav-item"><a href="">退出</a></li> -->
</ul>
</div>
</div>
<!-- 让IE8/9支持媒体查询从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll">
<ul class="layui-nav layui-nav-tree site-demo-nav" id="v_menu">
</ul>
</div>
</div>
<div class="layui-body layui-tab-content site-demo site-demo-body">
<div class="layui-tab-item layui-show">
<div class="layui-main">
<div id="LAY_preview">
</div>
</div>
</div>
</div>
</div>
<div class="site-tree-mobile layui-hide" style="opacity: 0.4;">
<i class="layui-icon">&#xe602;</i>
</div>
<div class="site-mobile-shade"></div>
<script src="layui/layui.js?t=1531663423583" charset="utf-8"></script>
<script>
window.global = {
pageType: 'demo'
,preview: function(){
var preview = document.getElementById('LAY_preview');
return preview ? preview.innerHTML : '';
}()
};
layui.config({
base: 'js/'
,version: '1531663423583'
}).use('global');
</script>
</div>
<script>
layui.use(['layer','element'], function(){
var $ = layui.$
,setIframe = function(){
var height = $(window).height() - 370;
$('#demoAdmin').height(height);
};
setIframe();
$(window).on('resize', setIframe);
});
</script>
<script src="https://lib.baomitu.com/jquery/3.3.1/jquery.min.js"></script>
<script src="js/llqrcode.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
function getObjectURL(file) {
var url = null;
if (window.createObjectURL != undefined) {
url = window.createObjectURL(file);
} else if (window.URL != undefined) {
url = window.URL.createObjectURL(file);
} else if (window.webkitURL != undefined) {
url = window.webkitURL.createObjectURL(file);
}
return url;
}
$("#LAY_preview").load("main.html")
$.post("getMenu",function (data) {
if (data == null || data == "" || data.code==-1) {
window.location.href = "index.html";
}
setTimeout(function () {
$.post("admin/index/checkUpdate",function (data) {
if (data.code==1) {
layer.confirm(data.msg, {
btn: ['去看看','算啦'],
title:"有更新啦"
}, function(){
window.location.href = data.data;
});
}
});
},2000);
console.log(data);
var out_menu = "";
for (var i = 0;i<data.length;i++){
if (data[i].type=="menu"){
out_menu+='<li class="layui-nav-item layui-nav-itemed">';
out_menu+='<a class="" href="javascript:;">'+data[i].name+'</a>';
out_menu+='<dl class="layui-nav-child">';
for (var ii = 0;ii<data[i].node.length;ii++){
out_menu+='<dd><a onclick="$(\'#LAY_preview\').load(\''+data[i].node[ii].url+'\');">'+data[i].node[ii].name+'</a></dd>';
}
out_menu+='</dl>';
out_menu+='</li>';
} else{
out_menu+='<li class="layui-nav-item"><a onclick="$(\'#LAY_preview\').load(\''+data[i].url+'\');">'+data[i].name+'</a></li>';
}
}
console.log(out_menu);
$("#v_menu").append(out_menu);
if (layui.element)
layui.element.render();
});
</script>
</body>
</html>

View File

@ -0,0 +1,163 @@
<style>
.layui-table-cell {
height: auto;
}
.layui-table img {
max-width: 200px;
}
</style>
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-normal" id="testList">选择微信有金额的二维码</button>
<button type="button" class="layui-btn" onclick="saveqr()">保存二维码</button>
<table class="layui-hide" id="test" lay-filter="wxqrlist"></table>
</div>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
var imgs = {},mytable;
var duilie = 0;
layui.use('upload', function() {
var $ = layui.jquery
, upload = layui.upload;
mytable = layui.table.render({
elem: '#test'
,data:imgs
,cols: [[
{type:'numbers',title: '序号'}
,{field:'', width:230, title: '二维码', templet:function (data) {
return "<img src='"+data.b64+"'/>"
}
}
,{field:'url', minWidth:150, title: '内容'}
,{field:'money',width:100, title: '金额',edit:"text"}
,{title: '操作', minWidth: 80, align:'center', toolbar: '#barDemo'}
]],
page:true
});
//监听工具条
layui.table.on('tool(wxqrlist)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
layer.confirm('真的删除行么', function(index){
obj.del();
imgs = layui.table.cache.test;
mytable.reload({
data: imgs
});
layer.close(index);
});
}
});
//多文件列表示例
var demoListView = $('#demoList')
,uploadListIns = upload.render({
elem: '#testList'
,url: '/upload/'
,accept: 'file'
,multiple: true
,auto: false
,bindAction: '#testListAction'
,choose: function(obj){
imgs = [];
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
layer.msg("等待所有二维码识别完毕后手动输入金额,输入完成后点击保存二维码")
// layer.msg('处理中', {
// icon: 16
// ,shade: 0.01
// ,time:0
// });
//读取本地文件
obj.preview(function(index, file, result){
// $.post("qr-code/test.php","base64="+encodeURIComponent(result.split(",")[1]),function (data) {
// console.log(data)
// if (!data.data) {
// data = JSON.parse(data);
// }
// imgs.push({"index":imgs.length,"money":"","b64":result,"url":data.data});
// mytable.reload({
// data: imgs
// });
// });
//console.log(index)
qrcode.decode(getObjectURL(file),result);
qrcode.callback = function(imgMsg,img64) {
console.log(imgMsg);
if (imgMsg==""){
$.post("qr-code/test.php","base64="+encodeURIComponent(img64.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}
imgs.push({"index":imgs.length,"money":"","b64":img64,"url":data.data});
mytable.reload({
data: imgs
});
});
} else{
imgs.push({"index":imgs.length,"money":"","b64":img64,"url":imgMsg});
mytable.reload({
data: imgs
});
}
}
});
}
});
});
function saveqr() {
var data = layui.table.cache.test;
for (var i = 0;i<data.length;i++){
if (data[i].money =="" || checkRate(data[i].money == false)){
layer.msg("序号为"+(i+1)+"的二维码金额有误,请检查");
return;
}
}
up(data,0);
}
function up(obj,index) {
if (obj.length==index){
layer.msg("操作成功!");
imgs = []
mytable.reload({
data: imgs
});
return;
}
$.post("admin/index/addPayQrcode","type=1&pay_url="+encodeURIComponent(obj[index].url)+"&price="+obj[index].money,function (data) {
up(obj,index+1)
});
}
function checkRate(input) {
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
if (!re.test(input)) {
return false;
}
}
</script>

View File

@ -0,0 +1,153 @@
<style>
.layui-table-cell {
height: auto;
}
.layui-table img {
max-width: 200px;
}
</style>
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-normal" id="testList">选择支付宝有金额的二维码</button>
<button type="button" class="layui-btn" onclick="saveqr()">保存二维码</button>
<table class="layui-hide" id="test" lay-filter="wxqrlist"></table>
</div>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
var imgs = {},mytable;
layui.use('upload', function() {
var $ = layui.jquery
, upload = layui.upload;
mytable = layui.table.render({
elem: '#test'
,data:imgs
,cols: [[
{type:'numbers',title: '序号'}
,{field:'', width:230, title: '二维码', templet:function (data) {
return "<img src='"+data.b64+"'/>"
}
}
,{field:'url', minWidth:150, title: '内容'}
,{field:'money',width:100, title: '金额',edit:"text"}
,{title: '操作', minWidth: 80, align:'center', toolbar: '#barDemo'}
]],
page:true
});
//监听工具条
layui.table.on('tool(wxqrlist)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
layer.confirm('真的删除行么', function(index){
obj.del();
imgs = layui.table.cache.test;
mytable.reload({
data: imgs
});
layer.close(index);
});
}
});
//多文件列表示例
var demoListView = $('#demoList')
,uploadListIns = upload.render({
elem: '#testList'
,url: '/upload/'
,accept: 'file'
,multiple: true
,auto: false
,bindAction: '#testListAction'
,choose: function(obj){
imgs = [];
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
layer.msg("等待所有二维码识别完毕后手动输入金额,输入完成后点击保存二维码")
//读取本地文件
obj.preview(function(index, file, result){
/*
$.post("qr-code/test.php","base64="+encodeURIComponent(result.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}
imgs.push({"index":imgs.length,"money":"","b64":result,"url":data.data});
mytable.reload({
data: imgs
});
});
*/
qrcode.decode(getObjectURL(file),result);
qrcode.callback = function(imgMsg,img64) {
if (imgMsg==""){
$.post("qr-code/test.php","base64="+encodeURIComponent(img64.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}
imgs.push({"index":imgs.length,"money":"","b64":img64,"url":data.data});
mytable.reload({
data: imgs
});
});
} else{
imgs.push({"index":imgs.length,"money":"","b64":img64,"url":imgMsg});
mytable.reload({
data: imgs
});
}
}
});
}
});
});
function saveqr() {
var data = layui.table.cache.test;
for (var i = 0;i<data.length;i++){
if (data[i].money =="" || checkRate(data[i].money == false)){
layer.msg("序号为"+(i+1)+"的二维码金额有误,请检查");
return;
}
}
up(data,0);
}
function up(obj,index) {
if (obj.length==index){
layer.msg("操作成功!");
imgs = []
mytable.reload({
data: imgs
});
return;
}
$.post("admin/index/addPayQrcode","type=2&pay_url="+encodeURIComponent(obj[index].url)+"&price="+obj[index].money,function (data) {
up(obj,index+1)
});
}
function checkRate(input) {
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
if (!re.test(input)) {
return false;
}
}
</script>

96
public/admin/jk.html Normal file
View File

@ -0,0 +1,96 @@
<div class="layui-form" action="">
<div class="layui-form-item">
<label class="layui-form-label">监控端状态</label>
<div class="layui-input-block">
<input type="text" id="jkstate" value="" lay-verify="required" placeholder="监控端状态" autocomplete="off" readonly class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">最后心跳</label>
<div class="layui-input-block">
<input type="text" id="lastheart" lay-verify="required" placeholder="最后心跳时间" autocomplete="off" readonly class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">最后收款</label>
<div class="layui-input-block">
<input type="text" id="lastpay" lay-verify="required" placeholder="最后收款时间" autocomplete="off" readonly class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">配置数据</label>
<div class="layui-input-block">
<input type="text" id="input" lay-verify="required" placeholder="手动配置数据" autocomplete="off" readonly class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">配置二维码</label>
<div class="layui-input-block">
<img id="pzqrcode">
</div>
</div>
<div class="layui-form-item" style="text-align: right">
<button class="layui-btn" onclick="window.open('../v.apk')">下载监控端</button>
<button class="layui-btn" onclick="window.open('https://github.com/szvone/vmqApk/releases')">最新版监控端下载</button>
</div>
<!--<div class="layui-form-item layui-form-text">-->
<!--<label class="layui-form-label">设置进入网站的提示</label>-->
<!--<div class="layui-input-block">-->
<!--<textarea placeholder="请输入公告内容" id="xz" class="layui-textarea"></textarea>-->
<!--</div>-->
<!--</div>-->
<!--<div class="layui-form-item">-->
<!--<button class="layui-btn" onclick="editxz()">保存</button>-->
<!--</div>-->
</div>
<script>
function formatDate(now) {
if (now==0) {
return "无";
}
now = new Date(now*1000);
return now.getFullYear()
+ "-" + (now.getMonth()>8?(now.getMonth()+1):"0"+(now.getMonth()+1))
+ "-" + (now.getDate()>9?now.getDate():"0"+now.getDate())
+ " " + (now.getHours()>9?now.getHours():"0"+now.getHours())
+ ":" + (now.getMinutes()>9?now.getMinutes():"0"+now.getMinutes())
+ ":" + (now.getSeconds()>9?now.getSeconds():"0"+now.getSeconds());
}
layui.use(['form','layer'], function(){
var table = layui.table,form = layui.form;
form.render();
});
$.post("admin/index/getSettings",function (data) {
console.log(data);
if (data.code==1){
if (data.data.jkstate == -1){
$("#jkstate").val("监控端未绑定,请您扫码绑定");
}else if (data.data.jkstate == 0){
$("#jkstate").val("监控端已掉线请您检查App是否正常运行");
}else if (data.data.jkstate == 1){
$("#jkstate").val("运行正常");
}
$("#lastheart").val(formatDate(data.data.lastheart));
$("#lastpay").val(formatDate(data.data.lastpay));
var img = window.location.host+"/"+data.data.key;
$("#input").val(img);
$("#pzqrcode").attr("src","enQrcode?url="+img);
}
});
</script>

274
public/admin/orderlist.html Normal file
View File

@ -0,0 +1,274 @@
<div class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">支付方式</label>
<div class="layui-input-inline">
<select id="type" lay-verify="required" lay-filter="type">
<option value="">不限制</option>
<option value="1">微信</option>
<option value="2">支付宝</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">订单状态</label>
<div class="layui-input-inline">
<select id="state" lay-verify="required" lay-filter="state">
<option value="">不限制</option>
<option value="-1">过期</option>
<option value="0">待支付</option>
<option value="1">完成</option>
<option value="2">通知失败</option>
</select>
</div>
</div>
</div>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="delGq">删除所有过期订单</button>
<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="delLast">删除七天前订单</button>
</div>
</script>
<table id="demo" lay-filter="test"></table>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="bd">补单</a>
<a class="layui-btn layui-btn-xs" lay-event="info">详情</a>
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
</script>
<script>
function formatDate(now) {
if (now=="0"){
return "无";
}
now = new Date(now*1000);
return now.getFullYear()
+ "-" + (now.getMonth()>8?(now.getMonth()+1):"0"+(now.getMonth()+1))
+ "-" + (now.getDate()>9?now.getDate():"0"+now.getDate())
+ " " + (now.getHours()>9?now.getHours():"0"+now.getHours())
+ ":" + (now.getMinutes()>9?now.getMinutes():"0"+now.getMinutes())
+ ":" + (now.getSeconds()>9?now.getSeconds():"0"+now.getSeconds());
}
var myTable,table,form;
layui.use(['form','table','laydate'], function(){
table = layui.table;
form = layui.form;
//第一个实例
myTable = table.render({
elem: '#demo'
,height: 'full-160'
,url: 'admin/index/getOrders'
,toolbar: '#toolbarDemo'
,where: {
state:$("#state").val(),
type:$("#type").val()
}
,cols: [[ //表头
{field: 'create_date', title: '创建时间',minWidth:160,templet: function(d){
return formatDate(d.create_date);
}
},
{field: 'pay_id', title: '商户编号',minWidth:180},
{field: 'order_id', title: '云端订单编号',minWidth:180},
{field: 'type', title: '支付方式',minWidth:100,templet: function(d){
if (d.type=="1"){
return '微信';
}else if (d.type=="2"){
return '支付宝';
}
}
},
{field: 'price', title: '订单金额',minWidth:100, align:'center'},
{field: 'really_price', title: '实际金额',minWidth:100, align:'center'},
{field: 'state', title: '状态',minWidth:80,templet: function(d){
if (d.state=="2"){
return '<span style="color: orange">通知失败</span>';
}else if (d.state=="1"){
return '<span style="color: green">完成</span>';
}else if (d.state=="0"){
return '<span style="color: orange">待支付</span>';
}else if (d.state=="-1"){
return '<span style="color: red">过期</span>';
}
}
},
{title: '操作', minWidth: 120, align:'center', toolbar: '#barDemo'}
]]
,page:true
});
//监听行工具事件
table.on('tool(test)', function(obj){ //注tool 是工具条事件名test 是 table 原始容器的属性 lay-filter="对应的值"
var data = obj.data //获得当前行数据
,layEvent = obj.event; //获得 lay-event 对应的值
if(layEvent === 'info'){
var out = "<p>创建时间:"+formatDate(data.create_date)+"</p>";
out += "<p>支付时间:"+formatDate(data.pay_date)+"</p>";
out += "<p>关闭时间:"+formatDate(data.close_date)+"</p>";
out += "<p>自定义参数:"+data.param+"</p>";
layer.alert(out);
}else if(layEvent === 'bd'){
layer.confirm('确定要补单吗?该操作将会将该订单标记为已支付,并向您的服务器发送订单完成通知', function(index){
layer.msg('操作中', {
icon: 16
,shade: 0.01
});
$.post("admin/index/setBd","id="+data.id,function (data) {
if (data.code==1){
layer.msg("操作成功!");
myTable.reload({
where: {
state:$("#state").val(),
type:$("#type").val()
}
});
}else if(data.code==-2){
layer.confirm('补单失败,异步通知返回错误,是否查看通知返回数据?', {
btn: ['查看','取消'] //按钮
}, function(){
alert(data.data);
}, function(){
});
}else{
layer.msg(data.msg);
}
});
console.log(data.id);
});
}else if(layEvent === 'del'){
layer.confirm('确定要删除订单吗?', function(index){
layer.msg('操作中', {
icon: 16
,shade: 0.01
});
$.post("admin/index/delOrder","id="+data.id,function (data) {
if (data.code==1){
layer.msg("操作成功!");
myTable.reload({
where: {
state:$("#state").val(),
type:$("#type").val()
}
});
}else{
layer.msg(data.msg);
}
});
console.log(data.id);
});
}
});
form.on('select(state)', function(data){
myTable.reload({
where: {
state:$("#state").val(),
type:$("#type").val()
}
});
});
form.on('select(type)', function(data){
myTable.reload({
where: {
state:$("#state").val(),
type:$("#type").val()
}
});
});
//头工具栏事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'delGq':
layer.confirm('确定要删除所有过期订单吗?', function(index){
layer.msg('操作中', {
icon: 16
,shade: 0.01
});
$.post("admin/index/delGqOrder",function (data) {
if (data.code==1){
layer.msg("操作成功!");
myTable.reload({
where: {
state:$("#state").val(),
type:$("#type").val()
}
});
}else{
layer.msg(data.msg);
}
});
});
break;
case 'delLast':
layer.confirm('确定要删除七天前的所有订单吗?', function(index){
layer.msg('操作中', {
icon: 16
,shade: 0.01
});
$.post("admin/index/delLastOrder",function (data) {
if (data.code==1){
layer.msg("操作成功!");
myTable.reload({
where: {
state:$("#state").val(),
type:$("#type").val()
}
});
}else{
layer.msg(data.msg);
}
});
});
break;
};
});
form.render();
});
</script>

351
public/admin/setting.html Normal file
View File

@ -0,0 +1,351 @@
<div class="layui-form" action="">
<div class="layui-form-item">
<label class="layui-form-label">后台账号</label>
<div class="layui-input-block">
<input type="text" id="user" lay-verify="required" placeholder="请输入管理员账号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">后台密码</label>
<div class="layui-input-block">
<input type="text" id="pass" lay-verify="required" placeholder="请输入管理员密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">订单有效期</label>
<div class="layui-input-block">
<input type="number" id="close" lay-verify="required" placeholder="请输入创建的订单几分钟后失效" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">异步回调</label>
<div class="layui-input-block">
<input type="text" id="notifyUrl" lay-verify="required" placeholder="请输入异步回调地址" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">同步回调</label>
<div class="layui-input-block">
<input type="text" id="returnUrl" lay-verify="required" placeholder="请输入支付完成后跳转地址" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">通讯密钥</label>
<div class="layui-input-block">
<input type="text" id="key" lay-verify="required" placeholder="请输入通讯密钥" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">区分方式</label>
<div class="layui-input-block">
<div class="layui-upload">
<select id="payQf">
<option value="1">金额递增</option>
<option value="2">金额递减</option>
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">微信码</label>
<div class="layui-input-block">
<div class="layui-upload">
<button type="button" class="layui-btn" id="wxup">上传收款二维码</button>(此处上传的是无金额的收款二维码)
<div class="layui-upload-list">
<img class="layui-upload-img" id="wximg">
<p id="wxcs"></p>
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">支付宝码</label>
<div class="layui-input-block">
<div class="layui-upload">
<button type="button" class="layui-btn" id="zfbup">上传收款二维码</button>(此处上传的是无金额的收款二维码)
<div class="layui-upload-list">
<img class="layui-upload-img" id="zfbimg">
<p id="zfbcs"></p>
</div>
</div>
</div>
</div>
<div class="layui-form-item" style="text-align: right;">
<button class="layui-btn" onclick="save()">保存</button>
</div>
<!--<div class="layui-form-item layui-form-text">-->
<!--<label class="layui-form-label">设置进入网站的提示</label>-->
<!--<div class="layui-input-block">-->
<!--<textarea placeholder="请输入公告内容" id="xz" class="layui-textarea"></textarea>-->
<!--</div>-->
<!--</div>-->
<!--<div class="layui-form-item">-->
<!--<button class="layui-btn" onclick="editxz()">保存</button>-->
<!--</div>-->
</div>
<script>
function formatDate(now) {
now = new Date(now*1000);
return now.getFullYear()
+ "-" + (now.getMonth()>8?(now.getMonth()+1):"0"+(now.getMonth()+1))
+ "-" + (now.getDate()>9?now.getDate():"0"+now.getDate())
+ " " + (now.getHours()>9?now.getHours():"0"+now.getHours())
+ ":" + (now.getMinutes()>9?now.getMinutes():"0"+now.getMinutes())
+ ":" + (now.getSeconds()>9?now.getSeconds():"0"+now.getSeconds());
}
layui.use(['form','layer','upload'], function(){
var table = layui.table,form = layui.form,upload = layui.upload;
var uploadInst = upload.render({
elem: '#wxup'
, url: 'qr-code/test.php'
,auto: false
,choose: function(obj){
console.log(obj)
obj.preview(function(index, file, result){
qrcode.decode(getObjectURL(file));
qrcode.callback = function(imgMsg) {
console.log(imgMsg)
if(imgMsg!=""){
$('#wximg').attr('src', "enQrcode?url="+imgMsg);
}else{
layer.msg('处理中', {
icon: 16
,shade: 0.01
,time:0
});
$.post("qr-code/test.php","base64="+encodeURIComponent(result.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}
if (data.code==1){
$('#wximg').attr('src', "enQrcode?url="+data.data);
layer.msg('处理成功');
} else{
return layer.alert('处理失败,可以尝试将二维码用草料识别出内容,然后重新将内容生成二维码图片上传!');
}
});
}
}
});
}
, before: function (obj) {
layer.msg('处理中', {
icon: 16
,shade: 0.01
,time:0
});
}
, done: function (res) {
//如果上传失败
if (res.code == -1) {
return layer.msg('上传失败');
}
if (res.data==""){
return layer.msg('请上传微信无金额收款二维码');
}
layer.msg('处理成功');
$('#wximg').attr('src', "enQrcode?url="+res.data);
}
, error: function () {
layer.msg('上传失败');
//演示失败状态,并实现重传
var demoText = $('#wxcs');
demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs wxcs">重试</a>');
demoText.find('.wxcs').on('click', function () {
uploadInst.upload();
});
}
});
var uploadInst2 = upload.render({
elem: '#zfbup'
, url: 'qr-code/test.php'
,auto: false
,choose: function(obj){
console.log(obj)
obj.preview(function(index, file, result){
qrcode.decode(getObjectURL(file));
qrcode.callback = function(imgMsg) {
console.log(imgMsg)
if(imgMsg!=""){
$('#zfbimg').attr('src', "enQrcode?url="+imgMsg);
}else{
layer.msg('处理中', {
icon: 16
,shade: 0.01
,time:0
});
$.post("qr-code/test.php","base64="+encodeURIComponent(result.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}
if (data.code==1){
$('#zfbimg').attr('src', "enQrcode?url="+data.data);
layer.msg('处理成功');
} else{
return layer.alert('处理失败,可以尝试将二维码用草料识别出内容,然后重新将内容生成二维码图片上传!');
}
});
}
}
});
}
, before: function (obj) {
layer.msg('处理中', {
icon: 16
,shade: 0.01
,time:0
});
}
, done: function (res) {
//如果上传失败
if (res.code == -1) {
return layer.msg('上传失败');
}
if (res.data=="" ){
return layer.msg('请上传支付宝无金额收款二维码');
}
layer.msg('处理成功');
$('#zfbimg').attr('src', "enQrcode?url="+res.data);
}
, error: function () {
layer.msg('上传失败');
//演示失败状态,并实现重传
var demoText = $('#zfbcs');
demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs zfbcs">重试</a>');
demoText.find('.zfbcs').on('click', function () {
uploadInst2.upload();
});
}
});
form.render();
});
function save() {
var user = $("#user").val();
var pass = $("#pass").val();
var notifyUrl = $("#notifyUrl").val();
var returnUrl = $("#returnUrl").val();
var key = $("#key").val();
var close = $("#close").val();
var payQf = $("#payQf").val();
if (user == ""){
layer.msg("请输入管理员账号");
return;
}
if (pass == ""){
layer.msg("请输入管理员密码");
return;
}
if (key == ""){
layer.msg("请输入通讯密钥");
return;
}
if (notifyUrl == ""){
layer.msg("请输入异步回调地址");
return;
}
if (returnUrl == ""){
layer.msg("请输入支付完成后跳转地址");
return;
}
if (close == ""){
layer.msg("请输入创建的订单几分钟后失效");
return;
}
var wximg = $("#wximg").attr("src");
if (wximg=="" || !wximg){
layer.msg("请上传微信无金额的收款二维码");
return;
}
var zfbimg = $("#zfbimg").attr("src");
if (zfbimg=="" || !zfbimg){
layer.msg("请上传支付宝无金额的收款二维码");
return;
}
wximg = wximg.replace(/enQrcode\?url=/g,"");
zfbimg = zfbimg.replace(/enQrcode\?url=/g,"");
$.post("admin/index/saveSetting","user="+user+"&pass="+pass+"&notifyUrl="+notifyUrl+"&returnUrl="+returnUrl+"&key="+key+"&wxpay="+wximg+"&zfbpay="+zfbimg+"&close="+close+"&payQf="+payQf,function (data) {
if (data.code==1){
$.post("admin/index/getSettings",function (data) {
console.log(data);
if (data.code==1){
$("#user").val(data.data.user);
$("#pass").val(data.data.pass);
$("#notifyUrl").val(data.data.notifyUrl);
$("#returnUrl").val(data.data.returnUrl);
$("#key").val(data.data.key);
$("#close").val(data.data.close);
if (data.data.wxpay!=""){
$('#wximg').attr('src', "enQrcode?url="+data.data.wxpay);
}
if (data.data.zfbpay!=""){
$('#zfbimg').attr('src', "enQrcode?url="+data.data.zfbpay);
}
}
});
}
layer.msg(data.msg);
});
}
function getstate(){
$.post("admin/index/getSettings",function (data) {
console.log(data);
if (data.code==1){
$("#user").val(data.data.user);
$("#pass").val(data.data.pass);
$("#notifyUrl").val(data.data.notifyUrl);
$("#returnUrl").val(data.data.returnUrl);
$("#key").val(data.data.key);
$("#close").val(data.data.close);
$("#payQf").val(data.data.payQf);
if (data.data.wxpay!=""){
$('#wximg').attr('src', "enQrcode?url="+data.data.wxpay);
}
if (data.data.zfbpay!=""){
$('#zfbimg').attr('src', "enQrcode?url="+data.data.zfbpay);
}
layui.form.render();
}
});
}
getstate();
</script>

View File

@ -0,0 +1,83 @@
<style>
.layui-table-cell {
height: auto;
}
.layui-table img {
max-width: 200px;
}
</style>
<table id="demo" lay-filter="test"></table>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
function formatDate(now) {
now = new Date(now*1000);
return now.getFullYear()
+ "-" + (now.getMonth()>8?(now.getMonth()+1):"0"+(now.getMonth()+1))
+ "-" + (now.getDate()>9?now.getDate():"0"+now.getDate())
+ " " + (now.getHours()>9?now.getHours():"0"+now.getHours())
+ ":" + (now.getMinutes()>9?now.getMinutes():"0"+now.getMinutes())
+ ":" + (now.getSeconds()>9?now.getSeconds():"0"+now.getSeconds());
}
var myTable,table,form;
layui.use(['form','table','laydate'], function(){
table = layui.table;
form = layui.form;
//第一个实例
myTable = table.render({
elem: '#demo'
,height: 'full-130'
,url: 'admin/index/getPayQrcodes'
,where: {
type:1,
}
,cols: [[ //表头
{field: 'state', title: '二维码',templet: function(d){
return '<img src="enQrcode?url='+d.pay_url+'"/>';
}
},
{field: 'price', title: '金额'},
{title:"操作", width: 70, align:'center', toolbar: '#barDemo'}
]]
,page:true
});
//监听行工具事件
table.on('tool(test)', function(obj){ //注tool 是工具条事件名test 是 table 原始容器的属性 lay-filter="对应的值"
var data = obj.data //获得当前行数据
,layEvent = obj.event; //获得 lay-event 对应的值
if(layEvent === 'del'){
layer.confirm('要删除该二维码么?', function(index){
layer.close(index);
//向服务端发送删除指令
$.post("admin/index/delPayQrcode","id="+data.id,function (data) {
if (data.code==1){
obj.del(); //删除对应行tr的DOM结构
}
layer.msg(data.msg);
});
console.log(data.id);
});
}
});
form.render();
});
</script>

View File

@ -0,0 +1,83 @@
<style>
.layui-table-cell {
height: auto;
}
.layui-table img {
max-width: 200px;
}
</style>
<table id="demo" lay-filter="test"></table>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
function formatDate(now) {
now = new Date(now*1000);
return now.getFullYear()
+ "-" + (now.getMonth()>8?(now.getMonth()+1):"0"+(now.getMonth()+1))
+ "-" + (now.getDate()>9?now.getDate():"0"+now.getDate())
+ " " + (now.getHours()>9?now.getHours():"0"+now.getHours())
+ ":" + (now.getMinutes()>9?now.getMinutes():"0"+now.getMinutes())
+ ":" + (now.getSeconds()>9?now.getSeconds():"0"+now.getSeconds());
}
var myTable,table,form;
layui.use(['form','table','laydate'], function(){
table = layui.table;
form = layui.form;
//第一个实例
myTable = table.render({
elem: '#demo'
,height: 'full-130'
,url: 'admin/index/getPayQrcodes'
,where: {
type:2,
}
,cols: [[ //表头
{field: 'state', title: '二维码',templet: function(d){
return '<img src="enQrcode?url='+d.pay_url+'"/>';
}
},
{field: 'price', title: '金额'},
{title:"操作", width: 70, align:'center', toolbar: '#barDemo'}
]]
,page:true
});
//监听行工具事件
table.on('tool(test)', function(obj){ //注tool 是工具条事件名test 是 table 原始容器的属性 lay-filter="对应的值"
var data = obj.data //获得当前行数据
,layEvent = obj.event; //获得 lay-event 对应的值
if(layEvent === 'del'){
layer.confirm('要删除该二维码么?', function(index){
layer.close(index);
//向服务端发送删除指令
$.post("admin/index/delPayQrcode","id="+data.id,function (data) {
if (data.code==1){
obj.del(); //删除对应行tr的DOM结构
}
layer.msg(data.msg);
});
console.log(data.id);
});
}
});
form.render();
});
</script>

853
public/api.html Normal file
View File

@ -0,0 +1,853 @@
<!--
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>API调用说明</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="layui/css/layui.css" media="all" />
</head>
<body class="body" style="padding: 15px;">
<h1 style="text-align: center">Api调用说明</h1><br><br>
-->
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
<p>测试支付页面:<a href="example" target="_blank">http://服务器域名/example/</a></p>
<p>如果需要使用测试代码请设置main.php,notify.php,return.php里面的$key为你的通讯密钥</p>
<p>设置后台的同步回调地址为http://服务器域名/example/return.php</p>
<p>设置后台的异步回调地址为http://服务器域名/example/notify.php</p>
</div>
</blockquote>
<div class="layui-collapse" lay-filter="test">
<div class="layui-colla-item">
<h2 class="layui-colla-title">创建订单</h2>
<div class="layui-colla-content">
<div>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求地址http://服务器域名/createOrder
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求方式POST/GET
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>通讯密钥示例a7cc8678193ee9c70ae3d75fd04ae6a9</p>
<p>校验签名示例md5(1547129707139vone66620.1a7cc8678193ee9c70ae3d75fd04ae6a9) = 2b8b5d58c51203162f14939bdbc46a54</p>
<p>参数示例示例payId=1547129707139&amp;type=2&amp;price=0.1&amp;sign=2b8b5d58c51203162f14939bdbc46a54&amp;param=vone666&amp;isHtml=0</p>
<div class="layui-inline">
<p>参数说明:</p>
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>payId</td>
<td>字符串</td>
<td>【必传】商户订单号,可以是时间戳,不可重复</td>
</tr>
<tr>
<td>type</td>
<td>整数</td>
<td>【必传】微信支付传入1 支付宝支付传入2</td>
</tr>
<tr>
<td>price</td>
<td>小数</td>
<td>【必传】订单金额</td>
</tr>
<tr>
<td>sign</td>
<td>字符串</td>
<td>【必传】签名,计算方式为 md5(payId+param+type+price+通讯密钥)</td>
</tr>
<tr>
<td>param</td>
<td>字符串</td>
<td>【可选】传输参数,将会原样返回到异步和同步通知接口</td>
</tr>
<tr>
<td>isHtml</td>
<td>整数</td>
<td>【可选】传入1则自动跳转到支付页面否则返回创建结果的json数据</td>
</tr>
<tr>
<td>notifyUrl</td>
<td>字符串</td>
<td>【可选】传入则设置该订单的异步通知接口为该参数,不传或传空则使用后台设置的接口</td>
</tr>
<tr>
<td>returnUrl</td>
<td>字符串</td>
<td>【可选】传入则设置该订单的同步跳转接口为该参数,不传或传空则使用后台设置的接口</td>
</tr>
</tbody>
</table>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>返回数据(示例):{"code":1,"msg":"成功","data":{"payId":"1547129707139","orderId":"201901102220147500","payType":2,"price":0.1,"reallyPrice":0.1,"payUrl":"HTTPS://QR.ALIPAY.COM/FKX03500Z2ZYWA0ELYUB5D","isAuto":1,"state":0,"timeOut":5,"date":1547130014}}</p>
<div class="layui-inline">
返回数据说明:
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>整数</td>
<td>返回代码1成功-1调用失败</td>
</tr>
<tr>
<td>msg</td>
<td>字符串</td>
<td>api调用结果说明</td>
</tr>
<tr>
<td>data</td>
<td>数组</td>
<td>api调用结果如果code为-1则data为null
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>payId</td>
<td>字符串</td>
<td>商户订单号</td>
</tr>
<tr>
<td>orderId</td>
<td>字符串</td>
<td>云端订单号,可用于查询订单是否支付成功</td>
</tr>
<tr>
<td>payType</td>
<td>整数</td>
<td>微信支付为1 支付宝支付为2</td>
</tr>
<tr>
<td>price</td>
<td>小数</td>
<td>订单金额</td>
</tr>
<tr>
<td>reallyPrice</td>
<td>小数</td>
<td>实际需付金额</td>
</tr>
<tr>
<td>payUrl</td>
<td>字符串</td>
<td>支付二维码内容</td>
</tr>
<tr>
<td>isAuto</td>
<td>整数</td>
<td>1需要手动输入金额 0扫码后自动输入金额</td>
</tr>
<tr>
<td>state</td>
<td>整数</td>
<td>订单状态:-1|订单过期 0|等待支付 1|完成 2|支付完成但通知失败</td>
</tr>
<tr>
<td>timeOut</td>
<td>整数</td>
<td>订单有效时间(分钟)</td>
</tr>
<tr>
<td>date</td>
<td>长整数</td>
<td>订单创建时间时间戳10位</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">查询订单信息</h2>
<div class="layui-colla-content">
<div>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求地址http://服务器域名/getOrder
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求方式POST/GET
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>参数示例示例orderId=201901102225513177</p>
<div class="layui-inline">
<p>参数说明:</p>
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>orderId</td>
<td>字符串</td>
<td>【必传】云端订单号,创建订单返回的</td>
</tr>
</tbody>
</table>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>返回数据(示例):{"code":1,"msg":"成功","data":{"payId":"1547129707139","orderId":"201901102220147500","payType":2,"price":0.1,"reallyPrice":0.1,"payUrl":"HTTPS://QR.ALIPAY.COM/FKX03500Z2ZYWA0ELYUB5D","isAuto":1,"state":0,"timeOut":5,"date":1547130014}}</p>
<div class="layui-inline">
返回数据说明:
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>整数</td>
<td>返回代码1成功-1调用失败</td>
</tr>
<tr>
<td>msg</td>
<td>字符串</td>
<td>api调用结果说明</td>
</tr>
<tr>
<td>data</td>
<td>数组</td>
<td>api调用结果如果code为-1则data为null
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>payId</td>
<td>字符串</td>
<td>商户订单号</td>
</tr>
<tr>
<td>orderId</td>
<td>字符串</td>
<td>云端订单号,可用于查询订单是否支付成功</td>
</tr>
<tr>
<td>payType</td>
<td>整数</td>
<td>微信支付为1 支付宝支付为2</td>
</tr>
<tr>
<td>price</td>
<td>小数</td>
<td>订单金额</td>
</tr>
<tr>
<td>reallyPrice</td>
<td>小数</td>
<td>实际需付金额</td>
</tr>
<tr>
<td>payUrl</td>
<td>字符串</td>
<td>支付二维码内容</td>
</tr>
<tr>
<td>isAuto</td>
<td>整数</td>
<td>1需要手动输入金额 0扫码后自动输入金额</td>
</tr>
<tr>
<td>state</td>
<td>整数</td>
<td>订单状态:-1|订单过期 0|等待支付 1|完成 2|支付完成但通知失败</td>
</tr>
<tr>
<td>timeOut</td>
<td>整数</td>
<td>订单有效时间(分钟)</td>
</tr>
<tr>
<td>date</td>
<td>长整数</td>
<td>订单创建时间时间戳10位</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">查询订单状态</h2>
<div class="layui-colla-content">
<div>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求地址http://服务器域名/checkOrder
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求方式POST/GET
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>参数示例示例orderId=201901102225513177</p>
<div class="layui-inline">
<p>参数说明:</p>
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>orderId</td>
<td>字符串</td>
<td>【必传】云端订单号,创建订单返回的</td>
</tr>
</tbody>
</table>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>返回数据(示例):{"code":1,"msg":"成功","data":"https://bbs.125.la/?payId=1547130880571&amp;param=vone666&amp;type=2&amp;price=0.1&amp;reallyPrice=0.1&amp;sign=c79f041bd5bc47d73bc19dc8406c9843"}</p>
<div class="layui-inline">
返回数据说明:
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>整数</td>
<td>返回代码1订单已被支付-1支付失败或还未支付具体查看msg字段</td>
</tr>
<tr>
<td>msg</td>
<td>字符串</td>
<td>调用结果说明</td>
</tr>
<tr>
<td>data</td>
<td>字符串</td>
<td>
如果code为-1则data为null否则为该订单支付完成后的跳转地址带回调参数
</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">关闭订单</h2>
<div class="layui-colla-content">
<div>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求地址http://服务器域名/closeOrder
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求方式POST/GET
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>参数示例示例orderId=201901102225513177&amp;sign=7db2d26323dd8ccbb5d130dd61d210a0</p>
<div class="layui-inline">
<p>参数说明:</p>
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>orderId</td>
<td>字符串</td>
<td>【必传】云端订单号,创建订单返回的</td>
</tr>
<tr>
<td>sign</td>
<td>字符串</td>
<td>【必传】md5(云端订单号+通讯密钥)</td>
</tr>
</tbody>
</table>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>返回数据(示例):{"code":1,"msg":"成功","data":null}</p>
<div class="layui-inline">
返回数据说明:
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>整数</td>
<td>返回代码1订单关闭成功-1订单关闭失败具体原因查看msg字段</td>
</tr>
<tr>
<td>msg</td>
<td>字符串</td>
<td>调用结果说明</td>
</tr>
<tr>
<td>data</td>
<td>字符串</td>
<td>
无用字段,请忽略
</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">查询服务端状态</h2>
<div class="layui-colla-content">
<div>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求地址http://服务器域名/getState
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
请求方式POST/GET
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>参数示例示例t=1547613643&amp;sign=7db2d26323dd8ccbb5d130dd61d210a0</p>
<div class="layui-inline">
<p>参数说明:</p>
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>t</td>
<td>长整数</td>
<td>【必传】现行时间戳</td>
</tr>
<tr>
<td>sign</td>
<td>字符串</td>
<td>【必传】md5(现行时间戳+通讯密钥)</td>
</tr>
</tbody>
</table>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>返回数据(示例):{"code":1,"msg":"成功","data":{"lastpay":"1547394640","lastheart":"1547613873","state":"1"}}</p>
<div class="layui-inline">
返回数据说明:
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>整数</td>
<td>返回代码1成功-1失败具体原因查看msg字段</td>
</tr>
<tr>
<td>msg</td>
<td>字符串</td>
<td>调用结果说明</td>
</tr>
<tr>
<td>data</td>
<td>字符串</td>
<td>api调用结果如果code为-1则data为null
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>lastpay</td>
<td>长整数</td>
<td>最后一次监控到支付的时间戳10位</td>
</tr>
<tr>
<td>lastheart</td>
<td>长整数</td>
<td>最后一次监控端向服务器发送心跳的时间戳10位</td>
</tr>
<tr>
<td>state</td>
<td>整数</td>
<td>监控端状态 1|在线 0|掉线 -1|还未绑定监控端</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">回调参数说明</h2>
<div class="layui-colla-content">
<blockquote class="layui-elem-quote news_search">
<div class="layui-inline">
当系统收到用户收款后将会向您后台设定的异步通知地址发送GET请求通知您的服务端订单完成收款
</div>
<div class="layui-inline">
若您使用的是isHtml=1则在支付完成后会携带参数跳转到您的同步通知接口若使用isHtml=0则只有异步通知
</div>
</blockquote>
<blockquote class="layui-elem-quote news_search">
<p>传输参数示例payId=1547130349673&amp;param=vone666&amp;type=2&amp;price=0.1&amp;reallyPrice=0.1&amp;sign=28943820b95019b6a63598a13c46f93f</p>
<div class="layui-inline">
传输参数说明:
</div>
<table class="layui-table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>返回参数</th>
<th>参数类型</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>payId</td>
<td>字符串</td>
<td>商户订单号</td>
</tr>
<tr>
<td>param</td>
<td>字符串</td>
<td>创建订单的时候传入的参数</td>
</tr>
<tr>
<td>type</td>
<td>整数</td>
<td>支付方式 微信支付为1 支付宝支付为2</td>
</tr>
<tr>
<td>price</td>
<td>小数</td>
<td>订单金额</td>
</tr>
<tr>
<td>reallyPrice</td>
<td>小数</td>
<td>实际支付金额</td>
</tr>
<tr>
<td>sign</td>
<td>字符串</td>
<td>校验签名,计算方式 = md5(payId + param + type + price + reallyPrice + 通讯密钥)</td>
</tr>
</tbody>
</table>
</blockquote>
<pre class="layui-code">
&lt;?php
ini_set(&quot;error_reporting&quot;,&quot;E_ALL &amp; ~E_NOTICE&quot;);
$key = &quot;83d551f0b3609781a22536ca2658473d&quot;;//通讯密钥
$payId = $_GET[&#x27;payId&#x27;];//商户订单号
$param = $_GET[&#x27;param&#x27;];//创建订单的时候传入的参数
$type = $_GET[&#x27;type&#x27;];//支付方式 微信支付为1 支付宝支付为2
$price = $_GET[&#x27;price&#x27;];//订单金额
$reallyPrice = $_GET[&#x27;reallyPrice&#x27;];//实际支付金额
$sign = $_GET[&#x27;sign&#x27;];//校验签名,计算方式 = md5(payId + param + type + price + reallyPrice + 通讯密钥)
//开始校验签名
$_sign = md5($payId . $param . $type . $price . $reallyPrice . $key);
if ($_sign != $sign) {
echo &quot;error_sign&quot;;//sign校验不通过
exit();
}
echo &quot;success&quot;;
//继续业务流程
//echo &quot;商户订单号:&quot;.$payId .&quot;&lt;br&gt;自定义参数:&quot;. $param .&quot;&lt;br&gt;支付方式:&quot;. $type .&quot;&lt;br&gt;订单金额:&quot;. $price .&quot;&lt;br&gt;实际支付金额:&quot;. $reallyPrice;
?&gt;
</pre>
</div>
</div>
</div>
<script>
layui.use(['element','code'], function(){
var element = layui.element;
layui.element.render();
layui.code({
title: 'PHP回调示例代码'
});
});
</script>
<!--
<script type="text/javascript" src="layui/layui.js"></script>
<script>
layui.use(['element', 'layer'], function(){
var element = layui.element;
var layer = layui.layer;
});
</script>
</body>
</html>
-->

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
@font-face{font-family:source sans pro;font-style:italic;font-weight:300;src:url(../fonts/source-sans-pro-300italic.eot);src:local('Source Sans Pro'),local('SourceSans Pro-Italic'),url(../fonts/source-sans-pro-300italic.eot?#iefix) format('embedded-opentype'),url(../fonts/source-sans-pro-300italic.woff2) format('woff2'),url(../fonts/source-sans-pro-300italic.woff) format('woff'),url(../fonts/source-sans-pro-300italic.ttf) format('truetype'),url('../fonts/source-sans-pro-300italic.svg#SourceSans Pro') format('svg')}@font-face{font-family:source sans pro;font-style:italic;font-weight:600;src:url(../fonts/source-sans-pro-600italic.eot);src:local('Source Sans Pro'),local('SourceSans Pro-Italic'),url(../fonts/source-sans-pro-600italic.eot?#iefix) format('embedded-opentype'),url(../fonts/source-sans-pro-600italic.woff2) format('woff2'),url(../fonts/source-sans-pro-600italic.woff) format('woff'),url(../fonts/source-sans-pro-600italic.ttf) format('truetype'),url('../fonts/source-sans-pro-600italic.svg#SourceSans Pro') format('svg')}@font-face{font-family:source sans pro;font-style:normal;font-weight:300;src:url(../fonts/source-sans-pro-300.eot);src:local('Source Sans Pro'),local('SourceSans Pro-Normal'),url(../fonts/source-sans-pro-300.eot?#iefix) format('embedded-opentype'),url(../fonts/source-sans-pro-300.woff2) format('woff2'),url(../fonts/source-sans-pro-300.woff) format('woff'),url(../fonts/source-sans-pro-300.ttf) format('truetype'),url('../fonts/source-sans-pro-300.svg#SourceSans Pro') format('svg')}@font-face{font-family:source sans pro;font-style:normal;font-weight:600;src:url(../fonts/source-sans-pro-600.eot);src:local('Source Sans Pro'),local('SourceSans Pro-Normal'),url(../fonts/source-sans-pro-600.eot?#iefix) format('embedded-opentype'),url(../fonts/source-sans-pro-600.woff2) format('woff2'),url(../fonts/source-sans-pro-600.woff) format('woff'),url(../fonts/source-sans-pro-600.ttf) format('truetype'),url('../fonts/source-sans-pro-600.svg#SourceSans Pro') format('svg')}

View File

@ -0,0 +1,12 @@
/*
Dimension by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
/* Main */
#main article {
opacity: 1;
margin: 4rem 0 0 0;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/assets/images/bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

17
public/assets/js/main.js Normal file
View File

@ -0,0 +1,17 @@
(function($){skel.breakpoints({xlarge:'(max-width: 1680px)',large:'(max-width: 1280px)',medium:'(max-width: 980px)',small:'(max-width: 736px)',xsmall:'(max-width: 480px)',xxsmall:'(max-width: 360px)'});$(function(){var $window=$(window),$body=$('body'),$wrapper=$('#wrapper'),$header=$('#header'),$footer=$('#footer'),$main=$('#main'),$main_articles=$main.children('article');$body.addClass('is-loading');$window.on('load',function(){window.setTimeout(function(){$body.removeClass('is-loading');},100);});$('form').placeholder();if(skel.vars.IEVersion<12){var flexboxFixTimeoutId;$window.on('resize.flexbox-fix',function(){clearTimeout(flexboxFixTimeoutId);flexboxFixTimeoutId=setTimeout(function(){if($wrapper.prop('scrollHeight')>$window.height())
$wrapper.css('height','auto');else
$wrapper.css('height','100vh');},250);}).triggerHandler('resize.flexbox-fix');}
var $nav=$header.children('nav'),$nav_li=$nav.find('li');if($nav_li.length%2==0){$nav.addClass('use-middle');$nav_li.eq(($nav_li.length/2)).addClass('is-middle');}
var delay=325,locked=false;$main._show=function(id,initial){var $article=$main_articles.filter('#'+id);if($article.length==0)
return;if(locked||(typeof initial!='undefined'&&initial===true)){$body.addClass('is-switching');$body.addClass('is-article-visible');$main_articles.removeClass('active');$header.hide();$footer.hide();$main.show();$article.show();$article.addClass('active');locked=false;setTimeout(function(){$body.removeClass('is-switching');},(initial?1000:0));return;}
locked=true;if($body.hasClass('is-article-visible')){var $currentArticle=$main_articles.filter('.active');$currentArticle.removeClass('active');setTimeout(function(){$currentArticle.hide();$article.show();setTimeout(function(){$article.addClass('active');$window.scrollTop(0).triggerHandler('resize.flexbox-fix');setTimeout(function(){locked=false;},delay);},25);},delay);}
else{$body.addClass('is-article-visible');setTimeout(function(){$header.hide();$footer.hide();$main.show();$article.show();setTimeout(function(){$article.addClass('active');$window.scrollTop(0).triggerHandler('resize.flexbox-fix');setTimeout(function(){locked=false;},delay);},25);},delay);}};$main._hide=function(addState){var $article=$main_articles.filter('.active');if(!$body.hasClass('is-article-visible'))
return;if(typeof addState!='undefined'&&addState===true)
history.pushState(null,null,'#');if(locked){$body.addClass('is-switching');$article.removeClass('active');$article.hide();$main.hide();$footer.show();$header.show();$body.removeClass('is-article-visible');locked=false;$body.removeClass('is-switching');$window.scrollTop(0).triggerHandler('resize.flexbox-fix');return;}
locked=true;$article.removeClass('active');setTimeout(function(){$article.hide();$main.hide();$footer.show();$header.show();setTimeout(function(){$body.removeClass('is-article-visible');$window.scrollTop(0).triggerHandler('resize.flexbox-fix');setTimeout(function(){locked=false;},delay);},25);},delay);};$main_articles.each(function(){var $this=$(this);$('<div class="close">Close</div>').appendTo($this).on('click',function(){location.hash='';});$this.on('click',function(event){event.stopPropagation();});});$body.on('click',function(event){if($body.hasClass('is-article-visible'))
$main._hide(true);});$window.on('keyup',function(event){switch(event.keyCode){case 27:if($body.hasClass('is-article-visible'))
$main._hide(true);break;default:break;}});$window.on('hashchange',function(event){if(location.hash==''||location.hash=='#'){event.preventDefault();event.stopPropagation();$main._hide();}
else if($main_articles.filter(location.hash).length>0){event.preventDefault();event.stopPropagation();$main._show(location.hash.substr(1));}});if('scrollRestoration'in history)
history.scrollRestoration='manual';else{var oldScrollPos=0,scrollPos=0,$htmlbody=$('html,body');$window.on('scroll',function(){oldScrollPos=scrollPos;scrollPos=$htmlbody.scrollTop();}).on('hashchange',function(){$window.scrollTop(oldScrollPos);});}
$main.hide();$main_articles.hide();if(location.hash!=''&&location.hash!='#')
$window.on('load',function(){$main._show(location.hash.substr(1),true);});});})(jQuery);

2
public/assets/js/skel.min.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

49
public/assets/js/util.js Normal file
View File

@ -0,0 +1,49 @@
(function($){$.fn.navList=function(){var $this=$(this);$a=$this.find('a'),b=[];$a.each(function(){var $this=$(this),indent=Math.max(0,$this.parents('li').length-1),href=$this.attr('href'),target=$this.attr('target');b.push('<a '+
'class="link depth-'+indent+'"'+
((typeof target!=='undefined'&&target!='')?' target="'+target+'"':'')+
((typeof href!=='undefined'&&href!='')?' href="'+href+'"':'')+
'>'+
'<span class="indent-'+indent+'"></span>'+
$this.text()+
'</a>');});return b.join('');};$.fn.panel=function(userConfig){if(this.length==0)
return $this;if(this.length>1){for(var i=0;i<this.length;i++)
$(this[i]).panel(userConfig);return $this;}
var $this=$(this),$body=$('body'),$window=$(window),id=$this.attr('id'),config;config=$.extend({delay:0,hideOnClick:false,hideOnEscape:false,hideOnSwipe:false,resetScroll:false,resetForms:false,side:null,target:$this,visibleClass:'visible'},userConfig);if(typeof config.target!='jQuery')
config.target=$(config.target);$this._hide=function(event){if(!config.target.hasClass(config.visibleClass))
return;if(event){event.preventDefault();event.stopPropagation();}
config.target.removeClass(config.visibleClass);window.setTimeout(function(){if(config.resetScroll)
$this.scrollTop(0);if(config.resetForms)
$this.find('form').each(function(){this.reset();});},config.delay);};$this.css('-ms-overflow-style','-ms-autohiding-scrollbar').css('-webkit-overflow-scrolling','touch');if(config.hideOnClick){$this.find('a').css('-webkit-tap-highlight-color','rgba(0,0,0,0)');$this.on('click','a',function(event){var $a=$(this),href=$a.attr('href'),target=$a.attr('target');if(!href||href=='#'||href==''||href=='#'+id)
return;event.preventDefault();event.stopPropagation();$this._hide();window.setTimeout(function(){if(target=='_blank')
window.open(href);else
window.location.href=href;},config.delay+10);});}
$this.on('touchstart',function(event){$this.touchPosX=event.originalEvent.touches[0].pageX;$this.touchPosY=event.originalEvent.touches[0].pageY;})
$this.on('touchmove',function(event){if($this.touchPosX===null||$this.touchPosY===null)
return;var diffX=$this.touchPosX-event.originalEvent.touches[0].pageX,diffY=$this.touchPosY-event.originalEvent.touches[0].pageY,th=$this.outerHeight(),ts=($this.get(0).scrollHeight-$this.scrollTop());if(config.hideOnSwipe){var result=false,boundary=20,delta=50;switch(config.side){case 'left':result=(diffY<boundary&&diffY>(-1*boundary))&&(diffX>delta);break;case 'right':result=(diffY<boundary&&diffY>(-1*boundary))&&(diffX<(-1*delta));break;case 'top':result=(diffX<boundary&&diffX>(-1*boundary))&&(diffY>delta);break;case 'bottom':result=(diffX<boundary&&diffX>(-1*boundary))&&(diffY<(-1*delta));break;default:break;}
if(result){$this.touchPosX=null;$this.touchPosY=null;$this._hide();return false;}}
if(($this.scrollTop()<0&&diffY<0)||(ts>(th-2)&&ts<(th+2)&&diffY>0)){event.preventDefault();event.stopPropagation();}});$this.on('click touchend touchstart touchmove',function(event){event.stopPropagation();});$this.on('click','a[href="#'+id+'"]',function(event){event.preventDefault();event.stopPropagation();config.target.removeClass(config.visibleClass);});$body.on('click touchend',function(event){$this._hide(event);});$body.on('click','a[href="#'+id+'"]',function(event){event.preventDefault();event.stopPropagation();config.target.toggleClass(config.visibleClass);});if(config.hideOnEscape)
$window.on('keydown',function(event){if(event.keyCode==27)
$this._hide(event);});return $this;};$.fn.placeholder=function(){if(typeof(document.createElement('input')).placeholder!='undefined')
return $(this);if(this.length==0)
return $this;if(this.length>1){for(var i=0;i<this.length;i++)
$(this[i]).placeholder();return $this;}
var $this=$(this);$this.find('input[type=text],textarea').each(function(){var i=$(this);if(i.val()==''||i.val()==i.attr('placeholder'))
i.addClass('polyfill-placeholder').val(i.attr('placeholder'));}).on('blur',function(){var i=$(this);if(i.attr('name').match(/-polyfill-field$/))
return;if(i.val()=='')
i.addClass('polyfill-placeholder').val(i.attr('placeholder'));}).on('focus',function(){var i=$(this);if(i.attr('name').match(/-polyfill-field$/))
return;if(i.val()==i.attr('placeholder'))
i.removeClass('polyfill-placeholder').val('');});$this.find('input[type=password]').each(function(){var i=$(this);var x=$($('<div>').append(i.clone()).remove().html().replace(/type="password"/i,'type="text"').replace(/type=password/i,'type=text'));if(i.attr('id')!='')
x.attr('id',i.attr('id')+'-polyfill-field');if(i.attr('name')!='')
x.attr('name',i.attr('name')+'-polyfill-field');x.addClass('polyfill-placeholder').val(x.attr('placeholder')).insertAfter(i);if(i.val()=='')
i.hide();else
x.hide();i.on('blur',function(event){event.preventDefault();var x=i.parent().find('input[name='+i.attr('name')+'-polyfill-field]');if(i.val()==''){i.hide();x.show();}});x.on('focus',function(event){event.preventDefault();var i=x.parent().find('input[name='+x.attr('name').replace('-polyfill-field','')+']');x.hide();i.show().focus();}).on('keypress',function(event){event.preventDefault();x.val('');});});$this.on('submit',function(){$this.find('input[type=text],input[type=password],textarea').each(function(event){var i=$(this);if(i.attr('name').match(/-polyfill-field$/))
i.attr('name','');if(i.val()==i.attr('placeholder')){i.removeClass('polyfill-placeholder');i.val('');}});}).on('reset',function(event){event.preventDefault();$this.find('select').val($('option:first').val());$this.find('input,textarea').each(function(){var i=$(this),x;i.removeClass('polyfill-placeholder');switch(this.type){case 'submit':case 'reset':break;case 'password':i.val(i.attr('defaultValue'));x=i.parent().find('input[name='+i.attr('name')+'-polyfill-field]');if(i.val()==''){i.hide();x.show();}
else{i.show();x.hide();}
break;case 'checkbox':case 'radio':i.attr('checked',i.attr('defaultValue'));break;case 'text':case 'textarea':i.val(i.attr('defaultValue'));if(i.val()==''){i.addClass('polyfill-placeholder');i.val(i.attr('placeholder'));}
break;default:i.val(i.attr('defaultValue'));break;}});});return $this;};$.prioritize=function($elements,condition){var key='__prioritize';if(typeof $elements!='jQuery')
$elements=$($elements);$elements.each(function(){var $e=$(this),$p,$parent=$e.parent();if($parent.length==0)
return;if(!$e.data(key)){if(!condition)
return;$p=$e.prev();if($p.length==0)
return;$e.prependTo($parent);$e.data(key,$p);}
else{if(condition)
return;$p=$e.data(key);$e.insertAfter($p);$e.removeData(key);}});};})(jQuery);

5
public/css/font-awesome.min.css vendored Normal file

File diff suppressed because one or more lines are too long

445
public/css/global.css Normal file
View File

@ -0,0 +1,445 @@
/**
layui官网
By 贤心
*/
h1,h2,h3{font-size: 14px;}
/* 布局 */
.site-inline{font-size: 0;}
.site-tree, .site-content{display: inline-block; *display:inline; *zoom:1; vertical-align: top; font-size: 14px;}
.site-tree{width: 220px; min-height: 900px; padding: 5px 0 20px;}
.site-content{width: 899px; min-height: 900px; padding: 20px 0 10px 20px;}
/* 头部 */
.header{height: 59px; border-bottom: 1px solid #404553; background-color: #393D49;}
.logo{position: absolute; left: 0; top: 16px;}
.logo img{width: 82px; height: 31px;}
.header .layui-nav{position: absolute; right: 0; top: 0; padding: 0; background: none;}
.header .layui-nav .layui-nav-item{margin: 0 20px; }
.header .layui-nav .layui-nav-item[mobile]{display: none;}
.header .layui-container .logo{left: 15px;}
.header .layui-container .layui-nav{right: 15px;}
.menu{position: absolute; right: 0; top: 0; line-height: 65px;}
.menu a{display:inline-block; *display:inline; *zoom:1; vertical-align:top;}
.menu a{position: relative; padding: 0 20px; margin: 0 20px; color: #c2c2c2; font-size: 14px;}
.menu a:hover{color: #fff; transition: all .5s; -webkit-transition: all .5s}
.menu a.this{color: #fff}
.menu a.this::after{content: ''; position: absolute; left: 0; bottom: -1px; width: 100%; height: 5px; background-color: #5FB878;}
.header-index{background-color: #05031A; border: none;}
.header-index .site-banner-bg{}
.header-index[spring]{background-color: #0D1206}
.header-index[summer]{background-color: #0A0E11}
.header-index[autumn]{background-color: #100903}
.header-index[winter]{background-color: #0E0E0E}
.header-demo{height: 60px; border-bottom: none;}
.header-demo .logo{left: 40px;}
.header-demo .layui-nav{top: 0;}
.header-demo .layui-nav .layui-nav-item{margin: 0 10px;}
.header-demo .layui-nav .layui-this a{padding: 0 30px;}
.component{position: absolute; width: 200px; left: 120px; top: 16px; }
.component .layui-input{height: 30px; padding-left: 12px; background-color: #424652; background-color: rgba(255,255,255,.05); border: none 0; color: #fff; font-size: 12px;}
.component .layui-form-select .layui-edge{display: none; border-top-color: #999;}
.component .layui-form-select dl{top: 36px; background-color: rgba(255,255,255,.9)}
.header-demo .component{left: 185px;}
/* 子侧边 */
.layui-side-child{width: 160px!important; left: 200px; bottom: 60px!important; border-right: 1px solid #eee; background-color: #fff;}
.layui-side-child .layui-side-scroll{width: 170px;}
.layui-side-child .layui-nav{padding: 10px 0; width: 160px; border-radius: 0; background: none}
.layui-side-child .layui-nav-child{border-radius: 0;}
.layui-side-child .layui-nav .layui-nav-title a,
.layui-side-child .layui-nav .layui-nav-title a:hover,
.layui-side-child .layui-nav-itemed>a{color: #666 !important;}
.layui-side-child .layui-nav-itemed .layui-nav-child{margin-bottom: 10px; background: none !important;}
.layui-side-child .layui-nav .layui-nav-item a{height: 30px; line-height: 30px; color: #666;}
.layui-side-child .layui-nav .layui-nav-item a:hover{background: none !important;}
.layui-side-child .layui-nav .layui-nav-child a{color: #999 !important;}
.layui-side-child .layui-nav .layui-nav-more{display: none;}
.layui-side-child .layui-nav-tree .layui-this,
.layui-side-child .layui-nav-tree .layui-this>a,
.layui-side-child .layui-nav-tree .layui-nav-child dd.layui-this,
.layui-side-child .layui-nav-tree .layui-nav-child dd.layui-this a{background: none; color: #5FB878 !important;}
.layui-side-child .layui-nav .layui-nav-child a:hover{color: #009688 !important}
.layui-side-child .layui-nav-bar{background-color: #5FB878;}
/* 底部 */
.footer{padding: 30px 0; line-height: 30px; text-align: center; color: #666; font-weight: 300;}
body .layui-layout-admin .footer-demo{height: 50px; padding: 5px 0;}
.footer a{padding: 0 5px;}
.site-union{margin-top: 10px; color: #999;}
.site-union>*{display: inline-block; vertical-align: middle;}
.site-union a[upyun] img{width: 80px;}
.site-union span{position: relative; top: 3px;}
.site-union span a{padding: 0; display: inline; color: #999;}
.site-union span a:hover{text-decoration: underline;}
.footer-demo p{display: inline-block; vertical-align: middle; height: 50px; padding-right: 10px;}
.footer-demo .site-union{position: relative; top: -9px;}
/* 首页banner部分 */
.site-banner{position: relative; height: 600px; text-align: center; overflow: hidden; background-color: #393D49;}
.site-banner-bg
,.site-banner-main{position: absolute; left: 0; top: 0; width: 100%; height: 100%;}
.site-banner-bg{background-position: center 0;}
.site-zfj{padding-top: 25px; height: 220px;}
.site-zfj i{position: absolute; left: 50%; top: 25px; width: 200px; height: 200px; margin-left: -100px; font-size: 200px; color: #c2c2c2;}
@-webkit-keyframes site-zfj {
0% {opacity: 1; -webkit-transform: translate3d(0, 0, 0) rotate(0deg) scale(1);}
10% {opacity: 0.8; -webkit-transform: translate3d(-100px, 0px, 0) rotate(10deg) scale(0.7);}
35% {opacity: 0.6; -webkit-transform: translate3d(100px, 0px, 0) rotate(30deg) scale(0.4);}
50% {opacity: 0.4; -webkit-transform: translate3d(0, 0, 0) rotate(360deg) scale(0);}
80% {opacity: 0.2; -webkit-transform: translate3d(0, 0, 0) rotate(720deg) scale(1);}
90% {opacity: 0.1; -webkit-transform: translate3d(0, 0, 0) rotate(3600deg) scale(6);}
100% {opacity: 1; -webkit-transform: translate3d(0, 0, 0) rotate(3600deg) scale(1);}
}
@keyframes site-zfj {
0% {opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1);}
10% {opacity: 0.8; transform: translate3d(-100px, 0px, 0) rotate(10deg) scale(0.7);}
35% {opacity: 0.6; transform: translate3d(100px, 0px, 0) rotate(30deg) scale(0.4);}
50% {opacity: 0.4; transform: translate3d(0, 0, 0) rotate(360deg) scale(0);}
80% {opacity: 0.2; transform: translate3d(0, 0, 0) rotate(720deg) scale(1);}
90% {opacity: 0.1; transform: translate3d(0, 0, 0) rotate(3600deg) scale(6);}
100% {opacity: 1; transform: translate3d(0, 0, 0) rotate(3600deg) scale(1);}
}
@-webkit-keyframes site-desc {
0% { -webkit-transform: scale(1.1);}
100% {opacity: 1; -webkit-transform: scale(1);}
}
@keyframes site-desc {
0% { transform: scale(1.1);}
100% {transform: scale(1);}
}
.site-zfj-anim i{-webkit-animation-name: site-zfj; animation-name: site-zfj; -webkit-animation-duration: 5s; animation-duration: 5s; -webkit-animation-timing-function: linear; animation-timing-function: linear;}
.site-desc{position: relative; height: 70px; margin-top: 25px; background: url(../images/layui/desc.png) center no-repeat;}
.site-desc-anim{-webkit-animation-name: site-desc; animation-name: site-desc;}
.site-desc cite{position: absolute; bottom: -40px; left: 0; width: 100%; color: #c2c2c2; font-style: normal;}
.site-download{margin-top: 80px; font-size: 0;}
.site-download a{position: relative; padding: 0 45px 0 90px; height: 60px; line-height: 60px; border: 1px solid #c2c2c2; border-color: rgba(255,255,255,.2); font-size: 24px; color: #ccc; transition: all .5s; -webkit-transition: all .5s;}
.site-download a:hover{border-color: rgba(255,255,255,.3); color: #fff; background-color: rgba(255,255,255,.05); border-radius: 30px;}
.site-download a cite{position: absolute; left: 45px; font-size: 30px;}
.site-version{position: relative; margin-top: 15px; color: #ccc; font-size: 12px;}
.site-version span{padding: 0 3px;}
.site-version *{font-style: normal;}
.site-version a{color: #e2e2e2; text-decoration: underline;}
.site-banner-other{position: absolute; left: 0; bottom: 30px; width: 100%; text-align: center; font-size: 0;}
.site-banner-other iframe{border: none;}
.site-banner-other a{display: inline-block; vertical-align: middle; height: 28px; line-height: 28px; margin: 0 5px; padding: 0 8px; border-radius: 2px; color: #c2c2c2; color: rgba(255,255,255,.8); border: 1px solid #c2c2c2; border-color: rgba(255,255,255,.2); font-size: 14px; transition: all .5s; -webkit-transition: all .5s;}
.site-banner-other a:hover{color: #fff; background-color: rgba(255,255,255,.1);}
.site-idea{margin: 50px 0; font-size: 0; text-align: center; font-weight: 300;}
.site-idea li{display: inline-block; vertical-align: top; *display: inline; *zoom:1; font-size: 14px; }
.site-idea li{width: 298px; height: 150px; padding: 30px; line-height: 24px; margin-left: 30px; border: 1px solid #d2d2d2; text-align: left;}
.site-idea li:first-child{margin-left: 0}
.site-idea .layui-field-title{border-color: #d2d2d2}
.site-idea .layui-field-title legend{margin: 0 20px 20px 0; padding: 0 20px; text-align: center;}
/* 赞助商 */
.site-sponsor-home{margin-top: 40px; text-align: center;}
.site-sponsor-home .layui-btn{position: relative; width: 233px; height: 65px; line-height: 65px; background: none; border-color: #212121; font-size: 26px; border-radius: 6px; /*padding-left: 55px;*/}
.site-sponsor-home .layui-btn:hover{background: #4A4855; color: #BAB8C3;}
.site-sponsor-home .layui-btn:before{/*position: absolute; left: 15px; top: 15px; content: ''; width: 30px; height: 30px; background: url(http://cdn.layui.com/upload/2018_1/168_1514869467160_26113.png) center; background-repeat: no-repeat; background-size: contain;*/}
.site-sponsor-home p{position: relative; padding-top: 15px; font-size: 22px; color: #212121;}
.site-sponsor-home p:before{content: ''; position: relative; top: -2px; display: inline-block; vertical-align: middle; width: 30px; height: 30px; margin-right: 10px; background: url(http://cdn.layui.com/upload/2018_1/168_1514869467160_26113.png) center; background-repeat: no-repeat; background-size: contain;}
@media screen and (max-width: 750px) {
.site-sponsor-home .layui-btn{width: 180px; height: 45px; line-height: 45px; font-size: 20px;}
.site-sponsor-home p{font-size: 16px;}
.site-sponsor-home p:before{width: 20px; height: 20px;}
}
/* 辅助 */
.site-tips{margin-bottom: 10px; padding: 15px; line-height: 22px; border-left: 5px solid #0078AD; background-color: #f2f2f2;}
body .site-tips p{margin: 0;}
body .layui-layer-notice .layui-layer-content{padding: 20px; line-height: 26px; background-color: #393D49; color: #fff; font-weight: 300;}
.layui-layer-notice .layui-text{color: #f8f8f8;}
.layui-layer-notice .layui-text a{color: #009688;}
/* 目录 */
.site-dir{display: none;}
.site-dir li{line-height: 26px; margin-left: 20px; overflow: visible; list-style-type: disc;}
.site-dir li a{display: block;}
.site-dir li a:active{color: #01AAED;}
.site-dir li a.layui-this{color: #01AAED;}
body .layui-layer-dir{box-shadow: none; border: 1px solid #d2d2d2;}
body .layui-layer-dir .layui-layer-content{padding: 10px;}
.site-dir a em{padding-left: 5px; font-size: 12px; color: #c2c2c2; font-style: normal;}
/* 文档 */
.site-tree{border-right: 1px solid #eee; }
.site-tree .layui-tree{line-height: 32px;}
.site-tree .layui-tree li i{position: relative; font-size: 22px; color: #000}
.site-tree .layui-tree li a cite{padding: 0 8px;}
.site-tree .layui-tree .site-tree-noicon a cite{padding-left: 15px;}
.site-tree .layui-tree li a em{font-size: 12px; color: #bbb; padding-right: 5px; font-style: normal;}
.site-tree .layui-tree li h2{line-height: 36px; border-left: 5px solid #009E94; margin: 15px 0 5px; padding: 0 10px; background-color: #f2f2f2;}
.site-tree .layui-tree li ul{margin-left: 27px; line-height: 28px;}
.site-tree .layui-tree li ul a,
.site-tree .layui-tree li ul a i{color: #777;}
.site-tree .layui-tree li ul a:hover{color: #333;}
.site-tree .layui-tree li ul li{margin-left: 25px; overflow: visible; list-style-type: disc; /*list-style-position: inside;*/}
.site-tree .layui-tree li ul li cite,
.site-tree .layui-tree .site-tree-noicon ul li cite{padding-left: 0;}
.site-tree .layui-tree .layui-this a{color: #01AAED;}
.site-tree .layui-tree .layui-this .layui-icon{color: #01AAED;}
.site-fix .site-tree{position: fixed; top: 0; bottom: 0; z-index: 666; min-height: 0; overflow: auto; background-color: #fff;}
.site-fix .site-content{margin-left: 220px;}
.site-fix-footer .site-tree{/*margin-bottom: 120px;*/}
.site-title{ margin: 30px 0 20px;}
.site-title fieldset{border: none; padding: 0; border-top: 1px solid #eee;}
.site-title fieldset legend{margin-left: 20px; padding: 0 10px; font-size: 22px; font-weight: 300;}
.site-text a{color: #01AAED;}
.site-h1{margin-bottom: 20px; line-height: 60px; padding-bottom: 10px; color: #393D49; border-bottom: 1px solid #eee; font-size: 28px; font-weight: 300;}
.site-h1 .layui-icon{position: relative; top: 5px; font-size: 50px; margin-right: 10px;}
.site-text{position:relative;}
.site-text p{margin-bottom: 10px; line-height:22px;}
.site-text em{padding: 0 3px; font-weight: 500; font-style: italic; color: #666;}
.site-text code{margin:0 5px; padding: 3px 10px; border: 1px solid #e2e2e2; background-color: #fbfbfb; color: #666; border-radius: 2px;}
.site-table{width: 100%; margin: 10px 0;}
.site-table thead{background-color:#f2f2f2; }
.site-table th,
.site-table td{padding: 6px 15px; min-height: 20px; line-height: 20px; border:1px solid #ddd; font-size: 14px; font-weight: 400;}
.site-table tr:nth-child(even){background: #fbfbfb;}
.site-block{padding: 20px; border: 1px solid #eee;}
.site-block .layui-form{margin-right: 200px;}
/* 更新日志 */
.site-changelog .layui-timeline-title h2{display: inline-block;}
.site-changelog .layui-timeline-title .layui-badge-rim{top: -2px; left: 10px;}
/* 颜色 */
.site-doc-color{font-size: 0;}
.site-doc-color li{display: inline-block; vertical-align: middle; width: 180px; margin-left: 20px; margin-bottom: 20px; padding: 20px 10px; color: #fff; text-align: center; border-radius: 2px; line-height: 22px; font-size: 14px;}
.site-doc-color li p[tips]{opacity: 0.8; font-size: 12px;}
.site-doc-necolor li{width: 108px; margin-top: 15px; margin-left: 0; border-radius: 0;}
.site-doc-bgcolor li{padding: 10px;}
/* 宫格 */
.site-doc-icon{margin-bottom: 50px; font-size: 0;}
.site-doc-icon li{display: inline-block; vertical-align: middle; width: 127px; height: 105px; line-height: 25px; padding: 20px 0; margin-right: -1px; margin-bottom: -1px; border: 1px solid #e2e2e2; font-size: 14px; text-align: center; color: #666; transition: all .3s; -webkit-transition: all .3s;}
.site-doc-anim li{height: auto;}
.site-doc-icon li .layui-icon{display: inline-block; font-size: 36px;}
.site-doc-icon li .doc-icon-name,
.site-doc-icon li .doc-icon-code{color: #c2c2c2;}
.site-doc-icon li .doc-icon-fontclass{height: 40px; line-height: 20px; padding: 0 5px; font-size: 13px; color: #333; }
.site-doc-icon li:hover{background-color: #f2f2f2; color: #000;}
/* 栅格示例 */
.grid-demo{padding: 10px; line-height: 50px; text-align: center; background-color: #79C48C; color: #fff;}
.grid-demo-bg1{background-color: #63BA79;}
.grid-demo-bg2{background-color: #49A761;}
.grid-demo-bg3{background-color: #38814A;}
/* 演示 */
body .layui-layout-admin .site-demo{bottom: 0px;padding: 0;}/*bottom: 60px;*/
body .site-demo-nav .layui-nav-item{line-height: 40px}
.layui-nav-item .layui-icon{position: relative; font-size: 20px;}
.layui-nav-item a cite{padding: 0 10px;}
.site-demo .layui-main{margin: 15px; line-height: 22px;}
.site-demo-editor{position: absolute; top: 0; bottom: 0; left: 0; width: 50%; }
.site-demo-area{position: absolute; top: 0; bottom: 0; width: 100%;}
.site-demo-editor textarea{position: absolute; width: 100%; height: 100%; padding: 10px; border: none; resize: none; background-color: #F7FBFF; background-color: #13151A; color: #999; font-family: Courier New; font-size: 12px; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}
.site-demo-btn{position: absolute; bottom: 15px; right: 20px;}
.site-demo-zanzhu{position: absolute; bottom: 0; left: 0; width: 100%; height: 90px; text-align: center; background-color: #e2e2e2; overflow: hidden;}
.site-demo-zanzhu>*{position: relative; z-index: 1;}
.site-demo-zanzhu:before{content: ""; position: absolute; z-index: 0; top: 50%; left: 50%; width: 120px; margin: -10px 0px 0px -60px; text-align: center; color: rgb(170, 170, 170); font-size: 18px; font-weight: 300; }
.site-demo-result{position: absolute; right: 0; top: 0; bottom: 0; width: 50%;}
.site-demo-result iframe{position: absolute; width: 100%; height: 100%;}
.site-demo-button{margin-bottom: 30px;}
.site-demo-button div{margin: 20px 30px 10px;}
.site-demo-button .layui-btn+.layui-btn{margin-left: 0;}
.site-demo-button .layui-btn{margin: 0 7px 10px 0; }
.site-demo-text a{color: #01AAED;}
.site-demo-laytpl{text-align: center;}
.site-demo-laytpl textarea,
.site-demo-laytpl div span{width: 40%; padding: 15px; margin: 0 15px;}
.site-demo-laytpl textarea{height: 300px; border: none; background-color: #3F3F3F; color: #E3CEAB; font-family: Courier New; resize: none;}
.site-demo-laytpl div span{display: inline-block; text-align: center; background: #101010; color: #fff;}
.site-demo-tplres{margin: 10px 0; text-align: center}
.site-demo-tplres .site-demo-tplh2,
.site-demo-tplres .site-demo-tplview{display: inline-block; width: 50%;}
.site-demo-tplres h2{padding: 15px; background: #e2e2e2;}
.site-demo-tplres h3{font-weight: 700;}
.site-demo-tplres div{padding: 14px; border: 1px solid #e2e2e2; text-align: left;}
.site-demo-upload,
.site-demo-upload img{width: 200px; height: 200px; border-radius: 100%;}
.site-demo-upload{position: relative; background: #e2e2e2;}
.site-demo-upload .site-demo-upbar{position: absolute; top: 50%; left: 50%; margin: -18px 0 0 -56px;}
.site-demo-upload .layui-upload-button{background-color: rgba(0,0,0,.2); color: rgba(255,255,255,1);}
.site-demo-util{position: relative; width: 300px;}
.site-demo-util img{width: 300px; border-radius: 100%;}
.site-demo-util span{position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #333; cursor: pointer;}
@-webkit-keyframes demo-fengjie {
0% {-webkit-filter: blur(0); opacity: 1; background: #fff; height: 300px; border-radius: 100%;}
80% {-webkit-filter: blur(50px); opacity: 0.95;}
100% {-webkit-filter: blur(20px); opacity: 0; background: #fff;}
}
@keyframes demo-fengjie {
0% {filter: blur(0); opacity: 1; background: #fff; height: 300px; border-radius: 100%;}
80% {filter: blur(50px); opacity: 0.95;}
100% {filter: blur(20px); opacity: 0; background: #fff;}
}
.site-demo-fengjie{-webkit-animation-name: demo-fengjie; animation-name: demo-fengjie; -webkit-animation-duration: 5s; animation-duration: 5s;}
.layui-layout-admin .site-demo-body{/* top: 106px; */}
.site-demo-title{position: fixed; left: 200px; right: 0; top: 65px;}
.site-demo-code{position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: none; padding: 10px; resize: none; font-size: 12px; background-color: #F7FBFF; color: #881280; font-family: Courier New;}
.site-demo-overflow{overflow: hidden;}
/* 其它 */
#trans-tooltip,
#tip-arrow-bottom,
#tip-arrow-top{display: none !important;}
/* 独立组件 与 主页 */
.alone{text-align: center; background-color: #009688; color: #fff; font-weight: 300; transition: all .3s; -webkit-transition: all .3s;}
.alone:hover{background-color: #5FB878;}
.alone a{display: block; padding: 50px 20px; color: #fff; font-size: 30px;}
.alone a cite{display: block; padding-top: 10px; font-size: 14px;}
.alone-banner{height: 190px; text-align: center; font-weight: 300; background-color: #009688; color:#fff;}
.alone-banner h1{padding-top: 60px; line-height: 32px; font-size: 30px; font-weight: 300;}
.alone-banner p{padding-top: 20px; color: #e2e2e2; color: rgba(255,255,255,.8);}
.alone-nav .layui-tab-title li{margin-right: 30px; padding: 0; color: #666;}
.alone-nav .layui-tab-title li a{ padding: 0 20px;}
.alone-download{margin: 30px 0;}
.alone-download .layui-btn{margin-right: 10px;}
.alone-download span{display: inline-block; line-height: 44px; padding-right: 20px;}
.alone-download span em{color: #999;}
.alone-title{margin-top: 20px;}
.alone-download-btn{text-align: center; margin-top: 50px; font-size: 0;}
.alone-download-btn .layui-btn{position: relative; width: 206px; height: 60px; line-height: 60px; font-size: 26px; font-weight: 300;}
.alone-download-btn .layui-btn+.layui-btn{margin: 0;}
.alone-download-btn .alone-download-right{margin-left: 20px !important; border-color: #009688; background: none; color: #009688;}
.alone-download-btn .layui-btn img{position: relative; top: -3px; width: 118px;}
/* 适配多设备 */
@media screen and (max-width: 750px) {
.layui-main{width: auto; margin: 0 10px;}
.logo,
.header-demo .logo{left: 10px;}
.component{display: none}
.header .layui-nav-child{left: auto; right: 0;}
.site-demo-overflow{overflow: auto;}
.site-nav-layim{display: none !important;}
.header .layui-nav .layui-nav-item{margin: 0;}
.header .layui-nav .layui-nav-item a{padding: 0 20px;}
.header .layui-nav .layui-nav-item[pc]{display: none;}
.header .layui-nav .layui-nav-item[mobile]{display: inline-block;}
.site-banner{height: 300px;}
.site-banner-bg{background-size: cover;}
.site-zfj{height: 100px; padding-top: 5px;}
.site-zfj i{top: 10px; width: 100px; height: 100px; margin-left: -50px; font-size: 100px;}
.site-desc{background-size: 70%; margin: 0;}
.site-desc cite{display: none;}
.site-download{margin-top: 0; }
.site-download a{height: 40px; line-height: 40px; padding: 0 25px 0 60px; border-radius: 30px; color: #fff; font-size: 16px;}
.site-download a cite{left: 20px;}
.site-banner-other{bottom: 10px;}
.site-idea{margin: 20px 0;}
.site-idea li{margin: 0 0 20px 0; width: 100%; height: auto; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}
.site-hengfu img{max-width: 100%}
.site-block .layui-form{margin-right: 0;}
.layui-layer-dir{display: none;}
.site-tree{position: fixed; top: 0; bottom: 0; min-height: 0; overflow: auto; z-index: 1000; left: -260px; background-color: #fff; transition: all .3s; -webkit-transition: all .3s;}
.site-content{width: 100%; padding: 0; overflow: auto;}
.site-content img{max-width: 100%;}
.site-tree-mobile{display: block!important; position: fixed; z-index: 100000; bottom: 15px; left: 15px; width: 50px; height: 50px; line-height: 50px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;}
.site-home .site-tree-mobile{display: none!important;}
.site-mobile .site-tree-mobile{display: none !important;}
.site-mobile .site-tree{left: 0;}
.site-mobile .site-mobile-shade{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.8); z-index: 999;}
.site-tree-mobile i{font-size: 20px;}
.layui-code-view{-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
.layui-layout-admin .layui-side{position: fixed; top: 0; left: -260px; transition: all .3s; -webkit-transition: all .3s; z-index: 10000;}
.layui-body{position: static; bottom: 0; left: 0;}
.site-mobile .layui-side{left: 0;}
.site-mobile .layui-side-child{top: 50%; left: 200px; height: 300px; margin-top: -100px;}
body .layui-layout-admin .footer-demo{position: static; height: auto; line-height: 30px;}
.footer-demo p{height: auto;}
.site-demo-area,
.site-demo-editor,
.site-demo-result,
.site-demo-editor textarea,
.site-demo-result iframe{position: static; width: 100%;}
.site-demo-editor textarea{height: 350px;}
.site-demo-zanzhu{display: none;}
.site-demo-btn{bottom: auto; top: 370px;}
.site-demo-result iframe{height: 500px;}
.site-demo-laytpl textarea, .site-demo-laytpl div span{margin: 0;}
.site-demo-tplres .site-demo-tplh2, .site-demo-tplres .site-demo-tplview{width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
.site-demo-title{position: static; left: 0;}
body .layui-layout-admin .site-demo{}
.site-demo-code{position: static; height: 350px;}
}
@-webkit-keyframes site-anim-closeup{ /* 特写 */
from {-webkit-transform: translate3d(0, 0, 0) scale(1); opacity: 1;}
to { -webkit-transform: translate3d(0, 400px, 0) scale(2); opacity: 0.5;}
}
@keyframes site-anim-closeup{
from {transform: translate3d(0, 0, 0) scale(1); opacity: 1;}
to {transform: translate3d(0, 400px, 0) scale(2); opacity: 0.5;}
}
.site-out-up{-webkit-animation-duration: 3s; animation-duration: 3s; -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-name: site-anim-closeup; animation-name: site-anim-closeup; overflow: hidden;}

View File

@ -0,0 +1,63 @@
@font-face {
font-family: MuiiconSpread;
font-weight: normal;
font-style: normal;
src: url('mui-icons-extra.ttf') format('truetype'); /* iOS 4.1- */
}
.mui-icon-extra
{
font-family: MuiiconSpread;
font-size: 24px;
font-weight: normal;
font-style: normal;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
}
.mui-icon-extra-cold:before { content: "\e500"; }
.mui-icon-extra-share:before { content: "\e200"; }
.mui-icon-extra-class:before { content: "\e118"; }
.mui-icon-extra-custom:before { content: "\e117"; }
.mui-icon-extra-new:before { content: "\e103"; }
.mui-icon-extra-card:before { content: "\e104"; }
.mui-icon-extra-grech:before { content: "\e105"; }
.mui-icon-extra-trend:before { content: "\e106"; }
.mui-icon-extra-filter:before { content: "\e207"; }
.mui-icon-extra-holiday:before { content: "\e300"; }
.mui-icon-extra-cart:before { content: "\e107"; }
.mui-icon-extra-heart:before { content: "\e180"; }
.mui-icon-extra-computer:before { content: "\e600"; }
.mui-icon-extra-express:before { content: "\e108"; }
.mui-icon-extra-gift:before { content: "\e109"; }
.mui-icon-extra-gold:before { content: "\e102"; }
.mui-icon-extra-lamp:before { content: "\e601"; }
.mui-icon-extra-rank:before { content: "\e110"; }
.mui-icon-extra-notice:before { content: "\e111"; }
.mui-icon-extra-sweep:before { content: "\e202"; }
.mui-icon-extra-arrowleftcricle:before { content: "\e401"; }
.mui-icon-extra-dictionary:before { content: "\e602"; }
.mui-icon-extra-heart-filled:before { content: "\e119"; }
.mui-icon-extra-xiaoshuo:before { content: "\e607"; }
.mui-icon-extra-top:before { content: "\e403"; }
.mui-icon-extra-people:before { content: "\e203"; }
.mui-icon-extra-topic:before { content: "\e603"; }
.mui-icon-extra-hotel:before { content: "\e301"; }
.mui-icon-extra-like:before { content: "\e206"; }
.mui-icon-extra-regist:before { content: "\e201"; }
.mui-icon-extra-order:before { content: "\e113"; }
.mui-icon-extra-alipay:before { content: "\e114"; }
.mui-icon-extra-find:before { content: "\e400"; }
.mui-icon-extra-arrowrightcricle:before { content: "\e402"; }
.mui-icon-extra-calendar:before { content: "\e115"; }
.mui-icon-extra-prech:before { content: "\e116"; }
.mui-icon-extra-cate:before { content: "\e501"; }
.mui-icon-extra-comment:before { content: "\e209"; }
.mui-icon-extra-at:before { content: "\e208"; }
.mui-icon-extra-addpeople:before { content: "\e204"; }
.mui-icon-extra-peoples:before { content: "\e205"; }
.mui-icon-extra-calc:before { content: "\e101"; }
.mui-icon-extra-classroom:before { content: "\e604"; }
.mui-icon-extra-phone:before { content: "\e404"; }
.mui-icon-extra-university:before { content: "\e605"; }
.mui-icon-extra-outline:before { content: "\e606"; }

129
public/css/login.css Normal file
View File

@ -0,0 +1,129 @@
html{height: 100%;}
#canvas-wrapper {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
}
body.signin {
background: #18c8f6;
height: auto;
/*background:url("/images/login-background.jpg") no-repeat center fixed;*/
background: #2f4050;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
color: rgba(255,255,255,.95);
}
.signinpanel {
width: 320px;
margin: 10% auto 0 auto;
background: #2f4050;
}
.signinpanel .logopanel {
float: none;
width: auto;
padding: 0;
background: none;
}
.signinpanel .signin-info ul {
list-style: none;
padding: 0;
margin: 20px 0;
}
.signinpanel .form-control {
display: block;
margin-top: 15px;
}
.signinpanel .uname {
/*background: #fff url(../img/user.png) no-repeat 95% center;*/
color:#333;
}
.signinpanel .pword {
/*background: #fff url(../img/locked.png) no-repeat 95% center;*/
color:#333;
}
.signinpanel .btn {
margin-top: 15px;
}
.signinpanel .vld-code {
float: right;
clear:right;
position:relative;
margin-top:-30px;
}
.signinpanel .vld-code img {
cursor: pointer;
width: 80px;
height: 30px;
}
.signinpanel .vld-code .reset-code {
display: block;
cursor: pointer;
font-size:12px;
color:chocolate;
}
.signinpanel form {
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255,255,255,.3);
-moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
-webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
padding: 30px;
}
.signup-footer{border-top: solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top: 15px;}
@media screen and (max-width: 768px) {
.signinpanel,
.signuppanel {
margin: 0 auto;
width: 420px!important;
padding: 20px;
}
.signinpanel form {
margin-top: 20px;
}
.signup-footer {
margin-bottom: 10px;
}
.signuppanel .form-control {
margin-bottom: 10px;
}
.signup-footer .pull-left,
.signup-footer .pull-right {
float: none !important;
text-align: center;
}
.signinpanel .signin-info ul {
display: none;
}
}
@media screen and (max-width: 320px) {
.signinpanel,
.signuppanel {
margin:0 20px;
width:auto;
}
}
.field-validation-error {
color: #f13636;
text-align:left;
}

8335
public/css/style.css Normal file

File diff suppressed because it is too large Load Diff

5
public/doc.html Normal file
View File

@ -0,0 +1,5 @@
<html>
<body>
zhelis
</body>
</html>

19
public/error.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>存在搭建问题</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
</head>
<body class="body">
<div style="padding: 15px;color: red;">
<h1 style="text-align: center">检测到运行目录未设定成public</h1><br><br>
<h1 style="text-align: center">请在宝塔面板-网站-设置-网站目录->修改运行目录为public并保存同时关闭防跨站攻击</h1><br><br>
</div>
</body>
</html>

29
public/example/index.html Normal file
View File

@ -0,0 +1,29 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>测试支付</title>
</head>
<body>
<p>商户订单号:<input type="text" id="payId"/></p>
<p>商户订单价:<input type="number" id="price" value="0.1"/></p>
<p>自定义参数:<input type="text" id="param" value="vone666"/></p>
<p>支付方式:<select id="type"><option value="1">微信支付</option><option value="2">支付宝支付</option></select></p>
<button onclick="zf()">支付</button>
<script src="https://lib.baomitu.com/jquery/3.4.0/jquery.min.js"></script>
<script>
$("#payId").val(new Date().getTime());
function zf() {
var p = "payId="+$("#payId").val() + "&price="+$("#price").val()+"&param="+$("#param").val()+"&type="+$("#type").val();
window.location.href = "main.php?" + p;
}
</script>
</body>
</html>

11
public/example/main.php Normal file
View File

@ -0,0 +1,11 @@
<?php
ini_set("error_reporting","E_ALL & ~E_NOTICE");
$key = "7eed756ca37ca057370ea9bb208d25fa";//通讯密钥
$host = "../createOrder";
$sign = md5($_GET['payId'].$_GET['param'].$_GET['type'].$_GET['price'].$key);
$p = "payId=".$_GET['payId'].'&param='.$_GET['param'].'&type='.$_GET['type']."&price=".$_GET['price'].'&sign='.$sign.'&isHtml=1';
echo "<script>window.location.href = '".$host."?".$p."'</script>";

24
public/example/notify.php Normal file
View File

@ -0,0 +1,24 @@
<?php
ini_set("error_reporting","E_ALL & ~E_NOTICE");
$key = "7eed756ca37ca057370ea9bb208d25fa";//通讯密钥
$payId = $_GET['payId'];//商户订单号
$param = $_GET['param'];//创建订单的时候传入的参数
$type = $_GET['type'];//支付方式 微信支付为1 支付宝支付为2
$price = $_GET['price'];//订单金额
$reallyPrice = $_GET['reallyPrice'];//实际支付金额
$sign = $_GET['sign'];//校验签名,计算方式 = md5(payId + param + type + price + reallyPrice + 通讯密钥)
//开始校验签名
$_sign = md5($payId . $param . $type . $price . $reallyPrice . $key);
if ($_sign != $sign) {
echo "error_sign";//sign校验不通过
exit();
}
echo "success";
//继续业务流程
//echo "商户订单号:".$payId ."<br>自定义参数:". $param ."<br>支付方式:". $type ."<br>订单金额:". $price ."<br>实际支付金额:". $reallyPrice;
?>

22
public/example/return.php Normal file
View File

@ -0,0 +1,22 @@
<?php
ini_set("error_reporting","E_ALL & ~E_NOTICE");
$key = "7eed756ca37ca057370ea9bb208d25fa";//通讯密钥
$payId = $_GET['payId'];//商户订单号
$param = $_GET['param'];//创建订单的时候传入的参数
$type = $_GET['type'];//支付方式 微信支付为1 支付宝支付为2
$price = $_GET['price'];//订单金额
$reallyPrice = $_GET['reallyPrice'];//实际支付金额
$sign = $_GET['sign'];//校验签名,计算方式 = md5(payId + param + type + price + reallyPrice + 通讯密钥)
//开始校验签名
$_sign = md5($payId . $param . $type . $price . $reallyPrice . $key);
if ($_sign != $sign) {
echo "error_sign";//sign校验不通过
exit();
}
//继续业务流程
echo "商户订单号:".$payId ."<br>自定义参数:". $param ."<br>支付方式:". $type ."<br>订单金额:". $price ."<br>实际支付金额:". $reallyPrice;
?>

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
public/image/bj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

BIN
public/image/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

106
public/index.html Normal file
View File

@ -0,0 +1,106 @@
<!DOCTYPE HTML>
<html>
<head>
<title>V免签</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta charset="utf-8" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="bookmark" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
</head>
<body>
<div id="wrapper">
<header id="header">
<div class="logo">
<span class="icon fa-rmb"></span>
</div>
<div class="content">
<div class="inner">
<h1>V免签</h1>
<p>个人用户收款解决方案</p>
</div>
</div>
<nav>
<ul>
<li><a href="#login">登录</a></li>
<li><a href="#about">简介</a></li>
</ul>
</nav>
</header>
<div id="main">
<article id="about">
<h2 class="major">简介</h2>
<p>1、V免签为个人用户提供支付宝、微信的免签约收款解决方案。</p>
<p>2、V免签为开源免费产品请勿二次出售。</p>
<p>3、V免签仅供交流学习使用请勿用于商业用途。</p>
<p>4、请遵守相关法律法规请勿用于非法用途。</p>
<p><input type="submit" value="获取V免签" class="" onclick="window.location.href='https://github.com/szvone/vmqphp'"/></p>
</article>
<article id="login">
<h2 class="major">登录</h2>
<form method="post" action="javascript:login();">
<div class="field half first">
<label for="user">账号</label>
<input type="text" name="user" id="user" />
</div>
<div class="field half">
<label for="pass">密码</label>
<input type="password" name="pass" id="pass" />
</div>
<ul class="actions">
<li><input id="login2" type="submit" value="登录" class="special" /></li>
<li><input type="reset" value="清空" /></li>
</ul>
</form>
<br>
<div id="result" role="dialog">
<p color class="h5 margin-top-sm text-black-hint" id="msg"></p>
</div>
</article>
</div>
<footer id="footer">
<p class="copyright">&copy;2019 V免签</p>
</footer>
</div>
<div id="bg"></div>
<script src="./assets/js/jQuery@1.11.3.js"></script>
<script src="./assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/layer.js"></script>
<script>
function login() {
try {
$.post("login","user="+$("#user").val()+"&pass="+$("#pass").val(),function (data) {
layer.msg(data.msg);
if (data.code==1){
window.location.href = "aaa.html";
}
});
}catch (e) {
layer.alert("程序出错,请检查:<br>1、伪静态是否设置成功<br>2、是否设置好数据库账号密码并导入数据库脚本")
}
}
</script>
</body>
</html>

25
public/index.php Normal file
View File

@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// [ 应用入口文件 ]
namespace think;
// 加载基础文件
require __DIR__ . '/../thinkphp/base.php';
// 支持事先使用静态方法设置Request对象和Config对象
// 执行应用并响应
Container::get('app')->run()->send();

237
public/js/canvasbg.js Normal file

File diff suppressed because one or more lines are too long

229
public/js/global.js Normal file
View File

@ -0,0 +1,229 @@
/**
layui官网
*/
layui.define(['code', 'element', 'table', 'util'], function(exports){
var $ = layui.jquery
,element = layui.element
,layer = layui.layer
,form = layui.form
,util = layui.util
,device = layui.device()
,$win = $(window), $body = $('body');
//阻止IE7以下访问
if(device.ie && device.ie < 8){
layer.alert('Layui最低支持ie8您当前使用的是古老的 IE'+ device.ie + ',你丫的肯定不是程序猿!');
}
var home = $('#LAY_home');
//首页banner
setTimeout(function(){
$('.site-zfj').addClass('site-zfj-anim');
setTimeout(function(){
$('.site-desc').addClass('site-desc-anim')
}, 5000)
}, 100);
//数字前置补零
var digit = function(num, length, end){
var str = '';
num = String(num);
length = length || 2;
for(var i = num.length; i < length; i++){
str += '0';
}
return num < Math.pow(10, length) ? str + (num|0) : num;
};
for(var i = 0; i < $('.adsbygoogle').length; i++){
(adsbygoogle = window.adsbygoogle || []).push({});
}
//展示当前版本
$('.site-showv').html(layui.v);
//固定Bar
if(global.pageType !== 'demo'){
util.fixbar({
bar1: true
,click: function(type){
if(type === 'bar1'){
location.href = '//fly.layui.com/';
}
}
});
}
/*
//窗口scroll
;!function(){
var main = $('.site-tree').parent(), scroll = function(){
var stop = $(window).scrollTop();
if($(window).width() <= 750) return;
var bottom = $('.footer').offset().top - $(window).height();
if(stop > 61 && stop < bottom){
if(!main.hasClass('site-fix')){
main.addClass('site-fix');
}
if(main.hasClass('site-fix-footer')){
main.removeClass('site-fix-footer');
}
} else if(stop >= bottom) {
if(!main.hasClass('site-fix-footer')){
main.addClass('site-fix site-fix-footer');
}
} else {
if(main.hasClass('site-fix')){
main.removeClass('site-fix').removeClass('site-fix-footer');
}
}
stop = null;
};
scroll();
$(window).on('scroll', scroll);
}();
*/
//示例页面滚动
$('.site-demo-body').on('scroll', function(){
var elemDate = $('.layui-laydate')
,elemTips = $('.layui-table-tips');
if(elemDate[0]){
elemDate.each(function(){
var othis = $(this);
if(!othis.hasClass('layui-laydate-static')){
othis.remove();
}
});
$('input').blur();
}
if(elemTips[0]) elemTips.remove();
if($('.layui-layer')[0]){
layer.closeAll('tips');
}
});
//代码修饰
layui.code({
elem: 'pre'
});
//目录
var siteDir = $('.site-dir');
if(siteDir[0] && $(window).width() > 750){
layer.ready(function(){
layer.open({
type: 1
,content: siteDir
,skin: 'layui-layer-dir'
,area: 'auto'
,maxHeight: $(window).height() - 300
,title: '目录'
//,closeBtn: false
,offset: 'r'
,shade: false
,success: function(layero, index){
layer.style(index, {
marginLeft: -15
});
}
});
});
siteDir.find('li').on('click', function(){
var othis = $(this);
othis.find('a').addClass('layui-this');
othis.siblings().find('a').removeClass('layui-this');
});
}
//在textarea焦点处插入字符
var focusInsert = function(str){
var start = this.selectionStart
,end = this.selectionEnd
,offset = start + str.length
this.value = this.value.substring(0, start) + str + this.value.substring(end);
this.setSelectionRange(offset, offset);
};
//演示页面
$('body').on('keydown', '#LAY_editor, .site-demo-text', function(e){
var key = e.keyCode;
if(key === 9 && window.getSelection){
e.preventDefault();
focusInsert.call(this, ' ');
}
});
var editor = $('#LAY_editor')
,iframeElem = $('#LAY_demo')
,demoForm = $('#LAY_demoForm')[0]
,demoCodes = $('#LAY_demoCodes')[0]
,runCodes = function(){
if(!iframeElem[0]) return;
var html = editor.val();
html = html.replace(/=/gi,"layequalsign");
html = html.replace(/script/gi,"layscrlayipttag");
demoCodes.value = html.length > 100*1000 ? '<h1>卧槽,你的代码过长</h1>' : html;
demoForm.action = '/api/runHtml/';
demoForm.submit();
};
$('#LAY_demo_run').on('click', runCodes), runCodes();
//让导航在最佳位置
var thisItem = $('.site-demo-nav').find('dd.layui-this');
if(thisItem[0]){
var itemTop = thisItem.offset().top
,winHeight = $(window).height()
,elemScroll = $('.layui-side-scroll');
if(itemTop > winHeight - 120){
elemScroll.animate({'scrollTop': itemTop/2}, 200)
}
}
//点击查看代码选项
element.on('tab(demoTitle)', function(obj){
if(obj.index === 1){
if(device.ie && device.ie < 9){
layer.alert('强烈不推荐你通过ie8/9 查看代码!因为,所有的标签都会被格式成大写,且没有换行符,影响阅读');
}
}
})
//手机设备的简单适配
var treeMobile = $('.site-tree-mobile')
,shadeMobile = $('.site-mobile-shade')
treeMobile.on('click', function(){
$('body').addClass('site-mobile');
});
shadeMobile.on('click', function(){
$('body').removeClass('site-mobile');
});
exports('global', {});
});

File diff suppressed because one or more lines are too long

3
public/js/layer.js Normal file

File diff suppressed because one or more lines are too long

2491
public/js/llqrcode.js Normal file

File diff suppressed because one or more lines are too long

2
public/js/skel.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
/** layui-v2.4.5 MIT License By https://www.layui.com */
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 274 KiB

Some files were not shown because too many files have changed in this diff Show More