Index.php
2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
namespace app\api\controller;
use app\common\controller\Api;
use app\api\model\Order;
use app\api\model\Banner;
use EasyWeChat\Factory;
/**
* 首页接口
*/
class Index extends Api
{
protected $noNeedLogin = ['index','info','jssdk'];
protected $noNeedRight = ['*'];
/**
* @ApiWeigh (99)
* @ApiTitle (首页-发单列表)
* @ApiSummary (首页-发单列表)
* @ApiMethod (POST)
*
* @ApiParams (name="page", type="inter", required=false, description="当前页(默认1)")
* @ApiParams (name="page_num", type="inter", required=false, description="每页显示数据个数(默认10)")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1604729641",
"data": {
"total": 1, //数据总数
"per_page": 15,
"current_page": 1,
"last_page": 1,
"data": [{
"id": 1, //发单ID
"market_name": "你好商城", //商城名称
"parking_fee": "50.00", //实际停车费
"deposit": "35.00", //定金
"grab_countdown": 65 //抢单倒计时
}]
}
})
*/
public function index(){
(new OrderGrab)->index();
}
/**
* @ApiWeigh (97)
* @ApiTitle (首页-发单详情)
* @ApiSummary (首页-发单详情)
* @ApiMethod (POST)
*
* @ApiParams (name="order_id", type="inter", required=true, description="订单ID")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1603017818",
"data": {
"id": 1, //发单ID
"market_name": "你好商城", //商城名称
"parking_fee": "50.00", //实际停车费
"deposit": "35.00", //定金
"grab_countdown": 65 //抢单倒计时
}
})
*/
public function info(){
(new OrderGrab)->info();
}
/**
* @ApiWeigh (95)
* @ApiTitle (轮播图列表)
* @ApiSummary (轮播图列表)
* @ApiMethod (POST)
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1602556163",
"data": [{
"id": 1, //ID
"image": "http://www.parking.top/uploads/20201106/856ab1bfffbb5fa30fa826bcab631bbc.jpg" //图片
}]
})
*/
public function bannerList()
{
$banner_list = Banner::order(['weigh'=>'desc','createtime'=>'desc'])->field('id,image')->select();
$this->success('成功',$banner_list);
}
public function jssdk()
{
$apis = [
'checkJsApi',
'getLocation', //获取位置
'openLocation', //打开位置
];
$res = Factory::officialAccount(config('wechat'))->jssdk->buildConfig($apis, $debug = true, $beta = false, $json = false);
$this->success('sdk', $res);
}
}