WapController.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * WapController.php UTF-8
  4. * 网页接口
  5. *
  6. * @date : 2018/1/16 16:48
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : wuyonghong <wyh@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace api\apple\controller;
  13. use api\common\controller\AppleApiBaseController;
  14. use huo\controller\pay\Sdk;
  15. use huolib\status\OrderStatus;
  16. class WapController extends AppleApiBaseController {
  17. public function _initialize() {
  18. parent::_initialize();
  19. }
  20. /**
  21. * 打开网页登陆框
  22. * http://doc.1tsdk.com/138?page_id=3512
  23. * 【域名】/wap/sdk/user
  24. *
  25. */
  26. public function member() {
  27. $_back_url = $this->request->server('HTTP_REFERER');
  28. $_channel_rq = $this->setChannelData();
  29. $this->assign('agentgame', $_channel_rq->getAgentGame());
  30. $this->assign('back_url', $_back_url);
  31. return $this->fetch('member/index');
  32. }
  33. /**
  34. * 找回密码
  35. * http://doc.1tsdk.com/138?page_id=2912
  36. * 【【域名】/v8/wap/forgetpwd/index
  37. * 【域名】wap/forgetpwd/index
  38. */
  39. public function forgetPwdPage() {
  40. return $this->fetch('member/forgetpwd');
  41. }
  42. /**
  43. *
  44. * WAP-支付页面(新)
  45. * http://doc.1tsdk.com/138?page_id=3513
  46. * 【域名】/wap/sdk/pay
  47. */
  48. public function pay() {
  49. $this->checkLogin();
  50. $_order_rq = $this->setOrderData();
  51. $_pay_token = get_val($this->rq_data, 'pay_token', '');
  52. $_rs = $_order_rq->checkPayToken($_pay_token);
  53. if (false == $_rs) {
  54. $_code = OrderStatus::TOKEN_ARGS_ERROR;
  55. $this->error(OrderStatus::getMsg($_code), [], $_code);
  56. }
  57. $_order_id = $_order_rq->getOrderId();
  58. $_rdata = (new Sdk())->getPayInfo($_order_id, true);
  59. if (empty($_rdata['data'])) {
  60. $this->error(OrderStatus::getMsg($_rdata['code']), [], $_rdata['code']);
  61. }
  62. $this->assign($_rdata['data']);
  63. return $this->fetch('order/index');
  64. }
  65. }