Index.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. namespace app\index\controller;
  3. use app\common\controller\Frontend;
  4. use app\utils\PayUtil;
  5. use think\Db;
  6. class Index extends Frontend
  7. {
  8. protected $noNeedLogin = '*';
  9. protected $noNeedRight = '*';
  10. protected $layout = '';
  11. /**
  12. * @return void
  13. */
  14. public function aa()
  15. {
  16. $pay = new PayUtil();
  17. $pay->jsPay('123123123123123','0.01','开通会员');
  18. return json_encode($pay->getData());
  19. }
  20. public function index()
  21. {
  22. $code = input('code', '', 'trim'); //邀请码
  23. $this->view->assign('code', $code);
  24. $this->view->assign('downurl', config("site.apk_url"));
  25. $is_ios = 0;
  26. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  27. $is_ios = 1;
  28. }
  29. $this->view->assign('is_ios', $is_ios);
  30. return $this->view->fetch();
  31. }
  32. public function wxsharedownload(){
  33. $this->view->assign('downurl', config("site.apk_url"));
  34. return $this->view->fetch();
  35. }
  36. public function suningh5(){
  37. return $this->view->fetch();
  38. }
  39. /**
  40. * app下载页
  41. * 判断是安卓还是ios
  42. */
  43. public function appdownload() {
  44. echo 'hello wold';
  45. }
  46. /**
  47. * app下载页-新
  48. * 判断是安卓还是ios
  49. */
  50. public function downapp() {
  51. $code = input('code', '', 'trim'); //邀请码
  52. $this->view->assign('code', $code);
  53. $this->view->assign('downurl', config("site.apk_url"));
  54. return $this->view->fetch();
  55. // if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  56. // header("Location: https://apps.apple.com/cn/app/%E4%BC%B4%E5%A3%B0%E8%AF%AD%E9%9F%B3/id1556551099");
  57. // }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  58. // //$host = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"];
  59. // //header("Location: ".$host."/index/index/download");
  60. // $this->view->assign('downurl', config("site.apk_url"));
  61. // return $this->view->fetch();
  62. // }else{
  63. // $this->view->assign('downurl', config("site.apk_url"));
  64. // return $this->view->fetch();
  65. // }
  66. }
  67. //基础文章网页
  68. public function basedata(){
  69. $key = input('key','');
  70. if(!$key){
  71. exit;
  72. }
  73. $content = Db::name('basedata')->where('key',$key)->find();
  74. $this->assign('content',$content['content']);
  75. return $this->fetch();
  76. }
  77. }