From bb21eac180a835999638a0de0c3491656fd4d12e Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Mon, 7 Nov 2016 00:32:52 +0800 Subject: [PATCH] =?UTF-8?q?added=20=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=96=B0=E6=A1=86=E6=9E=B6=E7=9A=84=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 33 +++ application/index/controller/Base.php | 13 + application/index/controller/Help.php | 20 ++ application/index/controller/Index.php | 11 +- application/index/controller/Product.php | 50 ++++ application/index/controller/User.php | 150 +++++++++- application/index/model/User.php | 9 - application/index/model/index.html | 0 application/index/view/help/base.html | 82 ++++++ application/index/view/help/index.html | 9 + application/index/view/help/pro1.html | 127 ++++++++ application/index/view/help/pro2.html | 127 ++++++++ application/index/view/help/pro3.html | 127 ++++++++ application/index/view/index/index.html | 83 +++++- application/index/view/product/index.html | 321 +++++++++++++++++++++ application/index/view/public/base.html | 44 +++ application/index/view/user/adminList.html | 48 +++ application/index/view/user/index.html | 53 ++++ application/index/view/user/recover.html | 93 ++++++ application/index/view/user/register.html | 100 +++++++ 20 files changed, 1486 insertions(+), 14 deletions(-) create mode 100644 application/index/controller/Help.php create mode 100644 application/index/controller/Product.php delete mode 100644 application/index/model/User.php create mode 100644 application/index/model/index.html create mode 100644 application/index/view/help/base.html create mode 100644 application/index/view/help/index.html create mode 100644 application/index/view/help/pro1.html create mode 100644 application/index/view/help/pro2.html create mode 100644 application/index/view/help/pro3.html create mode 100644 application/index/view/product/index.html create mode 100644 application/index/view/public/base.html create mode 100644 application/index/view/user/adminList.html create mode 100644 application/index/view/user/index.html create mode 100644 application/index/view/user/recover.html create mode 100644 application/index/view/user/register.html diff --git a/application/common.php b/application/common.php index 55d22f2..ef9ab6a 100644 --- a/application/common.php +++ b/application/common.php @@ -10,3 +10,36 @@ // +---------------------------------------------------------------------- // 应用公共文件 + + +/** + * CURL post数据 + * @param $url + * @param $data + * @param array $urlParam + * @param array $header + * @return mixed + */ +function curlPost( $url, $data, $urlParam = [], $header = [] ){ + $ch = curl_init(); + if( !empty($urlParam) ){ + $url = $url.'?'.http_build_query($urlParam); + } + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + + if( !empty($header) ){ + $headerStrArr = []; + foreach ($header as $key => $value){ + $headerStrArr[] = "$key: $value"; + } + curl_setopt($ch, CURLOPT_HTTPHEADER, $headerStrArr); + } + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_URL, $url); + $return = curl_exec($ch); + curl_close($ch); + return $return; +} \ No newline at end of file diff --git a/application/index/controller/Base.php b/application/index/controller/Base.php index 69bc57f..905103f 100644 --- a/application/index/controller/Base.php +++ b/application/index/controller/Base.php @@ -9,5 +9,18 @@ namespace app\index\controller; use think\Controller; class Base extends Controller { + protected $uid; + public function _initialize(){ + //初始化系统 + $this->uid = session('uid'); + if( !isset($this->uid) || empty($this->uid) ){ + $this->redirect('User/index'); + } + + //控制器初始化 + if(method_exists($this,'_myInitialize')){ + $this->_myInitialize(); + } + } } \ No newline at end of file diff --git a/application/index/controller/Help.php b/application/index/controller/Help.php new file mode 100644 index 0000000..0078374 --- /dev/null +++ b/application/index/controller/Help.php @@ -0,0 +1,20 @@ + + */ + +namespace app\index\controller; + + +class Help extends Base { + public function index(){ + $this->display(); + } + public function pro1(){ + $this->display(); + } + public function pro2(){ + $this->display(); + } +} \ No newline at end of file diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index 091dfdb..ba38993 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -7,7 +7,16 @@ namespace app\index\controller; class Index extends Base { - public function index() { + protected $uid; + public function index(){ +// $proList = D('BuyLog')->where(['uid' => $this->uid])->select(); + $proList = []; + $proNum = count($proList); + if( $proNum ){ + $this->assign('proList', $proList); + } + $this->assign('proNum', $proNum); + return $this->fetch(); } } diff --git a/application/index/controller/Product.php b/application/index/controller/Product.php new file mode 100644 index 0000000..3fb7dd3 --- /dev/null +++ b/application/index/controller/Product.php @@ -0,0 +1,50 @@ + + */ + +namespace app\index\controller; + + +class Product extends Base { + public function index(){ + $this->assign('pro',config('PROVINCE')); + $this->display(); + } + public function buy(){ + $data = $this->request->post(); + $data['uid'] = $this->uid; + $data['addTime'] = time(); + if( $data['type'] != 2 ){ + if( empty($data['email']) ){ + $this->error('电子邮箱不能为空!', '', true); + }else{ + if( !preg_match('/^[a-z]([a-z0-9]*[-_]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\.][a-z]{2,3}([\.][a-z]{2})?$/i', $data['email']) ){ + $this->error('手机号码不合法!', '', true); + } + } + if( empty($data['location']) ){ + $this->error('地区不能为空!', '', true); + } + if( empty($data['name']) ){ + $this->error('姓名不能为空!', '', true); + } + if( empty($data['city']) ){ + $this->error('所在城市不能为空!', '', true); + } + }else{ + $data['status'] = 1; + } +// $isBuy = D('BuyLog')->where(['uid' => $this->uid, 'proName' => $data['proName'], 'status' => 0])->count(); +// if( $isBuy ){ +// $this->error('请勿重复操作!', '', true); +// } +// $res = D('BuyLog')->add($data); +// if( $res === false ){ +// $this->error('操作失败!', '', true); +// }else{ +// $this->success('信息提交成功!', U('Index/index'), true); +// } + } +} \ No newline at end of file diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 38160e5..204953b 100644 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -6,10 +6,154 @@ */ namespace app\index\controller; -use \think\Controller; -class User extends Controller { +use extend\StrOrg; + +class User extends Base { public function index(){ - echo 11111; + return $this->fetch(); + } + + public function login(){ + if( $this->request->isPost() ){ + $user = $this->request->post('user'); + $pwd = $this->request->post('password'); + if( empty($user) ){ + $this->error('手机号不能为空!', '', true); + }else{ + if( !preg_match('/^1(3[0-9]|4[57]|5[0-35-9]|7[01678]|8[0-9])\\d{8}$/', $user) ){ + $this->error('手机号不合法!', '', true); + } + } + if( empty($pwd) ){ + $this->error('密码不能为空!', '', true); + } + $hashArr = $this->getAuthStr(); + $userData = [ + 'Account' => $user, + 'Password' => $pwd, + 'Type' => 3 + ]; + $userData = json_encode($userData); + $res = curlPost(config('API_HOST').config('API_USER_LOGIN'), $userData, $hashArr, ['Content-Type' => 'application/json']); + $resArr = json_decode($res , true); + if( $resArr['data']['Id'] == 0 ){ + $this->error($resArr['data']['Message'], '', true); + }else{ + session('uid', $resArr['data']['Id']); + session('phone', $user); + $this->success('登录成功!', url('Index/index'), true); + } + }else{ + $this->error('非法操作','', true); + } + } + + public function getCode(){ + if( $this->request->isPost() ){ + $user = $this->request->post('user'); + if( empty($user) ){ + $this->result(['status' => -999], -999); + } + $hashArr = $this->getAuthStr(); + $userData = [ + 'Account' => $user + ]; + $userData = json_encode($userData); + $nextTime = cache('nextTime');$now = time(); + if( $nextTime <= $now ){ + $res = curlPost(config('API_HOST').config('API_USER_CODE'), $userData, $hashArr, ['Content-Type' => 'application/json']); + $resArr = json_decode($res , true); + if( $resArr['status'] != 200 ){ + $this->error($resArr['message']); + }else{ + $nextTime = $now + 55; + cache('nextTime', $nextTime); + $this->result(['status' => 200], 200); + } + }else{ + $this->error('请勿频繁操作', '', true); + } + }else{ + $this->error('非法操作', '', true); + } + } + + public function register(){ + if( $this->request->isPost()){ + $user = $this->request->post('user'); + $pwd = $this->request->post('password'); + $code = $this->request->post('code'); + if( empty($user) ){ + $this->error('手机号码不能为空!', '', true); + }else{ + if( !preg_match('/^1(3[0-9]|4[57]|5[0-35-9]|7[01678]|8[0-9])\\d{8}$/', $user) ){ + $this->error('手机号码不合法!', '', true); + } + } + if( empty($pwd) ){ + $this->error('密码不能为空!', '', true); + } + if( empty($code) ){ + $this->error('验证码不能为空!', '', true); + } + $hashArr = $this->getAuthStr(); + $userData = [ + 'Account' => $user, + 'Password' => $pwd, + 'Code' => $code + ]; + $userData = json_encode($userData); + $res = curlPost(config('API_HOST').config('API_USER_REGISTER'), $userData, $hashArr, ['Content-Type' => 'application/json']); + $resArr = json_decode($res , true); + if( $resArr['data']['Id'] == 0 ){ + $this->error($resArr['data']['Message'], '', true); + }else{ + $this->success('注册成功!', url('User/index'), true); + } + }else{ + $this->display(); + } + } + + public function recover(){ + if( $this->request->isPost()){ + $user = $this->request->post('user'); + $pwd = $this->request->post('password'); + $rePwd = $this->request->post('rePassword'); + $code = $this->request->post('code'); + if( $rePwd != $pwd ){ + $this->error("两次输入密码不一致"); + } + $hashArr = $this->getAuthStr(); + $userData = [ + 'Account' => $user, + 'NewPassword' => $pwd, + 'Code' => $code + ]; + $userData = json_encode($userData); + $res = curlPost(config('API_HOST').config('API_USER_CHANGE_PWD'), $userData, $hashArr, ['Content-Type' => 'application/json']); + $resArr = json_decode($res , true); + if( $resArr['data']['Id'] == 0 ){ + $this->error($resArr['data']['Message'], '', true); + }else{ + $this->success('密码重置成功!', url('User/index'), true); + } + }else{ + $this->display(); + } + } + + private function getAuthStr(){ + $ticket = config('AUTH_TICKET'); + $nonceStr = StrOrg::randString(12,5,'oOLl01'); + $now = time(); + $hashStr = sha1("ticket={$ticket}&noncestr={$nonceStr}×tamp={$now}"); + $urlParam = [ + 's' => $hashStr, + 'n' => $nonceStr, + 't' => $now + ]; + return $urlParam; } } \ No newline at end of file diff --git a/application/index/model/User.php b/application/index/model/User.php deleted file mode 100644 index 4740910..0000000 --- a/application/index/model/User.php +++ /dev/null @@ -1,9 +0,0 @@ - + +
+ + + + + + + +Vr元年,内容缺乏,拍摄全景360°图像可以看做最快速的vr内容。
+本产品将多目取景器实时采集的图像画面,实时缝合成高质量的全景VR图像,可实时预监,对图像画面进行实时调节,此VR视频可通过网络传输到云,在经云端编解码后,最终通过呈现端展示出来,也可本地录制保存,实时输出。
+本软件运行在HP Z840 工作站为基础,加入4*2采集卡,4*1HD-SDI采集卡,i7高性能处理,16G内存,NVidia高性能图形渲染卡
+帮助用户进行先前设定。
+1、设备设定——为了更好的缝合效果,选择设备类型
+2、拍录设定
+设定拍录保存路径——选择拍录操作后文件保存的地址路径
+录制码率——普通,高端,最佳的码率规格对应不同比特率,比特率是指每秒传送的比特(bit)数。比特率越高,传送数据速度越快,画质越好。
+3、更多设置
+RTMP地址——推流地址设定,RTMP是实时消息传输协议。
+输出码率设定——每秒传输的兆数越大越清晰。码率即比特率是指每秒传送的比特(bit)数。比特率越高,传送数据速度越快,同时需要的带宽要求也就增大。
+输出分辨率设定
+安全距离设定——通过安全距离调整来微调畸变
+1、多模式预监
+![]() |
+ 平铺模式 |
+
![]() |
+ 包球/VR模式 |
+
![]() |
+ 网格模式,单个镜头图像 |
+
2、调节图像
+![]() |
+ 调色—实时手动调节,自动复位(包含:滤镜 饱和度 色调 伽玛值 亮度) |
+
![]() |
+ 曝光—实时手动调节,自动复位 |
+
![]() |
+ 白平衡—实时手动调节,自动复位 |
+
![]() |
+ 安全距离—安全距离及时反映到预览画面,调节安全距离可改善畸变 |
+
![]() |
+ 添加logo—显示logo,选择路径,调整logo半径 |
+
3、输出功能
+![]() |
+
+ 本地录制——全景视频实时录制。 +录制前,需在引导页或设置页面中对录制参数进行设置。 +录制中,显示录制状态,时间信息;可同时进行RTMP推流、SDI 输出、拍照。 +注意:若正在推流,录制码率与推流码率相同。 + |
+
![]() |
+
+ 本地拍照——拍摄全景照片,可在录制、RTMP推流、SDI输出同时进行拍照。 + |
+
![]() |
+
+ 回看—一键打开软件自带播放器,播放器默认播放最近一次操作内容画面。右侧列表可选择之前的操作内容。 + 注意:回放的前提是必须停止录制 + |
+
![]() |
+
+ RTMP推流—全景视频实时推流 +推流前,需在引导页或设置页面中对RTMP参数进行设置。 +推流中,显示推流信息;可同时进行录制、SDI输出、拍照。 + |
+
![]() |
+
+ SDI输出—全景视频实时输出 +输出前,需在引导页或设置页面中对SDI参数进行设置。 +输出中,显示输出信息;可同时进行录制、RTMP推流、拍照。 +注意:SDI输出质量和RTMP推流质量一致。 + |
+
4、其他
+![]() |
+
+ 操作日志—用户操作记录 + |
+
![]() |
+
+ 版本信息—版本号,更新信息,官网帮助 + |
+
1、设备选择:为了更好的缝合效果,更改引导页设备选择设定
+2、拍录设置:更改引导页拍录路径码率设定或增加引导页未设定的数据
+3、RTMP&SDI参数设置:更改引导页推流地址&输出质量设定或增加引导页未设定的
+帮助用户进行先前设定。
+1、设备设定——为了更好的缝合效果,选择设备类型
+2、拍录设定
+设定拍录保存路径——选择拍录操作后文件保存的地址路径
+录制码率——普通,高端,最佳的码率规格对应不同比特率,比特率是指每秒传送的比特(bit)数。比特率越高,传送数据速度越快,画质越好。
+3、更多设置
+RTMP地址——推流地址设定,RTMP是实时消息传输协议。
+输出码率设定——每秒传输的兆数越大越清晰。码率即比特率是指每秒传送的比特(bit)数。比特率越高,传送数据速度越快,同时需要的带宽要求也就增大。
+输出分辨率设定
+安全距离设定——通过安全距离调整来微调畸变
+1、多模式预监
+![]() |
+ 平铺模式 |
+
![]() |
+ 包球/VR模式 |
+
![]() |
+ 网格模式,单个镜头图像 |
+
2、调节图像
+![]() |
+ 调色—实时手动调节,自动复位(包含:滤镜 饱和度 色调 伽玛值 亮度) |
+
![]() |
+ 曝光—实时手动调节,自动复位 |
+
![]() |
+ 白平衡—实时手动调节,自动复位 |
+
![]() |
+ 安全距离—安全距离及时反映到预览画面,调节安全距离可改善畸变 |
+
![]() |
+ 添加logo—显示logo,选择路径,调整logo半径 |
+
3、输出功能
+![]() |
+
+ 本地录制——全景视频实时录制。 +录制前,需在引导页或设置页面中对录制参数进行设置。 +录制中,显示录制状态,时间信息;可同时进行RTMP推流、SDI 输出、拍照。 +注意:若正在推流,录制码率与推流码率相同。 + |
+
![]() |
+
+ 本地拍照——拍摄全景照片,可在录制、RTMP推流、SDI输出同时进行拍照。 + |
+
![]() |
+
+ 回看—一键打开软件自带播放器,播放器默认播放最近一次操作内容画面。右侧列表可选择之前的操作内容。 + 注意:回放的前提是必须停止录制 + |
+
![]() |
+
+ RTMP推流—全景视频实时推流 +推流前,需在引导页或设置页面中对RTMP参数进行设置。 +推流中,显示推流信息;可同时进行录制、SDI输出、拍照。 + |
+
![]() |
+
+ SDI输出—全景视频实时输出 +输出前,需在引导页或设置页面中对SDI参数进行设置。 +输出中,显示输出信息;可同时进行录制、RTMP推流、拍照。 +注意:SDI输出质量和RTMP推流质量一致。 + |
+
4、其他
+![]() |
+
+ 操作日志—用户操作记录 + |
+
![]() |
+
+ 版本信息—版本号,更新信息,官网帮助 + |
+
1、设备选择:为了更好的缝合效果,更改引导页设备选择设定
+2、拍录设置:更改引导页拍录路径码率设定或增加引导页未设定的数据
+3、RTMP&SDI参数设置:更改引导页推流地址&输出质量设定或增加引导页未设定的
+帮助用户进行先前设定。
+1、设备设定——为了更好的缝合效果,选择设备类型
+2、拍录设定
+设定拍录保存路径——选择拍录操作后文件保存的地址路径
+录制码率——普通,高端,最佳的码率规格对应不同比特率,比特率是指每秒传送的比特(bit)数。比特率越高,传送数据速度越快,画质越好。
+3、更多设置
+RTMP地址——推流地址设定,RTMP是实时消息传输协议。
+输出码率设定——每秒传输的兆数越大越清晰。码率即比特率是指每秒传送的比特(bit)数。比特率越高,传送数据速度越快,同时需要的带宽要求也就增大。
+输出分辨率设定
+安全距离设定——通过安全距离调整来微调畸变
+1、多模式预监
+![]() |
+ 平铺模式 |
+
![]() |
+ 包球/VR模式 |
+
![]() |
+ 网格模式,单个镜头图像 |
+
2、调节图像
+![]() |
+ 调色—实时手动调节,自动复位(包含:滤镜 饱和度 色调 伽玛值 亮度) |
+
![]() |
+ 曝光—实时手动调节,自动复位 |
+
![]() |
+ 白平衡—实时手动调节,自动复位 |
+
![]() |
+ 安全距离—安全距离及时反映到预览画面,调节安全距离可改善畸变 |
+
![]() |
+ 添加logo—显示logo,选择路径,调整logo半径 |
+
3、输出功能
+![]() |
+
+ 本地录制——全景视频实时录制。 +录制前,需在引导页或设置页面中对录制参数进行设置。 +录制中,显示录制状态,时间信息;可同时进行RTMP推流、SDI 输出、拍照。 +注意:若正在推流,录制码率与推流码率相同。 + |
+
![]() |
+
+ 本地拍照——拍摄全景照片,可在录制、RTMP推流、SDI输出同时进行拍照。 + |
+
![]() |
+
+ 回看—一键打开软件自带播放器,播放器默认播放最近一次操作内容画面。右侧列表可选择之前的操作内容。 + 注意:回放的前提是必须停止录制 + |
+
![]() |
+
+ RTMP推流—全景视频实时推流 +推流前,需在引导页或设置页面中对RTMP参数进行设置。 +推流中,显示推流信息;可同时进行录制、SDI输出、拍照。 + |
+
![]() |
+
+ SDI输出—全景视频实时输出 +输出前,需在引导页或设置页面中对SDI参数进行设置。 +输出中,显示输出信息;可同时进行录制、RTMP推流、拍照。 +注意:SDI输出质量和RTMP推流质量一致。 + |
+
4、其他
+![]() |
+
+ 操作日志—用户操作记录 + |
+
![]() |
+
+ 版本信息—版本号,更新信息,官网帮助 + |
+
1、设备选择:为了更好的缝合效果,更改引导页设备选择设定
+2、拍录设置:更改引导页拍录路径码率设定或增加引导页未设定的数据
+3、RTMP&SDI参数设置:更改引导页推流地址&输出质量设定或增加引导页未设定的
+产品名称 | +产品状态 | +产品购买/下载 | +订单时间 | +||||||
---|---|---|---|---|---|---|---|---|---|
{$vo['proName']} | +已购买 | +立即下载 | +已下载 | +购买正式版 | +已经购买 | +等待审核 | +{$vo['addTime'] | date='Y-m-d H:i:s',###} | +
用户编号 | +购买产品 | +用户姓名 | +用户手机号 | +用户所在地 | +企业名称 | +订单时间 | +操作 | +|
---|---|---|---|---|---|---|---|---|
{$vo['uid']} | +{$vo['proName']} | +{$vo['name']|default='-'} | +{$vo['phone']|default='-'} | +{$vo['city']|default='-'} | +{$vo['company']|default='-'} | +{$vo['addTime']} | +处理订单 | +撤销状态 | +