add
This commit is contained in:
commit
b8cd0c9418
34
.env
Normal file
34
.env
Normal file
@ -0,0 +1,34 @@
|
||||
APP_DEBUG=true
|
||||
|
||||
[APP]
|
||||
DEFAULT_TIMEZONE=Asia/Singapore
|
||||
|
||||
[DATABASE]
|
||||
TYPE=mysql
|
||||
HOSTNAME=127.0.0.1
|
||||
DATABASE=club
|
||||
USERNAME=root
|
||||
PASSWORD=8a2cff86ad165fsd
|
||||
HOSTPORT=3306
|
||||
CHARSET=utf8
|
||||
DEBUG=true
|
||||
|
||||
[LANG]
|
||||
default_lang=zh-cn
|
||||
|
||||
[SYSTEM]
|
||||
WEBSOCKET=192.168.88.244:8802
|
||||
PROTOCOL=http
|
||||
LOGO_PATH=/static/logo/fop_180_180.png
|
||||
PLAYER=http://192.168.0.254/zb.html
|
||||
dt_half = 1
|
||||
SB_SERVER=http://192.168.6.32:8080
|
||||
|
||||
[SWOOLE]
|
||||
HOST=0.0.0.0
|
||||
HOST_LOCAL=127.0.0.1
|
||||
PORT=8082
|
||||
DAEMONIZE=false
|
||||
|
||||
[DOMAIN]
|
||||
CONSOLE=12fds5efe.abc.cc
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.ace-tool/
|
||||
42
.travis.yml
Normal file
42
.travis.yml
Normal 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
|
||||
7
404.html
Normal file
7
404.html
Normal file
@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<head><title>404 Not Found</title></head>
|
||||
<body>
|
||||
<center><h1>404 Not Found</h1></center>
|
||||
<hr><center>nginx</center>
|
||||
</body>
|
||||
</html>
|
||||
32
LICENSE.txt
Normal file
32
LICENSE.txt
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
|
||||
版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
|
||||
All rights reserved。
|
||||
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
|
||||
|
||||
Apache Licence是著名的非盈利开源组织Apache采用的协议。
|
||||
该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,
|
||||
允许代码修改,再作为开源或商业软件发布。需要满足
|
||||
的条件:
|
||||
1. 需要给代码的用户一份Apache Licence ;
|
||||
2. 如果你修改了代码,需要在被修改的文件中说明;
|
||||
3. 在延伸的代码中(修改和有源代码衍生的代码中)需要
|
||||
带有原来代码中的协议,商标,专利声明和其他原来作者规
|
||||
定需要包含的说明;
|
||||
4. 如果再发布的产品中包含一个Notice文件,则在Notice文
|
||||
件中需要带有本协议内容。你可以在Notice中增加自己的
|
||||
许可,但不可以表现为对Apache Licence构成更改。
|
||||
具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
BIN
app/.DS_Store
vendored
Normal file
BIN
app/.DS_Store
vendored
Normal file
Binary file not shown.
1
app/.htaccess
Normal file
1
app/.htaccess
Normal file
@ -0,0 +1 @@
|
||||
deny from all
|
||||
22
app/AppService.php
Normal file
22
app/AppService.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app;
|
||||
|
||||
use think\Service;
|
||||
|
||||
/**
|
||||
* 应用服务类
|
||||
*/
|
||||
class AppService extends Service
|
||||
{
|
||||
public function register()
|
||||
{
|
||||
// 服务注册
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
// 服务启动
|
||||
}
|
||||
}
|
||||
58
app/ExceptionHandle.php
Normal file
58
app/ExceptionHandle.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
namespace app;
|
||||
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\exception\Handle;
|
||||
use think\exception\HttpException;
|
||||
use think\exception\HttpResponseException;
|
||||
use think\exception\ValidateException;
|
||||
use think\Response;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 应用异常处理类
|
||||
*/
|
||||
class ExceptionHandle extends Handle
|
||||
{
|
||||
/**
|
||||
* 不需要记录信息(日志)的异常类列表
|
||||
* @var array
|
||||
*/
|
||||
protected $ignoreReport = [
|
||||
HttpException::class,
|
||||
HttpResponseException::class,
|
||||
ModelNotFoundException::class,
|
||||
DataNotFoundException::class,
|
||||
ValidateException::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* 记录异常信息(包括日志或者其它方式记录)
|
||||
*
|
||||
* @access public
|
||||
* @param Throwable $exception
|
||||
* @return void
|
||||
*/
|
||||
public function report(Throwable $exception): void
|
||||
{
|
||||
// 使用内置的方式记录异常日志
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @access public
|
||||
* @param \think\Request $request
|
||||
* @param Throwable $e
|
||||
* @return Response
|
||||
*/
|
||||
public function render($request, Throwable $e): Response
|
||||
{
|
||||
// 添加自定义异常处理机制
|
||||
|
||||
// 其他错误交给系统处理
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
}
|
||||
8
app/Request.php
Normal file
8
app/Request.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace app;
|
||||
|
||||
// 应用请求对象类
|
||||
class Request extends \think\Request
|
||||
{
|
||||
|
||||
}
|
||||
71
app/common.php
Normal file
71
app/common.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
//应用公共文件
|
||||
|
||||
// 版本号
|
||||
define('VERSION_V','?ver=v10.0.1');
|
||||
|
||||
// 加密秘钥
|
||||
const UC_AUTH_KEY = 'L=<z|6aMF8s.Z_CE~K)e}c[VuG9hlJ#gp02t"1&`';
|
||||
|
||||
//自动结算洗码和占股金额能否超过上级余额 1可以超过 0不可以超过
|
||||
define('SETTLE_MONEY_EXCEED_PARENT_MONTY',1);
|
||||
|
||||
// 打印方法
|
||||
function pre($data){
|
||||
echo "<pre>";
|
||||
print_r($data);
|
||||
echo "</pre>";
|
||||
}
|
||||
// 生成一个apiToken 作用Websocket登录
|
||||
function create_login_token($user): string
|
||||
{
|
||||
$curTime = time();
|
||||
return md5($curTime.$user['encrypt'].$user['password']);
|
||||
}
|
||||
//系统非常规MD5加密方法
|
||||
function think_ucenter_md5($str, $key = 'ThinkUCenter'): string
|
||||
{
|
||||
return '' === $str ? '' : md5(sha1($str) . $key);
|
||||
}
|
||||
// 定义一个函数获取客户端IP地址
|
||||
function get_ip(){
|
||||
global $ip;
|
||||
if(getenv("HTTP_X_FORWARDED_FOR"))
|
||||
$ip = getenv("HTTP_X_FORWARDED_FOR");
|
||||
else if (getenv("HTTP_CLIENT_IP"))
|
||||
$ip = getenv("HTTP_CLIENT_IP");
|
||||
else if(getenv("REMOTE_ADDR"))
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
else $ip = "";
|
||||
return $ip;
|
||||
}
|
||||
// 正负数转换
|
||||
function to_number($number): float
|
||||
{
|
||||
$returnNumber = $number > 0 ? -1 * $number : abs($number);
|
||||
return round($returnNumber,2);
|
||||
}
|
||||
// 字符串结果转数组
|
||||
function string_to_array($string): array
|
||||
{
|
||||
if (empty($string)){
|
||||
return [];
|
||||
}
|
||||
$array = explode(",", $string);
|
||||
$returnArray = [];
|
||||
foreach ($array as $v){
|
||||
$item = explode(":", $v);
|
||||
$returnArray[$item[0]] = $item[1];
|
||||
}
|
||||
return $returnArray;
|
||||
}
|
||||
// 数组结果转字符串
|
||||
function array_to_string($array): string
|
||||
{
|
||||
$returnArray = [];
|
||||
foreach ($array as $k => $v){
|
||||
$returnArray[] = $k.':'.$v;
|
||||
}
|
||||
return implode(",", $returnArray);
|
||||
}
|
||||
17
app/event.php
Normal file
17
app/event.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// 事件定义文件
|
||||
return [
|
||||
'bind' => [
|
||||
],
|
||||
|
||||
'listen' => [
|
||||
'AppInit' => [],
|
||||
'HttpRun' => [],
|
||||
'HttpEnd' => [],
|
||||
'LogLevel' => [],
|
||||
'LogWrite' => [],
|
||||
],
|
||||
|
||||
'subscribe' => [
|
||||
],
|
||||
];
|
||||
2
app/handle/common.php
Normal file
2
app/handle/common.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// 这是系统自动生成的公共文件
|
||||
12
app/handle/controller/Common.php
Normal file
12
app/handle/controller/Common.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\handle\controller;
|
||||
|
||||
class Common {
|
||||
protected $middleware = [\app\middleware\checkLogin::class];
|
||||
public function initialize(){
|
||||
|
||||
}
|
||||
}
|
||||
340
app/handle/controller/Index.php
Normal file
340
app/handle/controller/Index.php
Normal file
@ -0,0 +1,340 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\handle\controller;
|
||||
use app\models\process\Boot;
|
||||
use app\models\process\NumberTab;
|
||||
use app\models\table\Table;
|
||||
use app\models\table\UserController;
|
||||
use freedom\utils\CardPositionNn;
|
||||
use freedom\utils\Waybill;
|
||||
use think\facade\Env;
|
||||
use think\facade\Session;
|
||||
use think\facade\Request;
|
||||
use think\facade\Lang;
|
||||
use think\facade\View;
|
||||
use think\response\Redirect;
|
||||
use think\response\Json;
|
||||
|
||||
class Index extends Common{
|
||||
public function index(): Redirect
|
||||
{
|
||||
$find = Session::get('user_info');
|
||||
$tableInfo = Table::get($find['table_id']);
|
||||
if($tableInfo['game_id'] == 2){
|
||||
$template = $tableInfo['scanner_type'] == 2 ? '/index/tab_dt_sb' : '/index/tab_dt';
|
||||
return redirect($template);
|
||||
|
||||
}else if($tableInfo['game_id'] == 4){
|
||||
$template = $tableInfo['scanner_type'] == 2 ? '/index/tab_nn_sb' : '/index/tab_nn';
|
||||
return redirect($template);
|
||||
|
||||
}else if($tableInfo['game_id'] == 5){
|
||||
return redirect('/index/tab_knn');
|
||||
}else if($tableInfo['game_id'] == 1){
|
||||
$template = $tableInfo['scanner_type'] == 2 ? '/index/tab_baccarat_sb' : '/index/tab_baccarat';
|
||||
return redirect($template);
|
||||
|
||||
}else if($tableInfo['game_id'] == 6){
|
||||
return redirect('/index/tab_toning');
|
||||
}else if($tableInfo['game_id'] == 7){
|
||||
return redirect('/index/tab_dice');
|
||||
}else{
|
||||
return redirect('/login/logout');
|
||||
}
|
||||
}
|
||||
private static function precondition(){
|
||||
$userInfo = Session::get('user_info');
|
||||
$userController = UserController::get($userInfo['id']);
|
||||
$loginToken = create_login_token($userController);
|
||||
UserController::where(['id' => $userController['id']])->update(['login_token' => $loginToken]);
|
||||
$tableInfo = Table::get($userController['table_id']);
|
||||
$langType = cookie('think_lang');
|
||||
|
||||
// 渲染参数和模板
|
||||
View::assign('login_token',$loginToken);
|
||||
View::assign('table',$tableInfo);
|
||||
View::assign('user',$userController);
|
||||
View::assign('langType',$langType);
|
||||
View::assign('websocketUrl',Env::get('system.WEBSOCKET'));
|
||||
View::assign('websocketProtocol',Env::get('system.PROTOCOL'));
|
||||
View::assign('logoPath',Env::get('system.LOGO_PATH'));
|
||||
View::assign('player',Env::get('system.PLAYER'));
|
||||
|
||||
//View::assign('localSbServer',Env::get('system.SB_SERVER'));
|
||||
View::assign('localSbServer', $tableInfo['media_near_rtmp']); // 无用的字段来作为本地识别设备IP
|
||||
}
|
||||
function get_lang(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$lang = Lang::get();
|
||||
return json(['status' => 1, 'lang' => $lang]);
|
||||
}
|
||||
public function tab_baccarat(): string
|
||||
{
|
||||
self::precondition();
|
||||
$find = Session::get('user_info');
|
||||
$tableInfo = Table::get($find['table_id']);
|
||||
if($tableInfo['is_scavenging'] == 1){
|
||||
return View::fetch('/index/tab_b_auto');
|
||||
}else{
|
||||
return View::fetch('/index/tab_b');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public function tab_baccarat_sb(): string
|
||||
{
|
||||
self::precondition();
|
||||
return View::fetch('/index/tab_b_sb');
|
||||
}
|
||||
|
||||
public function tab_dt(): string
|
||||
{
|
||||
self::precondition();
|
||||
$find = Session::get('user_info');
|
||||
$tableInfo = Table::get($find['table_id']);
|
||||
if($tableInfo['is_scavenging'] == 1){
|
||||
return View::fetch('/index/tab_dt_auto');
|
||||
}else{
|
||||
return View::fetch('/index/tab_dt');
|
||||
}
|
||||
|
||||
}
|
||||
public function tab_dt_sb(): string
|
||||
{
|
||||
self::precondition();
|
||||
return View::fetch('/index/tab_dt_sb');
|
||||
}
|
||||
|
||||
public function tab_nn(): string
|
||||
{
|
||||
self::precondition();
|
||||
return View::fetch('/index/tab_nn');
|
||||
}
|
||||
public function tab_nn_sb(): string
|
||||
{
|
||||
self::precondition();
|
||||
return View::fetch('/index/tab_nn_sb');
|
||||
}
|
||||
public function tab_knn(): string
|
||||
{
|
||||
self::precondition();
|
||||
return View::fetch('/index/tab_knn');
|
||||
}
|
||||
public function tab_toning(): string
|
||||
{
|
||||
self::precondition();
|
||||
return View::fetch('/index/tab_toning');
|
||||
}
|
||||
public function tab_dice(): string
|
||||
{
|
||||
self::precondition();
|
||||
return View::fetch('/index/tab_dice');
|
||||
}
|
||||
|
||||
public function tab_roulette(): string
|
||||
{
|
||||
self::precondition();
|
||||
return View::fetch('/index/tab_roulette');
|
||||
}
|
||||
//获取当前靴的结果汇总
|
||||
public function get_boot(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$bootId = intval(Request::instance()->post('boot_id'));
|
||||
$bootInfo = Boot::get($bootId);
|
||||
return json(['code'=>1,'data'=>$bootInfo]);
|
||||
}
|
||||
|
||||
// 路单接口调用
|
||||
public function waybill(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
// 接收游戏ID和靴ID
|
||||
$bootId = intval(Request::instance()->post('boot_id'));
|
||||
$forecast = intval(Request::instance()->post('forecast'));
|
||||
// 验证靴ID
|
||||
if($bootId > 0){
|
||||
$ns = NumberTab::getByBootIdDone($bootId,'result,pair');
|
||||
if($forecast == 1){
|
||||
// 庄问路
|
||||
$ns[] = array('result'=>1,'pair'=>0);
|
||||
}elseif($forecast == 2){
|
||||
// 闲问路
|
||||
$ns[] = array('result'=>2,'pair'=>0);
|
||||
}
|
||||
// 数据存在,输出路单
|
||||
if($ns){
|
||||
$result = Waybill::waybill($ns);
|
||||
return json($result);
|
||||
}else{
|
||||
$waybill = array();
|
||||
$waybill['bigEyeRoad'] = [];
|
||||
$waybill['bigRoad'] = [];
|
||||
$waybill['pathway'] = [];
|
||||
$waybill['roach'] = [];
|
||||
$waybill['showRoad'] = [];
|
||||
return json(['status'=>false,'waybill'=>$waybill]);
|
||||
}
|
||||
}else{
|
||||
return json(['status'=>false,'msg'=>'靴ID错误']);
|
||||
}
|
||||
}
|
||||
// 路单接口调用
|
||||
public function waybill_nn(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$bootId = intval(Request::instance()->post('boot_id'));
|
||||
// 验证靴ID
|
||||
if($bootId > 0){
|
||||
$ns = NumberTab::getByBootIdDone($bootId,'result_banker,result_player_1,result_player_2,result_player_3,win_player_1,win_player_2,win_player_3');
|
||||
if($ns){
|
||||
$result = Waybill::waybillNn($ns);
|
||||
return json($result);
|
||||
}else{
|
||||
$waybill = array();
|
||||
return json(['status'=>false,'msg'=>'数据不存在','waybill'=>$waybill]);
|
||||
}
|
||||
}else{
|
||||
return json(['status'=>false,'msg'=>'靴ID错误']);
|
||||
}
|
||||
}
|
||||
// 色碟露珠
|
||||
public function waybill_toning(){
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$bootId = intval(Request::instance()->post('boot_id'));
|
||||
// 验证靴ID
|
||||
if($bootId > 0){
|
||||
$ns = NumberTab::getByBootIdDone($bootId,'toning_result');
|
||||
if($ns){
|
||||
$result = Waybill::waybillToning($ns);
|
||||
return json($result);
|
||||
}else{
|
||||
$waybill = array();
|
||||
return json(['status'=>false,'msg'=>'数据不存在','waybill'=>$waybill]);
|
||||
}
|
||||
}else{
|
||||
return json(['status'=>false,'msg'=>'靴ID错误']);
|
||||
}
|
||||
}
|
||||
|
||||
public function waybill_dice(){
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$bootId = intval(Request::instance()->post('boot_id'));
|
||||
// 验证靴ID
|
||||
if($bootId > 0){
|
||||
$ns = NumberTab::getByBootIdDone($bootId,'dice_result');
|
||||
$waybill = array();
|
||||
if($ns){
|
||||
foreach ($ns as $v){
|
||||
$strArray = explode(",", $v['dice_result']);
|
||||
$intArray = array();
|
||||
foreach ($strArray as $value){
|
||||
$intArray[] = intval($value);
|
||||
}
|
||||
$waybill[] = $intArray;
|
||||
}
|
||||
return json(['status'=>true,'msg'=>'数据存在','waybill'=>$waybill]);
|
||||
}else{
|
||||
return json(['status'=>false,'msg'=>'数据不存在','waybill'=>$waybill]);
|
||||
}
|
||||
}else{
|
||||
return json(['status'=>false,'msg'=>'靴ID错误']);
|
||||
}
|
||||
}
|
||||
// 轮盘露珠
|
||||
// 色碟露珠
|
||||
public function waybill_roulette(){
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$bootId = intval(Request::instance()->post('boot_id'));
|
||||
// 验证靴ID
|
||||
if($bootId > 0){
|
||||
$ns = NumberTab::getByBootIdDone($bootId,'roulette_result');
|
||||
if($ns){
|
||||
$result = Waybill::waybillRoulette($ns);
|
||||
return json($result);
|
||||
}else{
|
||||
$waybill = array();
|
||||
return json(['status'=>false,'msg'=>'数据不存在','waybill'=>$waybill]);
|
||||
}
|
||||
}else{
|
||||
return json(['status'=>false,'msg'=>'靴ID错误']);
|
||||
}
|
||||
}
|
||||
public function lang() {
|
||||
switch (Request::instance()->get('lang')) {
|
||||
case 'cn':
|
||||
cookie('think_lang', 'zh-cn');
|
||||
break;
|
||||
case 'tw':
|
||||
cookie('think_lang', 'zh-tw');
|
||||
break;
|
||||
case 'en':
|
||||
cookie('think_lang', 'en-us');
|
||||
break;
|
||||
//其它语言
|
||||
}
|
||||
}
|
||||
//获取点数
|
||||
public function get_nn_num(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$resultArr = Request::instance()->post('result_json');
|
||||
$result = CardPositionNn::JudgeCowCow(json_decode($resultArr,true));
|
||||
return json(['status'=>true,'msg'=>$result['word']]);
|
||||
}
|
||||
public function get_number(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$numberTabId = intval(Request::instance()->post('number_tab_id'));
|
||||
$number = NumberTab::getFieldValue($numberTabId,"number");
|
||||
if ($number){
|
||||
return json(array('data' => $number, 'status' => 1));
|
||||
}else{
|
||||
return json(array('msg' => '数据出错', 'status' => 0));
|
||||
}
|
||||
}
|
||||
//获取上一局number_tab_id
|
||||
public function get_last_number_tab_id(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$tableId = intval(Request::instance()->post('table_id'));
|
||||
$bootId = intval(Request::instance()->post('boot_id'));
|
||||
$tableInfo = Table::get($tableId);
|
||||
if (!$tableInfo) return json(array('msg' => '查询出错','status' => 0));
|
||||
if($tableInfo['table_type'] == 0 && $tableInfo['bet_type'] != 2) return json(array('msg' => '该桌不允许删除露珠','status' => 0));
|
||||
$lastNumberTabTableId = NumberTab::where(['boot_id' => $bootId, 'bet_status' => 3])->order('id DESC')->limit(1)->value('id');
|
||||
if($lastNumberTabTableId > 0){
|
||||
return json(['data' => $lastNumberTabTableId,'status' => 1]);
|
||||
}else {
|
||||
return json(['msg' => '没有可删除的上一铺', 'status' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
public function get_result_total(){
|
||||
if(Request::instance()->isPost()){
|
||||
//获取路单对象
|
||||
$table_id = Request::instance()->post('table_id');
|
||||
$boot_id = Request::instance()->post('boot_id');
|
||||
$game_id = Table::where(array('id' => $table_id))->value('game_id');
|
||||
$result = array();
|
||||
$result['banker'] = NumberTab::where(array('boot_id' => $boot_id, 'result' => 1, 'table_id' => $table_id))->count();
|
||||
$result['player'] = NumberTab::where(array('boot_id' => $boot_id, 'result' => 2, 'table_id' => $table_id))->count();
|
||||
$result['tie'] = NumberTab::where(array('boot_id' => $boot_id, 'result' => 3, 'table_id' => $table_id))->count();
|
||||
if($game_id == 1){
|
||||
//百家乐
|
||||
$result['bankerPair'] = NumberTab::where(array('boot_id' => $boot_id, 'pair' => 1, 'table_id' => $table_id))->count();
|
||||
$result['playerPair'] = NumberTab::where(array('boot_id' => $boot_id, 'pair' => 2, 'table_id' => $table_id))->count();
|
||||
$both = NumberTab::where(array('boot_id' => $boot_id, 'pair' => 3, 'table_id' => $table_id))->count();
|
||||
$result['bankerPair'] = $result['bankerPair'] + $both;
|
||||
$result['playerPair'] = $result['playerPair'] + $both;
|
||||
$result['luckySix'] = NumberTab::where(array('boot_id' => $boot_id, 'result' => 1, 'table_id' => $table_id, 'luck_six'=>1))->count();
|
||||
}
|
||||
return json(['code'=>1,'data'=>$result]);
|
||||
}
|
||||
return json(['code'=>0,'data'=>[]]);
|
||||
}
|
||||
|
||||
}
|
||||
74
app/handle/controller/Login.php
Normal file
74
app/handle/controller/Login.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\handle\controller;
|
||||
use think\facade\Db;
|
||||
use think\facade\Request;
|
||||
use think\facade\Session;
|
||||
use think\facade\View;
|
||||
use think\Lang;
|
||||
|
||||
class Login {
|
||||
public function index(){
|
||||
if(Session::get('user_info')){
|
||||
return redirect('/login/logout');
|
||||
}
|
||||
return View::fetch();
|
||||
}
|
||||
/**
|
||||
* 处理登录
|
||||
*/
|
||||
public function dologin(){
|
||||
if(Request::instance()->post()){
|
||||
$username = Request::instance()->post('account');
|
||||
$password = Request::instance()->post('password');
|
||||
$find = Db::name('user_controller')->where(array('username' => $username, 'is_delete' => 0))->find();
|
||||
if(!$find){
|
||||
Session::delete('user_info');
|
||||
return json(['code' => 0, 'msg' => '用户不存在']);
|
||||
}
|
||||
if(think_ucenter_md5($password, UC_AUTH_KEY) === $find['password'] && $find['password']){
|
||||
Session::set('user_info',$find);
|
||||
Db::name('user_controller')->where(array('id' => $find['id']))->update(array('last_login_time' => time(), 'last_login_ip' => get_ip()));
|
||||
$tableInfo = Db::name('table')->where(array('id' => $find['table_id']))->find();
|
||||
cookie('think_lang',env('lang.default_lang', 'zh-cn'));
|
||||
if($tableInfo['game_id'] == 2){
|
||||
$template = $tableInfo['scanner_type'] == 2 ? '/index/tab_dt_sb' : '/index/tab_dt';
|
||||
return json(['code'=>1,'msg'=>'登录成功','url'=>$template]);
|
||||
|
||||
}else if($tableInfo['game_id'] == 4){
|
||||
$template = $tableInfo['scanner_type'] == 2 ? '/index/tab_nn_sb' : '/index/tab_nn';
|
||||
|
||||
return json(['code'=>1,'msg'=>'登录成功','url'=>$template]);
|
||||
|
||||
}else if($tableInfo['game_id'] == 5){
|
||||
return json(['code'=>1,'msg'=>'登录成功','url'=>'/index/tab_knn']);
|
||||
}else if($tableInfo['game_id'] == 1){
|
||||
|
||||
$template = $tableInfo['scanner_type'] == 2 ? '/index/tab_baccarat_sb' : '/index/tab_baccarat';
|
||||
return json(['code'=>1,'msg'=>'登录成功','url'=>$template]);
|
||||
|
||||
}else if($tableInfo['game_id'] == 6){
|
||||
return json(['code'=>1,'msg'=>'登录成功','url'=>'/index/tab_toning']);
|
||||
}else if($tableInfo['game_id'] == 7){
|
||||
return json(['code'=>1,'msg'=>'登录成功','url'=>'/index/tab_dice']);
|
||||
}else if($tableInfo['game_id'] == 8){
|
||||
return json(['code'=>1,'msg'=>'登录成功','url'=>'/index/tab_roulette']);
|
||||
}else{
|
||||
Session::delete('user_info');
|
||||
return json(['code'=>0,'msg'=>'账户信息出错']);
|
||||
}
|
||||
}else{
|
||||
Session::delete('user_info');
|
||||
return json(['code'=>0,'msg'=>'密码错误']);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
public function logout(){
|
||||
Session::delete('user_info');
|
||||
return redirect('/login/index');
|
||||
}
|
||||
}
|
||||
21
app/handle/controller/Manager.php
Normal file
21
app/handle/controller/Manager.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\handle\controller;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
use think\facade\View;
|
||||
|
||||
class Manager extends Common{
|
||||
public function index(){
|
||||
$manager = Db::name('manager')->where(array('id' => 2))->find();
|
||||
if(!$manager) exit('用户不存在');
|
||||
|
||||
View::assign('manager',$manager);
|
||||
View::assign('websocketUrl',Env::get('system.WEBSOCKET'));
|
||||
View::assign('websocketProtocol',Env::get('system.PROTOCOL'));
|
||||
View::assign('websocketProtocol',Env::get('system.PROTOCOL'));
|
||||
return View::fetch();
|
||||
}
|
||||
}
|
||||
99
app/handle/controller/Scan.php
Normal file
99
app/handle/controller/Scan.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\handle\controller;
|
||||
use app\models\process\NumberTab;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
use think\facade\Session;
|
||||
use think\facade\View;
|
||||
|
||||
class Scan extends Common{
|
||||
public function index(){
|
||||
// 用户信息
|
||||
$userInfo = Session::get('user_info');
|
||||
$user = Db::name('user_controller')->where(array('id' => $userInfo['id']))->find();
|
||||
if(!$user) exit('用户不存在');
|
||||
// 获取桌子信息
|
||||
$table = Db::name('table')->where(array('id' => $userInfo['table_id']))->find();
|
||||
$numberTab = NumberTab::getByTableIdOrderByIdDesc($table);
|
||||
|
||||
// 渲染参数和模板
|
||||
View::assign('table',$table);
|
||||
View::assign('user',$user);
|
||||
View::assign('numberTab', $numberTab);
|
||||
View::assign('websocketUrl',Env::get('system.WEBSOCKET'));
|
||||
View::assign('websocketProtocol',Env::get('system.PROTOCOL'));
|
||||
if ($table['scanner_type'] == 2) {
|
||||
View::assign('localSbServer', $table['media_near_rtmp']);
|
||||
return View::fetch('/scan/index_sb');
|
||||
} else {
|
||||
return View::fetch();
|
||||
}
|
||||
}
|
||||
|
||||
public function dt_index(){
|
||||
// 用户信息
|
||||
$userInfo = Session::get('user_info');
|
||||
$user = Db::name('user_controller')->where(array('id' => $userInfo['id']))->find();
|
||||
if(!$user) exit('用户不存在');
|
||||
// 获取桌子信息
|
||||
$table = Db::name('table')->where(array('id' => $userInfo['table_id']))->find();
|
||||
$numberTab = NumberTab::getByTableIdOrderByIdDesc($table);
|
||||
|
||||
// 渲染参数和模板
|
||||
View::assign('table',$table);
|
||||
View::assign('user',$user);
|
||||
View::assign('numberTab', $numberTab);
|
||||
View::assign('websocketUrl',Env::get('system.WEBSOCKET'));
|
||||
View::assign('websocketProtocol',Env::get('system.PROTOCOL'));
|
||||
if ($table['scanner_type'] == 2) {
|
||||
View::assign('localSbServer', $table['media_near_rtmp']);
|
||||
return View::fetch('/scan/dt_sb');
|
||||
} else {
|
||||
return View::fetch();
|
||||
}
|
||||
}
|
||||
public function nn_index(){
|
||||
// 用户信息
|
||||
$userInfo = Session::get('user_info');
|
||||
$user = Db::name('user_controller')->where(array('id' => $userInfo['id']))->find();
|
||||
if(!$user) exit('用户不存在');
|
||||
// 获取桌子信息
|
||||
$table = Db::name('table')->where(array('id' => $userInfo['table_id']))->find();
|
||||
$numberTab = NumberTab::getByTableIdOrderByIdDesc($table);
|
||||
|
||||
// 渲染参数和模板
|
||||
View::assign('table',$table);
|
||||
View::assign('user',$user);
|
||||
View::assign('numberTab', $numberTab);
|
||||
View::assign('websocketUrl',Env::get('system.WEBSOCKET'));
|
||||
View::assign('websocketProtocol',Env::get('system.PROTOCOL'));
|
||||
if ($table['scanner_type'] == 2) {
|
||||
View::assign('localSbServer', $table['media_near_rtmp']);
|
||||
return View::fetch('/scan/nn_sb');
|
||||
} else {
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function tc_index(){
|
||||
// 用户信息
|
||||
$userInfo = Session::get('user_info');
|
||||
$user = Db::name('user_controller')->where(array('id' => $userInfo['id']))->find();
|
||||
if(!$user) exit('用户不存在');
|
||||
// 获取桌子信息
|
||||
$table = Db::name('table')->where(array('id' => $userInfo['table_id']))->find();
|
||||
$numberTab = NumberTab::getByTableIdOrderByIdDesc($table);
|
||||
|
||||
// 渲染参数和模板
|
||||
View::assign('table',$table);
|
||||
View::assign('user',$user);
|
||||
View::assign('numberTab', $numberTab);
|
||||
View::assign('websocketUrl',Env::get('system.WEBSOCKET'));
|
||||
View::assign('websocketProtocol',Env::get('system.PROTOCOL'));
|
||||
return View::fetch();
|
||||
}
|
||||
}
|
||||
5
app/handle/event.php
Normal file
5
app/handle/event.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
// 这是系统自动生成的event定义文件
|
||||
return [
|
||||
|
||||
];
|
||||
5
app/handle/middleware.php
Normal file
5
app/handle/middleware.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
// 这是系统自动生成的middleware定义文件
|
||||
return [
|
||||
|
||||
];
|
||||
286
app/handle/view/index/tab_b.html
Normal file
286
app/handle/view/index/tab_b.html
Normal file
@ -0,0 +1,286 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/index_tab.css{$Think.VERSION_V}">
|
||||
<style type="text/css">
|
||||
.section .head .logo{background: url({$logoPath}) center center no-repeat;background-size: 110px;}
|
||||
.limit-box .list .item{width:100%;}
|
||||
.limit-box .list{line-height: 3vh;}
|
||||
img{width: 100%}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
</head>
|
||||
<body class="wp">
|
||||
<audio id="audio"></audio><section class="section">
|
||||
<div class="footer" style="margin-bottom: 0.5vh">
|
||||
<div class="canvas-box big">
|
||||
<div class="countdown">
|
||||
<div class="num">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
<div class="askbox" id="askbox">
|
||||
<div class="item" id="bankerask">
|
||||
<div class="box">
|
||||
下一局
|
||||
<strong style="color:#c40404;">{:lang('banker')}</strong>
|
||||
<i class="tip circle"></i>
|
||||
<i class="tip round"></i>
|
||||
<i class="tip bar"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" id="playerask">
|
||||
<div class="box">
|
||||
下一局
|
||||
<strong style="color:#0048ff;">{:lang('player')}</strong>
|
||||
<i class="tip circle"></i>
|
||||
<i class="tip round"></i>
|
||||
<i class="tip bar"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-data">
|
||||
<div>
|
||||
<div class="head box-sizing">
|
||||
<div class="logo">
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date">
|
||||
<div>
|
||||
{:lang('now_time')}:<span class="weekend"> </span><span class="time"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" style="width: 35%;">
|
||||
<!--label>{:lang('table')}</label--><input type="text" disabled="true" value="{$table.table_name}">
|
||||
</div>
|
||||
<div class="item input-box" style="width: 30%; padding-left:75px;">
|
||||
<label>{:lang('boot')}</label><input id="boot_num" type="text" disabled="true" value="">
|
||||
</div>
|
||||
<div class="item input-box m0" style="width: 30%; padding-left:75px;">
|
||||
<label>{:lang('number')}</label><input id="number_tab_number" type="text" disabled="true" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="title" style="margin-top:0px;">
|
||||
<li>
|
||||
<strong style="color:#6b0008">{:lang('banker')}</strong>
|
||||
<small>Banker</small>
|
||||
</li>
|
||||
<li>
|
||||
<strong style="color:#023778">{:lang('player')}</strong>
|
||||
<small>Player</small>
|
||||
</li>
|
||||
<li>
|
||||
<strong style="color: #0A5101">{:lang('tie')}</strong>
|
||||
<small>Tie</small>
|
||||
</li>
|
||||
<li>
|
||||
<strong style="color:#6b0008">{:lang('banker_pair')}</strong>
|
||||
<small>B Pair</small>
|
||||
</li>
|
||||
<li>
|
||||
<strong style="color:#023778">{:lang('player_pair')}</strong>
|
||||
<small>P Pair</small>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="top">
|
||||
<span style="color:#6b0008" id="result_total_banker">0</span>
|
||||
<span style="color:#023778" id="result_total_player">0</span>
|
||||
<span style="color: #0A5101" id="result_total_tie">0</span>
|
||||
<span style="color:#6b0008" id="result_total_bankerpair">0</span>
|
||||
<span style="color:#023778" id="result_total_playerpair">0</span>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item" style="text-align:center; display:inline-block;">
|
||||
<span id="betstatus"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="limit-box">
|
||||
<div class="list clearfix" style="padding-top:0;">
|
||||
<div class="lab" style="margin:0;">
|
||||
{:lang('banker')}\{:lang('player')}
|
||||
</div>
|
||||
<div class="item fl">
|
||||
<span class="fr showLimitBP"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list clearfix" style="padding-top:0;">
|
||||
<div class="lab" style="margin:0;">
|
||||
{:lang('tie')}
|
||||
</div>
|
||||
<div class="item fl">
|
||||
<span class="fr showLimitTie"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list clearfix" style="padding-top:0;">
|
||||
<div class="lab" style="margin:0;">
|
||||
{:lang('pair')}
|
||||
</div>
|
||||
<div class="item fl">
|
||||
<span class="fr showLimitPair"> </span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="canvas-box small">
|
||||
<!-- <div class="active-box" style="background-color: #ae7c67;right: 5px;">
|
||||
<div class="item" id="bankerask">
|
||||
{:lang('next')}:
|
||||
<strong style="color:#c40404">{:lang('banker')}</strong>
|
||||
<i class="tip circle"></i>
|
||||
<i class="tip round"></i>
|
||||
<i class="tip bar"></i>
|
||||
</div>
|
||||
<div class="item" id="playerask">
|
||||
{:lang('next')}:
|
||||
<strong style="color:#0048ff">{:lang('player')}</strong>
|
||||
<i class="tip circle"></i>
|
||||
<i class="tip round"></i>
|
||||
<i class="tip bar"></i>
|
||||
</div>
|
||||
</div> -->
|
||||
<canvas id="canvas1"></canvas>
|
||||
</div>
|
||||
<div class="canvas-box small">
|
||||
<canvas id="canvas2"></canvas>
|
||||
</div>
|
||||
</section><section class="control-box noselect">
|
||||
<div class="slide-btn">
|
||||
《
|
||||
</div>
|
||||
<div class="btn-box1">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start_bet')}</span>
|
||||
<!-- <span class="red_bg" id="end_bet" onclick="endBet()">结束下注</span> -->
|
||||
</div>
|
||||
<div class="btn-box2">
|
||||
<span id="banker" onclick="confirmResult('banker',1)">{:lang('banker')}</span>
|
||||
<span id="player" onclick="confirmResult('player',2)">{:lang('player')}</span>
|
||||
<span id="tie" onclick="confirmResult('tie',3)">{:lang('tie')}</span>
|
||||
<span id="banker_pair" onclick="confirmResultPair('banker_pair',1)">{:lang('banker_pair')}</span>
|
||||
<span id="player_pair" onclick="confirmResultPair('player_pair',2)">{:lang('player_pair')}</span>
|
||||
</div>
|
||||
<div class="btn-box3">
|
||||
<span class="red_bg" id="dosubmit" onclick="opening()">{:lang('opening')}</span>
|
||||
<input type="hidden" id="opening" value="0">
|
||||
<input type="hidden" id="result_banker_pair" value="0">
|
||||
<input type="hidden" id="result_player_pair" value="0">
|
||||
<input type="hidden" id="lucky_six" value="0">
|
||||
<input type="hidden" id="lucky_six_number" value="0">
|
||||
<input type="hidden" id="dt_pair" value="0">
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<!-- <span onclick="inCheckout()">{:lang('shuffle')}</span> -->
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
<div class="btn-box5">
|
||||
<div class="currencyBox">
|
||||
<span>币种:</span>
|
||||
<span><input type="checkbox" name="currencyType" value="CNY"> CNY</span>
|
||||
<span><input type="checkbox" name="currencyType" value="USD"> USD</span>
|
||||
</div>
|
||||
<div class="limitBox">
|
||||
<div style="width: 50%;display: inline;float:left;">
|
||||
<div style="padding: 0.5vh 0"><span>庄闲(RMB):</span><input type="text" style="width: 100px" id="cny_limit_bp" value=""></div>
|
||||
<div style="padding: 0.5vh 0"><span> 和(RMB):</span><input type="text" id="cny_limit_tie" style="width: 100px" value=""></div>
|
||||
<div style="padding: 0.5vh 0"><span>对子(RMB):</span><input type="text" id="cny_limit_pair" style="width: 100px" value=""></div>
|
||||
|
||||
</div>
|
||||
<div style="width: 50%;display: inline;float:left;">
|
||||
<div style="padding: 0.5vh 0">庄闲(USD):<input type="text" style="width: 100px" id="usd_limit_bp" value=""></div>
|
||||
<div style="padding: 0.5vh 0"> 和(USD):<input type="text"id="usd_limit_tie" style="width: 100px" value=""></div>
|
||||
<div style="padding: 0.5vh 0"><span>对子(USD):</span><input type="text" id="usd_limit_pair" style="width: 100px" value=""></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-box3">
|
||||
<span class="red_bg" id="doCurrency" onclick="setCurrencyLimit()">Currency</span>
|
||||
</div>
|
||||
</section>
|
||||
<div class="result-box" id="openingElement" style="display:none;">
|
||||
<img id="openingPng" src=""/>
|
||||
</div>
|
||||
<div id="fade" class="black_overlay">
|
||||
</div>
|
||||
<div class="iframe-box" style="display: none;">
|
||||
<h3 class="title"> 打印 <span class="off-btn" onclick="close_print()"> X </span></h3>
|
||||
<iframe src="" frameborder="0" id="print_iframe">
|
||||
</iframe>
|
||||
</div>
|
||||
<div class="update-ludan" id="update_ludan" style="z-index:999999;">
|
||||
<div class="update-ludan-title">
|
||||
{:lang('edit_previous_result')}
|
||||
</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('banker')}</option>
|
||||
<option value="2-0">{:lang('player')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
|
||||
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
|
||||
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
|
||||
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
|
||||
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
|
||||
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
|
||||
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
|
||||
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
|
||||
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle_b.js?3"></script>
|
||||
</body>
|
||||
</html>
|
||||
206
app/handle/view/index/tab_b_auto.html
Normal file
206
app/handle/view/index/tab_b_auto.html
Normal file
@ -0,0 +1,206 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.result-box{ width: 36vw;left: 29%;top:30%;}
|
||||
.result-box img{ width: 100%;max-width:150%}
|
||||
.color-red {color: red !important}
|
||||
/*win*/
|
||||
@keyframes breathe1 {
|
||||
0% {
|
||||
opacity:.7;
|
||||
box-shadow: 0px 1px 10px #030c03;
|
||||
}
|
||||
100% {
|
||||
opacity:1;
|
||||
box-shadow:0 1px 20px rgba(59,255,255,1);
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}:</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}:</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe" ></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<section class="begincard">
|
||||
<div class="box">
|
||||
<div class="result-box" id="openingElement" style="display:none;"><img id="openingPng" src="" /></div>
|
||||
<div class="card-box">
|
||||
|
||||
<div class="list banker-card">
|
||||
<div class="zx text" ><span>{:lang('banker')}</span></div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
<div class="draw">
|
||||
<div class="rotate">
|
||||
<div class="card" id="banker_bu">
|
||||
<div class="face"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list player-card">
|
||||
<div class="text zx" ><span>{:lang('player')}</span></div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
<div class="draw">
|
||||
<div class="rotate">
|
||||
<div class="card" id="player_bu">
|
||||
<div class="face"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div id="fade" class="black_overlay"></div>
|
||||
<div class="update-ludan" id="update_ludan">
|
||||
<div class="update-ludan-title">{:lang('edit_previous_result')}</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('banker')}</option>
|
||||
<option value="2-0">{:lang('player')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
|
||||
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
|
||||
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
|
||||
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
|
||||
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
|
||||
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
|
||||
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
|
||||
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
|
||||
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
495
app/handle/view/index/tab_b_sb.html
Normal file
495
app/handle/view/index/tab_b_sb.html
Normal file
@ -0,0 +1,495 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.result-box{ width: 36vw;left: 29%;top:30%;}
|
||||
.result-box img{ width: 100%;max-width:150%}
|
||||
/*win*/
|
||||
@keyframes breathe1 {
|
||||
0% {
|
||||
opacity:.7;
|
||||
box-shadow: 0px 1px 10px #030c03;
|
||||
}
|
||||
100% {
|
||||
opacity:1;
|
||||
box-shadow:0 1px 20px rgba(59,255,255,1);
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}:</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}:</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe" ></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<section class="begincard">
|
||||
<div class="box">
|
||||
<div class="result-box" id="openingElement" style="display:none;"><img id="openingPng" src="" /></div>
|
||||
<div class="card-box">
|
||||
|
||||
<div class="list banker-card">
|
||||
<div class="zx text" ><span>{:lang('banker')}</span></div>
|
||||
<div class="card"> <!--22-->
|
||||
<div class="face" data-position="22"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
<div class="card"><!--21-->
|
||||
<div class="face" data-position="21"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
<div class="draw"><!--32-->
|
||||
<div class="rotate">
|
||||
<div class="card" id="banker_bu">
|
||||
<div class="face" data-position="23"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list player-card">
|
||||
<div class="text zx" ><span>{:lang('player')}</span></div>
|
||||
<div class="card"><!--12-->
|
||||
<div class="face" data-position="12"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
<div class="card"><!--11-->
|
||||
<div class="face" data-position="11"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
<div class="draw"><!--31-->
|
||||
<div class="rotate">
|
||||
<div class="card" id="player_bu">
|
||||
<div class="face" data-position="13"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
|
||||
<div class="btn-box1" style="padding-top:5vh;">
|
||||
<span class="green_bg" id="restart_sb" onclick="restartSB()">{:lang('restart_sb')}</span>
|
||||
<span class="red_bg" id="stop_sb" onclick="stopSB()">{:lang('stop_sb')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div id="fade" class="black_overlay"></div>
|
||||
<div class="update-ludan" id="update_ludan">
|
||||
<div class="update-ludan-title">{:lang('edit_previous_result')}</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('banker')}</option>
|
||||
<option value="2-0">{:lang('player')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
|
||||
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
|
||||
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
|
||||
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
|
||||
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
|
||||
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
|
||||
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
|
||||
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
|
||||
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="change" id="change_cards">
|
||||
<div style="margin-top: 30px;">
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="101">
|
||||
<img src="/static/poker/101.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="102">
|
||||
<img src="/static/poker/102.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="103">
|
||||
<img src="/static/poker/103.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="104">
|
||||
<img src="/static/poker/104.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="105">
|
||||
<img src="/static/poker/105.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="106">
|
||||
<img src="/static/poker/106.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="107">
|
||||
<img src="/static/poker/107.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="108">
|
||||
<img src="/static/poker/108.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="109">
|
||||
<img src="/static/poker/109.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="110">
|
||||
<img src="/static/poker/110.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="111">
|
||||
<img src="/static/poker/111.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="112">
|
||||
<img src="/static/poker/112.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="113">
|
||||
<img src="/static/poker/113.png">
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="201">
|
||||
<img src="/static/poker/201.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="202">
|
||||
<img src="/static/poker/202.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="203">
|
||||
<img src="/static/poker/203.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="204">
|
||||
<img src="/static/poker/204.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="205">
|
||||
<img src="/static/poker/205.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="206">
|
||||
<img src="/static/poker/206.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="207">
|
||||
<img src="/static/poker/207.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="208">
|
||||
<img src="/static/poker/208.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="209">
|
||||
<img src="/static/poker/209.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="210">
|
||||
<img src="/static/poker/210.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="211">
|
||||
<img src="/static/poker/211.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="212">
|
||||
<img src="/static/poker/212.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="213">
|
||||
<img src="/static/poker/213.png">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="301">
|
||||
<img src="/static/poker/301.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="302">
|
||||
<img src="/static/poker/302.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="303">
|
||||
<img src="/static/poker/303.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="304">
|
||||
<img src="/static/poker/304.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="305">
|
||||
<img src="/static/poker/305.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="306">
|
||||
<img src="/static/poker/306.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="307">
|
||||
<img src="/static/poker/307.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="308">
|
||||
<img src="/static/poker/308.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="309">
|
||||
<img src="/static/poker/309.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="310">
|
||||
<img src="/static/poker/310.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="311">
|
||||
<img src="/static/poker/311.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="312">
|
||||
<img src="/static/poker/312.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="313">
|
||||
<img src="/static/poker/313.png">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="401">
|
||||
<img src="/static/poker/401.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="402">
|
||||
<img src="/static/poker/402.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="403">
|
||||
<img src="/static/poker/403.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="404">
|
||||
<img src="/static/poker/404.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="405">
|
||||
<img src="/static/poker/405.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="406">
|
||||
<img src="/static/poker/406.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="407">
|
||||
<img src="/static/poker/407.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="408">
|
||||
<img src="/static/poker/408.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="409">
|
||||
<img src="/static/poker/409.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="410">
|
||||
<img src="/static/poker/410.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="411">
|
||||
<img src="/static/poker/411.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="412">
|
||||
<img src="/static/poker/412.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="413">
|
||||
<img src="/static/poker/413.png">
|
||||
</label>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="change_card" onclick="changeErrSbCard()">Submit</span>
|
||||
<span class="red_bg" id="cancel_card" onclick="cancelChangeErrSbCard()">Cancel</span>
|
||||
</div>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
.change{
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
width: auto;
|
||||
height: 780px;
|
||||
background: rgb(0 0 0 / 90%);
|
||||
z-index: 999;
|
||||
overflow: hidden;
|
||||
}
|
||||
.change div {margin: auto 15px;}
|
||||
.change div img {
|
||||
width: 8vh;
|
||||
margin: 15px 10px 10px 10px;
|
||||
}
|
||||
[type=radio] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* IMAGE STYLES */
|
||||
[type=radio] + img {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* CHECKED STYLES */
|
||||
[type=radio]:checked + img {
|
||||
outline: 6px solid #f00;
|
||||
}
|
||||
|
||||
|
||||
.change .btn-box1 {
|
||||
margin-top: 15px;
|
||||
float: right;
|
||||
}
|
||||
.change .btn-box1 span {
|
||||
cursor: pointer;
|
||||
width: 110px;
|
||||
height: 35px;
|
||||
display: inline-block;
|
||||
margin: 0 45px 0 10px;
|
||||
padding-left:45px;
|
||||
line-height: 35px;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset, 0px 6px 5px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset,0px 6px 5px rgba(0,0,0,0.2);
|
||||
box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset, 0px 6px 5px rgba(0,0,0,0.2);
|
||||
}
|
||||
.change .green_bg {
|
||||
background: #0b6140;
|
||||
}
|
||||
.change .red_bg {
|
||||
background: #7a1e1e;
|
||||
}
|
||||
</style>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle_b_sb_scan_four.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
129
app/handle/view/index/tab_dice.html
Normal file
129
app/handle/view/index/tab_dice.html
Normal file
@ -0,0 +1,129 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}:</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}:</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe"></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
<canvas id="canvas"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div class="dice-box" id="dice_box">
|
||||
<div class="dice-box-container">
|
||||
<div class="dice-box-item" id="dice_item_1"><img src="/static/handle/img/dice0.png"></div>
|
||||
<div class="dice-box-item" id="dice_item_2"><img src="/static/handle/img/dice0.png"></div>
|
||||
<div class="dice-box-item" id="dice_item_3"><img src="/static/handle/img/dice0.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@keyframes fade {from {opacity: 1.0;}50% {opacity: 0.5;}to {opacity: 1.0;}}
|
||||
@-webkit-keyframes fade {from {opacity: 1.0;}50% {opacity: 0.5;}to {opacity: 1.0;}}
|
||||
.flicker{animation: fade 600ms infinite; -webkit-animation: fade 600ms infinite;}
|
||||
.dice-box{width: 100vw; height: 100vh; position: fixed; left: 0; top: 0; z-index: 1; background-color:rgba(0,0,0,0.5); display: none;}
|
||||
.dice-box-container{width: 80%; height: 330px; position: absolute; top: 30vh; left: 10vw; text-align: center;}
|
||||
.dice-box-item{width: 330px; height: 330px; display: inline-block; margin-right: 100px;}
|
||||
.dice-box-item:last-child{margin-right: 0;}
|
||||
.dice-box-item img{display: block; width: 100%; height: 100%;}
|
||||
</style>
|
||||
<input type="hidden" id="dice_result" value="">
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle_dice.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
232
app/handle/view/index/tab_dt.html
Normal file
232
app/handle/view/index/tab_dt.html
Normal file
@ -0,0 +1,232 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/index_tab.css{$Think.VERSION_V}">
|
||||
<style type="text/css">
|
||||
.section .head .logo{background: url({$logoPath}) center center no-repeat;background-size: 110px;}
|
||||
.limit-box .list .item{width:100%;}
|
||||
img{width: 100%}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio><section class="section"><!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
<div class="countdown">
|
||||
<div class="num">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
<div class="askbox" id="askbox">
|
||||
<div class="item" id="bankerask">
|
||||
<div class="box">
|
||||
下一局
|
||||
<strong style="color:#c40404;">{:lang('dragon')}</strong>
|
||||
<i class="tip circle"></i>
|
||||
<i class="tip round"></i>
|
||||
<i class="tip bar"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" id="playerask">
|
||||
<div class="box">
|
||||
下一局
|
||||
<strong style="color:#0048ff;">{:lang('tiger')}</strong>
|
||||
<i class="tip circle"></i>
|
||||
<i class="tip round"></i>
|
||||
<i class="tip bar"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="logo">
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date">
|
||||
<div>
|
||||
{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" style="width: 35%;">
|
||||
<!--label>{:lang('table')}</label--><input type="text" disabled="true" value="{$table.table_name}">
|
||||
</div>
|
||||
<div class="item input-box" style="width: 30%; padding-left:75px;">
|
||||
<label>{:lang('boot')}</label><input id="boot_num" type="text" disabled="true" value="">
|
||||
</div>
|
||||
<div class="item input-box m0" style="width: 30%; padding-left:75px;">
|
||||
<label>{:lang('number')}</label><input id="number_tab_number" type="text" disabled="true" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="title" style="margin-top:20px;">
|
||||
<li>
|
||||
<strong style="color:#6b0008">{:lang('dragon')}</strong>
|
||||
<small>Dragon</small>
|
||||
</li>
|
||||
<li>
|
||||
<strong style="color:#023778">{:lang('tiger')}</strong>
|
||||
<small>Tiger</small>
|
||||
</li>
|
||||
<li>
|
||||
<strong style="color: #0a5101">{:lang('tie')}</strong>
|
||||
<small>Tie</small>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="top">
|
||||
<span style="color:#6b0008" id="result_total_banker">0</span>
|
||||
<span style="color:#023778" id="result_total_player">0</span>
|
||||
<span style="color: #0a5101" id="result_total_tie">0</span>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item" style="text-align:center; display:inline-block;">
|
||||
<span id="betstatus"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="limit-box">
|
||||
<div class="list clearfix">
|
||||
<div class="lab">
|
||||
{:lang('dragon')}\{:lang('tiger')}
|
||||
</div>
|
||||
<div class="item fl">
|
||||
<span class="fr showLimitBP"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="lab">
|
||||
{:lang('tie')}
|
||||
</div>
|
||||
<div class="item fl">
|
||||
<span class="fr showLimitTie"> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="canvas-box small">
|
||||
<canvas id="canvas1"></canvas>
|
||||
</div>
|
||||
<div class="canvas-box small">
|
||||
<canvas id="canvas2"></canvas>
|
||||
</div>
|
||||
</section><section class="control-box noselect">
|
||||
<div class="slide-btn">
|
||||
《
|
||||
</div>
|
||||
<div class="btn-box1">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start_bet')}</span>
|
||||
<!--<span class="red_bg" id="end_bet" onclick="endBet()">结束下注</span>-->
|
||||
</div>
|
||||
<div class="btn-box2">
|
||||
<span id="banker" onclick="confirmResult('banker',1)">{:lang('dragon_all')}</span>
|
||||
<span id="player" onclick="confirmResult('player',2)">{:lang('tiger_all')}</span>
|
||||
<span id="tie" onclick="confirmResult('tie',3)">{:lang('tie_all')}</span>
|
||||
</div>
|
||||
<div class="btn-box3">
|
||||
<span class="red_bg" id="dosubmit" onclick="opening()">{:lang('opening')}</span>
|
||||
<input type="hidden" id="opening" value="0">
|
||||
<input type="hidden" id="result_banker_pair" value="0">
|
||||
<input type="hidden" id="result_player_pair" value="0">
|
||||
<input type="hidden" id="dt_pair" value="0">
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<!-- <span onclick="inCheckout()">{:lang('shuffle')}</span> -->
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
<div class="btn-box5">
|
||||
<div class="currencyBox">
|
||||
<span>币种:</span>
|
||||
<span><input type="checkbox" name="currencyType" value="CNY" checked> CNY</span>
|
||||
<span><input type="checkbox" name="currencyType" value="USD" checked> USD</span>
|
||||
</div>
|
||||
<div class="limitBox">
|
||||
<div style="width: 50%;display: inline;float:left;">
|
||||
<div style="padding: 0.5vh 0"><span>龙虎(RMB):</span><input type="text" style="width: 100px" id="cny_limit_bp" value="10-1000"></div>
|
||||
<div style="padding: 0.5vh 0"><span> 和(RMB):</span><input type="text" id="cny_limit_tie" style="width: 100px" value="10-1000"></div>
|
||||
</div>
|
||||
<div style="width: 50%;display: inline;float:left;">
|
||||
<div style="padding: 0.5vh 0">龙虎(USD):<input type="text" style="width: 100px" id="usd_limit_bp" value="10-1000"></div>
|
||||
<div style="padding: 0.5vh 0"> 和(USD):<input type="text"id="usd_limit_tie" style="width: 100px" value="10-1000"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-box3">
|
||||
<span class="red_bg" id="doCurrency" onclick="setCurrencyLimit()">Currency</span>
|
||||
</div>
|
||||
</section>
|
||||
<div class="result-box" id="openingElement" style="display:none;">
|
||||
<img id="openingPng" src=""/>
|
||||
</div>
|
||||
<div id="fade" class="black_overlay">
|
||||
</div>
|
||||
<div class="iframe-box" style="display: none;">
|
||||
<h3 class="title"> 打印 <span class="off-btn" onclick="close_print()"> X </span></h3>
|
||||
<iframe src="" frameborder="0" id="print_iframe">
|
||||
</iframe>
|
||||
</div>
|
||||
<div class="update-ludan" id="update_ludan" style="z-index:999999;">
|
||||
<div class="update-ludan-title">
|
||||
{:lang('edit_previous_result')}
|
||||
</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('dragon')}</option>
|
||||
<option value="2-0">{:lang('tiger')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle_b.js?1"></script>
|
||||
</body>
|
||||
</html>
|
||||
175
app/handle/view/index/tab_dt_auto.html
Normal file
175
app/handle/view/index/tab_dt_auto.html
Normal file
@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.begincard .list .card{ width: 13.1vw; height: 33vh; margin-top: 1vh; margin-left: 2vw; }
|
||||
.begincard .card .topleft, .begincard .card .bottomright{ font-size: 3vh;}
|
||||
.begincard .card .topleft{ top: 1vh;left: 1.2vw;}
|
||||
.begincard .card .bottomright { bottom: 1vh; right: 1.2vw;}
|
||||
.result-box{ top:18%;}
|
||||
.color-red {color: red !important}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe" ></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<section class="begincard">
|
||||
<div class="box">
|
||||
<div class="result-box" id="openingElement" style="display:none;"><img id="openingPng" src="" /></div>
|
||||
<div class="card-box">
|
||||
<div class="list player-card">
|
||||
<div class="text zx" ><span>{:lang('tiger')}</span></div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list banker-card">
|
||||
<div class="zx text" ><span>{:lang('dragon')}</span></div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div id="fade" class="black_overlay"></div>
|
||||
<div class="update-ludan" id="update_ludan">
|
||||
<div class="update-ludan-title">{:lang('edit_previous_result')}</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('banker')}</option>
|
||||
<option value="2-0">{:lang('player')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
|
||||
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
|
||||
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
|
||||
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
|
||||
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
|
||||
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
|
||||
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
|
||||
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
|
||||
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
464
app/handle/view/index/tab_dt_sb.html
Normal file
464
app/handle/view/index/tab_dt_sb.html
Normal file
@ -0,0 +1,464 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.begincard .list .card{ width: 13.1vw; height: 33vh; margin-top: 1vh; margin-left: 2vw; }
|
||||
.begincard .card .topleft, .begincard .card .bottomright{ font-size: 3vh;}
|
||||
.begincard .card .topleft{ top: 1vh;left: 1.2vw;}
|
||||
.begincard .card .bottomright { bottom: 1vh; right: 1.2vw;}
|
||||
.result-box{ top:18%;}
|
||||
.color-red {color: red !important}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe" ></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<section class="begincard">
|
||||
<div class="box">
|
||||
<div class="result-box" id="openingElement" style="display:none;"><img id="openingPng" src="" /></div>
|
||||
<div class="card-box">
|
||||
<div class="list player-card">
|
||||
<div class="text zx" ><span>{:lang('tiger')}</span></div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="11"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list banker-card">
|
||||
<div class="zx text" ><span>{:lang('dragon')}</span></div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="21"></div>
|
||||
<div class="topleft"></div>
|
||||
<div class="bottomright"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:5vh;">
|
||||
<span class="green_bg" id="restart_sb" onclick="restartSB()">{:lang('restart_sb')}</span>
|
||||
<span class="red_bg" id="stop_sb" onclick="stopSB()">{:lang('stop_sb')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div id="fade" class="black_overlay"></div>
|
||||
<div class="update-ludan" id="update_ludan">
|
||||
<div class="update-ludan-title">{:lang('edit_previous_result')}</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('banker')}</option>
|
||||
<option value="2-0">{:lang('player')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
|
||||
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
|
||||
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
|
||||
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
|
||||
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
|
||||
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
|
||||
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
|
||||
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
|
||||
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="change" id="change_cards">
|
||||
<div style="margin-top: 30px;">
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="101">
|
||||
<img src="/static/poker/101.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="102">
|
||||
<img src="/static/poker/102.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="103">
|
||||
<img src="/static/poker/103.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="104">
|
||||
<img src="/static/poker/104.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="105">
|
||||
<img src="/static/poker/105.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="106">
|
||||
<img src="/static/poker/106.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="107">
|
||||
<img src="/static/poker/107.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="108">
|
||||
<img src="/static/poker/108.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="109">
|
||||
<img src="/static/poker/109.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="110">
|
||||
<img src="/static/poker/110.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="111">
|
||||
<img src="/static/poker/111.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="112">
|
||||
<img src="/static/poker/112.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="113">
|
||||
<img src="/static/poker/113.png">
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="201">
|
||||
<img src="/static/poker/201.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="202">
|
||||
<img src="/static/poker/202.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="203">
|
||||
<img src="/static/poker/203.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="204">
|
||||
<img src="/static/poker/204.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="205">
|
||||
<img src="/static/poker/205.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="206">
|
||||
<img src="/static/poker/206.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="207">
|
||||
<img src="/static/poker/207.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="208">
|
||||
<img src="/static/poker/208.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="209">
|
||||
<img src="/static/poker/209.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="210">
|
||||
<img src="/static/poker/210.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="211">
|
||||
<img src="/static/poker/211.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="212">
|
||||
<img src="/static/poker/212.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="213">
|
||||
<img src="/static/poker/213.png">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="301">
|
||||
<img src="/static/poker/301.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="302">
|
||||
<img src="/static/poker/302.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="303">
|
||||
<img src="/static/poker/303.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="304">
|
||||
<img src="/static/poker/304.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="305">
|
||||
<img src="/static/poker/305.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="306">
|
||||
<img src="/static/poker/306.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="307">
|
||||
<img src="/static/poker/307.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="308">
|
||||
<img src="/static/poker/308.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="309">
|
||||
<img src="/static/poker/309.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="310">
|
||||
<img src="/static/poker/310.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="311">
|
||||
<img src="/static/poker/311.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="312">
|
||||
<img src="/static/poker/312.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="313">
|
||||
<img src="/static/poker/313.png">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="401">
|
||||
<img src="/static/poker/401.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="402">
|
||||
<img src="/static/poker/402.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="403">
|
||||
<img src="/static/poker/403.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="404">
|
||||
<img src="/static/poker/404.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="405">
|
||||
<img src="/static/poker/405.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="406">
|
||||
<img src="/static/poker/406.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="407">
|
||||
<img src="/static/poker/407.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="408">
|
||||
<img src="/static/poker/408.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="409">
|
||||
<img src="/static/poker/409.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="410">
|
||||
<img src="/static/poker/410.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="411">
|
||||
<img src="/static/poker/411.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="412">
|
||||
<img src="/static/poker/412.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="413">
|
||||
<img src="/static/poker/413.png">
|
||||
</label>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="change_card" onclick="changeErrSbCard()">Submit</span>
|
||||
<span class="red_bg" id="cancel_card" onclick="cancelChangeErrSbCard()">Cancel</span>
|
||||
</div>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
.change{
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
width: auto;
|
||||
height: 780px;
|
||||
background: rgb(0 0 0 / 90%);
|
||||
z-index: 999;
|
||||
overflow: hidden;
|
||||
}
|
||||
.change div {margin: auto 15px;}
|
||||
.change div img {
|
||||
width: 8vh;
|
||||
margin: 15px 10px 10px 10px;
|
||||
}
|
||||
[type=radio] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* IMAGE STYLES */
|
||||
[type=radio] + img {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* CHECKED STYLES */
|
||||
[type=radio]:checked + img {
|
||||
outline: 6px solid #f00;
|
||||
}
|
||||
|
||||
|
||||
.change .btn-box1 {
|
||||
margin-top: 15px;
|
||||
float: right;
|
||||
}
|
||||
.change .btn-box1 span {
|
||||
cursor: pointer;
|
||||
width: 110px;
|
||||
height: 35px;
|
||||
display: inline-block;
|
||||
margin: 0 45px 0 10px;
|
||||
padding-left:45px;
|
||||
line-height: 35px;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset, 0px 6px 5px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset,0px 6px 5px rgba(0,0,0,0.2);
|
||||
box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset, 0px 6px 5px rgba(0,0,0,0.2);
|
||||
}
|
||||
.change .green_bg {
|
||||
background: #0b6140;
|
||||
}
|
||||
.change .red_bg {
|
||||
background: #7a1e1e;
|
||||
}
|
||||
</style>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle_dt_sb.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
346
app/handle/view/index/tab_knn.html
Normal file
346
app/handle/view/index/tab_knn.html
Normal file
@ -0,0 +1,346 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.begincard .box{
|
||||
position: absolute;
|
||||
left: -18.6%;
|
||||
top: 64%;
|
||||
opacity: 1;
|
||||
}
|
||||
.begincard{
|
||||
position: fixed;
|
||||
margin-left: 60%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(0,0,0,0.5);
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
.begincard .list{ width: 100%;margin-left: 0;}
|
||||
.begincard .list .card{margin-right:0; width: 9.0vw; float: left;margin-top: 5px;margin-left: 5px;height: 23vh;}
|
||||
.begincard .list .card.xuanzhuan{
|
||||
height: 25vh;
|
||||
margin-left: 3.3vw;
|
||||
margin-top: 4.8vh;
|
||||
width:9vw;
|
||||
-webkit-transform: rotate(90deg);
|
||||
-moz-transform: rotate(90deg);
|
||||
-o-transform: rotate(90deg);
|
||||
-ms-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.begincard .list.position-card{
|
||||
width: 16.0vw;
|
||||
height: 30vh;
|
||||
background-color: rgba(000, 000, 000, 0.5);
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.begincard .list .card-title{
|
||||
float: left;
|
||||
text-align: center;
|
||||
color: #d8b16e;
|
||||
font-size:5.1vh;
|
||||
width: 10vw;
|
||||
display: inline-block;
|
||||
padding-bottom: 10px;
|
||||
/*background-color: rgba(000, 000, 000, 0.5);*/
|
||||
margin-top: 7px;
|
||||
}
|
||||
.card-title .card-result{color: #b31a20;}
|
||||
.begincard .box .list .card-title{
|
||||
position: absolute;
|
||||
top: -0.8vw;
|
||||
left: 1vw;
|
||||
color: #b31a20;
|
||||
width:14vw;
|
||||
}
|
||||
.begincard .win{
|
||||
border:3px solid #d8b16e;
|
||||
background-color: rgba(226, 212, 71, 0.5);
|
||||
border-radius: 10px;
|
||||
-webkit-animation-timing-function:ease-in-out;
|
||||
-webkit-animation-name:breathe;
|
||||
-webkit-animation-duration:500ms;
|
||||
-webkit-animation-iteration-count:infinite;
|
||||
-webkit-animation-direction:alternate;
|
||||
/*transform: scale(1.5,1.5);*/
|
||||
/*position: absolute;*/
|
||||
/*z-index: 10;*/
|
||||
}
|
||||
.win-tip{
|
||||
width: 34rem;
|
||||
height: 9rem;
|
||||
line-height: 9rem;
|
||||
text-align: center;
|
||||
background-image: url('/static/handle/img/tip_bg.png');
|
||||
background-size: 100% 100%;
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
left:-36%;
|
||||
display: none;
|
||||
font-size: 4rem;
|
||||
color: #cca768;
|
||||
}
|
||||
.win-tip.show{
|
||||
display: block;
|
||||
animation: bounceIn 1s 0s ease both;
|
||||
}
|
||||
.countdown .rob-count{
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
width: 58%;
|
||||
margin: 0 auto;
|
||||
padding: 1rem 0;
|
||||
position: absolute;
|
||||
left: 3rem;
|
||||
background-image: -webkit-linear-gradient(bottom,#775d2b,#b4a67d,#fff);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
top: -6rem;
|
||||
/* background: red; */
|
||||
font-size: 4rem;
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!--<?php print_r($table);?>-->
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count"></div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe" ></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<section class="begincard">
|
||||
<div class="box">
|
||||
<div class="list position-card">
|
||||
<div class="card-title word" >
|
||||
定位
|
||||
</div>
|
||||
<div class="card xuanzhuan">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box1">
|
||||
|
||||
<div class="list banker-card">
|
||||
<div class="card-title" >
|
||||
<div class="banker">庄</div>
|
||||
<div class="banker_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box2">
|
||||
|
||||
<div class="list player-1-card">
|
||||
<div class="card-title" >
|
||||
<div class="player">闲1</div>
|
||||
<div class="player_1_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box3">
|
||||
<div class="list player-2-card">
|
||||
<div class="card-title " >
|
||||
<div class="player">闲2</div>
|
||||
<div class="player_2_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box4">
|
||||
<div class="list player-3-card">
|
||||
<div class="card-title" >
|
||||
<div class="player">闲3</div>
|
||||
<div class="player_3_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face"></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="win-tip"></div>
|
||||
</section>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<?php if($table['is_rob'] == 1) : ?>
|
||||
<span class="green_bg" id="start_bet" onclick="startRob()">{:lang('start')}</span>
|
||||
<?php else: ?>
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<?php endif; ?>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div id="fade" class="black_overlay"></div>
|
||||
<div class="update-ludan" id="update_ludan">
|
||||
<div class="update-ludan-title">{:lang('edit_previous_result')}</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('banker')}</option>
|
||||
<option value="2-0">{:lang('player')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
|
||||
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
|
||||
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
|
||||
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
|
||||
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
|
||||
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
|
||||
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
|
||||
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
|
||||
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="number_rob_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<input type="hidden" id="is_rob" value="{$table.is_rob}">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
621
app/handle/view/index/tab_nn.html
Normal file
621
app/handle/view/index/tab_nn.html
Normal file
@ -0,0 +1,621 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.begincard .box{
|
||||
position: absolute;
|
||||
left: -18.6%;
|
||||
top: 64%;
|
||||
}
|
||||
.begincard{
|
||||
position: fixed;
|
||||
margin-left: 43%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(0,0,0,0.5);
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
.begincard .list{ width: 100%;margin-left: 0;}
|
||||
.begincard .list .card{margin-right:0; width: 9.0vw; float: left;margin-top: 5px;margin-left: 5px; height: 23vh;}
|
||||
.begincard .list .card.xuanzhuan{
|
||||
height: 25vh;
|
||||
margin-left: 3.3vw;
|
||||
margin-top: 4.8vh;
|
||||
width:9vw;
|
||||
-webkit-transform: rotate(90deg);
|
||||
-moz-transform: rotate(90deg);
|
||||
-o-transform: rotate(90deg);
|
||||
-ms-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.begincard .list.position-card{
|
||||
|
||||
width: 16.0vw;
|
||||
height: 30vh;
|
||||
background-color: rgba(000, 000, 000, 0.5);
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.begincard .list .card-title{
|
||||
float: left;
|
||||
text-align: center;
|
||||
color: #d8b16e;
|
||||
font-size:6vh;
|
||||
width: 9vw;
|
||||
display: inline-block;
|
||||
padding-bottom: 10px;
|
||||
margin-top: 7px;
|
||||
}
|
||||
.card-title .card-result{color: #b31a20;}
|
||||
.begincard .box .list .card-title{
|
||||
position: absolute;
|
||||
top: -0.8vw;
|
||||
left: 1vw;
|
||||
color: #b31a20;
|
||||
width:14vw;
|
||||
}
|
||||
.begincard .win{
|
||||
border:3px solid #d8b16e;
|
||||
background-color: rgba(226, 212, 71, 0.5);
|
||||
border-radius: 10px;
|
||||
-webkit-animation-timing-function:ease-in-out;
|
||||
-webkit-animation-name:breathe;
|
||||
-webkit-animation-duration:500ms;
|
||||
-webkit-animation-iteration-count:infinite;
|
||||
-webkit-animation-direction:alternate;
|
||||
}
|
||||
.win-tip{
|
||||
width: 34rem;
|
||||
height: 9rem;
|
||||
line-height: 9rem;
|
||||
text-align: center;
|
||||
background-image: url('/static/handle/img/tip_bg.png');
|
||||
background-size: 100% 100%;
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
left:-36%;
|
||||
display: none;
|
||||
font-size: 4rem;
|
||||
color: #cca768;
|
||||
}
|
||||
.win-tip.show{
|
||||
display: block;
|
||||
animation: bounceIn 1s 0s ease both;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe" ></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<section class="begincard">
|
||||
<div class="box">
|
||||
<div class="list position-card">
|
||||
<div class="card-title word" >
|
||||
定位
|
||||
</div>
|
||||
<div class="card xuanzhuan">
|
||||
<div class="face" data-position="0"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box1">
|
||||
<div class="list banker-card">
|
||||
<div class="card-title" >
|
||||
<div class="banker">B</div>
|
||||
<div class="banker_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="1"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="2"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="3"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="4"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="5"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box2">
|
||||
|
||||
<div class="list player-1-card">
|
||||
<div class="card-title" >
|
||||
<div class="player">P1</div>
|
||||
<div class="player_1_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="6"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="7"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="8"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="9"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="10"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box3">
|
||||
<div class="list player-2-card">
|
||||
<div class="card-title " >
|
||||
<div class="player">P2</div>
|
||||
<div class="player_2_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="11"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="12"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="13"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="14"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="15"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box4">
|
||||
<div class="list player-3-card">
|
||||
<div class="card-title" >
|
||||
<div class="player">P3</div>
|
||||
<div class="player_3_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="16"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="17"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="18"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="19"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="20"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="win-tip"></div>
|
||||
</section>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<?php if($table['is_rob'] == 1) : ?>
|
||||
<span class="green_bg" id="start_bet" onclick="startRob()">{:lang('start')}</span>
|
||||
<?php else: ?>
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<?php endif; ?>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div id="fade" class="black_overlay"></div>
|
||||
<div class="update-ludan" id="update_ludan">
|
||||
<div class="update-ludan-title">{:lang('edit_previous_result')}</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('banker')}</option>
|
||||
<option value="2-0">{:lang('player')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
|
||||
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
|
||||
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
|
||||
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
|
||||
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
|
||||
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
|
||||
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
|
||||
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
|
||||
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="change" id="change_cards">
|
||||
<div style="margin-top: 30px;">
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="101">
|
||||
<img src="/static/poker/101.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="102">
|
||||
<img src="/static/poker/102.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="103">
|
||||
<img src="/static/poker/103.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="104">
|
||||
<img src="/static/poker/104.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="105">
|
||||
<img src="/static/poker/105.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="106">
|
||||
<img src="/static/poker/106.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="107">
|
||||
<img src="/static/poker/107.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="108">
|
||||
<img src="/static/poker/108.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="109">
|
||||
<img src="/static/poker/109.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="110">
|
||||
<img src="/static/poker/110.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="111">
|
||||
<img src="/static/poker/111.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="112">
|
||||
<img src="/static/poker/112.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="113">
|
||||
<img src="/static/poker/113.png">
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="201">
|
||||
<img src="/static/poker/201.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="202">
|
||||
<img src="/static/poker/202.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="203">
|
||||
<img src="/static/poker/203.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="204">
|
||||
<img src="/static/poker/204.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="205">
|
||||
<img src="/static/poker/205.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="206">
|
||||
<img src="/static/poker/206.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="207">
|
||||
<img src="/static/poker/207.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="208">
|
||||
<img src="/static/poker/208.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="209">
|
||||
<img src="/static/poker/209.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="210">
|
||||
<img src="/static/poker/210.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="211">
|
||||
<img src="/static/poker/211.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="212">
|
||||
<img src="/static/poker/212.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="213">
|
||||
<img src="/static/poker/213.png">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="301">
|
||||
<img src="/static/poker/301.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="302">
|
||||
<img src="/static/poker/302.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="303">
|
||||
<img src="/static/poker/303.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="304">
|
||||
<img src="/static/poker/304.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="305">
|
||||
<img src="/static/poker/305.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="306">
|
||||
<img src="/static/poker/306.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="307">
|
||||
<img src="/static/poker/307.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="308">
|
||||
<img src="/static/poker/308.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="309">
|
||||
<img src="/static/poker/309.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="310">
|
||||
<img src="/static/poker/310.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="311">
|
||||
<img src="/static/poker/311.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="312">
|
||||
<img src="/static/poker/312.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="313">
|
||||
<img src="/static/poker/313.png">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="401">
|
||||
<img src="/static/poker/401.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="402">
|
||||
<img src="/static/poker/402.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="403">
|
||||
<img src="/static/poker/403.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="404">
|
||||
<img src="/static/poker/404.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="405">
|
||||
<img src="/static/poker/405.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="406">
|
||||
<img src="/static/poker/406.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="407">
|
||||
<img src="/static/poker/407.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="408">
|
||||
<img src="/static/poker/408.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="409">
|
||||
<img src="/static/poker/409.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="410">
|
||||
<img src="/static/poker/410.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="411">
|
||||
<img src="/static/poker/411.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="412">
|
||||
<img src="/static/poker/412.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="413">
|
||||
<img src="/static/poker/413.png">
|
||||
</label>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="change_card" onclick="changeErrSbCard()">Submit</span>
|
||||
<span class="red_bg" id="cancel_card" onclick="cancelChangeErrSbCard()">Cancel</span>
|
||||
</div>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
.change{
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
width: auto;
|
||||
height: 780px;
|
||||
background: rgb(0 0 0 / 90%);
|
||||
z-index: 999;
|
||||
overflow: hidden;
|
||||
}
|
||||
.change div {margin: auto 15px;}
|
||||
.change div img {
|
||||
width: 8vh;
|
||||
margin: 15px 10px 10px 10px;
|
||||
}
|
||||
[type=radio] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* IMAGE STYLES */
|
||||
[type=radio] + img {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* CHECKED STYLES */
|
||||
[type=radio]:checked + img {
|
||||
outline: 6px solid #f00;
|
||||
}
|
||||
|
||||
|
||||
.change .btn-box1 {
|
||||
margin-top: 15px;
|
||||
float: right;
|
||||
}
|
||||
.change .btn-box1 span {
|
||||
cursor: pointer;
|
||||
width: 110px;
|
||||
height: 35px;
|
||||
display: inline-block;
|
||||
margin: 0 45px 0 10px;
|
||||
padding-left:45px;
|
||||
line-height: 35px;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset, 0px 6px 5px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset,0px 6px 5px rgba(0,0,0,0.2);
|
||||
box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset, 0px 6px 5px rgba(0,0,0,0.2);
|
||||
}
|
||||
.change .green_bg {
|
||||
background: #0b6140;
|
||||
}
|
||||
.change .red_bg {
|
||||
background: #7a1e1e;
|
||||
}
|
||||
</style>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="number_rob_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<input type="hidden" id="is_rob" value="{$table.is_rob}">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
625
app/handle/view/index/tab_nn_sb.html
Normal file
625
app/handle/view/index/tab_nn_sb.html
Normal file
@ -0,0 +1,625 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.begincard .box{
|
||||
position: absolute;
|
||||
left: -18.6%;
|
||||
top: 64%;
|
||||
}
|
||||
.begincard{
|
||||
position: fixed;
|
||||
margin-left: 43%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(0,0,0,0.5);
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
.begincard .list{ width: 100%;margin-left: 0;}
|
||||
.begincard .list .card{margin-right:0; width: 9.0vw; float: left;margin-top: 5px;margin-left: 5px; height: 23vh;}
|
||||
.begincard .list .card.xuanzhuan{
|
||||
height: 25vh;
|
||||
margin-left: 3.3vw;
|
||||
margin-top: 4.8vh;
|
||||
width:9vw;
|
||||
-webkit-transform: rotate(90deg);
|
||||
-moz-transform: rotate(90deg);
|
||||
-o-transform: rotate(90deg);
|
||||
-ms-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.begincard .list.position-card{
|
||||
|
||||
width: 16.0vw;
|
||||
height: 30vh;
|
||||
background-color: rgba(000, 000, 000, 0.5);
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.begincard .list .card-title{
|
||||
float: left;
|
||||
text-align: center;
|
||||
color: #d8b16e;
|
||||
font-size:6vh;
|
||||
width: 9vw;
|
||||
display: inline-block;
|
||||
padding-bottom: 10px;
|
||||
margin-top: 7px;
|
||||
}
|
||||
.card-title .card-result{color: #b31a20;}
|
||||
.begincard .box .list .card-title{
|
||||
position: absolute;
|
||||
top: -0.8vw;
|
||||
left: 1vw;
|
||||
color: #b31a20;
|
||||
width:14vw;
|
||||
}
|
||||
.begincard .win{
|
||||
border:3px solid #d8b16e;
|
||||
background-color: rgba(226, 212, 71, 0.5);
|
||||
border-radius: 10px;
|
||||
-webkit-animation-timing-function:ease-in-out;
|
||||
-webkit-animation-name:breathe;
|
||||
-webkit-animation-duration:500ms;
|
||||
-webkit-animation-iteration-count:infinite;
|
||||
-webkit-animation-direction:alternate;
|
||||
}
|
||||
.win-tip{
|
||||
width: 34rem;
|
||||
height: 9rem;
|
||||
line-height: 9rem;
|
||||
text-align: center;
|
||||
background-image: url('/static/handle/img/tip_bg.png');
|
||||
background-size: 100% 100%;
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
left:-36%;
|
||||
display: none;
|
||||
font-size: 4rem;
|
||||
color: #cca768;
|
||||
}
|
||||
.win-tip.show{
|
||||
display: block;
|
||||
animation: bounceIn 1s 0s ease both;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe" ></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
<div class="t-logo-tit"><span>{$table.game_name} - {$table.table_name}</span></div>
|
||||
</div>
|
||||
<section class="begincard">
|
||||
<div class="box">
|
||||
<div class="list position-card">
|
||||
<div class="card-title word" >
|
||||
定位
|
||||
</div>
|
||||
<div class="card xuanzhuan">
|
||||
<div class="face" data-position="0"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box1">
|
||||
<div class="list banker-card">
|
||||
<div class="card-title" >
|
||||
<div class="banker">B</div>
|
||||
<div class="banker_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="1"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="2"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="3"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="4"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="5"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box2">
|
||||
|
||||
<div class="list player-1-card">
|
||||
<div class="card-title" >
|
||||
<div class="player">P1</div>
|
||||
<div class="player_1_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="6"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="7"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="8"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="9"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="10"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box3">
|
||||
<div class="list player-2-card">
|
||||
<div class="card-title " >
|
||||
<div class="player">P2</div>
|
||||
<div class="player_2_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="11"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="12"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="13"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="14"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="15"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box4">
|
||||
<div class="list player-3-card">
|
||||
<div class="card-title" >
|
||||
<div class="player">P3</div>
|
||||
<div class="player_3_result card-result"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="16"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="17"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="18"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="19"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="face" data-position="20"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="win-tip"></div>
|
||||
</section>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<?php if($table['is_rob'] == 1) : ?>
|
||||
<span class="green_bg" id="start_bet" onclick="startRob()">{:lang('start')}</span>
|
||||
<?php else: ?>
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<?php endif; ?>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:5vh;">
|
||||
<span class="green_bg" id="restart_sb" onclick="restartSB()">{:lang('restart_sb')}</span>
|
||||
<span class="red_bg" id="stop_sb" onclick="stopSB()">{:lang('stop_sb')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div id="fade" class="black_overlay"></div>
|
||||
<div class="update-ludan" id="update_ludan">
|
||||
<div class="update-ludan-title">{:lang('edit_previous_result')}</div>
|
||||
<div class="update-ludan-content">
|
||||
{:lang('select_result')}:
|
||||
<select id="update_ludan_result">
|
||||
<option value="">{:lang('select')}</option>
|
||||
<option value="1-0">{:lang('banker')}</option>
|
||||
<option value="2-0">{:lang('player')}</option>
|
||||
<option value="3-0">{:lang('tie')}</option>
|
||||
<option value="1-1">{:lang('banker')}-{:lang('banker_pair')}</option>
|
||||
<option value="1-2">{:lang('banker')}-{:lang('player_pair')}</option>
|
||||
<option value="1-3">{:lang('banker')}-{:lang('both_pair')}</option>
|
||||
<option value="2-1">{:lang('player')}-{:lang('banker_pair')}</option>
|
||||
<option value="2-2">{:lang('player')}-{:lang('player_pair')}</option>
|
||||
<option value="2-3">{:lang('player')}-{:lang('both_pair')}</option>
|
||||
<option value="3-1">{:lang('tie')}-{:lang('banker_pair')}</option>
|
||||
<option value="3-2">{:lang('tie')}-{:lang('player_pair')}</option>
|
||||
<option value="3-3">{:lang('tie')}-{:lang('both_pair')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="update-ludan-footer">
|
||||
<a id="confirm_update_ludan">{:lang('confirm')}</a>
|
||||
<a id="cancel_update_ludan">{:lang('cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="change" id="change_cards">
|
||||
<div style="margin-top: 30px;">
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="101">
|
||||
<img src="/static/poker/101.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="102">
|
||||
<img src="/static/poker/102.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="103">
|
||||
<img src="/static/poker/103.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="104">
|
||||
<img src="/static/poker/104.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="105">
|
||||
<img src="/static/poker/105.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="106">
|
||||
<img src="/static/poker/106.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="107">
|
||||
<img src="/static/poker/107.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="108">
|
||||
<img src="/static/poker/108.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="109">
|
||||
<img src="/static/poker/109.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="110">
|
||||
<img src="/static/poker/110.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="111">
|
||||
<img src="/static/poker/111.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="112">
|
||||
<img src="/static/poker/112.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="113">
|
||||
<img src="/static/poker/113.png">
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="201">
|
||||
<img src="/static/poker/201.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="202">
|
||||
<img src="/static/poker/202.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="203">
|
||||
<img src="/static/poker/203.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="204">
|
||||
<img src="/static/poker/204.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="205">
|
||||
<img src="/static/poker/205.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="206">
|
||||
<img src="/static/poker/206.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="207">
|
||||
<img src="/static/poker/207.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="208">
|
||||
<img src="/static/poker/208.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="209">
|
||||
<img src="/static/poker/209.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="210">
|
||||
<img src="/static/poker/210.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="211">
|
||||
<img src="/static/poker/211.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="212">
|
||||
<img src="/static/poker/212.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="213">
|
||||
<img src="/static/poker/213.png">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="301">
|
||||
<img src="/static/poker/301.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="302">
|
||||
<img src="/static/poker/302.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="303">
|
||||
<img src="/static/poker/303.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="304">
|
||||
<img src="/static/poker/304.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="305">
|
||||
<img src="/static/poker/305.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="306">
|
||||
<img src="/static/poker/306.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="307">
|
||||
<img src="/static/poker/307.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="308">
|
||||
<img src="/static/poker/308.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="309">
|
||||
<img src="/static/poker/309.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="310">
|
||||
<img src="/static/poker/310.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="311">
|
||||
<img src="/static/poker/311.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="312">
|
||||
<img src="/static/poker/312.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="313">
|
||||
<img src="/static/poker/313.png">
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="401">
|
||||
<img src="/static/poker/401.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="402">
|
||||
<img src="/static/poker/402.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="403">
|
||||
<img src="/static/poker/403.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="404">
|
||||
<img src="/static/poker/404.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="405">
|
||||
<img src="/static/poker/405.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="406">
|
||||
<img src="/static/poker/406.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="407">
|
||||
<img src="/static/poker/407.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="408">
|
||||
<img src="/static/poker/408.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="409">
|
||||
<img src="/static/poker/409.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="410">
|
||||
<img src="/static/poker/410.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="411">
|
||||
<img src="/static/poker/411.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="412">
|
||||
<img src="/static/poker/412.png">
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="cardToChanged" value="413">
|
||||
<img src="/static/poker/413.png">
|
||||
</label>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="change_card" onclick="changeErrSbCard()">Submit</span>
|
||||
<span class="red_bg" id="cancel_card" onclick="cancelChangeErrSbCard()">Cancel</span>
|
||||
</div>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
.change{
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
width: auto;
|
||||
height: 780px;
|
||||
background: rgb(0 0 0 / 90%);
|
||||
z-index: 999;
|
||||
overflow: hidden;
|
||||
}
|
||||
.change div {margin: auto 15px;}
|
||||
.change div img {
|
||||
width: 8vh;
|
||||
margin: 15px 10px 10px 10px;
|
||||
}
|
||||
[type=radio] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* IMAGE STYLES */
|
||||
[type=radio] + img {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* CHECKED STYLES */
|
||||
[type=radio]:checked + img {
|
||||
outline: 6px solid #f00;
|
||||
}
|
||||
|
||||
|
||||
.change .btn-box1 {
|
||||
margin-top: 15px;
|
||||
float: right;
|
||||
}
|
||||
.change .btn-box1 span {
|
||||
cursor: pointer;
|
||||
width: 110px;
|
||||
height: 35px;
|
||||
display: inline-block;
|
||||
margin: 0 45px 0 10px;
|
||||
padding-left:45px;
|
||||
line-height: 35px;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset, 0px 6px 5px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset,0px 6px 5px rgba(0,0,0,0.2);
|
||||
box-shadow: 0px 0px 3px rgba(255, 255, 255, 0.5) inset, 0px 6px 5px rgba(0,0,0,0.2);
|
||||
}
|
||||
.change .green_bg {
|
||||
background: #0b6140;
|
||||
}
|
||||
.change .red_bg {
|
||||
background: #7a1e1e;
|
||||
}
|
||||
</style>
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="number_rob_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<!--//1百家乐 2龙虎 4牛牛-->
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<input type="hidden" id="is_rob" value="{$table.is_rob}">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle_nn_sb.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
131
app/handle/view/index/tab_roulette.html
Normal file
131
app/handle/view/index/tab_roulette.html
Normal file
@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}:</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}:</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe"></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div class="roulette-result-box" id="roulette_result_box">
|
||||
<div class="roulette-result">
|
||||
<div class="roulette-result-item">
|
||||
<div class="roulette-result-num"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@keyframes fade {from {opacity: 1.0;}50% {opacity: 0.4;}to {opacity: 1.0;}}
|
||||
@-webkit-keyframes fade {from {opacity: 1.0;}50% {opacity: 0.4;}to {opacity: 1.0;}}
|
||||
.flicker{animation: fade 600ms infinite; -webkit-animation: fade 600ms infinite;}
|
||||
.roulette-result-box{width: 100vw; height: 100vh; position: fixed; left: 0; top: 0; z-index: 1; background-color:rgba(0,0,0,0.5); display: none;}
|
||||
.roulette-result{width: 80%; height: 420px; position: absolute; top: 30%; left: 10%; text-align: center}
|
||||
.roulette-result-item .roulette-result-num{cursor: pointer; border: 10px solid #FFFFFF; display: inline-block; width: 400px; height: 300px; background: #0b6140; margin-right: 60px; font-size: 320px; font-weight: bold; line-height: 300px; color: #F75748;}
|
||||
.roulette-result-item .roulette-result-num.active{border-color: #F75748 !important;animation: fade 400ms infinite; -webkit-animation: fade 400ms infinite;}
|
||||
|
||||
</style>
|
||||
|
||||
<input type="hidden" id="roulette_result" value="">
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle_roulette.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
137
app/handle/view/index/tab_toning.html
Normal file
137
app/handle/view/index/tab_toning.html
Normal file
@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>荷官端</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/reset.css{$Think.VERSION_V}">
|
||||
<link rel="stylesheet" type="text/css" href="/static/handle/css/common.css{$Think.VERSION_V}">
|
||||
<script type="text/javascript">
|
||||
var casinoTableId = "{$table.table_num}";
|
||||
var localSbServer="{$localSbServer}";
|
||||
var scanner_type = "{$table.scanner_type}";
|
||||
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var wait_time = "{$table.wait_time}";
|
||||
var table_type = "{$table.table_type}";
|
||||
var bet_type = "{$table.bet_type}";
|
||||
var lang;
|
||||
var flvUrl="{$table.media_far_rtmp}";
|
||||
var player="{$player}";
|
||||
var interval_time="{$table.interval_time}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="audio"></audio>
|
||||
<section class="section">
|
||||
<div class="top-sec">
|
||||
<div class="gra-btn countdown" >
|
||||
<div class="grab-count">
|
||||
</div>
|
||||
<div class="gc round-txt-item num"></div>
|
||||
</div>
|
||||
<!-- 视频-->
|
||||
<div class="video-sec fl">
|
||||
<div class="table-data">
|
||||
<div class="head box-sizing">
|
||||
<div class="box">
|
||||
<div class="clearfix">
|
||||
<div class="date"><div>{:lang('now_time')}:<span class="weekend"> 周四</span><span class="time"></span></div> </div>
|
||||
</div>
|
||||
<div class="list clearfix">
|
||||
<div class="item input-box" ><label>{:lang('boot')}:</label><span id="boot_num" ></span></div>
|
||||
<div class="item input-box m0" ><label>{:lang('number')}:</label><span id="number"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lan-box clearfix">
|
||||
<div class="item fl" style="opacity:0">
|
||||
<span>{:lang('online_number')}</span>
|
||||
<small id="onlineNumber">0</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="video-iframe" id="video-iframe"></iframe>
|
||||
</div>
|
||||
<div class="table-info fr">
|
||||
<div class="t-logo">
|
||||
<span id="show-status-span"></span>
|
||||
<img id="t-logo-img" src="{$logoPath}" />
|
||||
<div class="t-logo-tit"><span>{$table.table_name}</span></div>
|
||||
</div>
|
||||
<div class="nobegin-tip"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导航结速-->
|
||||
<div class="footer">
|
||||
<div class="canvas-box big">
|
||||
<canvas id="canvas3"></canvas>
|
||||
<input type="hidden" id="wait_time" value="{$table.wait_time}">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="control-box noselect">
|
||||
<div class="slide-btn">《</div>
|
||||
<div clss="btn-box0" style="padding:5vh 0 3vh 0">
|
||||
<select class="green_bg" id="language">
|
||||
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >简体中文</option>
|
||||
<option value="tw" <?php if(isset($langType) && $langType == 'zh-tw') echo 'selected="selected"'; ?> >繁體中文</option>
|
||||
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-box1" style="padding-top:0;">
|
||||
<span class="green_bg" id="start_bet" onclick="startBet()">{:lang('start')}</span>
|
||||
<span class="red_bg" id="end_bet" onclick="endBet()">{:lang('end')}</span>
|
||||
</div>
|
||||
<div class="btn-box4">
|
||||
<span onclick="resetNumberTab()">{:lang('reset_number')}</span>
|
||||
<span onclick="changeBoot()">{:lang('change_boot')}</span>
|
||||
<span onclick="resetBoot()">{:lang('close_boot')}</span>
|
||||
<span onclick="loginout()">{:lang('logout')}</span>
|
||||
</div>
|
||||
</section>
|
||||
<div class="toning-result-box" id="toning_result_box">
|
||||
<div class="toning-result">
|
||||
<div class="toning-result-item">
|
||||
<div class="toning-result-num toning-result-0">0</div>
|
||||
<div class="toning-result-num toning-result-1">1</div>
|
||||
<div class="toning-result-num toning-result-2">2</div>
|
||||
<div class="toning-result-num toning-result-3">3</div>
|
||||
<div class="toning-result-num toning-result-4">4</div>
|
||||
</div>
|
||||
<!-- <div><span onclick="opening()" class="toning-result-confirm">{:lang('confirm')}</span></div>-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@keyframes fade {from {opacity: 1.0;}50% {opacity: 0.4;}to {opacity: 1.0;}}
|
||||
@-webkit-keyframes fade {from {opacity: 1.0;}50% {opacity: 0.4;}to {opacity: 1.0;}}
|
||||
.toning-result-box{width: 100vw; height: 100vh; position: fixed; left: 0; top: 0; z-index: 1; background-color:rgba(0,0,0,0.5); display: none;}
|
||||
.toning-result{width: 80%; height: 420px; position: absolute; top: 30%; left: 10%; text-align: center}
|
||||
.toning-result-item .toning-result-num{cursor: pointer; border: 10px solid #FFFFFF; display: inline-block; width: 15%; height: 200px; background: #0b6140; margin-right: 60px; font-size: 180px; font-weight: bold; line-height: 200px; color: #F75748;}
|
||||
.toning-result-item .toning-result-num:last-child{margin-right: 0}
|
||||
.toning-result-item .toning-result-num.active{border-color: #F75748 !important;animation: fade 400ms infinite; -webkit-animation: fade 400ms infinite;}
|
||||
.toning-result-confirm{cursor: pointer; display: inline-block; width: 400px; height: 160px; background: #E6A23C; border-radius: 10px; margin-top: 40px; font-size: 60px; line-height: 160px; color: #fff; font-weight: bold;}
|
||||
</style>
|
||||
|
||||
<input type="hidden" id="toning_result" value="">
|
||||
|
||||
<input type="hidden" id="login_token" value="{$login_token}">
|
||||
<input type="hidden" id="account" value="{$user.username}">
|
||||
<input type="hidden" id="userid" value="{$user.id}">
|
||||
<input type="hidden" id="number_tab_status">
|
||||
<input type="hidden" id="table_id" value="{$table.id}">
|
||||
<input type="hidden" id="game_id" value="{$table.game_id}">
|
||||
<input type="hidden" id="is_scavenging" value="{$table.is_scavenging}">
|
||||
<input type="hidden" id="boot_id" value="">
|
||||
<input type="hidden" id="bet_type" value="{$table.bet_type}">
|
||||
<input type="hidden" id="keycode" value="">
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
|
||||
</body>
|
||||
</html>
|
||||
61
app/handle/view/login/index.html
Normal file
61
app/handle/view/login/index.html
Normal file
@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" style="width:100%; height:100%; background: #fff url('/static/handle/img/login-bg.jpg') repeat left top; overflow:hidden;">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>用户登录</title>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-1.8.3.min.js"></script>
|
||||
<style type="text/css">
|
||||
*{margin:0; padding:0; border:0; font-family:"微软雅黑"}
|
||||
.login{width:425px; height:500px; background:#fff; position: absolute; top:100px; left:45%;}
|
||||
.login h2{padding-top:50px; text-align:center;}
|
||||
.login h3{font-size:15px; color:#666; padding:20px 0px 0px 60px; font-weight:normal;}
|
||||
.login .input{padding:4px; border:1px solid #ddd; width:290px; border-radius:5px; margin:10px 0px 0px 60px; height:32px; line-height:32px;}
|
||||
.login .code{height:43px; margin:10px 0px 0px 60px;}
|
||||
.login .code .input-code{padding:4px; border:1px solid #ddd; height:32px; line-height:32px; width:180px; border-radius:5px; display:block; float:left; margin-right:10px;}
|
||||
.login button{display:block; margin:30px auto; width:290px; height:42px; border-radius:5px; background:#7FCF0A; cursor:pointer; color:#fff;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="login">
|
||||
<h2>操作台登录</h2>
|
||||
<h3>账号</h3>
|
||||
<input class="input" type="text" name="account" id="account" value="" maxlength="50" />
|
||||
<h3>密码</h3>
|
||||
<input class="input" type="password" name="pass" id="pass" value="" maxlength="50" />
|
||||
<button id="dologin" style="font-size:15px;">登录</button>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function (){
|
||||
$('#dologin').click(function (){
|
||||
var query = new Object();
|
||||
if($('#account').val() != ''){
|
||||
query.account = $('#account').val();
|
||||
}else{
|
||||
alert('请输入账号');
|
||||
return false;
|
||||
}
|
||||
if($('#pass').val() != '' && $('#pass').val().length > 5){
|
||||
query.password = $('#pass').val();
|
||||
}else{
|
||||
alert('请正确填写密码');
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url:'/login/dologin',
|
||||
data:query,
|
||||
dataType:"json",
|
||||
type:"POST",
|
||||
success:function(data){
|
||||
if(data.code === 1){
|
||||
window.location.href=data.url;
|
||||
}else{
|
||||
alert(data.msg);
|
||||
$('#passcode').attr('src',$('#passcode').attr('src')+'?');
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
27
app/handle/view/manager/index.html
Normal file
27
app/handle/view/manager/index.html
Normal file
@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>模拟经理端</title>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript">
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var account = "{$manager.username}";
|
||||
var userid = "{$manager.id}";
|
||||
var login_token = "{$manager.login_token}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div>模拟经理端</div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?connect=manager&account="+account+"&userid="+userid+"&login_token="+login_token,{transports: ['websocket']});
|
||||
websocket.on('onlineLogin',function(data){
|
||||
console.log(data)
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
67
app/handle/view/scan/dt_index.html
Normal file
67
app/handle/view/scan/dt_index.html
Normal file
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>模拟龙虎扫描端</title>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript">
|
||||
var table_id = "{$table.id}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
龙:<input name="banker_1" id="banker_1" ><button id="sub_1" onclick="submitResult('sub_1')">提交</button><br>
|
||||
虎:<input name="player_1" id="player_1" ><button id="sub_3" onclick="submitResult('sub_3')">提交</button><br>
|
||||
<input type="hidden" id="number_tab_id" value="{$numberTab.id}">
|
||||
</body>
|
||||
<script>
|
||||
var items = [
|
||||
101,102,103,104,105,106,107,108,109,110,111,112,113,
|
||||
201,202,203,204,205,206,207,208,209,210,211,212,213,
|
||||
301,302,303,304,305,306,307,308,309,310,311,312,313,
|
||||
401,402,403,404,405,406,407,408,409,410,411,412,413,
|
||||
];
|
||||
$(function(){
|
||||
var randomBanker = items[Math.floor(Math.random() * items.length)];
|
||||
$('#banker_1').val(randomBanker);
|
||||
var randomPlayer = items[Math.floor(Math.random() * items.length)];
|
||||
$('#player_1').val(randomPlayer);
|
||||
})
|
||||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?table_id="+table_id+"&appid=80002&connect=scan&appsecret=123456",{transports: ['websocket']});
|
||||
websocket.on('onlineLogin',function(data){
|
||||
if(data.status === true){
|
||||
// setNumberInfo(data);
|
||||
}else{
|
||||
layer.msg(data.msg,{time:5000});
|
||||
}
|
||||
});
|
||||
websocket.on('sendScanResult',function(data){
|
||||
console.log(data);
|
||||
});
|
||||
var setNumberInfo = function(data){
|
||||
$('#number_tab_id').val(data.round.number_tab_id);
|
||||
};
|
||||
// 点击提交结果
|
||||
var submitResult = function(id){
|
||||
var query = new Object();
|
||||
query.number_tab_id = parseInt($('#number_tab_id').val());
|
||||
if(id == "sub_1"){
|
||||
// 庄第一张
|
||||
query.card = $('#banker_1').val();
|
||||
query.position = "21";
|
||||
}else if(id == "sub_3"){
|
||||
// 闲第一张
|
||||
query.card = $('#player_1').val();
|
||||
query.position = "11";
|
||||
}
|
||||
if(query.card.length <= 0){
|
||||
layer.alert("扫牌失败,请重新扫牌!");
|
||||
return false;
|
||||
}
|
||||
websocket.emit('sendScanDt',{table_id : table_id, number_tab_id : query.number_tab_id, card : query.card, position : query.position});
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
189
app/handle/view/scan/dt_sb.html
Normal file
189
app/handle/view/scan/dt_sb.html
Normal file
@ -0,0 +1,189 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>模拟龙虎识别端</title>
|
||||
<script src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script src="/static/handle/js/md5.min.js"></script>
|
||||
<script src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div>
|
||||
台桌号: <input type="text" id="tableCode" name="tableCode"><br/>
|
||||
接收:<br/>
|
||||
1. 启动识别: startScanEvent<br/>
|
||||
2. 停止识别: stopScanEvent<br/>
|
||||
3. 指定下标识别: scanIndexEvent<br/>
|
||||
4. 多个位置识别: scanAllEvent<br/>
|
||||
5. 停止发送数据: stopSendingDataEvent<br/>
|
||||
<p></p>
|
||||
发送:<br/>
|
||||
1. 连接: <button onclick="join()">join</button>;响应:joinEvent<br/>
|
||||
<!--
|
||||
2. 发送数据:<button onclick="sendScan()">sendScan</button>;响应:sendScanEvent<br/>
|
||||
3. 发送指定下标数据:<button onclick="sendScanIndex()">sendScanIndex</button>;响应:sendScanIndexEvent<br/>
|
||||
4. 发送多个标框数据:<button onclick="sendScanAll()">sendScanAll</button>;响应:sendScanAllEvent<br/>
|
||||
-->
|
||||
|
||||
龙:<input name="banker_1" id="banker_1" ><button id="sub_1" onclick="submitResult('sub_1')">提交</button><br>
|
||||
虎:<input name="player_1" id="player_1" ><button id="sub_3" onclick="submitResult('sub_3')">提交</button><br>
|
||||
|
||||
<input type="hidden" id="number_tab_id" value="">
|
||||
<p></p>
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<script>
|
||||
|
||||
var items = [
|
||||
'as','2s','3s','4s','5s','6s','7s','8s','9s','ts','js','qs','ks',
|
||||
'ah','2h','3h','4h','5h','6h','7h','8h','9h','th','jh','qh','kh',
|
||||
'ac','2c','3c','4c','5c','6c','7c','8c','9c','tc','jc','qc','kc',
|
||||
'ad','2d','3d','4d','5d','6d','7d','8d','9d','td','jd','qd','kd',
|
||||
];
|
||||
$(function(){
|
||||
var randomBanker = items[Math.floor(Math.random() * items.length)];
|
||||
$('#banker_1').val(randomBanker);
|
||||
var randomPlayer = items[Math.floor(Math.random() * items.length)];
|
||||
$('#player_1').val(randomPlayer);
|
||||
})
|
||||
|
||||
|
||||
|
||||
var localSbServer="{$localSbServer}";
|
||||
|
||||
var socket = io(localSbServer,{transports: ['websocket']});
|
||||
var token = '';
|
||||
var tableCode = "B01";
|
||||
var key = "tntpokeraisyn";
|
||||
var stop = false;
|
||||
var biz = 0;
|
||||
|
||||
var submitResult = function(id){
|
||||
var query = new Object();
|
||||
if(id == "sub_1"){
|
||||
// 庄第一张
|
||||
query.card = $('#banker_1').val();
|
||||
query.position = "2";
|
||||
}else if(id == "sub_3"){
|
||||
// 闲第一张
|
||||
query.card = $('#player_1').val();
|
||||
query.position = "1";
|
||||
}
|
||||
if(query.card.length <= 0){
|
||||
layer.alert("扫牌失败,请重新扫牌!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sendScan(query);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function join() {
|
||||
tableCode = $('#tableCode').val();
|
||||
var timestamp = new Date().getTime();
|
||||
timestamp = Math.floor(timestamp / 1000);
|
||||
var sign = md5(tableCode + key + timestamp);
|
||||
|
||||
|
||||
console.log("发送 join 数据");
|
||||
console.log('socket.emit("join",{"tableCode":"' + tableCode + '", "timestamp":"' + timestamp + '","sign":"' + sign + '"})');
|
||||
|
||||
socket.emit('join', {'tableCode': tableCode, 'timestamp': timestamp, 'sign': sign});
|
||||
}
|
||||
|
||||
function sendScan(data) {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScan 数据");
|
||||
socket.emit('sendScan', {'tableCode': tableCode, 'token': token, 'tableType':'ONE', 'count':1, 'biz': biz, 'data':[{'index':data.position, 'card':data.card}]});
|
||||
}
|
||||
|
||||
function sendScanIndex(data) {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScanIndex 数据");
|
||||
socket.emit('sendScanIndex', {'tableCode': tableCode, 'token': token, 'tableType':'ONE','biz':biz,'data':[{'index':data.position, 'card':data.card}]});
|
||||
}
|
||||
|
||||
function sendScanAll() {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScanAll 数据");
|
||||
console.log('socket.emit("sendScanAll",{"tableCode":"' + tableCode + '", "token":"' + token + '","tableType":"ONE","biz":"abcd", "data":[{"index":1, "card":"3d"},{"index":2, "card":"5h"},{"index":3, "card":"5h"},{"index":4, "card":"5h"},{"index":5, "card":"kd"},{"index":6, "card":"None"}]})');
|
||||
socket.emit('sendScanAll', {'tableCode': tableCode, 'token': token, 'tableType':'ONE', 'biz':'abcd', 'data':[{'index':1, 'card':'3d'},{'index':2, 'card':'5h'},{'index':3, 'card':'5h'},{'index':4, 'card':'5h'},{'index':5, 'card':'kd'},{'index':6, 'card':'None'}]});
|
||||
}
|
||||
|
||||
// 设备
|
||||
socket.on('startScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到启动识别事件 startScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
if (data.tableCode == tableCode) {
|
||||
biz = data.biz;
|
||||
}
|
||||
});
|
||||
socket.on('stopScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到停止识别事件 stopScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
stop = true;
|
||||
});
|
||||
socket.on('stopSendingDataEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到停止识别事件 stopSendingDataEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
stop = true;
|
||||
});
|
||||
socket.on('scanIndexEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送动的信息
|
||||
console.log('设备接收到识别指定下标请求事件 scanIndexEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
|
||||
if (data.tableCode == tableCode) {
|
||||
biz = data.biz;
|
||||
}
|
||||
});
|
||||
socket.on('scanAllEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送动的信息
|
||||
console.log('设备接收到识别多个标框请求事件 scanAllEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
sendScanAll();
|
||||
});
|
||||
socket.on('joinEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到加入响应 joinEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
if(data.code == 200) {token = data.token;}
|
||||
});
|
||||
socket.on('sendScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送识别数据后,接收到响应 sendScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
socket.on('sendScanIndexEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送指定下标识别数据后,接收到响应 sendScanIndexEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
socket.on('sendScanAllEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送多标框识别数据后,接收到响应 sendScanAllEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
96
app/handle/view/scan/index.html
Normal file
96
app/handle/view/scan/index.html
Normal file
@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>模拟百家乐扫描端</title>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript">
|
||||
var table_id = "{$table.id}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
庄1:<input name="banker_1" id="banker_1" ><button id="sub_1" onclick="submitResult('sub_1')">提交</button><br>
|
||||
庄2:<input name="banker_2" id="banker_2" ><button id="sub_2" onclick="submitResult('sub_2')">提交</button><br>
|
||||
|
||||
闲1:<input name="player_1" id="player_1" ><button id="sub_3" onclick="submitResult('sub_3')">提交</button><br>
|
||||
闲2:<input name="player_2" id="player_2" ><button id="sub_4" onclick="submitResult('sub_4')">提交</button><br>
|
||||
补牌庄:<input name="banker_3" id="banker_3" ><button id="sub_5" onclick="submitResult('sub_5')">提交</button><br>
|
||||
补牌闲:<input name="player_3" id="player_3" ><button id="sub_6" onclick="submitResult('sub_6')">提交</button><br><br>
|
||||
<input type="hidden" id="number_tab_id" value="{$numberTab.id}">
|
||||
</body>
|
||||
<script>
|
||||
var items = [
|
||||
101,102,103,104,105,106,107,108,109,110,111,112,113,
|
||||
201,202,203,204,205,206,207,208,209,210,211,212,213,
|
||||
301,302,303,304,305,306,307,308,309,310,311,312,313,
|
||||
401,402,403,404,405,406,407,408,409,410,411,412,413,
|
||||
];
|
||||
$(function(){
|
||||
var randomBanker_1 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#banker_1').val(randomBanker_1);
|
||||
var randomBanker_2 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#banker_2').val(randomBanker_2);
|
||||
var randomPlayer_1 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#player_1').val(randomPlayer_1);
|
||||
var randomPlayer_2 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#player_2').val(randomPlayer_2);
|
||||
var randomBanker_3 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#banker_3').val(randomBanker_3);
|
||||
var randomPlayer_3 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#player_3').val(randomPlayer_3);
|
||||
})
|
||||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?table_id="+table_id+"&appid=80001&connect=scan&appsecret=123456",{transports: ['websocket']});
|
||||
websocket.on('onlineLogin',function(data){
|
||||
if(data.status === true){
|
||||
// setNumberInfo(data);
|
||||
}else{
|
||||
layer.msg(data.msg,{time:5000});
|
||||
}
|
||||
});
|
||||
websocket.on('sendScanResult',function(data){
|
||||
console.log(data);
|
||||
});
|
||||
var setNumberInfo = function(data){
|
||||
$('#number_tab_id').val(data.round.number_tab_id);
|
||||
};
|
||||
// 点击提交结果
|
||||
var submitResult = function(id){
|
||||
var query = new Object();
|
||||
query.number_tab_id = parseInt($('#number_tab_id').val());
|
||||
if(id == "sub_1"){
|
||||
// 庄第一张
|
||||
query.card = $('#banker_1').val();
|
||||
query.position = "21";
|
||||
}else if(id == "sub_2"){
|
||||
// 庄第二张
|
||||
query.card = $('#banker_2').val();
|
||||
query.position = "22";
|
||||
}else if(id == "sub_3"){
|
||||
// 闲第一张
|
||||
query.card = $('#player_1').val();
|
||||
query.position = "11";
|
||||
}else if(id == "sub_4"){
|
||||
// 闲第二张
|
||||
query.card = $('#player_2').val();
|
||||
query.position = "12";
|
||||
}else if(id == "sub_5"){
|
||||
// 庄第三张
|
||||
query.card = $('#banker_3').val();
|
||||
query.position = "23";
|
||||
}else if(id == "sub_6"){
|
||||
// 庄第三张
|
||||
query.card = $('#player_3').val();
|
||||
query.position = "13";
|
||||
}
|
||||
if(query.card.length <= 0){
|
||||
layer.alert("扫牌失败,请重新扫牌!");
|
||||
return false;
|
||||
}
|
||||
websocket.emit('sendScanBaccarat',{table_id : table_id, number_tab_id : query.number_tab_id, card : query.card, position : query.position});
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
220
app/handle/view/scan/index_sb.html
Normal file
220
app/handle/view/scan/index_sb.html
Normal file
@ -0,0 +1,220 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>模拟百家乐识别端</title>
|
||||
<script src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script src="/static/handle/js/md5.min.js"></script>
|
||||
<script src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div>
|
||||
台桌号: <input type="text" id="tableCode" name="tableCode"><br/>
|
||||
接收:<br/>
|
||||
1. 启动识别: startScanEvent<br/>
|
||||
2. 停止识别: stopScanEvent<br/>
|
||||
3. 指定下标识别: scanIndexEvent<br/>
|
||||
4. 多个位置识别: scanAllEvent<br/>
|
||||
5. 停止发送数据: stopSendingDataEvent<br/>
|
||||
<p></p>
|
||||
发送:<br/>
|
||||
1. 连接: <button onclick="join()">join</button>;响应:joinEvent<br/>
|
||||
<!--
|
||||
2. 发送数据:<button onclick="sendScan()">sendScan</button>;响应:sendScanEvent<br/>
|
||||
3. 发送指定下标数据:<button onclick="sendScanIndex()">sendScanIndex</button>;响应:sendScanIndexEvent<br/>
|
||||
4. 发送多个标框数据:<button onclick="sendScanAll()">sendScanAll</button>;响应:sendScanAllEvent<br/>
|
||||
-->
|
||||
|
||||
闲1:<input name="player_1" id="player_1" ><button id="sub_1" onclick="submitResult('sub_1')">提交</button><br>
|
||||
闲2:<input name="player_2" id="player_2" ><button id="sub_2" onclick="submitResult('sub_2')">提交</button><br>
|
||||
|
||||
庄1:<input name="banker_1" id="banker_1" ><button id="sub_3" onclick="submitResult('sub_3')">提交</button><br>
|
||||
庄2:<input name="banker_2" id="banker_2" ><button id="sub_4" onclick="submitResult('sub_4')">提交</button><br>
|
||||
|
||||
|
||||
补牌闲:<input name="player_3" id="player_3" ><button id="sub_5" onclick="submitResult('sub_5')">提交</button><br><br>
|
||||
补牌庄:<input name="banker_3" id="banker_3" ><button id="sub_6" onclick="submitResult('sub_6')">提交</button><br>
|
||||
|
||||
<input type="hidden" id="number_tab_id" value="">
|
||||
<p></p>
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<script>
|
||||
|
||||
var items = [
|
||||
'as','2s','3s','4s','5s','6s','7s','8s','9s','ts','js','qs','ks',
|
||||
'ah','2h','3h','4h','5h','6h','7h','8h','9h','th','jh','qh','kh',
|
||||
'ac','2c','3c','4c','5c','6c','7c','8c','9c','tc','jc','qc','kc',
|
||||
'ad','2d','3d','4d','5d','6d','7d','8d','9d','td','jd','qd','kd',
|
||||
];
|
||||
$(function(){
|
||||
var randomBanker_1 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#banker_1').val(randomBanker_1);
|
||||
var randomBanker_2 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#banker_2').val(randomBanker_2);
|
||||
var randomPlayer_1 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#player_1').val(randomPlayer_1);
|
||||
var randomPlayer_2 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#player_2').val(randomPlayer_2);
|
||||
var randomBanker_3 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#banker_3').val(randomBanker_3);
|
||||
var randomPlayer_3 = items[Math.floor(Math.random() * items.length)];
|
||||
$('#player_3').val(randomPlayer_3);
|
||||
})
|
||||
|
||||
|
||||
|
||||
var localSbServer="{$localSbServer}";
|
||||
|
||||
var socket = io(localSbServer,{transports: ['websocket']});
|
||||
var token = '';
|
||||
var tableCode = "B01";
|
||||
var key = "tntpokeraisyn";
|
||||
var stop = false;
|
||||
var biz = 0;
|
||||
|
||||
var submitResult = function(id){
|
||||
var query = new Object();
|
||||
if(id == "sub_3"){
|
||||
// 庄第一张
|
||||
query.card = $('#banker_1').val();
|
||||
query.position = "3";
|
||||
}else if(id == "sub_4"){
|
||||
// 庄第二张
|
||||
query.card = $('#banker_2').val();
|
||||
query.position = "4";
|
||||
}else if(id == "sub_1"){
|
||||
// 闲第一张
|
||||
query.card = $('#player_1').val();
|
||||
query.position = "1";
|
||||
}else if(id == "sub_2"){
|
||||
// 闲第二张
|
||||
query.card = $('#player_2').val();
|
||||
query.position = "2";
|
||||
}else if(id == "sub_6"){
|
||||
// 庄第三张
|
||||
query.card = $('#banker_3').val();
|
||||
query.position = "6";
|
||||
}else if(id == "sub_5"){
|
||||
// 庄第三张
|
||||
query.card = $('#player_3').val();
|
||||
query.position = "5";
|
||||
}
|
||||
if(query.card.length <= 0){
|
||||
layer.alert("扫牌失败,请重新扫牌!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sendScan(query);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function join() {
|
||||
tableCode = $('#tableCode').val();
|
||||
var timestamp = new Date().getTime();
|
||||
timestamp = Math.floor(timestamp / 1000);
|
||||
var sign = md5(tableCode + key + timestamp);
|
||||
|
||||
|
||||
console.log("发送 join 数据");
|
||||
console.log('socket.emit("join",{"tableCode":"' + tableCode + '", "timestamp":"' + timestamp + '","sign":"' + sign + '"})');
|
||||
|
||||
socket.emit('join', {'tableCode': tableCode, 'timestamp': timestamp, 'sign': sign});
|
||||
}
|
||||
|
||||
function sendScan(data) {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScan 数据");
|
||||
socket.emit('sendScan', {'tableCode': tableCode, 'token': token, 'tableType':'ONE', 'count':1, 'biz': biz, 'data':[{'index':data.position, 'card':data.card}]});
|
||||
}
|
||||
|
||||
function sendScanIndex(data) {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScanIndex 数据");
|
||||
socket.emit('sendScanIndex', {'tableCode': tableCode, 'token': token, 'tableType':'ONE','biz':biz,'data':[{'index':data.position, 'card':data.card}]});
|
||||
}
|
||||
|
||||
function sendScanAll() {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScanAll 数据");
|
||||
console.log('socket.emit("sendScanAll",{"tableCode":"' + tableCode + '", "token":"' + token + '","tableType":"ONE","biz":"abcd", "data":[{"index":1, "card":"3d"},{"index":2, "card":"5h"},{"index":3, "card":"5h"},{"index":4, "card":"5h"},{"index":5, "card":"kd"},{"index":6, "card":"None"}]})');
|
||||
socket.emit('sendScanAll', {'tableCode': tableCode, 'token': token, 'tableType':'ONE', 'biz':'abcd', 'data':[{'index':1, 'card':'3d'},{'index':2, 'card':'5h'},{'index':3, 'card':'5h'},{'index':4, 'card':'5h'},{'index':5, 'card':'kd'},{'index':6, 'card':'None'}]});
|
||||
}
|
||||
|
||||
// 设备
|
||||
socket.on('startScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到启动识别事件 startScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
if (data.tableCode == tableCode) {
|
||||
biz = data.biz;
|
||||
}
|
||||
});
|
||||
socket.on('stopScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到停止识别事件 stopScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
stop = true;
|
||||
});
|
||||
socket.on('stopSendingDataEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到停止识别事件 stopSendingDataEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
stop = true;
|
||||
});
|
||||
socket.on('scanIndexEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送动的信息
|
||||
console.log('设备接收到识别指定下标请求事件 scanIndexEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
|
||||
if (data.tableCode == tableCode) {
|
||||
biz = data.biz;
|
||||
}
|
||||
});
|
||||
socket.on('scanAllEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送动的信息
|
||||
console.log('设备接收到识别多个标框请求事件 scanAllEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
sendScanAll();
|
||||
});
|
||||
socket.on('joinEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到加入响应 joinEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
if(data.code == 200) {token = data.token;}
|
||||
});
|
||||
socket.on('sendScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送识别数据后,接收到响应 sendScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
socket.on('sendScanIndexEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送指定下标识别数据后,接收到响应 sendScanIndexEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
socket.on('sendScanAllEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送多标框识别数据后,接收到响应 sendScanAllEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
134
app/handle/view/scan/nn_index.html
Normal file
134
app/handle/view/scan/nn_index.html
Normal file
@ -0,0 +1,134 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>模拟牛牛扫描端</title>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript">
|
||||
var table_id = "{$table.id}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
起始牌:<input name="start" id="start" value="101"><button id="start_1" onclick="submitResult('start_1')">提交</button><br>
|
||||
<br/>
|
||||
1:<input name="banker_1" id="card1" value="102" ><button id="sub_1" onclick="submitResult('sub_1')">提交</button><br>
|
||||
2:<input name="banker_2" id="card2" value="103"><button id="sub_2" onclick="submitResult('sub_2')">提交</button><br>
|
||||
3:<input name="banker_3" id="card3" value="104"><button id="sub_3" onclick="submitResult('sub_3')">提交</button><br>
|
||||
4:<input name="banker_4" id="card4" value="105"><button id="sub_4" onclick="submitResult('sub_4')">提交</button><br>
|
||||
5:<input name="banker_5" id="card5" value="106"><button id="sub_5" onclick="submitResult('sub_5')">提交</button><br>
|
||||
<br/>
|
||||
6:<input name="player_1" id="card6" value="107"><button id="sub_6" onclick="submitResult('sub_6')">提交</button><br>
|
||||
7:<input name="player_2" id="card7" value="108"><button id="sub_7" onclick="submitResult('sub_7')">提交</button><br>
|
||||
8:<input name="player_1" id="card8" value="109"><button id="sub_8" onclick="submitResult('sub_8')">提交</button><br>
|
||||
9:<input name="player_2" id="card9" value="110"><button id="sub_9" onclick="submitResult('sub_9')">提交</button><br>
|
||||
10:<input name="player_1" id="card10" value="111"><button id="sub_10" onclick="submitResult('sub_10')">提交</button><br>
|
||||
<br/>
|
||||
11:<input name="player_1" id="card11" value="112"><button id="sub_11" onclick="submitResult('sub_11')">提交</button><br>
|
||||
12:<input name="player_2" id="card12" value="113"><button id="sub_12" onclick="submitResult('sub_12')">提交</button><br>
|
||||
13:<input name="player_1" id="card13" value="201"><button id="sub_13" onclick="submitResult('sub_13')">提交</button><br>
|
||||
14:<input name="player_2" id="card14" value="202"><button id="sub_14" onclick="submitResult('sub_14')">提交</button><br>
|
||||
15:<input name="player_1" id="card15" value="203"><button id="sub_15" onclick="submitResult('sub_15')">提交</button><br>
|
||||
<br/>
|
||||
16:<input name="player_1" id="card16" value="204"><button id="sub_16" onclick="submitResult('sub_16')">提交</button><br>
|
||||
17:<input name="player_2" id="card17" value="205"><button id="sub_17" onclick="submitResult('sub_17')">提交</button><br>
|
||||
18:<input name="player_1" id="card18" value="206"><button id="sub_18" onclick="submitResult('sub_18')">提交</button><br>
|
||||
19:<input name="player_2" id="card19" value="207"><button id="sub_19" onclick="submitResult('sub_19')">提交</button><br>
|
||||
20:<input name="player_1" id="card20" value="208"><button id="sub_20" onclick="submitResult('sub_20')">提交</button><br>
|
||||
<input type="hidden" id="number_tab_id" value="{$numberTab.id}">
|
||||
</body>
|
||||
<script>
|
||||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?table_id="+table_id+"&appid=80004&connect=scan&appsecret=123456",{transports: ['websocket']});
|
||||
websocket.on('onlineLogin',function(data){
|
||||
if(data.status === true){
|
||||
// setNumberInfo(data);
|
||||
}else{
|
||||
layer.msg(data.msg,{time:5000});
|
||||
}
|
||||
});
|
||||
websocket.on('sendScanResult',function(data){
|
||||
console.log(data);
|
||||
});
|
||||
var setNumberInfo = function(data){
|
||||
$('#number_tab_id').val(data.round.number_tab_id);
|
||||
};
|
||||
// 点击提交结果
|
||||
var submitResult = function(id){
|
||||
var query = new Object();
|
||||
query.number_tab_id = $('#number_tab_id').val();
|
||||
if(id == 'start_1'){
|
||||
query.card = $('#start').val();
|
||||
query.position = '0';
|
||||
}
|
||||
if(id == "sub_1"){
|
||||
query.card = $('#card1').val();
|
||||
query.position = "1";
|
||||
}else if(id == "sub_2"){
|
||||
query.card = $('#card2').val();
|
||||
query.position = "2";
|
||||
}else if(id == "sub_3"){
|
||||
query.card = $('#card3').val();
|
||||
query.position = "3";
|
||||
}else if(id == "sub_4"){
|
||||
query.card = $('#card4').val();
|
||||
query.position = "4";
|
||||
}else if(id == "sub_5"){
|
||||
query.card = $('#card5').val();
|
||||
query.position = "5";
|
||||
}else if(id == "sub_6"){
|
||||
query.card = $('#card6').val();
|
||||
query.position = "6";
|
||||
}else if(id == "sub_7"){
|
||||
query.card = $('#card7').val();
|
||||
query.position = "7";
|
||||
}else if(id == "sub_8"){
|
||||
query.card = $('#card8').val();
|
||||
query.position = "8";
|
||||
}else if(id == "sub_9"){
|
||||
query.card = $('#card9').val();
|
||||
query.position = "9";
|
||||
}else if(id == "sub_10"){
|
||||
query.card = $('#card10').val();
|
||||
query.position = "10";
|
||||
}else if(id == "sub_11"){
|
||||
query.card = $('#card11').val();
|
||||
query.position = "11";
|
||||
}else if(id == "sub_12"){
|
||||
query.card = $('#card12').val();
|
||||
query.position = "12";
|
||||
}else if(id == "sub_13"){
|
||||
query.card = $('#card13').val();
|
||||
query.position = "13";
|
||||
}else if(id == "sub_14"){
|
||||
query.card = $('#card14').val();
|
||||
query.position = "14";
|
||||
}else if(id == "sub_15"){
|
||||
query.card = $('#card15').val();
|
||||
query.position = "15";
|
||||
}else if(id == "sub_16"){
|
||||
query.card = $('#card16').val();
|
||||
query.position = "16";
|
||||
}else if(id == "sub_17"){
|
||||
query.card = $('#card17').val();
|
||||
query.position = "17";
|
||||
}else if(id == "sub_18"){
|
||||
query.card = $('#card18').val();
|
||||
query.position = "18";
|
||||
}else if(id == "sub_19"){
|
||||
query.card = $('#card19').val();
|
||||
query.position = "19";
|
||||
}else if(id == "sub_20"){
|
||||
query.card = $('#card20').val();
|
||||
query.position = "20";
|
||||
}
|
||||
if(query.card.length <= 0){
|
||||
layer.alert("扫牌失败,请重新扫牌!");
|
||||
return false;
|
||||
}
|
||||
websocket.emit('sendScanNn',{table_id : table_id, number_tab_id : query.number_tab_id, card : query.card, position : query.position});
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
248
app/handle/view/scan/nn_sb.html
Normal file
248
app/handle/view/scan/nn_sb.html
Normal file
@ -0,0 +1,248 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>模拟牛牛识别端</title>
|
||||
<script src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script src="/static/handle/js/md5.min.js"></script>
|
||||
<script src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div>
|
||||
台桌号: <input type="text" id="tableCode" name="tableCode"><br/>
|
||||
接收:<br/>
|
||||
1. 启动识别: startScanEvent<br/>
|
||||
2. 停止识别: stopScanEvent<br/>
|
||||
3. 指定下标识别: scanIndexEvent<br/>
|
||||
4. 多个位置识别: scanAllEvent<br/>
|
||||
5. 停止发送数据: stopSendingDataEvent<br/>
|
||||
<p></p>
|
||||
发送:<br/>
|
||||
1. 连接: <button onclick="join()">join</button>;响应:joinEvent<br/>
|
||||
<!--
|
||||
2. 发送数据:<button onclick="sendScan()">sendScan</button>;响应:sendScanEvent<br/>
|
||||
3. 发送指定下标数据:<button onclick="sendScanIndex()">sendScanIndex</button>;响应:sendScanIndexEvent<br/>
|
||||
4. 发送多个标框数据:<button onclick="sendScanAll()">sendScanAll</button>;响应:sendScanAllEvent<br/>
|
||||
-->
|
||||
|
||||
起始牌:<input name="start" id="start" value="as"><button id="start_1" onclick="submitResult('start_1')">提交</button><br>
|
||||
<br/>
|
||||
1:<input name="banker_1" id="card1" value="2s" ><button id="sub_1" onclick="submitResult('sub_1')">提交</button><br>
|
||||
2:<input name="banker_2" id="card2" value="3s"><button id="sub_2" onclick="submitResult('sub_2')">提交</button><br>
|
||||
3:<input name="banker_3" id="card3" value="4s"><button id="sub_3" onclick="submitResult('sub_3')">提交</button><br>
|
||||
4:<input name="banker_4" id="card4" value="5s"><button id="sub_4" onclick="submitResult('sub_4')">提交</button><br>
|
||||
5:<input name="banker_5" id="card5" value="6s"><button id="sub_5" onclick="submitResult('sub_5')">提交</button><br>
|
||||
<br/>
|
||||
6:<input name="player_1" id="card6" value="7s"><button id="sub_6" onclick="submitResult('sub_6')">提交</button><br>
|
||||
7:<input name="player_2" id="card7" value="8s"><button id="sub_7" onclick="submitResult('sub_7')">提交</button><br>
|
||||
8:<input name="player_1" id="card8" value="9s"><button id="sub_8" onclick="submitResult('sub_8')">提交</button><br>
|
||||
9:<input name="player_2" id="card9" value="ts"><button id="sub_9" onclick="submitResult('sub_9')">提交</button><br>
|
||||
10:<input name="player_1" id="card10" value="js"><button id="sub_10" onclick="submitResult('sub_10')">提交</button><br>
|
||||
<br/>
|
||||
11:<input name="player_1" id="card11" value="qs"><button id="sub_11" onclick="submitResult('sub_11')">提交</button><br>
|
||||
12:<input name="player_2" id="card12" value="ks"><button id="sub_12" onclick="submitResult('sub_12')">提交</button><br>
|
||||
13:<input name="player_1" id="card13" value="ah"><button id="sub_13" onclick="submitResult('sub_13')">提交</button><br>
|
||||
14:<input name="player_2" id="card14" value="2h"><button id="sub_14" onclick="submitResult('sub_14')">提交</button><br>
|
||||
15:<input name="player_1" id="card15" value="3h"><button id="sub_15" onclick="submitResult('sub_15')">提交</button><br>
|
||||
<br/>
|
||||
16:<input name="player_1" id="card16" value="4h"><button id="sub_16" onclick="submitResult('sub_16')">提交</button><br>
|
||||
17:<input name="player_2" id="card17" value="5h"><button id="sub_17" onclick="submitResult('sub_17')">提交</button><br>
|
||||
18:<input name="player_1" id="card18" value="6h"><button id="sub_18" onclick="submitResult('sub_18')">提交</button><br>
|
||||
19:<input name="player_2" id="card19" value="7h"><button id="sub_19" onclick="submitResult('sub_19')">提交</button><br>
|
||||
20:<input name="player_1" id="card20" value="8h"><button id="sub_20" onclick="submitResult('sub_20')">提交</button><br>
|
||||
<p></p>
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<script>
|
||||
|
||||
var localSbServer="{$localSbServer}";
|
||||
|
||||
var socket = io(localSbServer,{transports: ['websocket']});
|
||||
var token = '';
|
||||
var tableCode = "B01";
|
||||
var key = "tntpokeraisyn";
|
||||
var stop = false;
|
||||
var biz = 0;
|
||||
|
||||
var submitResult = function(id){
|
||||
var query = new Object();
|
||||
if(id == 'start_1'){
|
||||
query.card = $('#start').val();
|
||||
query.position = '21';
|
||||
}
|
||||
if(id == "sub_1"){
|
||||
query.card = $('#card1').val();
|
||||
query.position = "1";
|
||||
}else if(id == "sub_2"){
|
||||
query.card = $('#card2').val();
|
||||
query.position = "2";
|
||||
}else if(id == "sub_3"){
|
||||
query.card = $('#card3').val();
|
||||
query.position = "3";
|
||||
}else if(id == "sub_4"){
|
||||
query.card = $('#card4').val();
|
||||
query.position = "4";
|
||||
}else if(id == "sub_5"){
|
||||
query.card = $('#card5').val();
|
||||
query.position = "5";
|
||||
}else if(id == "sub_6"){
|
||||
query.card = $('#card6').val();
|
||||
query.position = "6";
|
||||
}else if(id == "sub_7"){
|
||||
query.card = $('#card7').val();
|
||||
query.position = "7";
|
||||
}else if(id == "sub_8"){
|
||||
query.card = $('#card8').val();
|
||||
query.position = "8";
|
||||
}else if(id == "sub_9"){
|
||||
query.card = $('#card9').val();
|
||||
query.position = "9";
|
||||
}else if(id == "sub_10"){
|
||||
query.card = $('#card10').val();
|
||||
query.position = "10";
|
||||
}else if(id == "sub_11"){
|
||||
query.card = $('#card11').val();
|
||||
query.position = "11";
|
||||
}else if(id == "sub_12"){
|
||||
query.card = $('#card12').val();
|
||||
query.position = "12";
|
||||
}else if(id == "sub_13"){
|
||||
query.card = $('#card13').val();
|
||||
query.position = "13";
|
||||
}else if(id == "sub_14"){
|
||||
query.card = $('#card14').val();
|
||||
query.position = "14";
|
||||
}else if(id == "sub_15"){
|
||||
query.card = $('#card15').val();
|
||||
query.position = "15";
|
||||
}else if(id == "sub_16"){
|
||||
query.card = $('#card16').val();
|
||||
query.position = "16";
|
||||
}else if(id == "sub_17"){
|
||||
query.card = $('#card17').val();
|
||||
query.position = "17";
|
||||
}else if(id == "sub_18"){
|
||||
query.card = $('#card18').val();
|
||||
query.position = "18";
|
||||
}else if(id == "sub_19"){
|
||||
query.card = $('#card19').val();
|
||||
query.position = "19";
|
||||
}else if(id == "sub_20"){
|
||||
query.card = $('#card20').val();
|
||||
query.position = "20";
|
||||
}
|
||||
if(query.card.length <= 0){
|
||||
layer.alert("扫牌失败,请重新扫牌!");
|
||||
return false;
|
||||
}
|
||||
sendScanIndex(query);
|
||||
}
|
||||
|
||||
|
||||
function join() {
|
||||
tableCode = $('#tableCode').val();
|
||||
var timestamp = new Date().getTime();
|
||||
timestamp = Math.floor(timestamp / 1000);
|
||||
var sign = md5(tableCode + key + timestamp);
|
||||
|
||||
|
||||
console.log("发送 join 数据");
|
||||
console.log('socket.emit("join",{"tableCode":"' + tableCode + '", "timestamp":"' + timestamp + '","sign":"' + sign + '"})');
|
||||
|
||||
socket.emit('join', {'tableCode': tableCode, 'timestamp': timestamp, 'sign': sign});
|
||||
}
|
||||
|
||||
function sendScan() {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScan 数据");
|
||||
console.log('socket.emit("sendScan",{"tableCode":"' + tableCode + '", "token":"' + token + '","tableType":"ONE", "count":6, "biz":"abcd", "data":[{"index":1, "card":"3d"},{"index":2, "card":"5h"}]})');
|
||||
socket.emit('sendScan', {'tableCode': tableCode, 'token': token, 'tableType':'ONE', 'count':6, 'biz': 'abcd', 'data':[{'index':1, 'card':'3d'},{'index':2, 'card':'5h'}]});
|
||||
}
|
||||
|
||||
function sendScanIndex(data) {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScanIndex 数据");
|
||||
socket.emit('sendScanIndex', {'tableCode': tableCode, 'token': token, 'tableType':'ONE','biz':biz,'data':[{'index':data.position, 'card':data.card}]});
|
||||
}
|
||||
|
||||
function sendScanAll() {
|
||||
if (token == '') {
|
||||
alert('须先join');
|
||||
return ;
|
||||
}
|
||||
tableCode = $('#tableCode').val();
|
||||
console.log("发送 sendScanAll 数据");
|
||||
console.log('socket.emit("sendScanAll",{"tableCode":"' + tableCode + '", "token":"' + token + '","tableType":"ONE","biz":"abcd", "data":[{"index":1, "card":"3d"},{"index":2, "card":"5h"},{"index":3, "card":"5h"},{"index":4, "card":"5h"},{"index":5, "card":"kd"},{"index":6, "card":"None"}]})');
|
||||
socket.emit('sendScanAll', {'tableCode': tableCode, 'token': token, 'tableType':'ONE', 'biz':'abcd', 'data':[{'index':1, 'card':'3d'},{'index':2, 'card':'5h'},{'index':3, 'card':'5h'},{'index':4, 'card':'5h'},{'index':5, 'card':'kd'},{'index':6, 'card':'None'}]});
|
||||
}
|
||||
|
||||
// 设备
|
||||
socket.on('startScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到启动识别事件 startScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
sendScan();
|
||||
});
|
||||
socket.on('stopScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到停止识别事件 stopScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
stop = true;
|
||||
});
|
||||
socket.on('stopSendingDataEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到停止识别事件 stopSendingDataEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
stop = true;
|
||||
});
|
||||
socket.on('scanIndexEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送动的信息
|
||||
console.log('设备接收到识别指定下标请求事件 scanIndexEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
|
||||
if (data.tableCode == tableCode) {
|
||||
biz = data.biz;
|
||||
}
|
||||
});
|
||||
socket.on('scanAllEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送动的信息
|
||||
console.log('设备接收到识别多个标框请求事件 scanAllEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
sendScanAll();
|
||||
});
|
||||
socket.on('joinEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备接收到加入响应 joinEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
if(data.code == 200) {token = data.token;}
|
||||
});
|
||||
socket.on('sendScanEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送识别数据后,接收到响应 sendScanEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
socket.on('sendScanIndexEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送指定下标识别数据后,接收到响应 sendScanIndexEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
socket.on('sendScanAllEvent',(data)=>{
|
||||
//监听浏览器通过msg事件发送的信息
|
||||
console.log('设备发送多标框识别数据后,接收到响应 sendScanAllEvent');
|
||||
console.log('data',data);//你好浏览器
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
102
app/handle/view/scan/tc_index.html
Normal file
102
app/handle/view/scan/tc_index.html
Normal file
@ -0,0 +1,102 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>模拟三卡扫描端</title>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript">
|
||||
var table_id = "{$table.id}";
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
起始牌:<input name="start" id="start" value="101"><button id="start_1" onclick="submitResult('start_1')">提交</button><br>
|
||||
<br/>
|
||||
1:<input name="banker_1" id="card1" value="102" ><button id="sub_1" onclick="submitResult('sub_1')">提交</button><br>
|
||||
2:<input name="banker_2" id="card2" value="103"><button id="sub_2" onclick="submitResult('sub_2')">提交</button><br>
|
||||
3:<input name="banker_3" id="card3" value="104"><button id="sub_3" onclick="submitResult('sub_3')">提交</button><br>
|
||||
<br/>
|
||||
4:<input name="player_1" id="card4" value="107"><button id="sub_4" onclick="submitResult('sub_4')">提交</button><br>
|
||||
5:<input name="player_2" id="card5" value="108"><button id="sub_5" onclick="submitResult('sub_5')">提交</button><br>
|
||||
6:<input name="player_3" id="card6" value="109"><button id="sub_6" onclick="submitResult('sub_6')">提交</button><br>
|
||||
<br/>
|
||||
7:<input name="player_1" id="card7" value="112"><button id="sub_7" onclick="submitResult('sub_7')">提交</button><br>
|
||||
8:<input name="player_2" id="card8" value="113"><button id="sub_8" onclick="submitResult('sub_8')">提交</button><br>
|
||||
9:<input name="player_3" id="card9" value="201"><button id="sub_9" onclick="submitResult('sub_9')">提交</button><br>
|
||||
<br/>
|
||||
10:<input name="player_1" id="card10" value="204"><button id="sub_10" onclick="submitResult('sub_10')">提交</button><br>
|
||||
11:<input name="player_2" id="card11" value="205"><button id="sub_11" onclick="submitResult('sub_11')">提交</button><br>
|
||||
12:<input name="player_3" id="card12" value="206"><button id="sub_12" onclick="submitResult('sub_12')">提交</button><br>
|
||||
<input type="hidden" id="number_tab_id" value="{$numberTab.id}">
|
||||
</body>
|
||||
<script>
|
||||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?table_id="+table_id+"&appid=80003&connect=scan&appsecret=123456",{transports: ['websocket']});
|
||||
websocket.on('onlineLogin',function(data){
|
||||
if(data.status === true){
|
||||
// setNumberInfo(data);
|
||||
}else{
|
||||
layer.msg(data.msg,{time:5000});
|
||||
}
|
||||
});
|
||||
websocket.on('sendScanResult',function(data){
|
||||
console.log(data);
|
||||
});
|
||||
var setNumberInfo = function(data){
|
||||
$('#number_tab_id').val(data.round.number_tab_id);
|
||||
};
|
||||
// 点击提交结果
|
||||
var submitResult = function(id){
|
||||
var query = new Object();
|
||||
query.number_tab_id = $('#number_tab_id').val();
|
||||
if(id == 'start_1'){
|
||||
query.card = $('#start').val();
|
||||
query.position = '0';
|
||||
}
|
||||
if(id == "sub_1"){
|
||||
query.card = $('#card1').val();
|
||||
query.position = "1";
|
||||
}else if(id == "sub_2"){
|
||||
query.card = $('#card2').val();
|
||||
query.position = "2";
|
||||
}else if(id == "sub_3"){
|
||||
query.card = $('#card3').val();
|
||||
query.position = "3";
|
||||
}else if(id == "sub_4"){
|
||||
query.card = $('#card4').val();
|
||||
query.position = "4";
|
||||
}else if(id == "sub_5"){
|
||||
query.card = $('#card5').val();
|
||||
query.position = "5";
|
||||
}else if(id == "sub_6"){
|
||||
query.card = $('#card6').val();
|
||||
query.position = "6";
|
||||
}else if(id == "sub_7"){
|
||||
query.card = $('#card7').val();
|
||||
query.position = "7";
|
||||
}else if(id == "sub_8"){
|
||||
query.card = $('#card8').val();
|
||||
query.position = "8";
|
||||
}else if(id == "sub_9"){
|
||||
query.card = $('#card9').val();
|
||||
query.position = "9";
|
||||
}else if(id == "sub_10"){
|
||||
query.card = $('#card10').val();
|
||||
query.position = "10";
|
||||
}else if(id == "sub_11"){
|
||||
query.card = $('#card11').val();
|
||||
query.position = "11";
|
||||
}else if(id == "sub_12"){
|
||||
query.card = $('#card12').val();
|
||||
query.position = "12";
|
||||
}
|
||||
if(query.card.length <= 0){
|
||||
layer.alert("扫牌失败,请重新扫牌!");
|
||||
return false;
|
||||
}
|
||||
websocket.emit('sendScanTc',{table_id : table_id, number_tab_id : query.number_tab_id, card : query.card, position : query.position});
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
2
app/index/common.php
Normal file
2
app/index/common.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// 这是系统自动生成的公共文件
|
||||
13
app/index/controller/Common.php
Normal file
13
app/index/controller/Common.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\index\controller;
|
||||
|
||||
use app\middleware\checkLogin;
|
||||
|
||||
class Common{
|
||||
protected $middleware = [checkLogin::class];
|
||||
public function initialize(){
|
||||
|
||||
}
|
||||
}
|
||||
37
app/index/controller/Index.php
Normal file
37
app/index/controller/Index.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\index\controller;
|
||||
|
||||
use think\facade\View;
|
||||
use think\facade\Db;
|
||||
use think\facade\Session;
|
||||
use think\facade\Request;
|
||||
use think\facade\Lang;
|
||||
use think\response\Json;
|
||||
use think\facade\Env;
|
||||
|
||||
class Index extends Common{
|
||||
//首页
|
||||
public function index(){
|
||||
$tables = Db::name('table')->where(['status' => 1])->select()->toArray();
|
||||
$user_info = Session::get('user_info');
|
||||
$user = Db::name('user')->where(['id' => $user_info['id']])->find();
|
||||
$login_token = create_login_token($user);
|
||||
$api_token = $login_token;
|
||||
Db::name('user')->where(['id' => $user_info['id']])->update(['login_token' => $login_token, 'api_token' => $api_token]);
|
||||
View::assign('api_token',$api_token);
|
||||
View::assign('login_token',$login_token);
|
||||
View::assign('tables',$tables);
|
||||
View::assign('user',$user);
|
||||
View::assign('websocketUrl',Env::get('system.WEBSOCKET'));
|
||||
View::assign('websocketProtocol',Env::get('system.PROTOCOL'));
|
||||
return View::fetch();
|
||||
}
|
||||
function get_lang(): Json
|
||||
{
|
||||
if(!Request::instance()->isPost()) return json();
|
||||
$lang = Lang::get();
|
||||
return json(array('status' => 1, 'lang' => $lang));
|
||||
}
|
||||
}
|
||||
50
app/index/controller/Login.php
Normal file
50
app/index/controller/Login.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\index\controller;
|
||||
|
||||
use think\facade\View;
|
||||
use think\facade\Request;
|
||||
use think\facade\Db;
|
||||
use think\facade\Session;
|
||||
use think\response\Redirect;
|
||||
use think\response\Json;
|
||||
|
||||
class Login
|
||||
{
|
||||
public function index(){
|
||||
if(Session::get('user_info')){
|
||||
return redirect('/login/logout');
|
||||
}
|
||||
return View::fetch();
|
||||
}
|
||||
/**
|
||||
* 处理登录
|
||||
*/
|
||||
public function dologin(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
$username = Request::instance()->post('username');
|
||||
$password = Request::instance()->post('password');
|
||||
$find = Db::name('user')->where(array('username' => $username, 'is_delete' => 0, 'status' => 1))->find();
|
||||
if(!$find){
|
||||
Session::delete('user_info');
|
||||
return json(['code' => 0, 'msg' => '用户不存在']);
|
||||
}
|
||||
if(think_ucenter_md5($password, UC_AUTH_KEY) == $find['password'] && !empty($find['password'])){
|
||||
Session::set('user_info',$find);
|
||||
return json(['code'=>1,'msg'=>'登录成功','url'=>'/']);
|
||||
}else{
|
||||
Session::delete('user_info');
|
||||
return json(['code'=>0,'msg'=>'密码错误']);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
public function logout(): Redirect
|
||||
{
|
||||
Session::delete('user_info');
|
||||
return redirect('/login/index');
|
||||
}
|
||||
}
|
||||
5
app/index/event.php
Normal file
5
app/index/event.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
// 这是系统自动生成的event定义文件
|
||||
return [
|
||||
|
||||
];
|
||||
5
app/index/middleware.php
Normal file
5
app/index/middleware.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
// 这是系统自动生成的middleware定义文件
|
||||
return [
|
||||
|
||||
];
|
||||
22
app/index/middleware/checkLogin.php
Normal file
22
app/index/middleware/checkLogin.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\index\middleware;
|
||||
use think\facade\Session;
|
||||
use think\facade\Request;
|
||||
use think\facade\View;
|
||||
use think\facade\Env;
|
||||
|
||||
class checkLogin
|
||||
{
|
||||
/**
|
||||
* 处理请求
|
||||
*
|
||||
* @param \think\Request $request
|
||||
* @param \Closure $next
|
||||
* @return Response
|
||||
*/
|
||||
public function handle($request, \Closure $next){
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
588
app/index/view/index/index.html
Normal file
588
app/index/view/index/index.html
Normal file
@ -0,0 +1,588 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Document</title>
|
||||
<style type="text/css">
|
||||
*{list-style-type: none; margin: 0; padding: 0; font-size: 14px;}
|
||||
input{width: 60px;}
|
||||
button{padding: 5px 20px; cursor: pointer; border: 0;}
|
||||
li{display: block; width: 48%; float: left; height: 320px; border: 2px solid #ff6600;}
|
||||
dt{display: block; float: left; height: 100px; width: 150px; padding: 40px 10px; text-align: center;}
|
||||
dt span{font-size: 30px;}
|
||||
dd{display: block; float: left; height: 300px; width: 150px; padding: 10px; border-left: 1px solid #ccc;}
|
||||
.card-img{width: 30px; height: 42px; display: inline-block;}
|
||||
dd.card img{width: 100%; height: 100%;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="logout()">退出登录</button><div>余分:<span id="money"></span></div>
|
||||
<div>
|
||||
<ul>
|
||||
{foreach name="tables" item="v"}
|
||||
<li id="table_{$v.id}">
|
||||
<dl>
|
||||
<dt>{$v.table_name}({$v.id})<br><br><span id="time_{$v.id}" style="color: #129611">0</span></dt>
|
||||
<?php if($v['game_id'] == 1) : ?>
|
||||
<dd>
|
||||
<br>
|
||||
<select id="baccarat_type_{$v.id}">
|
||||
<option value="0" selected>baccarat_type_0</option>
|
||||
<option value="1">baccarat_type_1</option>
|
||||
</select>
|
||||
<br>
|
||||
<br>
|
||||
B:<input type="text" id="banker_{$v.id}"><br>
|
||||
P:<input type="text" id="player_{$v.id}"><br>
|
||||
T:<input type="text" id="tie_{$v.id}"><br>
|
||||
BP:<input type="text" id="banker_pair_{$v.id}"><br>
|
||||
PP:<input type="text" id="player_pair_{$v.id}"><br>
|
||||
LuckSix:<input type="text" id="luck_six_{$v.id}"><br>
|
||||
Big:<input type="text" id="big_{$v.id}"><br>
|
||||
Small:<input type="text" id="small_{$v.id}"><br>
|
||||
</dd>
|
||||
<dd>
|
||||
<input type="hidden" name="table_id" value="{$v.id}">
|
||||
<input type="hidden" name="boot_id" value="">
|
||||
<input type="hidden" name="number_tab_id" value="">
|
||||
X号:<span name="boot_num"></span>
|
||||
P号:<span name="number"></span>
|
||||
<br>
|
||||
<br>
|
||||
<button onclick="toBet({$v.id},{$v.game_id})" style="background-color: #129611; color: #fff;">toBet</button>
|
||||
<button onclick="cancelBet({$v.id},{$v.game_id})">cancelBet</button>
|
||||
</dd>
|
||||
<dd id="card_{$v.id}" class="card">
|
||||
<div class="player">
|
||||
<div class="card-img"><img id="table_{$v.id}_card_11" src="/static/poker/empty.png" /></div>
|
||||
<div class="card-img"><img id="table_{$v.id}_card_12" src="/static/poker/empty.png" /></div>
|
||||
<div class="card-img"><img id="table_{$v.id}_card_13" src="/static/poker/empty.png" /></div>
|
||||
</div>
|
||||
<div class="banker">
|
||||
<div class="card-img"><img id="table_{$v.id}_card_21" src="/static/poker/empty.png" /></div>
|
||||
<div class="card-img"><img id="table_{$v.id}_card_22" src="/static/poker/empty.png" /></div>
|
||||
<div class="card-img"><img id="table_{$v.id}_card_23" src="/static/poker/empty.png" /></div>
|
||||
</div>
|
||||
</dd>
|
||||
<?php elseif($v['game_id'] == 2) : ?>
|
||||
<dd>
|
||||
B:<input type="text" id="banker_{$v.id}"><br>
|
||||
P:<input type="text" id="player_{$v.id}"><br>
|
||||
T:<input type="text" id="tie_{$v.id}"><br>
|
||||
</dd>
|
||||
<dd>
|
||||
<input type="hidden" name="table_id" value="{$v.id}">
|
||||
<input type="hidden" name="boot_id" value="">
|
||||
<input type="hidden" name="number_tab_id" value="">
|
||||
X号:<span name="boot_num"></span>
|
||||
P号:<span name="number"></span>
|
||||
<br>
|
||||
<br>
|
||||
<button onclick="toBet({$v.id},{$v.game_id})" style="background-color: #129611; color: #fff;">toBet</button>
|
||||
<button onclick="cancelBet({$v.id},{$v.game_id})">cancelBet</button>
|
||||
</dd>
|
||||
<?php elseif($v['game_id'] == 4 || $v['game_id'] == 5) : ?>
|
||||
<dd>
|
||||
闲一平倍:<input type="text" id="amount_player_1_{$v.id}"><br>
|
||||
闲一翻倍:<input type="text" id="amount_player_1_times_{$v.id}"><br>
|
||||
<?php if($v['is_rob'] != 1) : ?>
|
||||
庄一平倍:<input type="text" id="amount_player_1_banker_{$v.id}"><br>
|
||||
庄一翻倍:<input type="text" id="amount_player_1_banker_times_{$v.id}"><br>
|
||||
<?php endif; ?>
|
||||
<br>
|
||||
闲二平倍:<input type="text" id="amount_player_2_{$v.id}"><br>
|
||||
闲二翻倍:<input type="text" id="amount_player_2_times_{$v.id}"><br>
|
||||
<?php if($v['is_rob'] != 1) : ?>
|
||||
庄二平倍:<input type="text" id="amount_player_2_banker_{$v.id}"><br>
|
||||
庄二翻倍:<input type="text" id="amount_player_2_banker_times_{$v.id}"><br>
|
||||
<?php endif; ?>
|
||||
<br>
|
||||
闲三平倍:<input type="text" id="amount_player_3_{$v.id}"><br>
|
||||
闲三翻倍:<input type="text" id="amount_player_3_times_{$v.id}"><br>
|
||||
<?php if($v['is_rob'] != 1) : ?>
|
||||
庄三平倍:<input type="text" id="amount_player_3_banker_{$v.id}"><br>
|
||||
庄三翻倍:<input type="text" id="amount_player_3_banker_times_{$v.id}"><br>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dd>
|
||||
<input type="hidden" name="table_id" value="{$v.id}">
|
||||
<input type="hidden" name="boot_id" value="">
|
||||
<input type="hidden" name="number_tab_id" value="">
|
||||
靴号:<span name="boot_num"></span>
|
||||
铺号:<span name="number"></span>
|
||||
<br>
|
||||
<br>
|
||||
<?php if($v['is_rob'] == 1) : ?>
|
||||
<button onclick="toRob({$v.id},{$v.game_id})" style="background-color: #ff9900; color: #fff;">抢庄</button>
|
||||
<?php endif; ?>
|
||||
<button onclick="toBetNn({$v.id},{$v.game_id})" style="background-color: #129611; color: #fff;">下注</button>
|
||||
<button onclick="cancelBet({$v.id},{$v.game_id})">取消下注</button>
|
||||
</dd>
|
||||
<?php elseif($v['game_id'] == 6) : ?>
|
||||
<dd>
|
||||
0:<input type="text" id="toning_zero_{$v.id}"><br>
|
||||
4:<input type="text" id="toning_four_{$v.id}"><br>
|
||||
1:<input type="text" id="toning_one_{$v.id}"><br>
|
||||
3:<input type="text" id="toning_three_{$v.id}"><br>
|
||||
big:<input type="text" id="toning_big_{$v.id}"><br>
|
||||
small:<input type="text" id="toning_small_{$v.id}"><br>
|
||||
singular:<input type="text" id="toning_singular_{$v.id}"><br>
|
||||
plural:<input type="text" id="toning_plural_{$v.id}"><br>
|
||||
</dd>
|
||||
<dd>
|
||||
<input type="hidden" name="table_id" value="{$v.id}">
|
||||
<input type="hidden" name="boot_id" value="">
|
||||
<input type="hidden" name="number_tab_id" value="">
|
||||
X号:<span name="boot_num"></span>
|
||||
P号:<span name="number"></span>
|
||||
<br>
|
||||
<br>
|
||||
<button onclick="toBetToning({$v.id},{$v.game_id})" style="background-color: #129611; color: #fff;">toBet</button>
|
||||
<button onclick="cancelBet({$v.id},{$v.game_id})">cancelBet</button>
|
||||
</dd>
|
||||
<?php elseif($v['game_id'] == 7) : ?>
|
||||
<dd>
|
||||
<input type="hidden" name="table_id" value="{$v.id}">
|
||||
<input type="hidden" name="boot_id" value="">
|
||||
<input type="hidden" name="number_tab_id" value="">
|
||||
X号:<span name="boot_num"></span>
|
||||
P号:<span name="number"></span>
|
||||
<br>
|
||||
<br>
|
||||
<button onclick="toBetDice({$v.id},{$v.game_id})" style="background-color: #129611; color: #fff;">toBet</button>
|
||||
<button onclick="cancelBet({$v.id},{$v.game_id})">cancelBet</button>
|
||||
</dd>
|
||||
<?php elseif($v['game_id'] == 8) : ?>
|
||||
<dd>
|
||||
下注方式:
|
||||
<select id="roulette_type">
|
||||
<option value="european" selected>欧式</option>
|
||||
<option value="french">法式</option>
|
||||
</select>
|
||||
</dd>
|
||||
<dd>
|
||||
<input type="hidden" name="table_id" value="{$v.id}">
|
||||
<input type="hidden" name="boot_id" value="">
|
||||
<input type="hidden" name="number_tab_id" value="">
|
||||
X号:<span name="boot_num"></span>
|
||||
P号:<span name="number"></span>
|
||||
<br>
|
||||
<br>
|
||||
<button onclick="toBetRoulette({$v.id},{$v.game_id})" style="background-color: #129611; color: #fff;">toBet</button>
|
||||
<button onclick="cancelBet({$v.id},{$v.game_id})">cancelBet</button>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
|
||||
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
|
||||
<script type="text/javascript">
|
||||
var websocketUrl="{$websocketUrl}";
|
||||
var websocketProtocol="{$websocketProtocol}";
|
||||
var api_token = "{$api_token}";
|
||||
|
||||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?connect=user&userid={$user.id}&account={$user.username}&login_token={$login_token}",{transports: ['websocket']});
|
||||
var user_id = {$user.id};
|
||||
var username = "{$user.username}";
|
||||
var lang;
|
||||
websocket.on('reconnecting', (timeout) => {
|
||||
//触发重连
|
||||
layer.msg('服务断开,正在重新连接...', {
|
||||
icon: 16,
|
||||
shade: 0.6,
|
||||
time:0,
|
||||
});
|
||||
});
|
||||
websocket.on('reconnect', (timeout) => {
|
||||
//重连成功
|
||||
layer.closeAll();
|
||||
layer.msg('服务重新连接成功');
|
||||
});
|
||||
//事件返回 开始*********************************************************************************************************************
|
||||
websocket.on('onlineLogin',function(data){
|
||||
if(data.status === true){
|
||||
$('#money').html(data.money);
|
||||
//获取桌子状态
|
||||
forGetState();
|
||||
}else{
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
});
|
||||
websocket.on('getState',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
setCard(data);
|
||||
}
|
||||
});
|
||||
websocket.on('startRob',function(data){
|
||||
if(data.status === true){
|
||||
layer.msg('table_'+data.table_id+'_开始抢庄');
|
||||
}
|
||||
});
|
||||
websocket.on('startRobCountDown',function(data){
|
||||
if(data.status === true){
|
||||
$('#time_'+data.table_id).html(data.count_down);
|
||||
}
|
||||
});
|
||||
websocket.on('startBetCountDown',function(data){
|
||||
if(data.status === true){
|
||||
$('#time_'+data.table_id).html(data.count_down);
|
||||
}
|
||||
});
|
||||
websocket.on('endBet',function(data){
|
||||
if(data.status === true){
|
||||
$('#time_'+data.table_id).html(0);
|
||||
}
|
||||
});
|
||||
websocket.on('opening',function(data){
|
||||
if(data.status === true){
|
||||
$('#money').html(data.round.money);
|
||||
}
|
||||
});
|
||||
websocket.on('toBet',function(data){
|
||||
if(data.status === true){
|
||||
$('#money').html(data.money);
|
||||
layer.msg('下注成功');
|
||||
}else{
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
});
|
||||
websocket.on('cancelBet',function(data){
|
||||
if(data.status === true){
|
||||
$('#money').html(data.money);
|
||||
}
|
||||
layer.msg(lang[data.msg]);
|
||||
});
|
||||
websocket.on('openingBaccaratResult',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
// 清空牌
|
||||
var table_id = data.table_id;
|
||||
$('#card_' + table_id).find("img").attr("src", "/static/poker/empty.png");
|
||||
// http获取数据
|
||||
let query = {
|
||||
'table_id' : table_id,
|
||||
'user_id' : user_id,
|
||||
'api_token' : api_token,
|
||||
'number_tab_id' : data.round.previous_number_tab_id,
|
||||
}
|
||||
$.ajax({
|
||||
url:"http://api.fullofpeople.org/Pcapi/user_bet_baccarat",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
async:false,
|
||||
data: query,
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
websocket.on('openingDtResult',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
// 清空牌
|
||||
var table_id = data.table_id;
|
||||
$('#card_' + table_id).find("img").attr("src", "/static/poker/empty.png");
|
||||
// http获取数据
|
||||
let query = {
|
||||
'table_id' : table_id,
|
||||
'user_id' : user_id,
|
||||
'api_token' : api_token,
|
||||
'number_tab_id' : data.round.previous_number_tab_id,
|
||||
}
|
||||
$.ajax({
|
||||
url:"http://api.fullofpeople.org/Pcapi/user_bet_dt",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
async:false,
|
||||
data: query,
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
websocket.on('openingNnResult',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
// 清空牌
|
||||
var table_id = data.table_id;
|
||||
$('#card_' + table_id).find("img").attr("src", "/static/poker/empty.png");
|
||||
}
|
||||
});
|
||||
websocket.on('openingTcResult',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
// 清空牌
|
||||
var table_id = data.table_id;
|
||||
$('#card_' + table_id).find("img").attr("src", "/static/poker/empty.png");
|
||||
}
|
||||
});
|
||||
websocket.on('openingToningResult',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
}
|
||||
});
|
||||
websocket.on('openingDiceResult',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
}
|
||||
});
|
||||
websocket.on('openingRouletteResult',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
}
|
||||
});
|
||||
websocket.on('changeBoot',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
}
|
||||
});
|
||||
websocket.on('resetBoot',function(data){
|
||||
if(data.status === true){
|
||||
setNumberTab(data);
|
||||
}
|
||||
});
|
||||
websocket.on('toRob',function(data){
|
||||
layer.msg(data.msg);
|
||||
});
|
||||
websocket.on('sendScanResult',function (data){
|
||||
var table_id = data.table_id;
|
||||
var round = data.round;
|
||||
$('#table_' + table_id + '_card_' + round.position).attr("src", "/static/poker/" + round.card + ".png");
|
||||
});
|
||||
//事件返回 结束*********************************************************************************************************************
|
||||
function toBet(table_id, game_id){
|
||||
var number_tab_id = $('#table_'+table_id).find('input[name="number_tab_id"]').val();
|
||||
if(game_id === 1){
|
||||
let banker_amount = $('#banker_'+table_id).val();
|
||||
let player_amount = $('#player_'+table_id).val();
|
||||
let tie_amount = $('#tie_'+table_id).val();
|
||||
let banker_pair_amount = $('#banker_pair_'+table_id).val();
|
||||
let player_pair_amount = $('#player_pair_'+table_id).val();
|
||||
let luck_six_amount = $('#luck_six_'+table_id).val();
|
||||
let big_amount = $('#big_'+table_id).val();
|
||||
let small_amount = $('#small_'+table_id).val();
|
||||
let baccarat_type = $('#baccarat_type_'+table_id).val();
|
||||
websocket.emit('toBet',{
|
||||
table_id:table_id,
|
||||
user_id:user_id,
|
||||
number_tab_id:number_tab_id,
|
||||
baccarat_type:baccarat_type,
|
||||
banker_amount:banker_amount,
|
||||
player_amount:player_amount,
|
||||
tie_amount:tie_amount,
|
||||
banker_pair_amount:banker_pair_amount,
|
||||
player_pair_amount:player_pair_amount,
|
||||
luck_six_amount:luck_six_amount,
|
||||
big_amount:big_amount,
|
||||
small_amount:small_amount,
|
||||
});
|
||||
}else if(game_id === 2){
|
||||
let banker_amount = $('#banker_'+table_id).val();
|
||||
let player_amount = $('#player_'+table_id).val();
|
||||
let tie_amount = $('#tie_'+table_id).val();
|
||||
websocket.emit('toBet',{
|
||||
table_id:table_id,
|
||||
user_id:user_id,
|
||||
number_tab_id:number_tab_id,
|
||||
banker_amount:banker_amount,
|
||||
player_amount:player_amount,
|
||||
tie_amount:tie_amount
|
||||
});
|
||||
}
|
||||
}
|
||||
function toBetNn(table_id, game_id){
|
||||
var number_tab_id = $('#table_'+table_id).find('input[name="number_tab_id"]').val();
|
||||
if(game_id === 4 || game_id === 5){
|
||||
var amount_player_1 = $('#amount_player_1_'+table_id).val();
|
||||
var amount_player_1_times = $('#amount_player_1_times_'+table_id).val();
|
||||
var amount_player_1_banker = $('#amount_player_1_banker_'+table_id).val();
|
||||
var amount_player_1_banker_times = $('#amount_player_1_banker_times_'+table_id).val();
|
||||
|
||||
var amount_player_2 = $('#amount_player_2_'+table_id).val();
|
||||
var amount_player_2_times = $('#amount_player_2_times_'+table_id).val();
|
||||
var amount_player_2_banker = $('#amount_player_2_banker_'+table_id).val();
|
||||
var amount_player_2_banker_times = $('#amount_player_2_banker_times_'+table_id).val();
|
||||
|
||||
var amount_player_3 = $('#amount_player_3_'+table_id).val();
|
||||
var amount_player_3_times = $('#amount_player_3_times_'+table_id).val();
|
||||
var amount_player_3_banker = $('#amount_player_3_banker_'+table_id).val();
|
||||
var amount_player_3_banker_times = $('#amount_player_3_banker_times_'+table_id).val();
|
||||
|
||||
var event = 'toBet';
|
||||
websocket.emit(event,{
|
||||
table_id:table_id,
|
||||
user_id:user_id,
|
||||
number_tab_id:number_tab_id,
|
||||
|
||||
amount_player_1:amount_player_1,
|
||||
amount_player_1_times:amount_player_1_times,
|
||||
amount_player_1_banker:amount_player_1_banker,
|
||||
amount_player_1_banker_times:amount_player_1_banker_times,
|
||||
|
||||
amount_player_2:amount_player_2,
|
||||
amount_player_2_times:amount_player_2_times,
|
||||
amount_player_2_banker:amount_player_2_banker,
|
||||
amount_player_2_banker_times:amount_player_2_banker_times,
|
||||
|
||||
amount_player_3:amount_player_3,
|
||||
amount_player_3_times:amount_player_3_times,
|
||||
amount_player_3_banker:amount_player_3_banker,
|
||||
amount_player_3_banker_times:amount_player_3_banker_times,
|
||||
});
|
||||
}
|
||||
}
|
||||
function toRob(table_id, game_id){
|
||||
var number_tab_id = $('#table_'+table_id).find('input[name="number_tab_id"]').val();
|
||||
websocket.emit('toRob',{table_id:table_id, user_id:user_id, number_tab_id:number_tab_id});
|
||||
}
|
||||
function toBetToning(table_id, game_id){
|
||||
var number_tab_id = $('#table_'+table_id).find('input[name="number_tab_id"]').val();
|
||||
|
||||
var toning_zero = $('#toning_zero_'+table_id).val();
|
||||
var toning_four = $('#toning_four_'+table_id).val();
|
||||
var toning_one = $('#toning_one_'+table_id).val();
|
||||
var toning_three = $('#toning_three_'+table_id).val();
|
||||
|
||||
var toning_big = $('#toning_big_'+table_id).val();
|
||||
var toning_small = $('#toning_small_'+table_id).val();
|
||||
var toning_singular = $('#toning_singular_'+table_id).val();
|
||||
var toning_plural = $('#toning_plural_'+table_id).val();
|
||||
|
||||
var event = 'toBet';
|
||||
websocket.emit(event,{
|
||||
table_id:table_id,
|
||||
user_id:user_id,
|
||||
number_tab_id:number_tab_id,
|
||||
|
||||
toning_zero:toning_zero,
|
||||
toning_four:toning_four,
|
||||
toning_one:toning_one,
|
||||
toning_three:toning_three,
|
||||
toning_big:toning_big,
|
||||
toning_small:toning_small,
|
||||
toning_singular:toning_singular,
|
||||
toning_plural:toning_plural,
|
||||
});
|
||||
}
|
||||
function toBetDice(table_id, game_id){
|
||||
var number_tab_id = $('#table_'+table_id).find('input[name="number_tab_id"]').val();
|
||||
var event = 'toBet';
|
||||
websocket.emit(event,{
|
||||
table_id:table_id,
|
||||
user_id:user_id,
|
||||
number_tab_id:number_tab_id,
|
||||
amount:{
|
||||
small:100,
|
||||
two_11:100,
|
||||
three_111:100,
|
||||
leopard:100,
|
||||
number_4:100,
|
||||
number_10:100,
|
||||
two_12:100,
|
||||
two_24:100,
|
||||
living_1:100,
|
||||
living_4:100,
|
||||
singular:100
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toBetRoulette(table_id, game_id){
|
||||
var number_tab_id = $('#table_'+table_id).find('input[name="number_tab_id"]').val();
|
||||
var event = 'toBet';
|
||||
var roulette_type = $('#roulette_type').val();
|
||||
if(roulette_type == 'european'){
|
||||
websocket.emit(event,{
|
||||
table_id:table_id,
|
||||
user_id:user_id,
|
||||
number_tab_id:number_tab_id,
|
||||
roulette_type:'european',
|
||||
amount:{
|
||||
'straight_8':100,
|
||||
'split_13-16':100,
|
||||
'street_4-5-6':100,
|
||||
'triple_0-2-3':100,
|
||||
'four_0-1-2-3':100,
|
||||
'corner_2-3-5-6':100,
|
||||
'line_4-5-6-7-8-9':100,
|
||||
'dozen_1':100,
|
||||
'column_1':100,
|
||||
'red':100,
|
||||
'odd':100,
|
||||
'low':100
|
||||
},
|
||||
french_amount:{}
|
||||
});
|
||||
}else {
|
||||
websocket.emit(event,{
|
||||
table_id:table_id,
|
||||
user_id:user_id,
|
||||
number_tab_id:number_tab_id,
|
||||
roulette_type:'french',
|
||||
amount:{
|
||||
'straight_8':100,
|
||||
'zeroGame': 40,
|
||||
'neighborsOfZero':90,
|
||||
'orphans': 50,
|
||||
'theThird':60
|
||||
|
||||
},
|
||||
european_amount:{}
|
||||
});
|
||||
}
|
||||
}
|
||||
function cancelBet(table_id, game_id){
|
||||
var number_tab_id = $('#table_'+table_id).find('input[name="number_tab_id"]').val();
|
||||
websocket.emit('cancelBet',{table_id:table_id, user_id:user_id, number_tab_id:number_tab_id});
|
||||
}
|
||||
function setNumberTab(data){
|
||||
var table_id = data.table_id;
|
||||
$('#table_'+table_id).find('input[name="boot_id"]').val(data.round.boot_id);
|
||||
$('#table_'+table_id).find('span[name="boot_num"]').html(data.round.boot_num);
|
||||
$('#table_'+table_id).find('input[name="number_tab_id"]').val(data.round.number_tab_id);
|
||||
$('#table_'+table_id).find('span[name="number"]').html(data.round.number_tab_number);
|
||||
}
|
||||
function setCard(data) {
|
||||
var table_id = data.table_id;
|
||||
var showCard = data.round.show_card;
|
||||
if (showCard.length > 0) {
|
||||
for (var i = 0; i < showCard.length; i++) {
|
||||
$('#table_' + table_id + '_card_' + showCard[i].position).attr("src", "/static/poker/" + showCard[i].card + ".png");
|
||||
}
|
||||
}
|
||||
}
|
||||
function forGetState(){
|
||||
$('input[name="table_id"]').each(function(){
|
||||
var table_id = $(this).val();
|
||||
websocket.emit('getState',{table_id : table_id, userid : user_id});
|
||||
});
|
||||
}
|
||||
function logout(){
|
||||
window.location.href="/login/logout";
|
||||
}
|
||||
function getLang(){
|
||||
$.ajax({
|
||||
url:"/index/get_lang",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
async:false,
|
||||
success:function(data){
|
||||
if(data.status == 1){
|
||||
lang = data.lang;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
$(function(){
|
||||
getLang();
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
33
app/index/view/login/index.html
Normal file
33
app/index/view/login/index.html
Normal file
@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Document</title>
|
||||
<script type="text/javascript" src="/static/handle/js/jquery-2.1.0.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<input type="text" value="" id="username"><br>
|
||||
<input type="text" value="" id="password"><br>
|
||||
<button onclick="login()">登录</button>
|
||||
<script type="text/javascript">
|
||||
function login(){
|
||||
var query = new Object();
|
||||
query.username = $('#username').val();
|
||||
query.password = $('#password').val();
|
||||
$.ajax({
|
||||
url:'/login/dologin',
|
||||
data:query,
|
||||
dataType:"json",
|
||||
type:"POST",
|
||||
success:function(data){
|
||||
if(data.code === 1){
|
||||
window.location.href=data.url;
|
||||
}else{
|
||||
alert(data.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
app/listener/.DS_Store
vendored
Normal file
BIN
app/listener/.DS_Store
vendored
Normal file
Binary file not shown.
100
app/listener/GetState.php
Normal file
100
app/listener/GetState.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener;
|
||||
|
||||
use app\models\bet\Bet;
|
||||
use app\models\process\NumberTab;
|
||||
use app\services\connect\GetCardService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class GetState
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$tableFd = app('swoole.table.fd');
|
||||
pre('getState:ws:'.$ws->getSender());
|
||||
$fdInfo = $tableFd->get((string) $ws->getSender());
|
||||
pre($fdInfo);
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,$fdInfo['mode']);
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
$numberTabInfo = NumberTab::getByTableIdOrderByIdDesc($tableInfo);
|
||||
$field = '*';
|
||||
if($numberTabInfo['game_id'] == 1){
|
||||
$field = 'table_id,game_id,user_id,banker_amount,player_amount,tie_amount,banker_pair_amount,player_pair_amount,luck_six_amount,big_amount,small_amount';
|
||||
}elseif($numberTabInfo['game_id'] == 2){
|
||||
$field = 'table_id,game_id,user_id,banker_amount,player_amount,tie_amount';
|
||||
}elseif($numberTabInfo['game_id'] == 4 || $numberTabInfo['game_id'] == 5){
|
||||
$field = 'table_id,game_id,user_id,
|
||||
amount_player_1,amount_player_1_times,withhold_player_1_times,amount_player_1_banker,amount_player_1_banker_times,withhold_player_1_banker_times,
|
||||
amount_player_2,amount_player_2_times,withhold_player_2_times,amount_player_2_banker,amount_player_2_banker_times,withhold_player_2_banker_times,
|
||||
amount_player_3,amount_player_3_times,withhold_player_3_times,amount_player_3_banker,amount_player_3_banker_times,withhold_player_3_banker_times';
|
||||
}elseif($numberTabInfo['game_id'] == 6){
|
||||
$field = 'table_id,game_id,user_id,toning_amount';
|
||||
}elseif($numberTabInfo['game_id'] == 7){
|
||||
$field = 'table_id,game_id,user_id,dice_amount';
|
||||
}elseif($numberTabInfo['game_id'] == 8){
|
||||
$field = 'table_id,game_id,user_id,roulette_european_amount,roulette_french_amount';
|
||||
}
|
||||
$bets = $numberTabInfo ? Bet::getByNumberTabIdValid($numberTabInfo['id'], $field) : [];
|
||||
if($bets){
|
||||
if($numberTabInfo['game_id'] == 6){
|
||||
foreach ($bets as $key => $val){
|
||||
$val['toning_amount'] = string_to_array($val['toning_amount']);
|
||||
$bets[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
if($numberTabInfo['game_id'] == 7){
|
||||
foreach ($bets as $key => $val){
|
||||
$val['dice_amount'] = string_to_array($val['dice_amount']);
|
||||
$bets[$key] = $val;
|
||||
}
|
||||
}
|
||||
if($numberTabInfo['game_id'] == 8){
|
||||
foreach ($bets as $key => $val){
|
||||
if($val['roulette_european_amount']){
|
||||
$val['roulette_type'] = 'european';
|
||||
$val['roulette_amount'] = string_to_array($val['roulette_european_amount']);
|
||||
}elseif($val['roulette_french_amount']){
|
||||
$val['roulette_type'] = 'french';
|
||||
$val['roulette_amount'] = string_to_array($val['roulette_french_amount']);
|
||||
}else{
|
||||
$val['roulette_type'] = '';
|
||||
$val['roulette_amount'] = array();
|
||||
}
|
||||
unset($val['roulette_european_amount']);
|
||||
unset($val['roulette_french_amount']);
|
||||
$bets[$key] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
$round = [
|
||||
// 靴ID
|
||||
'boot_id' => $numberTabInfo ? $numberTabInfo['boot_id'] : 0,
|
||||
// 靴号
|
||||
'boot_num' => $numberTabInfo ? $numberTabInfo['boot_num'] : 1,
|
||||
// 铺ID
|
||||
'number_tab_id' => $numberTabInfo ? $numberTabInfo['id'] : 0,
|
||||
// 铺号
|
||||
'number_tab_number' => $numberTabInfo ? $numberTabInfo['number'] : 1,
|
||||
// 铺状态 0、未开始 1、接受下注 2、下注结束 3、开出结果
|
||||
'bet_status' => $numberTabInfo ? $numberTabInfo['bet_status'] : 0,
|
||||
// 注单数据
|
||||
'bet' => $bets,
|
||||
// 牌数据
|
||||
'show_card' => $numberTabInfo ? GetCardService::getCard($tableInfo,$numberTabInfo) : []
|
||||
];
|
||||
$ws->emit('getState',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
|
||||
}else{
|
||||
$ws->emit('getState', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
60
app/listener/WsClose.php
Normal file
60
app/listener/WsClose.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener;
|
||||
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
class WsClose
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(WebSocket $ws){
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fd = $ws->getSender();
|
||||
$fdInfo = $tableFd->get((string) $fd);
|
||||
$mode = $fdInfo['mode'];
|
||||
switch ($mode) {
|
||||
case 'space':
|
||||
$tableSpace = app('swoole.table.space');
|
||||
$tableSpace->del((string) $fdInfo['table_id']);
|
||||
$ws->leave(SocketSession::SPACE_ROOM_NAME);
|
||||
break;
|
||||
case 'scan':
|
||||
$tableScan = app('swoole.table.scan');
|
||||
$tableScan->del((string) $fdInfo['scan_appid']);
|
||||
$ws->leave(SocketSession::SCAN_ROOM_NAME);
|
||||
break;
|
||||
case 'user':
|
||||
$tableUser = app('swoole.table.user');
|
||||
$tableUser->del((string) $fdInfo['user_id']);
|
||||
$ws->leave(SocketSession::USER_ROOM_NAME);
|
||||
break;
|
||||
case 'api':
|
||||
$tableApi = app('swoole.table.api');
|
||||
$tableApi->del((string) $fdInfo['api_appid']);
|
||||
$ws->leave(SocketSession::API_ROOM_NAME);
|
||||
break;
|
||||
case 'manager':
|
||||
$tableManager = app('swoole.table.manager');
|
||||
$tableManager->del((string) $fdInfo['user_id']);
|
||||
$ws->leave(SocketSession::MANAGER_ROOM_NAME);
|
||||
break;
|
||||
case 'chat_user':
|
||||
$chatListener = new \app\listener\chat\ChatConnectListener();
|
||||
$chatListener->onClose($ws);
|
||||
break;
|
||||
case 'chat_agent':
|
||||
$chatListener = new \app\listener\chat\ChatConnectListener();
|
||||
$chatListener->onClose($ws);
|
||||
break;
|
||||
}
|
||||
$tableFd->del((string) $fd);
|
||||
$ws->leave(SocketSession::HOUSE_NAME);
|
||||
echo $fd.":退出\n";
|
||||
}
|
||||
}
|
||||
38
app/listener/WsConnect.php
Normal file
38
app/listener/WsConnect.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener;
|
||||
|
||||
use app\services\connect\ScanConnectService;
|
||||
use app\services\connect\SpaceConnectService;
|
||||
use app\services\connect\UserConnectService;
|
||||
use app\services\connect\ManagerConnectService;
|
||||
use think\Request;
|
||||
|
||||
class WsConnect
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Request $event){
|
||||
$connect = $event->get('connect');
|
||||
switch ($connect) {
|
||||
case 'space':
|
||||
SpaceConnectService::doSpaceConnect($event);
|
||||
break;
|
||||
case 'user':
|
||||
UserConnectService::doUserConnect($event);
|
||||
break;
|
||||
case 'scan':
|
||||
ScanConnectService::doScanConnect($event);
|
||||
break;
|
||||
case 'manager':
|
||||
ManagerConnectService::doManagerConnect($event);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
243
app/listener/chat/ChatConnect.php
Normal file
243
app/listener/chat/ChatConnect.php
Normal file
@ -0,0 +1,243 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\listener\chat;
|
||||
|
||||
use app\services\chat\SessionService;
|
||||
use app\services\chat\AssignService;
|
||||
use app\models\chat\ChatSession;
|
||||
use think\facade\Db;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
/**
|
||||
* 聊天连接监听器
|
||||
* 处理: chat.connect 事件
|
||||
*/
|
||||
class ChatConnect
|
||||
{
|
||||
private SessionService $sessionService;
|
||||
private AssignService $assignService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->sessionService = new SessionService();
|
||||
$this->assignService = new AssignService();
|
||||
}
|
||||
|
||||
/**
|
||||
* 事件监听处理
|
||||
*/
|
||||
public function handle(array $data, WebSocket $ws): void
|
||||
{
|
||||
// 添加更详细的调试日志
|
||||
echo "[Chat] ========== 收到chat.connect事件 ==========\n";
|
||||
echo "[Chat] 原始数据: " . json_encode($data, JSON_UNESCAPED_UNICODE) . "\n";
|
||||
|
||||
$token = $data['token'] ?? '';
|
||||
$source = (int)($data['source'] ?? ChatSession::SOURCE_PC);
|
||||
$role = $data['role'] ?? 'user'; // user 或 agent
|
||||
|
||||
echo "[Chat] 解析后 - Token: {$token}, Source: {$source}, Role: {$role}\n";
|
||||
|
||||
if ($role === 'agent') {
|
||||
$this->handleAgentConnect($ws, $token, $data);
|
||||
} else {
|
||||
$this->handleUserConnect($ws, $token, $source);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理用户连接
|
||||
*/
|
||||
private function handleUserConnect(WebSocket $ws, string $token, int $source): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
|
||||
// 调试日志
|
||||
echo "[Chat] 收到用户连接请求 - FD: {$fd}, Token: {$token}, Source: {$source}\n";
|
||||
|
||||
// 验证用户Token
|
||||
$user = $this->verifyUserToken($token);
|
||||
if (!$user) {
|
||||
echo "[Chat] Token验证失败 - Token: {$token}\n";
|
||||
|
||||
// 尝试查询数据库看看是否有这个token
|
||||
$count = Db::name('user')->where('login_token', $token)->count();
|
||||
echo "[Chat] 数据库中login_token={$token}的记录数: {$count}\n";
|
||||
|
||||
$ws->emit('chat.connected', [
|
||||
'success' => false,
|
||||
'error' => 'invalid_token'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$userId = (int)$user['id'];
|
||||
echo "[Chat] Token验证成功 - UserID: {$userId}, Username: {$user['username']}\n";
|
||||
|
||||
// 注册连接
|
||||
$this->sessionService->registerUserConnection($userId, $fd);
|
||||
|
||||
// 保存fd映射
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$tableFd->set((string)$fd, [
|
||||
'mode' => 'chat_user',
|
||||
'user_id' => $userId,
|
||||
'table_id' => 0,
|
||||
'scan_appid' => '',
|
||||
'api_appid' => '',
|
||||
]);
|
||||
|
||||
// 加入聊天房间
|
||||
$ws->join('chat_user_' . $userId);
|
||||
|
||||
// 获取或创建会话
|
||||
$session = $this->sessionService->createSession($userId, $source);
|
||||
echo "[Chat] 会话创建成功 - SessionID: {$session['id']}, Status: {$session['status']}\n";
|
||||
|
||||
// 获取客服信息
|
||||
$agentInfo = null;
|
||||
if (!empty($session['admin_id'])) {
|
||||
$admin = Db::name('admin')->where('id', $session['admin_id'])->find();
|
||||
$agentInfo = [
|
||||
'id' => $admin['id'],
|
||||
'nickname' => $admin['nickname'] ?? $admin['username'] ?? '客服',
|
||||
];
|
||||
}
|
||||
|
||||
$ws->emit('chat.connected', [
|
||||
'success' => true,
|
||||
'sessionId' => $session['id'],
|
||||
'status' => $session['status'],
|
||||
'agentInfo' => $agentInfo,
|
||||
]);
|
||||
echo "[Chat] 发送chat.connected响应成功\n";
|
||||
|
||||
// 如果会话待分配,通知用户
|
||||
if ($session['status'] === ChatSession::STATUS_PENDING) {
|
||||
$ws->emit('chat.offline_notice', [
|
||||
'message' => '当前客服繁忙,请稍候...'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理客服连接
|
||||
*/
|
||||
private function handleAgentConnect(WebSocket $ws, string $token, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
|
||||
// 验证客服Token (复用Admin Session)
|
||||
$admin = $this->verifyAdminToken($token);
|
||||
if (!$admin) {
|
||||
$ws->emit('chat.connected', [
|
||||
'success' => false,
|
||||
'error' => 'invalid_token'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$adminId = (int)$admin['id'];
|
||||
$maxSessions = (int)($data['maxSessions'] ?? 10);
|
||||
|
||||
// 注册连接
|
||||
$this->sessionService->registerAgentConnection($adminId, $fd);
|
||||
|
||||
// 设置客服在线
|
||||
$this->assignService->setAgentOnline($adminId);
|
||||
|
||||
// 保存fd映射
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$tableFd->set((string)$fd, [
|
||||
'mode' => 'chat_agent',
|
||||
'user_id' => $adminId,
|
||||
'table_id' => 0,
|
||||
'scan_appid' => '',
|
||||
'api_appid' => '',
|
||||
]);
|
||||
|
||||
// 加入客服房间
|
||||
$ws->join('chat_agent_' . $adminId);
|
||||
|
||||
// 处理离线队列
|
||||
$processed = $this->assignService->processOfflineQueue($adminId);
|
||||
|
||||
// 获取当前会话列表
|
||||
$sessions = $this->sessionService->getAgentSessions($adminId);
|
||||
|
||||
$ws->emit('chat.connected', [
|
||||
'success' => true,
|
||||
'sessions' => $sessions,
|
||||
'processedFromQueue' => count($processed),
|
||||
]);
|
||||
|
||||
// 通知被分配的用户
|
||||
foreach ($processed as $item) {
|
||||
$this->notifyUserAssigned($item['userId'], $item['sessionId'], $adminId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证用户Token
|
||||
*/
|
||||
private function verifyUserToken(string $token): ?array
|
||||
{
|
||||
if (empty($token)) {
|
||||
echo "[Chat] Token为空\n";
|
||||
return null;
|
||||
}
|
||||
|
||||
// 去除token末尾可能的空格
|
||||
$token = trim($token);
|
||||
|
||||
echo "[Chat] 开始验证Token: {$token}\n";
|
||||
|
||||
$user = Db::name('user')
|
||||
->where('login_token', $token)
|
||||
->where('status', 1)
|
||||
->where('is_delete', 0)
|
||||
->find();
|
||||
|
||||
if ($user) {
|
||||
echo "[Chat] 找到用户: ID={$user['id']}, Username={$user['username']}\n";
|
||||
} else {
|
||||
echo "[Chat] 未找到匹配的用户\n";
|
||||
}
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证客服Token
|
||||
*/
|
||||
private function verifyAdminToken(string $token): ?array
|
||||
{
|
||||
if (empty($token)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 复用Admin的session token验证
|
||||
return Db::name('admin')
|
||||
->where('login_token', $token)
|
||||
->where('status', 1)
|
||||
->find();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知用户会话已分配
|
||||
*/
|
||||
private function notifyUserAssigned(int $userId, int $sessionId, int $adminId): void
|
||||
{
|
||||
$ws = app('\think\swoole\WebSocket');
|
||||
$admin = Db::name('admin')->where('id', $adminId)->find();
|
||||
|
||||
$ws->to('chat_user_' . $userId)->emit('chat.session.assigned', [
|
||||
'sessionId' => $sessionId,
|
||||
'agentInfo' => [
|
||||
'id' => $admin['id'],
|
||||
'nickname' => $admin['nickname'] ?? $admin['username'] ?? '客服',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
297
app/listener/chat/ChatConnectListener.php
Normal file
297
app/listener/chat/ChatConnectListener.php
Normal file
@ -0,0 +1,297 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\listener\chat;
|
||||
|
||||
use app\services\chat\SessionService;
|
||||
use app\services\chat\AssignService;
|
||||
use app\models\chat\ChatSession;
|
||||
use think\facade\Db;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
/**
|
||||
* 聊天连接监听器
|
||||
* 处理: chat.connect, chat.ping, 断开连接
|
||||
* Class ChatConnectListener
|
||||
* @package app\listener\chat
|
||||
*/
|
||||
class ChatConnectListener
|
||||
{
|
||||
private SessionService $sessionService;
|
||||
private AssignService $assignService;
|
||||
|
||||
// 约束参数 (specs.md CC-10~CC-13)
|
||||
private const HEARTBEAT_INTERVAL = 30; // 心跳间隔30秒
|
||||
private const OFFLINE_TIMEOUT = 60; // 离线判定60秒
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->sessionService = new SessionService();
|
||||
$this->assignService = new AssignService();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理聊天连接事件
|
||||
*/
|
||||
public function onConnect(WebSocket $ws, array $data): void
|
||||
{
|
||||
// 添加更详细的调试日志
|
||||
echo "[Chat] ========== 收到chat.connect事件 ==========\n";
|
||||
echo "[Chat] 原始数据: " . json_encode($data, JSON_UNESCAPED_UNICODE) . "\n";
|
||||
|
||||
$token = $data['token'] ?? '';
|
||||
$source = (int)($data['source'] ?? ChatSession::SOURCE_PC);
|
||||
$role = $data['role'] ?? 'user'; // user 或 agent
|
||||
|
||||
echo "[Chat] 解析后 - Token: {$token}, Source: {$source}, Role: {$role}\n";
|
||||
|
||||
if ($role === 'agent') {
|
||||
$this->handleAgentConnect($ws, $token, $data);
|
||||
} else {
|
||||
$this->handleUserConnect($ws, $token, $source);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理用户连接
|
||||
*/
|
||||
private function handleUserConnect(WebSocket $ws, string $token, int $source): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
|
||||
// 调试日志
|
||||
echo "[Chat] 收到用户连接请求 - FD: {$fd}, Token: {$token}, Source: {$source}\n";
|
||||
|
||||
// 验证用户Token
|
||||
$user = $this->verifyUserToken($token);
|
||||
if (!$user) {
|
||||
echo "[Chat] Token验证失败 - Token: {$token}\n";
|
||||
|
||||
// 尝试查询数据库看看是否有这个token
|
||||
$count = Db::name('user')->where('login_token', $token)->count();
|
||||
echo "[Chat] 数据库中login_token={$token}的记录数: {$count}\n";
|
||||
|
||||
$ws->emit('chat.connected', [
|
||||
'success' => false,
|
||||
'error' => 'invalid_token'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$userId = (int)$user['id'];
|
||||
echo "[Chat] Token验证成功 - UserID: {$userId}, Username: {$user['username']}\n";
|
||||
|
||||
// 注册连接
|
||||
$this->sessionService->registerUserConnection($userId, $fd);
|
||||
|
||||
// 保存fd映射
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$tableFd->set((string)$fd, [
|
||||
'mode' => 'chat_user',
|
||||
'user_id' => $userId,
|
||||
'table_id' => 0,
|
||||
'scan_appid' => '',
|
||||
'api_appid' => '',
|
||||
]);
|
||||
|
||||
// 加入聊天房间
|
||||
$ws->join('chat_user_' . $userId);
|
||||
|
||||
// 获取或创建会话
|
||||
$session = $this->sessionService->createSession($userId, $source);
|
||||
echo "[Chat] 会话创建成功 - SessionID: {$session['id']}, Status: {$session['status']}\n";
|
||||
|
||||
// 获取客服信息
|
||||
$agentInfo = null;
|
||||
if (!empty($session['admin_id'])) {
|
||||
$admin = Db::name('admin')->where('id', $session['admin_id'])->find();
|
||||
$agentInfo = [
|
||||
'id' => $admin['id'],
|
||||
'nickname' => $admin['nickname'] ?? $admin['username'] ?? '客服',
|
||||
];
|
||||
}
|
||||
|
||||
$ws->emit('chat.connected', [
|
||||
'success' => true,
|
||||
'sessionId' => $session['id'],
|
||||
'status' => $session['status'],
|
||||
'agentInfo' => $agentInfo,
|
||||
]);
|
||||
echo "[Chat] 发送chat.connected响应成功\n";
|
||||
|
||||
// 如果会话待分配,通知用户
|
||||
if ($session['status'] === ChatSession::STATUS_PENDING) {
|
||||
$ws->emit('chat.offline_notice', [
|
||||
'message' => '当前客服繁忙,请稍候...'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理客服连接
|
||||
*/
|
||||
private function handleAgentConnect(WebSocket $ws, string $token, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
|
||||
// 验证客服Token (复用Admin Session)
|
||||
$admin = $this->verifyAdminToken($token);
|
||||
if (!$admin) {
|
||||
$ws->emit('chat.connected', [
|
||||
'success' => false,
|
||||
'error' => 'invalid_token'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$adminId = (int)$admin['id'];
|
||||
$maxSessions = (int)($data['maxSessions'] ?? 10);
|
||||
|
||||
// 注册连接
|
||||
$this->sessionService->registerAgentConnection($adminId, $fd);
|
||||
|
||||
// 设置客服在线
|
||||
$this->assignService->setAgentOnline($adminId);
|
||||
|
||||
// 保存fd映射
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$tableFd->set((string)$fd, [
|
||||
'mode' => 'chat_agent',
|
||||
'user_id' => $adminId,
|
||||
'table_id' => 0,
|
||||
'scan_appid' => '',
|
||||
'api_appid' => '',
|
||||
]);
|
||||
|
||||
// 加入客服房间
|
||||
$ws->join('chat_agent_' . $adminId);
|
||||
|
||||
// 处理离线队列
|
||||
$processed = $this->assignService->processOfflineQueue($adminId);
|
||||
|
||||
// 获取当前会话列表
|
||||
$sessions = $this->sessionService->getAgentSessions($adminId);
|
||||
|
||||
$ws->emit('chat.connected', [
|
||||
'success' => true,
|
||||
'sessions' => $sessions,
|
||||
'processedFromQueue' => count($processed),
|
||||
]);
|
||||
|
||||
// 通知被分配的用户
|
||||
foreach ($processed as $item) {
|
||||
$this->notifyUserAssigned($item['userId'], $item['sessionId'], $adminId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理心跳
|
||||
*/
|
||||
public function onPing(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($fdInfo['mode'] === 'chat_user') {
|
||||
$this->sessionService->refreshUserConnection($fdInfo['user_id']);
|
||||
} elseif ($fdInfo['mode'] === 'chat_agent') {
|
||||
$this->sessionService->refreshAgentConnection($fdInfo['user_id']);
|
||||
$this->assignService->refreshAgentOnline($fdInfo['user_id']);
|
||||
}
|
||||
|
||||
$ws->emit('chat.pong', []);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理断开连接
|
||||
*/
|
||||
public function onClose(WebSocket $ws): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($fdInfo['mode'] === 'chat_user') {
|
||||
$userId = $fdInfo['user_id'];
|
||||
$this->sessionService->clearUserConnection($userId);
|
||||
$ws->leave('chat_user_' . $userId);
|
||||
} elseif ($fdInfo['mode'] === 'chat_agent') {
|
||||
$adminId = $fdInfo['user_id'];
|
||||
$this->sessionService->clearAgentConnection($adminId);
|
||||
$this->assignService->setAgentOffline($adminId);
|
||||
$ws->leave('chat_agent_' . $adminId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证用户Token
|
||||
*/
|
||||
private function verifyUserToken(string $token): ?array
|
||||
{
|
||||
if (empty($token)) {
|
||||
echo "[Chat] Token为空\n";
|
||||
return null;
|
||||
}
|
||||
|
||||
// 去除token末尾可能的空格
|
||||
$token = trim($token);
|
||||
|
||||
echo "[Chat] 开始验证Token: {$token}\n";
|
||||
|
||||
$user = Db::name('user')
|
||||
->where('login_token', $token)
|
||||
->where('status', 1)
|
||||
->where('is_delete', 0)
|
||||
->find();
|
||||
|
||||
if ($user) {
|
||||
echo "[Chat] 找到用户: ID={$user['id']}, Username={$user['username']}\n";
|
||||
} else {
|
||||
echo "[Chat] 未找到匹配的用户\n";
|
||||
}
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证客服Token
|
||||
*/
|
||||
private function verifyAdminToken(string $token): ?array
|
||||
{
|
||||
if (empty($token)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 复用Admin的session token验证
|
||||
return Db::name('admin')
|
||||
->where('login_token', $token)
|
||||
->where('status', 1)
|
||||
->find();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知用户会话已分配
|
||||
*/
|
||||
private function notifyUserAssigned(int $userId, int $sessionId, int $adminId): void
|
||||
{
|
||||
$ws = app('\think\swoole\WebSocket');
|
||||
$admin = Db::name('admin')->where('id', $adminId)->find();
|
||||
|
||||
$ws->to('chat_user_' . $userId)->emit('chat.session.assigned', [
|
||||
'sessionId' => $sessionId,
|
||||
'agentInfo' => [
|
||||
'id' => $admin['id'],
|
||||
'nickname' => $admin['nickname'] ?? $admin['username'] ?? '客服',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
25
app/listener/chat/ChatMessageAck.php
Normal file
25
app/listener/chat/ChatMessageAck.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\listener\chat;
|
||||
|
||||
use app\services\chat\MessageService;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
/**
|
||||
* 消息确认监听器
|
||||
*/
|
||||
class ChatMessageAck
|
||||
{
|
||||
private MessageService $messageService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->messageService = new MessageService();
|
||||
}
|
||||
|
||||
public function handle(array $data, WebSocket $ws): void
|
||||
{
|
||||
$this->messageService->acknowledgeMessage($ws, $data);
|
||||
}
|
||||
}
|
||||
290
app/listener/chat/ChatMessageListener.php
Normal file
290
app/listener/chat/ChatMessageListener.php
Normal file
@ -0,0 +1,290 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\listener\chat;
|
||||
|
||||
use app\services\chat\MessageService;
|
||||
use app\services\chat\SessionService;
|
||||
use app\models\chat\ChatMessage;
|
||||
use app\models\chat\ChatSession;
|
||||
use think\facade\Db;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
/**
|
||||
* 聊天消息监听器
|
||||
* 处理: chat.message.send, chat.message.ack, chat.typing
|
||||
* Class ChatMessageListener
|
||||
* @package app\listener\chat
|
||||
*/
|
||||
class ChatMessageListener
|
||||
{
|
||||
private MessageService $messageService;
|
||||
private SessionService $sessionService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->messageService = new MessageService();
|
||||
$this->sessionService = new SessionService();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理发送消息
|
||||
* 两段ACK: server_ack(服务端已接收) + peer_ack(对端已送达)
|
||||
*/
|
||||
public function onMessageSend(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo || !in_array($fdInfo['mode'], ['chat_user', 'chat_agent'])) {
|
||||
$ws->emit('chat.message.server_ack', [
|
||||
'success' => false,
|
||||
'error' => 'not_connected'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$sessionId = (int)($data['sessionId'] ?? 0);
|
||||
$msgType = (int)($data['msgType'] ?? ChatMessage::MSG_TYPE_TEXT);
|
||||
$content = $data['content'] ?? '';
|
||||
$clientMsgId = $data['clientMsgId'] ?? null;
|
||||
|
||||
// 验证会话
|
||||
$session = ChatSession::find($sessionId);
|
||||
if (!$session || $session['status'] === ChatSession::STATUS_ENDED) {
|
||||
$ws->emit('chat.message.server_ack', [
|
||||
'clientMsgId' => $clientMsgId,
|
||||
'success' => false,
|
||||
'error' => 'session_invalid'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证内容
|
||||
$validation = $this->messageService->validateContent($content, $msgType);
|
||||
if (!$validation['valid']) {
|
||||
$ws->emit('chat.message.server_ack', [
|
||||
'clientMsgId' => $clientMsgId,
|
||||
'success' => false,
|
||||
'error' => $validation['error']
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// 确定发送者
|
||||
$senderType = $fdInfo['mode'] === 'chat_user'
|
||||
? ChatMessage::SENDER_USER
|
||||
: ChatMessage::SENDER_ADMIN;
|
||||
$senderId = $fdInfo['user_id'];
|
||||
|
||||
// 验证发送者权限
|
||||
if ($senderType === ChatMessage::SENDER_USER && $session['user_id'] != $senderId) {
|
||||
$ws->emit('chat.message.server_ack', [
|
||||
'clientMsgId' => $clientMsgId,
|
||||
'success' => false,
|
||||
'error' => 'permission_denied'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
if ($senderType === ChatMessage::SENDER_ADMIN && $session['admin_id'] != $senderId) {
|
||||
$ws->emit('chat.message.server_ack', [
|
||||
'clientMsgId' => $clientMsgId,
|
||||
'success' => false,
|
||||
'error' => 'permission_denied'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建消息
|
||||
$message = $this->messageService->createMessage([
|
||||
'session_id' => $sessionId,
|
||||
'sender_type' => $senderType,
|
||||
'sender_id' => $senderId,
|
||||
'msg_type' => $msgType,
|
||||
'content' => $content,
|
||||
'client_msg_id' => $clientMsgId,
|
||||
]);
|
||||
|
||||
// 发送 server_ack
|
||||
$ws->emit('chat.message.server_ack', [
|
||||
'clientMsgId' => $clientMsgId,
|
||||
'msgId' => $message['msg_id'],
|
||||
'success' => true,
|
||||
'status' => 'received'
|
||||
]);
|
||||
|
||||
// 推送给对端
|
||||
$this->pushToPeer($ws, $session->toArray(), $message, $senderType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理消息确认 (已读回执)
|
||||
*/
|
||||
public function onMessageAck(WebSocket $ws, array $data): void
|
||||
{
|
||||
$msgId = $data['msgId'] ?? null;
|
||||
$msgIds = $data['msgIds'] ?? [];
|
||||
|
||||
if ($msgId) {
|
||||
$msgIds[] = $msgId;
|
||||
}
|
||||
|
||||
if (empty($msgIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 标记为已读
|
||||
$this->messageService->markMessagesAsRead($msgIds);
|
||||
|
||||
// 通知发送方消息已读
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取消息信息,通知原发送者
|
||||
foreach ($msgIds as $id) {
|
||||
$message = ChatMessage::where('msg_id', $id)->find();
|
||||
if (!$message) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$session = ChatSession::find($message['session_id']);
|
||||
if (!$session) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 确定对端
|
||||
if ($message['sender_type'] === ChatMessage::SENDER_USER) {
|
||||
$targetFd = $this->sessionService->getUserFd($session['user_id']);
|
||||
} else {
|
||||
$targetFd = $this->sessionService->getAgentFd($session['admin_id']);
|
||||
}
|
||||
|
||||
if ($targetFd) {
|
||||
$server = app('swoole.server');
|
||||
if ($server->isEstablished($targetFd)) {
|
||||
$server->push($targetFd, json_encode([
|
||||
'event' => 'chat.message.peer_ack',
|
||||
'data' => [
|
||||
'msgId' => $id,
|
||||
'status' => 'read'
|
||||
]
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理正在输入状态
|
||||
*/
|
||||
public function onTyping(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo || !in_array($fdInfo['mode'], ['chat_user', 'chat_agent'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$sessionId = (int)($data['sessionId'] ?? 0);
|
||||
$isTyping = (bool)($data['isTyping'] ?? false);
|
||||
|
||||
$session = ChatSession::find($sessionId);
|
||||
if (!$session || $session['status'] !== ChatSession::STATUS_ACTIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 转发给对端
|
||||
if ($fdInfo['mode'] === 'chat_user') {
|
||||
// 用户输入,通知客服
|
||||
if ($session['admin_id']) {
|
||||
$ws->to('chat_agent_' . $session['admin_id'])->emit('chat.typing', [
|
||||
'sessionId' => $sessionId,
|
||||
'isTyping' => $isTyping,
|
||||
'from' => 'user'
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
// 客服输入,通知用户
|
||||
$ws->to('chat_user_' . $session['user_id'])->emit('chat.typing', [
|
||||
'sessionId' => $sessionId,
|
||||
'isTyping' => $isTyping,
|
||||
'from' => 'agent'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送消息给对端
|
||||
*/
|
||||
private function pushToPeer(WebSocket $ws, array $session, array $message, int $senderType): void
|
||||
{
|
||||
$payload = [
|
||||
'event' => 'chat.message.new',
|
||||
'data' => [
|
||||
'msgId' => $message['msg_id'],
|
||||
'sessionId' => $message['session_id'],
|
||||
'senderType' => $message['sender_type'],
|
||||
'msgType' => $message['msg_type'],
|
||||
'content' => $message['content'],
|
||||
'time' => $message['create_time'],
|
||||
]
|
||||
];
|
||||
|
||||
if ($senderType === ChatMessage::SENDER_USER) {
|
||||
// 用户发送,推给客服
|
||||
if ($session['admin_id']) {
|
||||
$targetFd = $this->sessionService->getAgentFd($session['admin_id']);
|
||||
if ($targetFd) {
|
||||
$pushed = $this->messageService->pushMessage(
|
||||
$message['msg_id'],
|
||||
$targetFd,
|
||||
$payload
|
||||
);
|
||||
if ($pushed) {
|
||||
// 发送 peer_ack 给发送者
|
||||
$ws->emit('chat.message.peer_ack', [
|
||||
'msgId' => $message['msg_id'],
|
||||
'status' => 'delivered'
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 无客服,消息保持pending状态
|
||||
$this->messageService->updateMessageStatus(
|
||||
$message['msg_id'],
|
||||
ChatMessage::STATUS_PENDING
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 客服发送,推给用户
|
||||
$targetFd = $this->sessionService->getUserFd($session['user_id']);
|
||||
if ($targetFd) {
|
||||
$pushed = $this->messageService->pushMessage(
|
||||
$message['msg_id'],
|
||||
$targetFd,
|
||||
$payload
|
||||
);
|
||||
if ($pushed) {
|
||||
$ws->emit('chat.message.peer_ack', [
|
||||
'msgId' => $message['msg_id'],
|
||||
'status' => 'delivered'
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
// 用户离线,消息保持pending
|
||||
$this->messageService->updateMessageStatus(
|
||||
$message['msg_id'],
|
||||
ChatMessage::STATUS_PENDING
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
app/listener/chat/ChatMessageSend.php
Normal file
25
app/listener/chat/ChatMessageSend.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\listener\chat;
|
||||
|
||||
use app\services\chat\MessageService;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
/**
|
||||
* 发送消息监听器
|
||||
*/
|
||||
class ChatMessageSend
|
||||
{
|
||||
private MessageService $messageService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->messageService = new MessageService();
|
||||
}
|
||||
|
||||
public function handle(array $data, WebSocket $ws): void
|
||||
{
|
||||
$this->messageService->sendMessage($ws, $data);
|
||||
}
|
||||
}
|
||||
43
app/listener/chat/ChatPing.php
Normal file
43
app/listener/chat/ChatPing.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\listener\chat;
|
||||
|
||||
use app\services\chat\SessionService;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
/**
|
||||
* 聊天心跳监听器
|
||||
* 处理: chat.ping 事件
|
||||
*/
|
||||
class ChatPing
|
||||
{
|
||||
private SessionService $sessionService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->sessionService = new SessionService();
|
||||
}
|
||||
|
||||
/**
|
||||
* 事件监听处理
|
||||
*/
|
||||
public function handle(array $data, WebSocket $ws): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($fdInfo['mode'] === 'chat_user') {
|
||||
$this->sessionService->refreshUserConnection($fdInfo['user_id']);
|
||||
} elseif ($fdInfo['mode'] === 'chat_agent') {
|
||||
$this->sessionService->refreshAgentConnection($fdInfo['user_id']);
|
||||
}
|
||||
|
||||
$ws->emit('chat.pong', []);
|
||||
}
|
||||
}
|
||||
310
app/listener/chat/ChatSessionListener.php
Normal file
310
app/listener/chat/ChatSessionListener.php
Normal file
@ -0,0 +1,310 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\listener\chat;
|
||||
|
||||
use app\services\chat\SessionService;
|
||||
use app\services\chat\AssignService;
|
||||
use app\services\chat\MessageService;
|
||||
use app\models\chat\ChatSession;
|
||||
use app\models\chat\ChatMessage;
|
||||
use think\facade\Db;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
/**
|
||||
* 聊天会话监听器
|
||||
* 处理: chat.session.end, chat.session.rate, chat.agent.online, chat.agent.offline, chat.session.transfer
|
||||
* Class ChatSessionListener
|
||||
* @package app\listener\chat
|
||||
*/
|
||||
class ChatSessionListener
|
||||
{
|
||||
private SessionService $sessionService;
|
||||
private AssignService $assignService;
|
||||
private MessageService $messageService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->sessionService = new SessionService();
|
||||
$this->assignService = new AssignService();
|
||||
$this->messageService = new MessageService();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理结束会话
|
||||
*/
|
||||
public function onSessionEnd(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo || !in_array($fdInfo['mode'], ['chat_user', 'chat_agent'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$sessionId = (int)($data['sessionId'] ?? 0);
|
||||
$session = ChatSession::find($sessionId);
|
||||
|
||||
if (!$session) {
|
||||
$ws->emit('chat.session.ended', [
|
||||
'success' => false,
|
||||
'error' => 'session_not_found'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证权限
|
||||
$operatorId = $fdInfo['user_id'];
|
||||
if ($fdInfo['mode'] === 'chat_user' && $session['user_id'] != $operatorId) {
|
||||
$ws->emit('chat.session.ended', [
|
||||
'success' => false,
|
||||
'error' => 'permission_denied'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
if ($fdInfo['mode'] === 'chat_agent' && $session['admin_id'] != $operatorId) {
|
||||
$ws->emit('chat.session.ended', [
|
||||
'success' => false,
|
||||
'error' => 'permission_denied'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// 结束会话
|
||||
$result = $this->sessionService->endSession($sessionId, $operatorId);
|
||||
|
||||
if ($result) {
|
||||
// 通知双方
|
||||
$ws->emit('chat.session.ended', [
|
||||
'success' => true,
|
||||
'sessionId' => $sessionId
|
||||
]);
|
||||
|
||||
// 通知对方
|
||||
if ($fdInfo['mode'] === 'chat_user' && $session['admin_id']) {
|
||||
$ws->to('chat_agent_' . $session['admin_id'])->emit('chat.session.ended', [
|
||||
'sessionId' => $sessionId,
|
||||
'endedBy' => 'user'
|
||||
]);
|
||||
} elseif ($fdInfo['mode'] === 'chat_agent') {
|
||||
$ws->to('chat_user_' . $session['user_id'])->emit('chat.session.ended', [
|
||||
'sessionId' => $sessionId,
|
||||
'endedBy' => 'agent'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理会话评价
|
||||
*/
|
||||
public function onSessionRate(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
// 只有用户可以评价
|
||||
if (!$fdInfo || $fdInfo['mode'] !== 'chat_user') {
|
||||
return;
|
||||
}
|
||||
|
||||
$sessionId = (int)($data['sessionId'] ?? 0);
|
||||
$rating = (int)($data['rating'] ?? 0);
|
||||
$content = $data['content'] ?? null;
|
||||
|
||||
$session = ChatSession::find($sessionId);
|
||||
if (!$session || $session['user_id'] != $fdInfo['user_id']) {
|
||||
$ws->emit('chat.session.rated', [
|
||||
'success' => false,
|
||||
'error' => 'invalid_session'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$result = $this->sessionService->rateSession($sessionId, $rating, $content);
|
||||
|
||||
$ws->emit('chat.session.rated', [
|
||||
'success' => $result,
|
||||
'sessionId' => $sessionId
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理客服上线
|
||||
*/
|
||||
public function onAgentOnline(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo || $fdInfo['mode'] !== 'chat_agent') {
|
||||
return;
|
||||
}
|
||||
|
||||
$adminId = $fdInfo['user_id'];
|
||||
$maxSessions = (int)($data['maxSessions'] ?? 10);
|
||||
|
||||
// 设置在线状态
|
||||
$this->assignService->setAgentOnline($adminId);
|
||||
|
||||
// 处理离线队列
|
||||
$processed = $this->assignService->processOfflineQueue($adminId);
|
||||
|
||||
// 获取当前会话列表
|
||||
$sessions = $this->sessionService->getAgentSessions($adminId);
|
||||
|
||||
$ws->emit('chat.agent.online_success', [
|
||||
'sessions' => $sessions,
|
||||
'processedFromQueue' => count($processed),
|
||||
]);
|
||||
|
||||
// 通知被分配的用户
|
||||
foreach ($processed as $item) {
|
||||
$this->notifyUserAssigned($ws, $item['userId'], $item['sessionId'], $adminId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理客服下线
|
||||
*/
|
||||
public function onAgentOffline(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo || $fdInfo['mode'] !== 'chat_agent') {
|
||||
return;
|
||||
}
|
||||
|
||||
$adminId = $fdInfo['user_id'];
|
||||
|
||||
// 设置离线状态
|
||||
$this->assignService->setAgentOffline($adminId);
|
||||
|
||||
// 获取该客服的活跃会话
|
||||
$sessions = ChatSession::getActiveByAdminId($adminId);
|
||||
|
||||
// 通知用户客服已离线
|
||||
foreach ($sessions as $session) {
|
||||
$ws->to('chat_user_' . $session['user_id'])->emit('chat.offline_notice', [
|
||||
'sessionId' => $session['id'],
|
||||
'message' => '客服已离线,请稍后再试'
|
||||
]);
|
||||
}
|
||||
|
||||
$ws->emit('chat.agent.offline_success', [
|
||||
'success' => true
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理会话转接
|
||||
*/
|
||||
public function onSessionTransfer(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo || $fdInfo['mode'] !== 'chat_agent') {
|
||||
return;
|
||||
}
|
||||
|
||||
$sessionId = (int)($data['sessionId'] ?? 0);
|
||||
$targetAdminId = (int)($data['targetAdminId'] ?? 0);
|
||||
|
||||
$session = ChatSession::find($sessionId);
|
||||
if (!$session || $session['admin_id'] != $fdInfo['user_id']) {
|
||||
$ws->emit('chat.session.transferred', [
|
||||
'success' => false,
|
||||
'error' => 'invalid_session'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查目标客服是否在线
|
||||
$onlineAgents = $this->assignService->getOnlineAgents();
|
||||
if (!in_array($targetAdminId, $onlineAgents)) {
|
||||
$ws->emit('chat.session.transferred', [
|
||||
'success' => false,
|
||||
'error' => 'target_agent_offline'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行转接
|
||||
$result = $this->sessionService->transferSession($sessionId, $targetAdminId);
|
||||
|
||||
if ($result) {
|
||||
$targetAdmin = Db::name('admin')->where('id', $targetAdminId)->find();
|
||||
|
||||
// 通知原客服
|
||||
$ws->emit('chat.session.transferred', [
|
||||
'success' => true,
|
||||
'sessionId' => $sessionId
|
||||
]);
|
||||
|
||||
// 通知新客服
|
||||
$sessionDetail = $this->sessionService->getSessionDetail($sessionId);
|
||||
$ws->to('chat_agent_' . $targetAdminId)->emit('chat.session.new', [
|
||||
'session' => $sessionDetail,
|
||||
'transferredFrom' => $fdInfo['user_id']
|
||||
]);
|
||||
|
||||
// 通知用户
|
||||
$ws->to('chat_user_' . $session['user_id'])->emit('chat.session.assigned', [
|
||||
'sessionId' => $sessionId,
|
||||
'agentInfo' => [
|
||||
'id' => $targetAdmin['id'],
|
||||
'nickname' => $targetAdmin['nickname'] ?? $targetAdmin['username'] ?? '客服',
|
||||
],
|
||||
'transferred' => true
|
||||
]);
|
||||
} else {
|
||||
$ws->emit('chat.session.transferred', [
|
||||
'success' => false,
|
||||
'error' => 'transfer_failed'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待处理队列列表 (客服端)
|
||||
*/
|
||||
public function onQueueList(WebSocket $ws, array $data): void
|
||||
{
|
||||
$fd = $ws->getSender();
|
||||
$tableFd = app('swoole.table.fd');
|
||||
$fdInfo = $tableFd->get((string)$fd);
|
||||
|
||||
if (!$fdInfo || $fdInfo['mode'] !== 'chat_agent') {
|
||||
return;
|
||||
}
|
||||
|
||||
$pendingSessions = $this->sessionService->getPendingSessions();
|
||||
|
||||
$ws->emit('chat.queue.list', [
|
||||
'sessions' => $pendingSessions
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知用户会话已分配
|
||||
*/
|
||||
private function notifyUserAssigned(WebSocket $ws, int $userId, int $sessionId, int $adminId): void
|
||||
{
|
||||
$admin = Db::name('admin')->where('id', $adminId)->find();
|
||||
|
||||
$ws->to('chat_user_' . $userId)->emit('chat.session.assigned', [
|
||||
'sessionId' => $sessionId,
|
||||
'agentInfo' => [
|
||||
'id' => $admin['id'],
|
||||
'nickname' => $admin['nickname'] ?? $admin['username'] ?? '客服',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
17
app/listener/chat/ChatTyping.php
Normal file
17
app/listener/chat/ChatTyping.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\listener\chat;
|
||||
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
/**
|
||||
* 正在输入监听器
|
||||
*/
|
||||
class ChatTyping
|
||||
{
|
||||
public function handle(array $data, WebSocket $ws): void
|
||||
{
|
||||
// 暂时不实现,预留接口
|
||||
}
|
||||
}
|
||||
31
app/listener/scan/Baccarat.php
Normal file
31
app/listener/scan/Baccarat.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\scan;
|
||||
|
||||
use app\models\table\Table;
|
||||
use app\services\scan\ScanBaccaratService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class Baccarat
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
if (!isset($event['table_id']) || empty(intval($event['table_id']))){
|
||||
$ws->emit('sendScanResult',['status' => false, 'msg' => "not_table_data"]);
|
||||
}
|
||||
$tableInfo = Table::get(intval($event['table_id']));
|
||||
$serviceRes = ScanBaccaratService::doScanBaccarat($event,$tableInfo);
|
||||
if ($serviceRes['status']){
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('sendScanResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $serviceRes['data']]);
|
||||
}else{
|
||||
$ws->emit('sendScanResult',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => $serviceRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
app/listener/scan/CheckScanStatus.php
Normal file
44
app/listener/scan/CheckScanStatus.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\scan;
|
||||
|
||||
use app\models\process\NumberTab;
|
||||
use app\models\table\Table;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class CheckScanStatus
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
|
||||
$tableId = intval($event['table_id']);
|
||||
$tableInfo = Table::get($tableId);
|
||||
if (!$tableInfo) {
|
||||
$ws->emit('checkScanStatus',['status' => false, 'msg' => 'TableInfo Error']);
|
||||
return;
|
||||
}
|
||||
$numberTabInfo = NumberTab::getByTableIdOrderByIdDesc($tableInfo);
|
||||
if (!$numberTabInfo){
|
||||
$ws->emit('checkScanStatus',['status' => false, 'msg' => 'Not NumberTab Data']);
|
||||
return;
|
||||
}
|
||||
$round = array();
|
||||
$round['tid'] = $tableId;
|
||||
$round['boot_id'] = intval($numberTabInfo['boot_id']);
|
||||
$round['boot_num'] = intval($numberTabInfo['boot_num']);
|
||||
$round['number_tab_id'] = intval($numberTabInfo['id']);
|
||||
$round['number_tab_number'] = intval($numberTabInfo['number']);
|
||||
if ($numberTabInfo['bet_status'] == 2){
|
||||
$round['is_scan'] = true;
|
||||
}else{
|
||||
$round['is_scan'] = false;
|
||||
}
|
||||
$ws->emit('checkScanStatus',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
|
||||
}
|
||||
}
|
||||
31
app/listener/scan/Dt.php
Normal file
31
app/listener/scan/Dt.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\scan;
|
||||
|
||||
use app\models\table\Table;
|
||||
use app\services\scan\ScanDtService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
class Dt
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
if (!isset($event['table_id']) || empty(intval($event['table_id']))){
|
||||
$ws->emit('sendScanResult',['status' => false, 'msg' => "not_table_data"]);
|
||||
}
|
||||
$tableInfo = Table::get(intval($event['table_id']));
|
||||
$serviceRes = ScanDtService::doScanDt($event,$tableInfo);
|
||||
if ($serviceRes['status']){
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('sendScanResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $serviceRes['data']]);
|
||||
}else{
|
||||
$ws->emit('sendScanResult',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => $serviceRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
app/listener/scan/Nn.php
Normal file
35
app/listener/scan/Nn.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\scan;
|
||||
|
||||
use app\models\table\Table;
|
||||
use app\services\scan\ScanNnService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class Nn
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
if (!isset($event['table_id']) || empty(intval($event['table_id']))){
|
||||
$ws->emit('sendScanResult',['status' => false, 'msg' => "not_table_data"]);
|
||||
}
|
||||
$tableInfo = Table::get(intval($event['table_id']));
|
||||
if ($tableInfo['scanner_type'] == 1) {
|
||||
$serviceRes = ScanNnService::doScanNn($event,$tableInfo);
|
||||
} else {
|
||||
$serviceRes = ScanNnService::doScanNnSb($event,$tableInfo);
|
||||
}
|
||||
if ($serviceRes['status']){
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('sendScanResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $serviceRes['data']]);
|
||||
}else{
|
||||
$ws->emit('sendScanResult',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => $serviceRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
app/listener/scan/NnChange.php
Normal file
35
app/listener/scan/NnChange.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\scan;
|
||||
|
||||
use app\models\table\Table;
|
||||
use app\services\scan\ChangeNnService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class NnChange
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
if (!isset($event['table_id']) || empty(intval($event['table_id']))){
|
||||
$ws->emit('sendScanResult',['status' => false, 'msg' => "not_table_data"]);
|
||||
}
|
||||
$tableInfo = Table::get(intval($event['table_id']));
|
||||
if ($tableInfo['scanner_type'] == 1) {
|
||||
$serviceRes = ChangeNnService::doScanNnChange($event,$tableInfo);
|
||||
} else {
|
||||
$serviceRes = ChangeNnService::doScanNnSbChange($event,$tableInfo);
|
||||
}
|
||||
if ($serviceRes['status']){
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('sendScanResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $serviceRes['data'], 'isChanged' => true]);
|
||||
}else{
|
||||
$ws->emit('sendScanChangeNnResult',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => $serviceRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
app/listener/scan/Tc.php
Normal file
31
app/listener/scan/Tc.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\scan;
|
||||
|
||||
use app\models\table\Table;
|
||||
use app\services\scan\ScanTcService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class Tc
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
if (!isset($event['table_id']) || empty(intval($event['table_id']))){
|
||||
$ws->emit('sendScanResult',['status' => false, 'msg' => "not_table_data"]);
|
||||
}
|
||||
$tableInfo = Table::get(intval($event['table_id']));
|
||||
$serviceRes = ScanTcService::doScanTc($event,$tableInfo);
|
||||
if ($serviceRes['status']){
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('sendScanResult',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $serviceRes['data']]);
|
||||
}else{
|
||||
$ws->emit('sendScanResult',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => $serviceRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
32
app/listener/space/ChangeBoot.php
Normal file
32
app/listener/space/ChangeBoot.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\models\process\Boot;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
class ChangeBoot
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
$modelRes = Boot::changeBoot($tableInfo);
|
||||
if ($modelRes['status'] == true){
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('changeBoot',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $modelRes['data']]);
|
||||
}else{
|
||||
$ws->emit('changeBoot', ['status' => false, 'msg' => $modelRes['msg']]);
|
||||
}
|
||||
}else{
|
||||
$ws->emit('changeBoot', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
app/listener/space/EndBet.php
Normal file
29
app/listener/space/EndBet.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
|
||||
use app\services\process\EndBetService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
class EndBet
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
$res = SocketSession::preliminaryCheck($event,'space');
|
||||
if ($res['status'] == true){
|
||||
$numberTabId = intval($event['number_tab_id']);
|
||||
$tableInfo = $res['data'];
|
||||
EndBetService::endBet($numberTabId,$tableInfo);
|
||||
}else{
|
||||
$ws->emit('endBet', ['status' => false, 'msg' => $res['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
28
app/listener/space/EndRob.php
Normal file
28
app/listener/space/EndRob.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\process\EndRobService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class EndRob
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$res = SocketSession::preliminaryCheck($event,'space');
|
||||
if ($res['status'] == true){
|
||||
$numberTabId = intval($event['number_tab_id']);
|
||||
$tableInfo = $res['data'];
|
||||
EndRobService::endRob($numberTabId,$tableInfo);
|
||||
}else{
|
||||
$ws->emit('endRob', ['status' => false, 'msg' => $res['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/OpeningBaccarat.php
Normal file
27
app/listener/space/OpeningBaccarat.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\opening\OpeningBaccaratService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class OpeningBaccarat
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
OpeningBaccaratService::openingBaccarat($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('openingBaccarat', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/OpeningDice.php
Normal file
27
app/listener/space/OpeningDice.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\opening\OpeningDiceService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class OpeningDice
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
OpeningDiceService::openingDice($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('openingDice', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/OpeningDt.php
Normal file
27
app/listener/space/OpeningDt.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\opening\OpeningDtService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
class OpeningDt
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
OpeningDtService::openingDt($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('openingDt', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/OpeningNn.php
Normal file
27
app/listener/space/OpeningNn.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\opening\OpeningNnService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class OpeningNn
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
OpeningNnService::openingNn($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('openingDt', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/OpeningTc.php
Normal file
27
app/listener/space/OpeningTc.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\opening\OpeningTcService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class OpeningTc
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
OpeningTcService::openingTc($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('openingTc', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/OpeningToning.php
Normal file
27
app/listener/space/OpeningToning.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\opening\OpeningToningService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class OpeningToning
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
OpeningToningService::openingToning($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('openingToning', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/ResetBaccarat.php
Normal file
27
app/listener/space/ResetBaccarat.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\reset\ResetBaccaratService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class ResetBaccarat
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
ResetBaccaratService::resetBaccarat($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('resetBaccarat', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
32
app/listener/space/ResetBoot.php
Normal file
32
app/listener/space/ResetBoot.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\models\process\Sumday;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class ResetBoot
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
$modelRes = Sumday::resetBoot($tableInfo);
|
||||
if ($modelRes['status'] == true){
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('resetBoot',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $modelRes['data']]);
|
||||
}else{
|
||||
$ws->emit('resetBoot', ['status' => false, 'msg' => $modelRes['msg']]);
|
||||
}
|
||||
}else{
|
||||
$ws->emit('resetBoot', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/ResetDt.php
Normal file
27
app/listener/space/ResetDt.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\reset\ResetDtService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class ResetDt
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
ResetDtService::resetDt($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('resetBaccarat', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
28
app/listener/space/ResetNumberTab.php
Normal file
28
app/listener/space/ResetNumberTab.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
|
||||
use app\services\process\ResetNumberTabService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class ResetNumberTab
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$res = SocketSession::preliminaryCheck($event,'space');
|
||||
if ($res['status'] == true){
|
||||
$tableInfo = $res['data'];
|
||||
ResetNumberTabService::resetNumberTabService($tableInfo);
|
||||
}else{
|
||||
$ws->emit('resetNumberTab', ['status' => false, 'msg' => $res['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
app/listener/space/StartBet.php
Normal file
29
app/listener/space/StartBet.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
|
||||
use app\services\process\StartBetService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\WebSocket;
|
||||
|
||||
class StartBet
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, WebSocket $ws)
|
||||
{
|
||||
$res = SocketSession::preliminaryCheck($event,'space');
|
||||
if ($res['status'] == true){
|
||||
$numberTabId = intval($event['number_tab_id']);
|
||||
$tableInfo = $res['data'];
|
||||
StartBetService::startBet($numberTabId,$tableInfo);
|
||||
}else{
|
||||
$ws->emit('startBet', ['status' => false, 'msg' => $res['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
28
app/listener/space/StartRob.php
Normal file
28
app/listener/space/StartRob.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\process\StartRobService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class StartRob
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$res = SocketSession::preliminaryCheck($event,'space');
|
||||
if ($res['status'] == true){
|
||||
$numberTabId = intval($event['number_tab_id']);
|
||||
$tableInfo = $res['data'];
|
||||
StartRobService::startRob($numberTabId,$tableInfo);
|
||||
}else{
|
||||
$ws->emit('startRob', ['status' => false, 'msg' => $res['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/listener/space/openingRoulette.php
Normal file
27
app/listener/space/openingRoulette.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\space;
|
||||
|
||||
use app\services\opening\OpeningRouletteService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class OpeningRoulette
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'space');
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
OpeningRouletteService::openingRoulette($event,$tableInfo,$ws);
|
||||
}else{
|
||||
$ws->emit('openingRoulette', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
40
app/listener/user/CancelBet.php
Normal file
40
app/listener/user/CancelBet.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\user;
|
||||
|
||||
use app\services\bet\CancelBetService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class CancelBet
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'user');
|
||||
$fd = $ws->getSender();
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
if(SocketSession::checkRepeat($fd,'user','isToCancelBet')){
|
||||
$res = CancelBetService::cancelBet($event,$tableInfo);
|
||||
if ($res['status'] == true){
|
||||
$ws->emit('cancelBet',['status' => true, 'table_id' => $tableInfo['id'],'user_id' => $res['user_id'],'manager_id' => $res['manager_id'], 'money' => $res['money'], 'msg' => $res['msg']]);
|
||||
$ws->to(SocketSession::MANAGER_ROOM_NAME)->emit('cancelBet',['status' => true, 'table_id' => $tableInfo['id'],'user_id' => $res['user_id'],'manager_id' => $res['manager_id'], 'money' => $res['money'], 'msg' => $res['msg']]);
|
||||
|
||||
}else{
|
||||
$ws->emit('cancelBet',['status' => false, 'msg' => $res['msg']]);
|
||||
}
|
||||
SocketSession::resetRepeat($fd,'user','isToCancelBet');
|
||||
}else{
|
||||
$ws->emit('toBet',['status' => false, 'msg' => 'notice_repeat']);
|
||||
}
|
||||
}else{
|
||||
$ws->emit('changeBoot', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
60
app/listener/user/ToBet.php
Normal file
60
app/listener/user/ToBet.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\user;
|
||||
|
||||
use app\services\bet\ToBetBaccaratService;
|
||||
use app\services\bet\ToBetDiceService;
|
||||
use app\services\bet\ToBetRouletteService;
|
||||
use app\services\bet\ToBetToningService;
|
||||
use app\services\bet\ToBetDtService;
|
||||
use app\services\bet\ToBetNnService;
|
||||
use app\services\bet\ToBetTcService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class ToBet
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'user');
|
||||
$fd = $ws->getSender();
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
if(SocketSession::checkRepeat($fd,'user','isToBet')){
|
||||
switch ($tableInfo['game_id']){
|
||||
case 1 :
|
||||
ToBetBaccaratService::toBetBaccarat($event,$tableInfo);
|
||||
break;
|
||||
case 2 :
|
||||
ToBetDtService::toBetDt($event,$tableInfo);
|
||||
break;
|
||||
case 4 :
|
||||
ToBetNnService::toBetNn($event,$tableInfo);
|
||||
break;
|
||||
case 5 :
|
||||
ToBetTcService::toBetTc($event,$tableInfo);
|
||||
break;
|
||||
case 6 :
|
||||
ToBetToningService::toBetToning($event, $tableInfo);
|
||||
break;
|
||||
case 7 :
|
||||
ToBetDiceService::toBetDice($event, $tableInfo);
|
||||
break;
|
||||
case 8 :
|
||||
ToBetRouletteService::toBetRoulette($event, $tableInfo);
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
$ws->emit('toBet',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => 'notice_repeat']);
|
||||
}
|
||||
}else{
|
||||
$ws->emit('changeBoot', ['status' => false, 'msg' => $preliminaryCheckRes['msg']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
app/listener/user/ToLeaveSeat.php
Normal file
30
app/listener/user/ToLeaveSeat.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\user;
|
||||
|
||||
use app\services\bet\ToLeaveSeatService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class ToLeaveSeat
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'user');
|
||||
$fd = $ws->getSender();
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
if(SocketSession::checkRepeat($fd,'user','isToLeaveSeat')){
|
||||
ToLeaveSeatService::toLeaveSeat($event,$tableInfo);
|
||||
}else{
|
||||
$ws->emit('toLeaveSeat',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => 'notice_repeat']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
app/listener/user/ToRob.php
Normal file
30
app/listener/user/ToRob.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\user;
|
||||
|
||||
use app\services\bet\ToRobService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class ToRob
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'user');
|
||||
$fd = $ws->getSender();
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
if(SocketSession::checkRepeat($fd,'user','isToRob')){
|
||||
ToRobService::toTob($event,$tableInfo);
|
||||
}else{
|
||||
$ws->emit('toRob',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => 'notice_repeat']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
app/listener/user/ToSeat.php
Normal file
30
app/listener/user/ToSeat.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\listener\user;
|
||||
|
||||
use app\services\bet\ToSeatService;
|
||||
use freedom\utils\SocketSession;
|
||||
use think\swoole\Websocket;
|
||||
|
||||
class ToSeat
|
||||
{
|
||||
/**
|
||||
* 事件监听处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(array $event, Websocket $ws)
|
||||
{
|
||||
$preliminaryCheckRes = SocketSession::preliminaryCheck($event,'user');
|
||||
$fd = $ws->getSender();
|
||||
if($preliminaryCheckRes['status'] == true){
|
||||
$tableInfo = $preliminaryCheckRes['data'];
|
||||
if(SocketSession::checkRepeat($fd,'user','isToSeat')){
|
||||
ToSeatService::toSeat($event,$tableInfo);
|
||||
}else{
|
||||
$ws->emit('toSeat',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => 'notice_repeat']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
app/middleware.php
Normal file
12
app/middleware.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
// 全局中间件定义文件
|
||||
return [
|
||||
// 全局请求缓存
|
||||
// \think\middleware\CheckRequestCache::class,
|
||||
// 多语言加载
|
||||
\think\middleware\LoadLangPack::class,
|
||||
// Session初始化
|
||||
\think\middleware\SessionInit::class,
|
||||
//跨域请求
|
||||
\think\middleware\AllowCrossDomain::class
|
||||
];
|
||||
20
app/middleware/checkLogin.php
Normal file
20
app/middleware/checkLogin.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\middleware;
|
||||
use Closure;
|
||||
use think\facade\Session;
|
||||
class checkLogin
|
||||
{
|
||||
/**
|
||||
* 验证登录中间件,现在使用在操作端
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$user_info = Session::get('user_info');
|
||||
if(empty($user_info)){
|
||||
return redirect('/login/index');
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
BIN
app/models/.DS_Store
vendored
Normal file
BIN
app/models/.DS_Store
vendored
Normal file
Binary file not shown.
712
app/models/bet/Bet.php
Normal file
712
app/models/bet/Bet.php
Normal file
@ -0,0 +1,712 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\models\bet;
|
||||
|
||||
|
||||
use app\models\process\NumberTab;
|
||||
use app\models\user\Recharge;
|
||||
use app\models\user\User;
|
||||
use freedom\basic\BaseModel;
|
||||
use freedom\traits\ModelTrait;
|
||||
use freedom\utils\DiceUtil;
|
||||
use freedom\utils\ToningUtil;
|
||||
use freedom\utils\RouletteUtil;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* TODO 注单Model
|
||||
* Class Bet
|
||||
* @package app\models\bet
|
||||
*/
|
||||
class Bet extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'bet';
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* TODO 获取有效Bet
|
||||
* @param int $numberTabId
|
||||
* @return array
|
||||
*/
|
||||
public static function getByNumberTabIdValid(int $numberTabId, string $field = '*'): array
|
||||
{
|
||||
$select = self::where(['number_tab_id' => $numberTabId, 'status' => 1])->field($field)->select();
|
||||
if (!empty($select)) return $select->toArray();
|
||||
else return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 获取抢庄Bet
|
||||
* @param int $numberTabId
|
||||
* @param int $robBankerId
|
||||
* @return array
|
||||
*/
|
||||
public static function getByNumberTabIdRob(int $numberTabId, int $robBankerId): array
|
||||
{
|
||||
|
||||
$find = self::where(['number_tab_id' => $numberTabId, '', 'status' => 1, 'user_id' => $robBankerId])->find();
|
||||
if ($find) return $find->toArray();
|
||||
else return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 获取非抢庄Bet
|
||||
* @param int $numberTabId
|
||||
* @param int $robBankerId
|
||||
* @return array
|
||||
*/
|
||||
public static function getByNumberTabIdNotRob(int $numberTabId, int $robBankerId): array
|
||||
{
|
||||
|
||||
$select = self::where(['number_tab_id' => $numberTabId, '', 'status' => 1])->where(['user_id','<>',$robBankerId])->select();
|
||||
if ($select) return $select->toArray();
|
||||
else return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 获取今日Win总数
|
||||
* @param int $userId
|
||||
* @return float
|
||||
*/
|
||||
public static function getWinTotalToday(int $userId): float
|
||||
{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$endTime = time();
|
||||
return self::where(['user_id' => $userId])->where('unify_time', ['between',[$startTime,$endTime]])->sum("win_total");
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 获取同局的Bet
|
||||
* @param int $userId
|
||||
* @param int $numberTabId
|
||||
* @return array
|
||||
*/
|
||||
public static function getPrevBetInfo(int $userId, int $numberTabId): array
|
||||
{
|
||||
$find = self::where(['user_id' => $userId, 'number_tab_id' => $numberTabId, 'status' => 1])->order('id DESC')->find();
|
||||
if ($find) return $find->toArray();
|
||||
else return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 抢庄 AllGame
|
||||
* @param array $userInfo
|
||||
* @param array $numberTabInfo
|
||||
* @return bool
|
||||
*/
|
||||
public static function toRob(array $userInfo, array $numberTabInfo): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
NumberTab::where(['id' => $numberTabInfo['id']])->update(['rob_banker_id' => $userInfo['id'], 'rob_banker_username' => $userInfo['username']]);
|
||||
$bet = [
|
||||
'agent_parent_id_path' => $userInfo['agent_parent_id_path'],
|
||||
'user_id' => $userInfo['id'],
|
||||
'username' => $userInfo['username'],
|
||||
'nickname' => $userInfo['nickname'],
|
||||
'table_id' => $numberTabInfo['table_id'],
|
||||
'boot_id' => $numberTabInfo['boot_id'],
|
||||
'boot_num' => $numberTabInfo['boot_num'],
|
||||
'number_tab_id' => $numberTabInfo['id'],
|
||||
'number' => $numberTabInfo['number'],
|
||||
'game_id' => $numberTabInfo['game_id'],
|
||||
'game_name' => $numberTabInfo['game_name'],
|
||||
'table_name' => $numberTabInfo['table_name'],
|
||||
'sumday_id' => $numberTabInfo['sumday_id'],
|
||||
'day' => $numberTabInfo['day'],
|
||||
'money_before_bet' => $userInfo['money'],
|
||||
'money_after_bet' => $userInfo['money'],
|
||||
'create_time' => time(),
|
||||
];
|
||||
self::create($bet);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 落座 AllGame
|
||||
* @param array $userInfo
|
||||
* @param array $numberTabInfo
|
||||
* @param array $tableInfo
|
||||
* @param int $seatNum
|
||||
* @return bool
|
||||
*/
|
||||
public static function toSeat(array $userInfo, array $numberTabInfo, array $tableInfo,int $seatNum): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
$seatArr = json_decode($numberTabInfo['seat_json'],true);
|
||||
if(empty($seatArr[$userInfo['manager_id']])){
|
||||
$seat_num = $tableInfo['seat_num'] >=4 ? $tableInfo['seat_num'] + 1 : $tableInfo['seat_num'];
|
||||
$seat_arr = [];
|
||||
for($i=1;$i<=$seat_num;$i++){
|
||||
if($i != 4){
|
||||
$seat_arr[$i] = 0;
|
||||
}
|
||||
}
|
||||
$managerSeatArr = $seat_arr;
|
||||
}else{
|
||||
$managerSeatArr = $seatArr[$userInfo['manager_id']];
|
||||
}
|
||||
|
||||
$nowSeatNum = array_search($userInfo['id'],$managerSeatArr);
|
||||
if($nowSeatNum){
|
||||
$managerSeatArr[$nowSeatNum] = 0;
|
||||
}
|
||||
$managerSeatArr[$seatNum] = $userInfo['id'];
|
||||
$seatArr[$userInfo['manager_id']] = $managerSeatArr;
|
||||
$newSeatJson = json_encode($seatArr);
|
||||
NumberTab::where(['id' => $numberTabInfo['id']])->update(['seat_json' => $newSeatJson]);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* TODO 离座 AllGame
|
||||
* @param array $userInfo
|
||||
* @param array $numberTabInfo
|
||||
* @return bool
|
||||
*/
|
||||
public static function toLeaveSeat(array $userInfo, array $numberTabInfo): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
$seatArr = json_decode( $numberTabInfo['seat_json'],true);
|
||||
$managerSeatArr = $seatArr[$userInfo['manager_id']];
|
||||
|
||||
$nowSeatNum = array_search($userInfo['id'],$managerSeatArr);
|
||||
if($nowSeatNum){
|
||||
$managerSeatArr[$nowSeatNum] = 0;
|
||||
}
|
||||
$seatArr[$userInfo['manager_id']] = $managerSeatArr;
|
||||
$newSeatJson = json_encode($seatArr);
|
||||
NumberTab::where(['id' => $numberTabInfo['id']])->update(['seat_json' => $newSeatJson]);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO toBet AllGame
|
||||
* @param array $tableInfo 桌子信息
|
||||
* @param array $userInfo 用户信息
|
||||
* @param array $numberTabInfo 铺信息
|
||||
* @param array $prevBetInfo 上一次的注单信息
|
||||
* @param array $betAmount 当前的下注信息
|
||||
* @param int $seat_num 座位号
|
||||
* @param array $betTotalAmount 用户当前铺总额信息
|
||||
* @param int $time 时间
|
||||
* @param int $baccaratType 百家乐免佣抽佣
|
||||
* @param string $rouletteType 骰子欧式法式
|
||||
* @return bool
|
||||
*/
|
||||
public static function toBet(
|
||||
array $tableInfo,
|
||||
array $userInfo,
|
||||
array $numberTabInfo,
|
||||
array $prevBetInfo,
|
||||
array $betAmount,
|
||||
int $seat_num,
|
||||
array $betTotalAmount,
|
||||
int $time,
|
||||
int $baccaratType,
|
||||
string $rouletteType = ''
|
||||
): bool {
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
// number_tab 铺表总额更新
|
||||
if ($tableInfo['game_id'] == 1){
|
||||
NumberTab::where('id',$numberTabInfo['id'])
|
||||
->inc('banker_amount',$betAmount['banker_amount'])
|
||||
->inc('player_amount',$betAmount['player_amount'])
|
||||
->inc('tie_amount',$betAmount['tie_amount'])
|
||||
->inc('banker_pair_amount',$betAmount['banker_pair_amount'])
|
||||
->inc('player_pair_amount',$betAmount['player_pair_amount'])
|
||||
->inc('luck_six_amount',$betAmount['luck_six_amount'])
|
||||
->inc('big_amount',$betAmount['big_amount'])
|
||||
->inc('small_amount',$betAmount['small_amount'])
|
||||
->update();
|
||||
} elseif ($tableInfo['game_id'] == 2){
|
||||
NumberTab::where('id',$numberTabInfo['id'])
|
||||
->inc('banker_amount',$betAmount['banker_amount'])
|
||||
->inc('player_amount',$betAmount['player_amount'])
|
||||
->inc('tie_amount',$betAmount['tie_amount'])
|
||||
->update();
|
||||
} elseif ($tableInfo['game_id'] == 4 || $tableInfo['game_id'] == 5){
|
||||
NumberTab::where('id',$numberTabInfo['id'])
|
||||
->inc('amount_player_1',$betAmount['amount_player_1'])
|
||||
->inc('amount_player_1_times',$betAmount['amount_player_1_times'])
|
||||
->inc('withhold_player_1_times',$betAmount['withhold_player_1_times'])
|
||||
->inc('amount_player_1_banker',$betAmount['amount_player_1_banker'])
|
||||
->inc('amount_player_1_banker_times',$betAmount['amount_player_1_banker_times'])
|
||||
->inc('withhold_player_1_banker_times',$betAmount['withhold_player_1_banker_times'])
|
||||
->inc('amount_player_2',$betAmount['amount_player_2'])
|
||||
->inc('amount_player_2_times',$betAmount['amount_player_2_times'])
|
||||
->inc('withhold_player_2_times',$betAmount['withhold_player_2_times'])
|
||||
->inc('amount_player_2_banker',$betAmount['amount_player_2_banker'])
|
||||
->inc('amount_player_2_banker_times',$betAmount['amount_player_2_banker_times'])
|
||||
->inc('withhold_player_2_banker_times',$betAmount['withhold_player_2_banker_times'])
|
||||
->inc('amount_player_3',$betAmount['amount_player_3'])
|
||||
->inc('amount_player_3_times',$betAmount['amount_player_3_times'])
|
||||
->inc('withhold_player_3_times',$betAmount['withhold_player_3_times'])
|
||||
->inc('amount_player_3_banker',$betAmount['amount_player_3_banker'])
|
||||
->inc('amount_player_3_banker_times',$betAmount['amount_player_3_banker_times'])
|
||||
->inc('withhold_player_3_banker_times',$betAmount['withhold_player_3_banker_times'])
|
||||
->update();
|
||||
} elseif ($tableInfo['game_id'] == 6){
|
||||
$beforeAmountString = $numberTabInfo['toning_amount'];
|
||||
$beforeAmountArray = string_to_array($beforeAmountString);
|
||||
$afterAmountArray = ToningUtil::amountInc($beforeAmountArray, $betAmount);
|
||||
NumberTab::where('id',$numberTabInfo['id'])->update(['toning_amount' => array_to_string($afterAmountArray)]);
|
||||
} elseif ($tableInfo['game_id'] == 7){
|
||||
$beforeAmountString = $numberTabInfo['dice_amount'];
|
||||
$beforeAmountArray = string_to_array($beforeAmountString);
|
||||
$afterAmountArray = DiceUtil::amountInc($beforeAmountArray, $betAmount);
|
||||
NumberTab::where('id',$numberTabInfo['id'])->update(['dice_amount' => array_to_string($afterAmountArray)]);
|
||||
} elseif ($tableInfo['game_id'] == 8){
|
||||
$beforeAmountString = $numberTabInfo[$rouletteType];
|
||||
$beforeAmountArray = string_to_array($beforeAmountString);
|
||||
$afterAmountArray = RouletteUtil::amountInc($beforeAmountArray, $betAmount);
|
||||
NumberTab::where('id',$numberTabInfo['id'])->update([ $rouletteType => array_to_string($afterAmountArray)]);
|
||||
}
|
||||
$amount = array_sum($betAmount);
|
||||
$totalAmount = array_sum($betTotalAmount);
|
||||
User::where('id',$userInfo['id'])->dec('money',$amount)->update();
|
||||
if($prevBetInfo){
|
||||
$bet = ['id' => $prevBetInfo['id'], 'amount' => $totalAmount, 'money_after_bet' => $userInfo['money'] - $amount];
|
||||
if ($tableInfo['game_id'] == 6){
|
||||
$bet['toning_amount'] = array_to_string($betTotalAmount);
|
||||
} elseif($tableInfo['game_id'] == 7){
|
||||
$bet['dice_amount'] = array_to_string($betTotalAmount);
|
||||
} elseif($tableInfo['game_id'] == 8){
|
||||
$bet[$rouletteType] = array_to_string($betTotalAmount);
|
||||
} else {
|
||||
$bet = array_merge($bet,$betTotalAmount);
|
||||
}
|
||||
$bet['seat_num'] = $seat_num;
|
||||
$bet['manager_id'] = $userInfo['manager_id'];
|
||||
self::where(['id' => $prevBetInfo['id']])->update($bet);
|
||||
}else{
|
||||
$bet = array(
|
||||
'user_id' => $userInfo['id'],
|
||||
'agent_parent_id_path' => $userInfo['agent_parent_id_path'],
|
||||
'username' => $userInfo['username'],
|
||||
'nickname' => $userInfo['nickname'],
|
||||
'table_id' => $tableInfo['id'],
|
||||
'boot_id' => $numberTabInfo['boot_id'],
|
||||
'boot_num' => $numberTabInfo['boot_num'],
|
||||
'number_tab_id' => $numberTabInfo['id'],
|
||||
'number' => $numberTabInfo['number'],
|
||||
'game_id' => $tableInfo['game_id'],
|
||||
'game_name' => $tableInfo['game_name'],
|
||||
'table_name' => $tableInfo['table_name'],
|
||||
'sumday_id' => $numberTabInfo['sumday_id'],
|
||||
'day' => $numberTabInfo['day'],
|
||||
'amount' => $totalAmount,
|
||||
'money_before_bet' => $userInfo['money'],
|
||||
'money_after_bet' => $userInfo['money'] - $amount,
|
||||
'unify_time' => $numberTabInfo['unify_time'],
|
||||
'create_time' => $time,
|
||||
'baccarat_type' => $baccaratType,
|
||||
'seat_num' => $seat_num,
|
||||
'manager_id' => $userInfo['manager_id']
|
||||
);
|
||||
if ($tableInfo['game_id'] == 6){
|
||||
$bet['toning_amount'] = array_to_string($betTotalAmount);
|
||||
} elseif ($tableInfo['game_id'] == 7){
|
||||
$bet['dice_amount'] = array_to_string($betTotalAmount);
|
||||
} elseif ($tableInfo['game_id'] == 8){
|
||||
$bet[$rouletteType] = array_to_string($betTotalAmount);
|
||||
} else {
|
||||
$bet = array_merge($bet,$betTotalAmount);
|
||||
}
|
||||
self::create($bet);
|
||||
}
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e){
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* TODO openingBet AllGame
|
||||
* @param array $tableInfo 桌子信息
|
||||
* @param array $betInfo 注单信息
|
||||
* @param array $userInfo 用户信息
|
||||
* @param array $numberTabInfo 铺信息
|
||||
* @param float $amount 下注总数
|
||||
* @param float $winTotal 赢钱金额
|
||||
* @param float $rebate 洗码量
|
||||
* @param float $withholdAmount 翻倍下注数
|
||||
* @return array
|
||||
*/
|
||||
public static function openingBet(
|
||||
array $tableInfo,
|
||||
array $betInfo,
|
||||
array $userInfo,
|
||||
array $numberTabInfo,
|
||||
float $amount,
|
||||
float $winTotal,
|
||||
float $rebate,
|
||||
float $withholdAmount = 0
|
||||
): array
|
||||
{
|
||||
$time = time();
|
||||
Db::startTrans();
|
||||
try {
|
||||
// 更新user表余额
|
||||
$money = $userInfo['money'] + $winTotal + $amount + $withholdAmount;
|
||||
$updateMoney = round(($winTotal + $amount + $withholdAmount),2);
|
||||
User::where(['id' => $userInfo['id']])->inc('money',$updateMoney)->update();
|
||||
// 更新bet表
|
||||
if ($numberTabInfo['game_id'] == 1 || $numberTabInfo['game_id'] == 2){
|
||||
$betUpdate = ['result' => $numberTabInfo['result'], 'win_total' => $winTotal, 'end_money' => $money, 'is_end' => 1];
|
||||
} elseif ($numberTabInfo['game_id'] == 6){
|
||||
$betUpdate = ['toning_result' => $numberTabInfo['toning_result'], 'win_total' => $winTotal, 'end_money' => $money, 'is_end' => 1];
|
||||
} elseif ($numberTabInfo['game_id'] == 7){
|
||||
$betUpdate = ['dice_result' => $numberTabInfo['dice_result'], 'win_total' => $winTotal, 'end_money' => $money, 'is_end' => 1];
|
||||
} elseif ($numberTabInfo['game_id'] == 8){
|
||||
$betUpdate = ['roulette_result' => $numberTabInfo['roulette_result'], 'win_total' => $winTotal, 'end_money' => $money, 'is_end' => 1];
|
||||
}else {
|
||||
$betUpdate = ['win_total' => $winTotal, 'end_money' => $money, 'is_end' => 1];
|
||||
}
|
||||
if (in_array($tableInfo['game_id'],[4,5])){
|
||||
$betUpdate['position_first'] = $betInfo['position_first'];
|
||||
$betUpdate['result_player_1'] = $betInfo['result_player_1'];
|
||||
$betUpdate['result_player_2'] = $betInfo['result_player_2'];
|
||||
$betUpdate['result_player_3'] = $betInfo['result_player_3'];
|
||||
$betUpdate['result_banker'] = $betInfo['result_banker'];
|
||||
$betUpdate['win_player_1'] = $betInfo['win_player_1'];
|
||||
$betUpdate['win_player_2'] = $betInfo['win_player_2'];
|
||||
$betUpdate['win_player_3'] = $betInfo['win_player_3'];
|
||||
$betUpdate['times_player_1'] = $betInfo['times_player_1'];
|
||||
$betUpdate['times_player_2'] = $betInfo['times_player_2'];
|
||||
$betUpdate['times_player_3'] = $betInfo['times_player_3'];
|
||||
}
|
||||
self::where(['id' => $betInfo['id']])->update($betUpdate);
|
||||
/* 处理洗码及占股 */
|
||||
$agent = explode(',', $userInfo['agent_parent_id_path']);
|
||||
$generalAgent = User::get(intval($agent[0]));
|
||||
if($numberTabInfo['game_id'] == 5){
|
||||
$betXimalv = $generalAgent['agent_ximalv_tc'];
|
||||
}elseif($numberTabInfo['game_id'] == 4){
|
||||
$betXimalv = $generalAgent['agent_ximalv_nn'];
|
||||
}elseif($numberTabInfo['game_id'] == 2){
|
||||
$betXimalv = $generalAgent['agent_ximalv_dt'];
|
||||
}else{
|
||||
$betXimalv = $generalAgent['agent_ximalv'];
|
||||
}
|
||||
$betMaliang = round(($rebate * $betXimalv) / 100,2);
|
||||
krsort($agent);
|
||||
$nextCs = 0;
|
||||
$nextMaliang = 0;
|
||||
$nextZhanGulv = 0;
|
||||
$nextRebate = 0;
|
||||
foreach($agent as $key => $value){
|
||||
$userPathInfo = User::get($value);
|
||||
if($userPathInfo){
|
||||
$maliang = 0;
|
||||
if($numberTabInfo['game_id'] == 5){
|
||||
$ximalv = $userPathInfo['agent_ximalv_tc'];
|
||||
}elseif($numberTabInfo['game_id'] == 4){
|
||||
$ximalv = $userPathInfo['agent_ximalv_nn'];
|
||||
}elseif($numberTabInfo['game_id'] == 2){
|
||||
$ximalv = $userPathInfo['agent_ximalv_dt'];
|
||||
}else{
|
||||
$ximalv = $userPathInfo['agent_ximalv'];
|
||||
}
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$netZhangulv = round(($userPathInfo['agent_cs'] / 100 - $nextZhanGulv),2);
|
||||
if($tableInfo['is_xima'] == 1 && $rebate > 0){
|
||||
$maliang = round(($rebate * $ximalv) / 100,2);
|
||||
$netMaliang = $maliang - $nextMaliang;
|
||||
$shareMaliang = $betMaliang * $netZhangulv;
|
||||
$percentMaliang = round(($userPathInfo['agent_cs'] / 100) * $betMaliang, 2);
|
||||
if($userPathInfo['share_xima'] == 2){
|
||||
$nextLevelMaliang = $maliang - $percentMaliang;
|
||||
}else{
|
||||
$nextLevelMaliang = $maliang;
|
||||
}
|
||||
$maliangTrue = $netMaliang - $shareMaliang;
|
||||
//判断是否即时结算洗吗
|
||||
$insertXima = array(
|
||||
'agent_parent_id_path' => $userInfo['agent_parent_id_path'],
|
||||
'user_id' => $value,
|
||||
'bet_user_id' => $userInfo['id'],
|
||||
'bet_id' => $betInfo['id'],
|
||||
'game_id' => $betInfo['game_id'],
|
||||
'table_id' => $betInfo['table_id'],
|
||||
'game_name' => $betInfo['game_name'],
|
||||
'table_name' => $betInfo['table_name'],
|
||||
'boot_num' => $betInfo['boot_num'],
|
||||
'number' => $betInfo['number'],
|
||||
'sumday_id' => $betInfo['sumday_id'],
|
||||
'day' => $betInfo['day'],
|
||||
'number_tab_id' => $betInfo['number_tab_id'],
|
||||
'boot_id' => $betInfo['boot_id'],
|
||||
'ximaliang' => $rebate,
|
||||
'ximalv' => $ximalv,
|
||||
'maliang' => $maliang,
|
||||
'maliang_true' => $maliangTrue,
|
||||
'total' => $amount,
|
||||
'win_total' => $winTotal,
|
||||
'create_time' => $time,
|
||||
'unify_time' => $betInfo['unify_time'],
|
||||
'type' => $type,
|
||||
'net_maliang' => $netMaliang,
|
||||
'bet_maliang' => $betMaliang,
|
||||
'agent_cs' => $userPathInfo['agent_cs'],
|
||||
'net_agent_cs' => $netZhangulv,
|
||||
'share_maliang' => $shareMaliang,
|
||||
'percent_maliang' => $percentMaliang,
|
||||
'next_level_maliang' => $nextLevelMaliang,
|
||||
);
|
||||
if($generalAgent['now_checkout_xima'] == 1 && $betInfo['user_id'] == $userPathInfo['id'] && $userPathInfo['agent'] == 0){
|
||||
// 判断上级余额扣为负数
|
||||
$parentInfo = User::where(['id' => $userPathInfo['agent_parent_id']])->find();
|
||||
if(SETTLE_MONEY_EXCEED_PARENT_MONTY == 1 || $maliang <= $parentInfo['money']){
|
||||
// 洗码表记录状态
|
||||
$insertXima['is_checkout'] = 1;
|
||||
$insertXima['checkout_time'] = $time;
|
||||
|
||||
// 增加用户余额
|
||||
User::where(['id' => $userPathInfo['id']])->inc('money',$maliang)->update();
|
||||
$money = $money + $maliangTrue;
|
||||
|
||||
// 添加用户上分记录
|
||||
$userScoreData = [
|
||||
'type' => 2,
|
||||
'amount' => $maliang,
|
||||
'mode' => 1,
|
||||
'agent_or_admin' => 4,
|
||||
'controller_type' => '系统即时结算',
|
||||
'user_id' => $userPathInfo['id'],
|
||||
'user_type' => $userPathInfo['agent'],
|
||||
'user_agent_level' => $userPathInfo['agent_level'],
|
||||
'username_for' => $userPathInfo['username'],
|
||||
'nickname_for' => $userPathInfo['nickname'],
|
||||
'user_parent_id' => $userPathInfo['agent_parent_id'],
|
||||
'create_time' => $time,
|
||||
'old_money' => $userPathInfo['money'],
|
||||
'new_money' => $userPathInfo['money'] + $maliang,
|
||||
'controller_old_money' => $parentInfo['money'],
|
||||
'controller_new_money' => $parentInfo['money'] - $maliang,
|
||||
'controller_system' => 4,
|
||||
];
|
||||
Recharge::create($userScoreData);
|
||||
|
||||
// 扣除上级余额
|
||||
User::where(['id' => $parentInfo['id']])->dec('money',$maliang)->update();
|
||||
|
||||
// 添加用户上分记录
|
||||
$userScoreData = [
|
||||
'type' => 2,
|
||||
'amount' => $maliang,
|
||||
'mode' => 2,
|
||||
'agent_or_admin' => 4,
|
||||
'controller_type' => '系统即时结算',
|
||||
'user_id' => $parentInfo['id'],
|
||||
'user_type' => $parentInfo['agent'],
|
||||
'user_agent_level' => $parentInfo['agent_level'],
|
||||
'username_for' => $parentInfo['username'],
|
||||
'nickname_for' => $parentInfo['nickname'],
|
||||
'user_parent_id' => $parentInfo['agent_parent_id'],
|
||||
'create_time' => $time,
|
||||
'old_money' => $parentInfo['money'],
|
||||
'new_money' => $parentInfo['money'] - $maliang,
|
||||
'controller_old_money' => $parentInfo['money'],
|
||||
'controller_new_money' => $parentInfo['money'] - $maliang,
|
||||
'controller_system' => 4,
|
||||
];
|
||||
Recharge::create($userScoreData);
|
||||
|
||||
// 添加洗码结算记录
|
||||
$ximaLogData = [
|
||||
'user_id' => $userPathInfo['id'],
|
||||
'username' => $userPathInfo['username'],
|
||||
'admin_or_agent' => 4,
|
||||
'ximaliang' => $rebate,
|
||||
'maliang' => $maliang,
|
||||
'agent_ximalv' => $userPathInfo['agent_ximalv'].'/'.$userPathInfo['agent_ximalv_dt'].'/'.$userPathInfo['agent_ximalv_nn'].'/'.$userPathInfo['agent_ximalv_tc'],
|
||||
'create_time' => $time,
|
||||
'old_money' => $userPathInfo['money'],
|
||||
'new_money' => $userPathInfo['money'] + $maliang,
|
||||
'type' => 1, // 洗码上分
|
||||
];
|
||||
XimaLog::create($ximaLogData);
|
||||
}
|
||||
|
||||
}
|
||||
Xima::create($insertXima);
|
||||
$nextMaliang = $netMaliang + $nextMaliang;
|
||||
}
|
||||
//计算占股
|
||||
$shareAmount = to_number(round(($userPathInfo['agent_cs'] * $winTotal) / 100,2));
|
||||
$shareAmountTrue = to_number(round(($netZhangulv * $winTotal),2));
|
||||
$netCs = $shareAmount - $nextCs;
|
||||
$insertCs = array(
|
||||
'agent_parent_id_path' => $userInfo['agent_parent_id_path'],
|
||||
'user_id' => $value,
|
||||
'bet_user_id' => $userInfo['id'],
|
||||
'bet_id' => $betInfo['id'],
|
||||
'game_id' => $betInfo['game_id'],
|
||||
'table_id' => $betInfo['table_id'],
|
||||
'game_name' => $betInfo['game_name'],
|
||||
'table_name' => $betInfo['table_name'],
|
||||
'boot_num' => $betInfo['boot_num'],
|
||||
'number' => $betInfo['number'],
|
||||
'number_tab_id' => $betInfo['number_tab_id'],
|
||||
'boot_id' => $betInfo['boot_id'],
|
||||
'sumday_id' => $betInfo['sumday_id'],
|
||||
'day' => $betInfo['day'],
|
||||
'share_amount' => $shareAmount,
|
||||
'share_amount_true' => $shareAmountTrue,
|
||||
'share_percent' => $userPathInfo['agent_cs'],
|
||||
'total' => $amount,
|
||||
'win_total' => $winTotal,
|
||||
'create_time' => $time,
|
||||
'unify_time' => $betInfo['unify_time'],
|
||||
'type' => $type,
|
||||
'net_cs' => $netCs,
|
||||
'maliang' => $maliang,
|
||||
'share_maliang' => $shareMaliang ?? 0,
|
||||
'net_maliang' => $netMaliang ?? 0,
|
||||
);
|
||||
Cs::create($insertCs);
|
||||
$nextZhanGulv = $netZhangulv + $nextZhanGulv;
|
||||
$nextCs = $netCs + $nextCs;
|
||||
|
||||
// 计算返水
|
||||
$rebateRate = $userPathInfo['rebate_rate'];
|
||||
if($generalAgent['agent_type'] == 1){
|
||||
$rebateAmount = ($amount * $rebateRate) / 100;
|
||||
$rebateAmountActual = $rebateAmount - $nextRebate;
|
||||
$insertRebate = array(
|
||||
'agent_parent_id_path' => $userInfo['agent_parent_id_path'],
|
||||
'user_id' => $value,
|
||||
'bet_user_id' => $userInfo['id'],
|
||||
'bet_id' => $betInfo['id'],
|
||||
'game_id' => $betInfo['game_id'],
|
||||
'table_id' => $betInfo['table_id'],
|
||||
'game_name' => $betInfo['game_name'],
|
||||
'table_name' => $betInfo['table_name'],
|
||||
'boot_num' => $betInfo['boot_num'],
|
||||
'number' => $betInfo['number'],
|
||||
'sumday_id' => $betInfo['sumday_id'],
|
||||
'day' => $betInfo['day'],
|
||||
'number_tab_id' => $betInfo['number_tab_id'],
|
||||
'boot_id' => $betInfo['boot_id'],
|
||||
'amount' => $amount,
|
||||
'rebate_amount' => $rebateAmount,
|
||||
'rebate_amount_actual' => $rebateAmountActual,
|
||||
'rebate_rate' => $rebateRate,
|
||||
'create_time' => $time,
|
||||
'unify_time' => $betInfo['unify_time'],
|
||||
);
|
||||
Rebate::create($insertRebate);
|
||||
$nextRebate = $rebateAmountActual + $nextRebate;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 提交事务
|
||||
Db::commit();
|
||||
return ['status' => true, 'msg' => 'opening_success', 'money' => $money];
|
||||
} catch (\Exception $e) {
|
||||
// 回滚事务
|
||||
Db::rollback();
|
||||
return ['status' => false, 'msg' => 'opening_fail'];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* TODO cancelBet AllGame
|
||||
* @param array $tableInfo
|
||||
* @param array $numberTabInfo
|
||||
* @param array $userInfo
|
||||
* @param array $prevBetInfo
|
||||
* @return array
|
||||
*/
|
||||
public static function cancelBet(array $tableInfo, array $numberTabInfo, array $userInfo, array $prevBetInfo): array{
|
||||
Db::startTrans();
|
||||
try {
|
||||
if($tableInfo['game_id'] == 1){
|
||||
$updateNumberTab = array(
|
||||
'banker_amount' => $numberTabInfo['banker_amount'] - $prevBetInfo['banker_amount'],
|
||||
'player_amount' => $numberTabInfo['player_amount'] - $prevBetInfo['player_amount'],
|
||||
'tie_amount' => $numberTabInfo['tie_amount'] - $prevBetInfo['tie_amount'],
|
||||
'banker_pair_amount' => $numberTabInfo['banker_pair_amount'] - $prevBetInfo['banker_pair_amount'],
|
||||
'player_pair_amount' => $numberTabInfo['player_pair_amount'] - $prevBetInfo['player_pair_amount'],
|
||||
'luck_six_amount' => $numberTabInfo['luck_six_amount'] - $prevBetInfo['luck_six_amount'],
|
||||
'big_amount' => $numberTabInfo['big_amount'] - $prevBetInfo['big_amount'],
|
||||
'small_amount' => $numberTabInfo['player_pair_amount'] - $prevBetInfo['small_amount']
|
||||
);
|
||||
}elseif($tableInfo['game_id'] == 2){
|
||||
$updateNumberTab = array(
|
||||
'banker_amount' => $numberTabInfo['banker_amount'] - $prevBetInfo['banker_amount'],
|
||||
'player_amount' => $numberTabInfo['player_amount'] - $prevBetInfo['player_amount'],
|
||||
'tie_amount' => $numberTabInfo['tie_amount'] - $prevBetInfo['tie_amount'],
|
||||
);
|
||||
}elseif($tableInfo['game_id'] == 4 || $tableInfo['game_id'] == 5){
|
||||
$updateNumberTab = array(
|
||||
'amount_player_1' => $numberTabInfo['amount_player_1'] - $prevBetInfo['amount_player_1'],
|
||||
'amount_player_1_times' => $numberTabInfo['amount_player_1_times'] - $prevBetInfo['amount_player_1_times'],
|
||||
'withhold_player_1_times' => $numberTabInfo['withhold_player_1_times'] - $prevBetInfo['withhold_player_1_times'],
|
||||
'amount_player_1_banker' => $numberTabInfo['amount_player_1_banker'] - $prevBetInfo['amount_player_1_banker'],
|
||||
'amount_player_1_banker_times' => $numberTabInfo['amount_player_1_banker_times'] - $prevBetInfo['amount_player_1_banker_times'],
|
||||
'withhold_player_1_banker_times' => $numberTabInfo['withhold_player_1_banker_times'] - $prevBetInfo['withhold_player_1_banker_times'],
|
||||
|
||||
'amount_player_2' => $numberTabInfo['amount_player_2'] - $prevBetInfo['amount_player_2'],
|
||||
'amount_player_2_times' => $numberTabInfo['amount_player_2_times'] - $prevBetInfo['amount_player_2_times'],
|
||||
'withhold_player_2_times' => $numberTabInfo['withhold_player_2_times'] - $prevBetInfo['withhold_player_2_times'],
|
||||
'amount_player_2_banker' => $numberTabInfo['amount_player_2_banker'] - $prevBetInfo['amount_player_2_banker'],
|
||||
'amount_player_2_banker_times' => $numberTabInfo['amount_player_2_banker_times'] - $prevBetInfo['amount_player_2_banker_times'],
|
||||
'withhold_player_2_banker_times' => $numberTabInfo['withhold_player_2_banker_times'] - $prevBetInfo['withhold_player_2_banker_times'],
|
||||
|
||||
'amount_player_3' => $numberTabInfo['amount_player_3'] - $prevBetInfo['amount_player_3'],
|
||||
'amount_player_3_times' => $numberTabInfo['amount_player_3_times'] - $prevBetInfo['amount_player_3_times'],
|
||||
'withhold_player_3_times' => $numberTabInfo['withhold_player_3_times'] - $prevBetInfo['withhold_player_3_times'],
|
||||
'amount_player_3_banker' => $numberTabInfo['amount_player_3_banker'] - $prevBetInfo['amount_player_3_banker'],
|
||||
'amount_player_3_banker_times' => $numberTabInfo['amount_player_3_banker_times'] - $prevBetInfo['amount_player_3_banker_times'],
|
||||
'withhold_player_3_banker_times' => $numberTabInfo['withhold_player_3_banker_times'] - $prevBetInfo['withhold_player_3_banker_times'],
|
||||
);
|
||||
}
|
||||
NumberTab::where(['id' => $numberTabInfo['id']])->update($updateNumberTab);
|
||||
//删除bet表下注记录,并且更新会员余分
|
||||
Bet::where(['table_id' => $tableInfo['id'], 'number_tab_id' => $numberTabInfo['id'], 'user_id' => $userInfo['id']])->delete();
|
||||
if($tableInfo['game_id'] == 4){
|
||||
$returnMoney = round(($prevBetInfo['withhold_amount'] + $prevBetInfo['amount']), 2);
|
||||
}else{
|
||||
$returnMoney = $prevBetInfo['amount'];
|
||||
}
|
||||
User::where(['id' => $userInfo['id']])->inc('money',$returnMoney)->update();
|
||||
$newMoney = round(($userInfo['money'] + $returnMoney), 2);
|
||||
Db::commit();
|
||||
return ['status' => true, 'table_id' => $tableInfo['id'], 'user_id' => $userInfo['id'], 'manager_id' => $userInfo['manager_id'],'msg' => 'cancel_bet_success', 'money' => $newMoney];
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
return ['status' => false, 'msg' => 'cannot_cancel_bet'];
|
||||
}
|
||||
}
|
||||
}
|
||||
36
app/models/bet/Cs.php
Normal file
36
app/models/bet/Cs.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\models\bet;
|
||||
|
||||
|
||||
use freedom\basic\BaseModel;
|
||||
use freedom\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* TODO 占股表Model
|
||||
* Class Bet
|
||||
* @package app\models\bet
|
||||
*/
|
||||
class Cs extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'cs';
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
public static function getByNumberTabIdValid(int $numberTabId, string $field = '*'): array
|
||||
{
|
||||
$select = self::where(['number_tab_id' => $numberTabId])->field($field)->select();
|
||||
if (!empty($select)) return $select->toArray();
|
||||
else return [];
|
||||
}
|
||||
}
|
||||
36
app/models/bet/Rebate.php
Normal file
36
app/models/bet/Rebate.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\models\bet;
|
||||
|
||||
|
||||
use freedom\basic\BaseModel;
|
||||
use freedom\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* TODO 洗码表Model
|
||||
* Class Bet
|
||||
* @package app\models\bet
|
||||
*/
|
||||
class Rebate extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'rebate';
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
public static function getByNumberTabIdValid(int $numberTabId, string $field = '*'): array
|
||||
{
|
||||
$select = self::where(['number_tab_id' => $numberTabId])->field($field)->select();
|
||||
if (!empty($select)) return $select->toArray();
|
||||
else return [];
|
||||
}
|
||||
}
|
||||
36
app/models/bet/Xima.php
Normal file
36
app/models/bet/Xima.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\models\bet;
|
||||
|
||||
|
||||
use freedom\basic\BaseModel;
|
||||
use freedom\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* TODO 洗码表Model
|
||||
* Class Bet
|
||||
* @package app\models\bet
|
||||
*/
|
||||
class Xima extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'xima';
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
public static function getByNumberTabIdValid(int $numberTabId, string $field = '*'): array
|
||||
{
|
||||
$select = self::where(['number_tab_id' => $numberTabId])->field($field)->select();
|
||||
if (!empty($select)) return $select->toArray();
|
||||
else return [];
|
||||
}
|
||||
}
|
||||
29
app/models/bet/XimaLog.php
Normal file
29
app/models/bet/XimaLog.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\models\bet;
|
||||
|
||||
|
||||
use freedom\basic\BaseModel;
|
||||
use freedom\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* TODO 洗码结算表Model
|
||||
* Class Bet
|
||||
* @package app\models\bet
|
||||
*/
|
||||
class XimaLog extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'xima_log';
|
||||
|
||||
use ModelTrait;
|
||||
}
|
||||
88
app/models/card/Card.php
Normal file
88
app/models/card/Card.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\models\card;
|
||||
|
||||
|
||||
use freedom\basic\BaseModel;
|
||||
use freedom\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* TODO 百家乐牌数据
|
||||
* Class Card
|
||||
* @package app\models\table
|
||||
*/
|
||||
class Card extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'card';
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 牌数据保存
|
||||
* @param int $numberTabId
|
||||
* @param array $cardInfo
|
||||
* @return bool
|
||||
*/
|
||||
public static function saveAndUpdateCard(int $numberTabId, int $position, int $card):bool
|
||||
{
|
||||
$update = [];
|
||||
switch ($position){
|
||||
case 11:
|
||||
$update['player_1'] = $card;
|
||||
break;
|
||||
case 12:
|
||||
$update['player_2'] = $card;
|
||||
break;
|
||||
case 13:
|
||||
$update['player_3'] = $card;
|
||||
break;
|
||||
case 21:
|
||||
$update['banker_1'] = $card;
|
||||
break;
|
||||
case 22:
|
||||
$update['banker_2'] = $card;
|
||||
break;
|
||||
case 23:
|
||||
$update['banker_3'] = $card;
|
||||
break;
|
||||
}
|
||||
if (empty($update)) return false;
|
||||
$card = self::where(['number_tab_id' => $numberTabId])->find();
|
||||
if ($card){
|
||||
$res = self::where(['id' => $card['id']])->update($update);
|
||||
} else {
|
||||
$insert = [
|
||||
'number_tab_id' => $numberTabId,
|
||||
'create_time' => time()
|
||||
];
|
||||
$insert = array_merge($insert, $update);
|
||||
$res = self::create($insert);
|
||||
}
|
||||
return (bool)$res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取卡牌
|
||||
* @param int $numberTabId
|
||||
* @return array
|
||||
*/
|
||||
public static function getCard(int $numberTabId): array
|
||||
{
|
||||
$card = self::where(['number_tab_id' => $numberTabId])->field('banker_1,banker_2,banker_3,player_1,player_2,player_3')->find();
|
||||
if ($card) {
|
||||
return $card->toArray();
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user