增加优惠券详情

This commit is contained in:
2021-06-25 15:04:54 +08:00
parent 711940ecce
commit add71f3d4c
3 changed files with 36 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ return [
'tokenUri' => 'https://open.cyzl.com/beta/auth/oauth/token', 'tokenUri' => 'https://open.cyzl.com/beta/auth/oauth/token',
'baseUri' => 'https://open.cyzl.com/beta/api', 'baseUri' => 'https://open.cyzl.com/beta/api',
'urlKey' => env('WASH_CAR_URLKEY', ''),//免登陆跳转 'urlKey' => env('WASH_CAR_URLKEY', ''),//免登陆跳转
'infoUrl' => env('WASH_CAR_INFOURL', ''),//优惠券详情地址
], ],
/** /**
@@ -31,6 +32,7 @@ return [
'tokenUri' => 'https://open.cyzl.com/api/auth/oauth/token', 'tokenUri' => 'https://open.cyzl.com/api/auth/oauth/token',
'baseUri' => 'https://open.cyzl.com/api', 'baseUri' => 'https://open.cyzl.com/api',
'urlKey' => env('WASH_CAR_URLKEY', ''),//免登陆跳转 'urlKey' => env('WASH_CAR_URLKEY', ''),//免登陆跳转
'infoUrl' => env('WASH_CAR_INFOURL', ''),//优惠券详情地址
], ],
]; ];

View File

@@ -12,7 +12,7 @@ class CouponAction extends Init
*/ */
public function getOrderUrl() public function getOrderUrl()
{ {
$url = $this->config['baseUri'] . '/v2/h5/redirect/autoLogin/returnUrl'; $url = $this->config['baseUri'] . '/v2/h5/redirect/autoLogin/commonReturnUrl';
$this->params = array_merge($this->params, [ $this->params = array_merge($this->params, [
'urlKey' => $this->config['urlKey'], 'urlKey' => $this->config['urlKey'],
@@ -25,6 +25,37 @@ class CouponAction extends Init
return $this->getResponse(); return $this->getResponse();
} }
/**
* Notes: 获取优惠券详情H5地址
* @Author: 玄尘
* @Date : 2021/6/25 14:16
* @return array
*/
public function getCouponInfoUrl()
{
$url = $this->config['baseUri'] . '/v2/h5/redirect/autoLogin/commonReturnUrl';
$accessToken = $this->getToken();
$data = $this->params;
$callback_url = $this->config['infoUrl'] . '?' . http_build_query([
'activityId' => $data['activityId'],
'code' => $data['code'],
'accessToken' => $accessToken,
]);
$data = array_merge($data, ['url' => $callback_url]);
unset($data['code']);
unset($data['activityId']);
$this->params = $data;
$params = $this->getParams();
$this->http($url, $params);
return $this->getResponse();
}
/** /**
* Notes: 发券 * Notes: 发券
* @Author: 玄尘 * @Author: 玄尘

View File

@@ -71,6 +71,8 @@ class Init
} else { } else {
$this->getAjaxToken(); $this->getAjaxToken();
} }
return $this->access_token;
} }
/** /**