api.php 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. <?php
  2. use app\http\middleware\AllowOriginMiddleware;
  3. use app\http\middleware\api\AuthTokenMiddleware;
  4. use app\http\middleware\api\BlockerMiddleware;
  5. use app\http\middleware\api\ClientMiddleware;
  6. use app\http\middleware\InstallMiddleware;
  7. use app\http\middleware\StationOpenMiddleware;
  8. use think\facade\Config;
  9. use think\facade\Route;
  10. use think\Response;
  11. /**
  12. * 用户端路由配置
  13. */
  14. Route::group('api', function () {
  15. /**
  16. * 无需授权接口
  17. */
  18. Route::group(function () {
  19. Route::get('geoLbscoder', 'v1.PublicController/geoLbscoder')->name('geoLbscoder');//经纬度转位置信息
  20. Route::get('city', 'v2.PublicController/city')->name('city');//增加省市区
  21. Route::get('site_config', 'v1.PublicController/getSiteConfig')->name('getSiteConfig');//获取网站配置
  22. Route::get('navigation/[:template_name]', 'v1.PublicController/getNavigation')->name('getNavigation');//获取底部导航
  23. Route::get('search/keyword', 'v1.PublicController/search')->name('searchKeyword');//热门搜索关键字获取
  24. Route::get('category', 'v1.product.CategoryController/category')->name('category');//商品分类类
  25. Route::get('category_version', 'v1.product.CategoryController/getCategoryVersion')->name('getCategoryVersion');//商品分类类版本
  26. Route::get('reply/list/:id', 'v1.product.StoreProductController/reply_list')->name('replyList');//商品评价列表
  27. Route::get('reply/config/:id', 'v1.product.StoreProductController/reply_config')->name('replyConfig');//商品评价数量和好评度
  28. Route::get('user_agreement/[:type]', 'v1.PublicController/getUserAgreement')
  29. ->name('getUserAgreement')
  30. ->middleware(AuthTokenMiddleware::class, false);//获取用户协议
  31. Route::get('get_open_adv', 'v1.PublicController/getOpenAdv')->name('getOpenAdv');//首页开屏广告
  32. })->middleware(StationOpenMiddleware::class);
  33. /**
  34. * 授权不通过,不会抛出异常继续执行
  35. */
  36. Route::group(function () {
  37. //公共类
  38. Route::get('index', 'v1.PublicController/index')->name('index');//首页
  39. Route::any('test', 'v1.PublicController/test')->name('test');//测试
  40. Route::any('send_test', 'v1.PublicController/send_test')->name('send_test');//测试
  41. Route::any('version', 'v1.PublicController/version')->name('version');//测试
  42. Route::any('withdraw/notify', 'v1.WithdrawController/notify')->name('withdrawNotify');//测试
  43. Route::get('menu/user', 'v1.PublicController/menu_user')->name('menuUser');//个人中心菜单
  44. //商品类
  45. Route::get('brand', 'v1.product.StoreProductController/brand')->name('brand');//品牌列表
  46. Route::get('presale/list', 'v1.product.StoreProductController/presaleList')->name('presaleList');//预售商品列表
  47. Route::post('image_base64', 'v1.PublicController/get_image_base64')->name('getImageBase64');// 获取图片base64
  48. Route::get('product/detail/recommend/:id', 'v1.product.StoreProductController/recommend')->name('productRecommend');//商品详情推荐商品
  49. Route::get('product/detail/activity/:id', 'v1.product.StoreProductController/activity')->name('productActivity');//商品详情关联活动
  50. Route::get('product/detail/:id/[:type]', 'v1.product.StoreProductController/detail')->name('detail');//商品详情
  51. Route::get('product/store/detail/:id', 'v2.product.StoreProductController/getStoreProductInfo')->name('getStoreProductInfo');//用平台商品ID获取门店该商品详情
  52. Route::get('product/detail_content/:id/', 'v1.product.StoreProductController/detailContent')->name('detailContent');//商品详情内容
  53. Route::get('groom/list/:type', 'v1.product.StoreProductController/groom_list')->name('groomList');//获取首页推荐不同类型商品的轮播图和商品
  54. Route::get('products', 'v1.product.StoreProductController/lst')->name('products');//商品列表
  55. Route::get('product/hot', 'v1.product.StoreProductController/product_hot')->name('productHot');//为你推荐
  56. Route::get('reply/comment/:id', 'v1.product.StoreProductController/commentList')->name('commentList');//评价回复列表
  57. //文章分类类
  58. Route::get('article/category/list', 'v1.publics.ArticleCategoryController/lst')->name('articleCategoryList');//文章分类列表
  59. //文章类
  60. Route::get('article/list/:cid', 'v1.publics.ArticleController/lst')->name('articleList');//文章列表
  61. Route::get('article/details/:id', 'v1.publics.ArticleController/details')->name('articleDetails');//文章详情
  62. Route::get('article/hot/list', 'v1.publics.ArticleController/hot')->name('articleHotList');//文章 热门
  63. Route::get('article/new/list', 'v1.publics.ArticleController/new')->name('articleNewList');//文章 最新
  64. Route::get('article/banner/list', 'v1.publics.ArticleController/banner')->name('articleBannerList');//文章 banner
  65. //活动---秒杀
  66. Route::get('seckill/index', 'v1.activity.StoreSeckillController/index')->name('seckillIndex');//秒杀商品时间区间
  67. Route::get('seckill/list/:time', 'v1.activity.StoreSeckillController/lst')->name('seckillList');//秒杀商品列表
  68. Route::get('seckill/detail/:id/[:time]', 'v1.activity.StoreSeckillController/detail')->name('seckillDetail');//秒杀商品详情
  69. Route::get('seckill/detail_code/:id', 'v1.activity.StoreSeckillController/detailCode')->name('seckilldetailCode');//秒杀商品二维码
  70. //活动---砍价
  71. Route::get('bargain/config', 'v1.activity.StoreBargainController/config')->name('bargainConfig');//砍价商品列表配置
  72. Route::get('bargain/list', 'v1.activity.StoreBargainController/lst')->name('bargainList');//砍价商品列表
  73. Route::get('bargain/detail/:id', 'v1.activity.StoreBargainController/detail')->name('bargainDetail');//砍价商品详情
  74. //活动---拼团
  75. Route::get('combination/list', 'v1.activity.StoreCombinationController/lst')->name('combinationList');//拼团商品列表
  76. Route::get('combination/detail/:id', 'v1.activity.StoreCombinationController/detail')->name('combinationDetail');//拼团商品详情
  77. Route::get('combination/detail_code/:id', 'v1.activity.StoreCombinationController/detailCode')->name('detailCode');//拼团商品详情二维码
  78. //用户类
  79. Route::get('user/activity', 'v1.user.UserController/activity')->name('userActivity');//活动状态
  80. //微信
  81. Route::get('wechat/config', 'v1.wechat.WechatController/config')->name('wechatConfig');//微信 sdk 配置
  82. Route::get('wechat/auth', 'v1.wechat.WechatController/auth')->name('wechatAuth');//微信授权
  83. Route::post('wechat/app_auth', 'v1.wechat.WechatController/appAuth')->name('appAuth');//微信APP授权
  84. //小程序登陆
  85. Route::post('wechat/mp_auth', 'v1.wechat.AuthController/mp_auth')->name('mpAuth');//小程序登陆
  86. Route::get('wechat/get_logo', 'v1.PublicController/getLogo')->name('getLogo');//登陆页面logo
  87. Route::get('wechat/teml_ids', 'v1.wechat.AuthController/teml_ids')->name('wechatTemlIds');//小程序订阅消息
  88. Route::get('wechat/live', 'v1.wechat.AuthController/live')->name('wechatLive');//小程序直播列表
  89. Route::get('wechat/livePlaybacks/:id', 'v1.wechat.AuthController/livePlaybacks')->name('livePlaybacks');//小程序直播回放
  90. //物流公司
  91. Route::get('logistics', 'v1.PublicController/logistics')->name('logistics');//物流公司列表
  92. //分享配置
  93. Route::get('share', 'v1.PublicController/share')->name('share');//分享配置
  94. //优惠券
  95. Route::get('coupons', 'v1.activity.StoreCouponsController/lst')->name('couponsList'); //可领取优惠券列表
  96. //短信购买异步通知
  97. Route::post('sms/pay/notify', 'v1.PublicController/sms_pay_notify')->name('smsPayNotify'); //短信购买异步通知
  98. //获取关注微信公众号海报
  99. Route::get('wechat/follow', 'v1.wechat.WechatController/follow')->name('Follow');
  100. //用户是否关注
  101. Route::get('subscribe', 'v1.user.UserController/subscribe')->name('Subscribe');
  102. //门店列表
  103. Route::get('store_list', 'v1.PublicController/store_list')->name('storeList');
  104. //获取城市列表
  105. Route::get('city_list', 'v1.PublicController/city_list')->name('cityList');
  106. //获取附近最近门店
  107. Route::get('nearby_store', 'v1.store.StoreController/nearbyStore')->name('nearbyStore');
  108. Route::get('pink', 'v1.PublicController/pink')->name('pinkData');
  109. Route::get('combination/banner_list', 'v1.activity.StoreCombinationController/banner_list')->name('combinationBannerList');//拼团列表轮播图
  110. Route::post('user/set_visit', 'v1.user.UserController/set_visit')->name('setVisit');// 添加用户访问记录
  111. Route::get('copy_words', 'v1.PublicController/copy_words')->name('copyWords');// 复制口令接口
  112. //活动---积分商城
  113. Route::get('store_integral/index', 'v1.activity.StoreIntegralController/index')->name('storeIntegralIndex');//积分商城首页数据
  114. Route::get('store_integral/list', 'v1.activity.StoreIntegralController/lst')->name('storeIntegralList');//积分商品列表
  115. Route::get('store_integral/detail/:id', 'v1.activity.StoreIntegralController/detail')->name('storeIntegralDetail');//积分商品详情
  116. //优惠套餐列表
  117. Route::get('store_discounts/list/:product_id', 'v1.activity.StoreDiscountsController/index');
  118. //获取客服类型
  119. Route::get('get_customer_type', 'v2.PublicController/getCustomerType')->name('getCustomerType');//获取客服类型
  120. Route::get('user/service/get_adv', 'v1.user.StoreService/getKfAdv')->name('userServiceGetKfAdv');//获取客服页面广告
  121. })->middleware(StationOpenMiddleware::class)->middleware(AuthTokenMiddleware::class, false);
  122. /**
  123. * diy相关
  124. */
  125. Route::group('diy', function () {
  126. //无需登录接口
  127. Route::group(function () {
  128. Route::get('get_diy/[:id]', 'v1.PublicController/getDiy');//DIY接口
  129. Route::get('diy_version/[:id]', 'v1.PublicController/getDiyVersion');//DIY版本接口
  130. });
  131. //未授权接口---不会抛异常
  132. Route::group(function () {
  133. Route::get('user_info', 'v1.diy.Diy/userInfo')->name('diyUserInfo');//diy用户信息
  134. Route::get('video_list', 'v1.diy.Diy/videoList')->name('diyVideoList');//diy短视频列表
  135. Route::get('newcomer_list', 'v1.diy.Diy/newcomerList')->name('diyNewcomerList');//diy新人专享商品列表
  136. })->middleware(AuthTokenMiddleware::class, false);
  137. //需要授权接口
  138. Route::group(function () {
  139. })->middleware(AuthTokenMiddleware::class, true);
  140. })->middleware(StationOpenMiddleware::class);
  141. Route::any('wechat/serve', 'v1.wechat.WechatController/serve');//公众号服务
  142. Route::any('wechat/miniServe', 'v1.wechat.WechatController/miniServe');//小程序服务
  143. Route::any('work/serve', 'v1.wechat.WechatController/work');//公众号服务
  144. Route::any('wechat/notify', 'v1.wechat.WechatController/notify');//公众号支付回调
  145. Route::any('routine/notify', 'v1.wechat.AuthController/notify');//小程序支付回调
  146. Route::any('pay/notify/:type', 'v1.PayController/notify');//支付回调
  147. Route::any('city_delivery/notify', 'v1.CityDeliveryController/notify');//UU、达达回调
  148. Route::get('get_script', 'v1.PublicController/getScript');//统计代码
  149. Route::get('get_copyright', 'v1.PublicController/getCopyright');//获取版权
  150. Route::any('authNotify', 'v1.PublicController/authNotify');//小程序支付回调
  151. //图形验证码
  152. Route::get('ajcaptcha', 'v1.LoginController/ajcaptcha')->name('ajcaptcha');
  153. //图形验证码
  154. Route::post('ajcheck', 'v1.LoginController/ajcheck')->name('ajcheck');
  155. /**
  156. * 登录类
  157. */
  158. Route::group(function () {
  159. //apple快捷登陆
  160. Route::post('apple_login', 'v1.LoginController/appleLogin')->name('appleLogin');//微信APP授权
  161. //账号密码登录
  162. Route::post('login', 'v1.LoginController/login')->name('login');
  163. // 获取发短信的key
  164. Route::get('verify_code', 'v1.LoginController/verifyCode')->name('verifyCode');
  165. //手机号登录
  166. Route::post('login/mobile', 'v1.LoginController/mobile')->name('loginMobile');
  167. //图片验证码
  168. Route::get('sms_captcha', 'v1.LoginController/captcha')->name('captcha');
  169. //验证码发送
  170. Route::post('register/verify', 'v1.LoginController/verify')->name('registerVerify');
  171. //手机号注册
  172. Route::post('register', 'v1.LoginController/register')->name('register');
  173. //手机号修改密码
  174. Route::post('register/reset', 'v1.LoginController/reset')->name('registerReset');
  175. // 绑定手机号(静默授权 还未有用户信息)
  176. Route::post('binding', 'v1.LoginController/binding_phone')->name('bindingPhone');
  177. // 支付宝复制链接支付
  178. Route::get('ali_pay', 'v1.order.StoreOrderController/aliPay')->name('aliPay');
  179. })->middleware(StationOpenMiddleware::class);
  180. /**
  181. * 会员授权接口
  182. */
  183. Route::group(function () {
  184. //保存商品评价回复
  185. Route::post('reply/comment/:id', 'v1.product.StoreProductController/replyComment')->name('replyComment');
  186. //获取评论详情
  187. Route::get('reply/info/:id', 'v1.product.StoreProductController/replyInfo')->name('replyInfo');
  188. //评论回复点赞
  189. Route::post('reply/praise/:id', 'v1.product.StoreProductController/commentPraise')->name('commentPraise');
  190. //取消评论回复点赞
  191. Route::post('reply/un_praise/:id', 'v1.product.StoreProductController/unCommentPraise')->name('unCommentPraise');
  192. //评论点赞
  193. Route::post('reply/reply_praise/:id', 'v1.product.StoreProductController/replyPraise')->name('replyPraise');
  194. //取消评论点赞
  195. Route::post('reply/un_reply_praise/:id', 'v1.product.StoreProductController/unReplyPraise')->name('unReplyPraise');
  196. // 用户注销
  197. Route::get('cancel/user', 'v1.PublicController/cancelUser')->name('cancelUser');
  198. //用户修改手机号
  199. Route::post('user/updatePhone', 'v1.LoginController/update_binding_phone')->name('updateBindingPhone');
  200. //设置登录code
  201. Route::post('user/code', 'v1.user.StoreService/setLoginCode')->name('setLoginCode');
  202. //查看code是否可用
  203. Route::get('user/code', 'v1.LoginController/setLoginKey')->name('getLoginKey');
  204. //用户绑定手机号
  205. Route::post('user/binding', 'v1.LoginController/user_binding_phone')->name('userBindingPhone');
  206. Route::get('logout', 'v1.LoginController/logout')->name('logout');// 退出登录
  207. Route::post('switch_h5', 'v1.LoginController/switch_h5')->name('switch_h5');// 切换账号
  208. //商品类
  209. Route::get('product/code/:id', 'v1.product.StoreProductController/code')->name('productCode');//商品分享二维码 推广员
  210. //公共类
  211. Route::post('upload/image', 'v1.PublicController/upload_image')->name('uploadImage');//图片上传
  212. //用户类 客服聊天记录
  213. Route::get('user/service/list', 'v1.user.StoreService/lst')->name('userServiceList');//客服列表
  214. Route::get('user/service/record', 'v1.user.StoreService/record')->name('userServiceRecord');//客服聊天记录
  215. Route::post('user/service/feedback', 'v1.user.StoreService/saveFeedback')->name('saveFeedback');//保存客服反馈信息
  216. Route::get('user/service/feedback', 'v1.user.StoreService/getFeedbackInfo')->name('getFeedbackInfo');//获得客服反馈头部信息
  217. Route::get('user/record', 'v1.user.StoreService/recordList')->name('recordList');//获取用户和客服的消息列表
  218. //用户类 用户
  219. Route::get('user', 'v1.user.UserController/user')->name('user');//个人中心
  220. Route::get('bank_info', 'v1.user.UserController/bankInfo')->name('bankInfo');//个人中心
  221. Route::post('user/spread', 'v1.user.UserController/spread')->name('userSpread');//静默绑定授权
  222. Route::post('user/edit', 'v1.user.UserController/edit')->name('userEdit');//用户修改信息
  223. Route::get('user/balance', 'v1.user.UserController/balance')->name('userBalance');//用户资金统计
  224. Route::get('userinfo', 'v1.user.UserController/userinfo')->name('userinfo');// 用户信息
  225. Route::get('user/rand_code', 'v1.user.UserController/randCode')->name('randCode');//查看用户code
  226. Route::get('user/visit_list', 'v1.user.UserController/visitList')->name('visitList');//商品浏览列表
  227. Route::delete('user/visit', 'v1.user.UserController/visitDelete')->name('visitDelete');//商品浏览记录删除
  228. //实名认证
  229. Route::post('rname', 'v1.user.UserController/rname')->name('realname');// 实名认证
  230. Route::post('user/check', 'v1.user.UserController/check')->name('check');//个人中心
  231. Route::get('rate', 'v1.user.UserController/rate')->name('rate');// 实名认证查询
  232. //积分类
  233. Route::get('award_integral/:type', 'v1.user.UserController/awardIntegralList')->name('awardIntegralList');//活动积分详情
  234. Route::post('award_integral/:id', 'v1.user.UserController/extractIntegral')->name('extractIntegral');//提取积分
  235. //用户类 地址
  236. Route::get('address/detail/:id', 'v1.user.UserAddressController/address')->name('address');//获取单个地址
  237. Route::get('address/list', 'v1.user.UserAddressController/address_list')->name('addressList');//地址列表
  238. Route::post('address/default/set', 'v1.user.UserAddressController/address_default_set')->name('addressDefaultSet');//设置默认地址
  239. Route::get('address/default', 'v1.user.UserAddressController/address_default')->name('addressDefault');//获取默认地址
  240. Route::post('address/edit', 'v1.user.UserAddressController/address_edit')->name('addressEdit');//修改 添加 地址
  241. Route::post('address/del', 'v1.user.UserAddressController/address_del')->name('addressDel');//删除地址
  242. //用户类 收藏
  243. Route::get('collect/user', 'v1.user.UserCollectController/collect_user')->name('collectUser');//收藏商品列表
  244. Route::post('collect/add', 'v1.user.UserCollectController/collect_add')->name('collectAdd');//添加收藏
  245. Route::post('collect/del', 'v1.user.UserCollectController/collect_del')->name('collectDel');//取消收藏
  246. Route::post('collect/all', 'v1.user.UserCollectController/collect_all')->name('collectAll');//批量添加收藏
  247. Route::get('brokerage_rank', 'v1.user.UserBrokerageController/brokerage_rank')->name('brokerageRank');//佣金排行
  248. Route::get('rank', 'v1.user.UserController/rank')->name('rank');//推广人排行
  249. //用戶类 分享
  250. Route::post('user/share', 'v1.PublicController/user_share')->name('user_share');//记录用户分享
  251. Route::get('user/share/words', 'v1.PublicController/copy_share_words')->name('user_share_words');//关键字分享
  252. //用户类 点赞
  253. // Route::post('like/add', 'user.UserController/like_add')->name('likeAdd');//添加点赞
  254. // Route::post('like/del', 'user.UserController/like_del')->name('likeDel');//取消点赞
  255. //用户类 签到
  256. Route::get('sign/config', 'v1.user.UserSignController/sign_config')->name('signConfig');//签到配置
  257. Route::get('sign/list', 'v1.user.UserSignController/sign_list')->name('signList');//签到列表
  258. Route::get('sign/month', 'v1.user.UserSignController/sign_month')->name('signIntegral');//签到列表(年月)
  259. Route::post('sign/user', 'v1.user.UserSignController/sign_user')->name('signUser');//签到用户信息
  260. Route::post('sign/integral', 'v1.user.UserSignController/sign_integral')->middleware(BlockerMiddleware::class)->name('signIntegral');//签到
  261. //优惠券类
  262. Route::post('coupon/receive', 'v1.activity.StoreCouponsController/receive')->name('couponReceive'); //领取优惠券
  263. Route::post('coupon/receive/batch', 'v1.activity.StoreCouponsController/receive_batch')->name('couponReceiveBatch'); //批量领取优惠券
  264. Route::get('coupons/user/:types', 'v1.activity.StoreCouponsController/user')->name('couponsUser');//用户已领取优惠券
  265. Route::get('coupons/order/:price', 'v1.activity.StoreCouponsController/order')->name('couponsOrder');//优惠券 订单列表
  266. //购物车类
  267. Route::get('cart/list', 'v1.order.StoreCartController/lst')->name('cartList'); //购物车列表
  268. Route::post('cart/compute', 'v1.order.StoreCartController/computeCart')->name('computeCart'); //购物车列表重新计算
  269. Route::post('cart/add', 'v1.order.StoreCartController/add')->middleware(BlockerMiddleware::class)->name('cartAdd'); //购物车添加
  270. Route::post('cart/del', 'v1.order.StoreCartController/del')->name('cartDel'); //购物车删除
  271. Route::post('order/cancel', 'v1.order.StoreOrderController/cancel')->name('orderCancel'); //订单取消
  272. Route::post('cart/num', 'v1.order.StoreCartController/num')->name('cartNum'); //购物车 修改商品数量
  273. Route::get('cart/count', 'v1.order.StoreCartController/count')->name('cartCount'); //购物车 获取数量
  274. //订单类
  275. Route::post('order/check_shipping', 'v1.order.StoreOrderController/checkShipping')->name('checkShipping'); //检测是否显示快递和自提标签
  276. Route::post('order/confirm', 'v1.order.StoreOrderController/confirm')->name('orderConfirm'); //订单确认
  277. Route::post('order/computed/:key', 'v1.order.StoreOrderController/computedOrder')->name('computedOrder'); //计算订单金额
  278. Route::post('order/create/:key', 'v1.order.StoreOrderController/create')->middleware(BlockerMiddleware::class)->name('orderCreate'); //订单创建
  279. Route::get('order/data', 'v1.order.StoreOrderController/data')->name('orderData'); //订单统计数据
  280. Route::get('order/list', 'v1.order.StoreOrderController/lst')->name('orderList'); //订单列表
  281. Route::get('order/detail/:uni', 'v1.order.StoreOrderController/detail')->name('orderDetail'); //订单详情
  282. Route::get('order/write/records/:id', 'v1.order.StoreOrderController/writeOffRecords')->name('writeOffRecords'); //订单核销记录
  283. Route::get('delivery_order/detail/:id', 'v1.order.StoreOrderController/deliveryOrderDetail')->name('deliveryOrderDetail'); //配送订单详情
  284. //订单售后
  285. Route::get('order/refund/reason', 'v1.order.StoreOrderController/refund_reason')->name('orderRefundReason'); //订单退款理由
  286. Route::get('order/refund/cart_info/:id', 'v1.order.StoreOrderController/refundCartInfo')->name('StoreOrderRefundCartInfo');//获取退款商品列表
  287. Route::post('order/refund/cart_info', 'v1.order.StoreOrderController/refundCartInfoList')->name('StoreOrderRefundCartInfoList');//获取退款商品列表
  288. Route::post('order/refund/apply/:id', 'v1.order.StoreOrderController/applyRefund')->middleware(BlockerMiddleware::class)->name('StoreOrderApplRefund');//订单申请退款V2
  289. Route::post('order/refund/verify', 'v1.order.StoreOrderController/refund_verify')->middleware(BlockerMiddleware::class)->name('orderRefundVerify'); //订单申请退款
  290. Route::post('order/refund/express', 'v1.order.StoreOrderController/refund_express')->name('orderRefundExpress'); //退货退款填写订单号
  291. Route::get('order/refund/list', 'v1.order.StoreOrderRefundController/lst')->name('orderRefundList'); //售后订单列表
  292. Route::get('order/refund/detail/:uni', 'v1.order.StoreOrderRefundController/detail')->name('orderRefundDetail'); //售后订单详情
  293. Route::post('order/refund/cancel/:uni', 'v1.order.StoreOrderRefundController/cancelApply')->name('orderRefundCancel'); //取消售后申请
  294. Route::get('order/refund/del/:uni', 'v1.order.StoreOrderRefundController/delRefundOrder')->name('delRefundOrder'); //删除已退款和拒绝退款的订单
  295. Route::post('order/take', 'v1.order.StoreOrderController/take')->name('orderTake'); //订单收货
  296. Route::get('order/express/:uni/[:type]', 'v1.order.StoreOrderController/express')->name('orderExpress'); //订单查看物流
  297. Route::post('order/del', 'v1.order.StoreOrderController/del')->name('orderDel'); //订单删除
  298. Route::post('order/again', 'v1.order.StoreOrderController/again')->name('orderAgain'); //订单 再次下单
  299. Route::post('order/pay', 'v1.order.StoreOrderController/pay')->name('orderPay'); //订单支付
  300. Route::post('order/product', 'v1.order.StoreOrderController/product')->name('orderProduct'); //订单商品信息
  301. Route::post('order/comment', 'v1.order.StoreOrderController/comment')->middleware(BlockerMiddleware::class)->name('orderComment'); //订单评价
  302. Route::get('order/pay_cashier', 'v1.order.StoreOrderController/payCashierOrder')->name('payCashierOrder'); //用户门店下单付款
  303. //活动---砍价
  304. Route::post('bargain/start', 'v1.activity.StoreBargainController/start')->name('bargainStart');//砍价开启
  305. Route::post('bargain/start/user', 'v1.activity.StoreBargainController/start_user')->name('bargainStartUser');//砍价 开启砍价用户信息
  306. Route::post('bargain/share', 'v1.activity.StoreBargainController/share')->name('bargainShare');//砍价 观看/分享/参与次数
  307. Route::post('bargain/help', 'v1.activity.StoreBargainController/help')->name('bargainHelp');//砍价 帮助好友砍价
  308. Route::post('bargain/help/price', 'v1.activity.StoreBargainController/help_price')->name('bargainHelpPrice');//砍价 砍掉金额
  309. Route::post('bargain/help/count', 'v1.activity.StoreBargainController/help_count')->name('bargainHelpCount');//砍价 砍价帮总人数、剩余金额、进度条、已经砍掉的价格
  310. Route::post('bargain/help/list', 'v1.activity.StoreBargainController/help_list')->name('bargainHelpList');//砍价 砍价帮
  311. Route::get('bargain/user/list', 'v1.activity.StoreBargainController/user_list')->name('bargainUserList');//砍价列表(已参与)
  312. Route::post('bargain/user/cancel', 'v1.activity.StoreBargainController/user_cancel')->name('bargainUserCancel');//砍价取消
  313. Route::get('bargain/poster_info/:bargainId', 'v1.activity.StoreBargainController/posterInfo')->name('posterInfo');//砍价海报详细信息
  314. //活动---拼团
  315. Route::get('combination/pink/:id', 'v1.activity.StoreCombinationController/pink')->name('combinationPink');//拼团开团
  316. Route::post('combination/remove', 'v1.activity.StoreCombinationController/remove')->name('combinationRemove');//拼团 取消开团
  317. Route::get('combination/poster_info/:id', 'v1.activity.StoreCombinationController/posterInfo')->name('pinkPosterInfo');//拼团海报详细获取
  318. //账单类
  319. Route::get('commission', 'v1.user.UserBrokerageController/commission')->name('commission');//推广数据 昨天的佣金 累计提现金额 当前佣金
  320. Route::post('spread/people', 'v1.user.UserController/spread_people')->name('spreadPeople');//推荐用户
  321. Route::post('spread/order', 'v1.user.UserBrokerageController/spread_order')->name('spreadOrder');//推广订单
  322. Route::get('spread/commission/:type', 'v1.user.UserBillController/spread_commission')->name('spreadCommission');//推广佣金明细
  323. Route::get('spread/count/:type', 'v1.user.UserBrokerageController/spread_count')->name('spreadCount');//推广 佣金 3/提现 4 总和
  324. Route::get('integral/list', 'v1.user.UserBillController/integral_list')->name('integralList');//积分记录
  325. Route::get('user/routine_code', 'v1.user.UserBillController/getRoutineCode')->name('getRoutineCode');//小程序二维码
  326. Route::get('user/spread_info', 'v1.user.UserBillController/getSpreadInfo')->name('getSpreadInfo');//获取分销背景等信息
  327. //提现类
  328. Route::get('extract/bank', 'v1.user.UserExtractController/bank')->name('extractBank');//提现银行/提现最低金额
  329. Route::post('extract/cash', 'v1.user.UserExtractController/cash')->name('extractCash');//提现申请
  330. Route::get('energy/bank', 'v1.user.UserExchangeController/bank')->name('exchangeEnergyBank');//能量值提取
  331. Route::post('energy/exchange', 'v1.user.UserExchangeController/exchange_energy')->name('exchangeEnergy');//能量值提取
  332. Route::post('energy/import', 'v1.user.UserExchangeController/brokerageToEnergy')->name('brokerageToEnergy');//能量值提取
  333. Route::post('energy/money', 'v1.user.UserExchangeController/energyToNowMoney')->name('energyToNowMoney');//能量值提取
  334. Route::post('brokerage/trade', 'v1.user.UserBrokerageController/trade')->name('brokerageTrade');//能量值提取
  335. Route::post('integral/trade', 'v1.user.UserController/trade')->name('integralTrade');//能量值提取
  336. Route::post('extract/calculator', 'v1.user.UserExtractController/cash_calculator')->name('extractCalculator');//提现申请
  337. Route::post('extract/employee', 'v1.user.UserController/addEmployee')->name('addEmployee');//提现申请
  338. Route::get('extract/sign_url', 'v1.user.UserController/applySignUrl')->name('applySignUrl');//提现申请
  339. //充值类
  340. Route::post('recharge/recharge', 'v1.user.UserRechargeController/recharge')->name('rechargeRecharge');//统一充值
  341. Route::post('recharge/routine', 'v1.user.UserRechargeController/routine')->name('rechargeRoutine');//小程序充值
  342. Route::post('recharge/wechat', 'v1.user.UserRechargeController/wechat')->name('rechargeWechat');//公众号充值
  343. Route::get('recharge/index', 'v1.user.UserRechargeController/index')->name('rechargeQuota');//充值余额选择
  344. //会员等级类
  345. Route::get('user/level/detection', 'v1.user.UserLevelController/detection')->name('userLevelDetection');//检测用户是否可以成为会员
  346. Route::get('user/level/grade', 'v1.user.UserLevelController/grade')->name('userLevelGrade');//会员等级列表
  347. Route::get('user/level/task/:id', 'v1.user.UserLevelController/task')->name('userLevelTask');//获取等级任务
  348. Route::get('user/level/info', 'v1.user.UserLevelController/userLevelInfo')->name('levelInfo');//获取等级任务
  349. Route::get('user/level/expList', 'v1.user.UserLevelController/expList')->name('expList');//获取等级任务
  350. Route::get('user/level/activate_info', 'v1.user.UserLevelController/activateInfo')->name('userActivateInfo');//用户激活会员卡需要的信息
  351. Route::post('user/level/activate', 'v1.user.UserLevelController/activateLevel')->name('userActivateLevel');//用户激活会员卡
  352. //首页获取未支付订单
  353. Route::get('order/nopay', 'v1.order.StoreOrderController/get_noPay')->name('getNoPay');//获取未支付订单
  354. Route::get('seckill/code/:id', 'v1.activity.StoreSeckillController/code')->name('seckillCode');//秒杀商品海报
  355. Route::get('combination/code/:id', 'v1.activity.StoreCombinationController/code')->name('combinationCode');//拼团商品海报
  356. //会员卡
  357. Route::get('user/member/card/index', 'v1.user.MemberCardController/index')->name('userMemberCardIndex');// 主页会员权益介绍页
  358. Route::post('user/member/card/draw', 'v1.user.MemberCardController/draw_member_card')->name('userMemberCardDraw');//卡密领取会员卡
  359. Route::post('user/member/card/create', 'v1.order.OtherOrderController/create')->name('userMemberCardCreate');//购买卡创建订单
  360. Route::get('user/member/coupons/list', 'v1.user.MemberCardController/memberCouponList')->name('userMemberCouponsList');//会员券列表
  361. Route::get('user/member/overdue/time', 'v1.user.MemberCardController/getOverdueTime')->name('userMemberOverdueTime');//会员时间
  362. //线下付款
  363. Route::post('order/offline/check/price', 'v1.order.OtherOrderController/computed_offline_pay_price')->name('orderOfflineCheckPrice'); //检测线下付款金额
  364. Route::post('order/offline/create', 'v1.order.OtherOrderController/create')->name('orderOfflineCreate'); //检测线下付款金额
  365. Route::get('order/offline/pay/type', 'v1.order.OtherOrderController/pay_type')->name('orderOfflineCreate'); //线下付款支付方式
  366. //积分商城订单
  367. Route::post('store_integral/order/confirm', 'v1.activity.StoreIntegralOrderController/confirm')->name('storeIntegralOrderConfirm'); //订单确认
  368. Route::post('store_integral/order/create', 'v1.activity.StoreIntegralOrderController/create')->name('storeIntegralOrderCreate'); //订单创建
  369. Route::get('store_integral/order/detail/:uni', 'v1.activity.StoreIntegralOrderController/detail')->name('storeIntegralOrderDetail'); //订单详情
  370. Route::get('store_integral/order/list', 'v1.activity.StoreIntegralOrderController/lst')->name('storeIntegralOrderList'); //订单列表
  371. Route::post('store_integral/order/take', 'v1.activity.StoreIntegralOrderController/take')->name('storeIntegralOrderTake'); //订单收货
  372. Route::get('store_integral/order/express/:uni', 'v1.activity.StoreIntegralOrderController/express')->name('storeIntegralOrderExpress'); //订单查看物流
  373. Route::post('store_integral/order/del', 'v1.activity.StoreIntegralOrderController/del')->name('storeIntegralOrderDel'); //订单删除
  374. //消息站内信
  375. Route::get('user/message_system/list', 'v1.user.MessageSystemController/message_list')->name('MessageSystemList'); //站内信列表
  376. Route::get('user/message_system/detail/:id', 'v1.user.MessageSystemController/detail')->name('MessageSystemDetail'); //详情
  377. //供应商申请
  378. Route::get('user/apply/record', 'v1.system.UserApplyController/userApplyRecord')->name('userApplyRecord'); //供应商申请记录
  379. Route::post('user/apply/supplier/:id', 'v1.system.UserApplyController/userApply')->name('userApplySupplier'); //供应商申请
  380. Route::get('user/apply/:id', 'v1.system.UserApplyController/getInfo')->name('userApplyInfo'); //单个申请记录数据
  381. })->middleware(StationOpenMiddleware::class)->middleware(AuthTokenMiddleware::class, true);
  382. /**
  383. * v1.1 版本路由
  384. */
  385. Route::group('v2', function () {
  386. //无需授权接口
  387. Route::group(function () {
  388. //小程序登录页面自动加载,返回用户信息的缓存key,返回是否强制绑定手机号
  389. Route::get('routine/auth_type', 'v2.wechat.AuthController/authType')->option(['real_name' => '小程序页面登录类型']);
  390. //小程序授权登录,返回token
  391. Route::get('routine/auth_login', 'v2.wechat.AuthController/authLogin')->option(['real_name' => '小程序授权登录']);
  392. //小程序授权绑定手机号
  393. Route::post('routine/auth_binding_phone', 'v2.wechat.AuthController/authBindingPhone')->option(['real_name' => '小程序授权绑定手机号']);
  394. //小程序手机号直接登录
  395. Route::post('routine/phone_login', 'v2.wechat.AuthController/phoneLogin')->option(['real_name' => '手机号直接登录']);
  396. //小程序授权后绑定手机号
  397. Route::post('routine/binding_phone', 'v2.wechat.AuthController/BindingPhone')->option(['real_name' => '小程序授权后绑定手机号']);
  398. //公众号授权登录,返回token
  399. Route::get('wechat/auth_login', 'v2.wechat.WechatController/authLogin')->option(['real_name' => '公众号授权登录']);
  400. //公众号授权绑定手机号
  401. Route::post('wechat/auth_binding_phone', 'v2.wechat.WechatController/silenceAuthBindingPhone')->option(['real_name' => '公众号授权绑定手机号']);
  402. //小程序授权
  403. Route::get('wechat/routine_auth', 'v2.wechat.AuthController/auth');
  404. //小程序静默授权
  405. Route::get('wechat/silence_auth', 'v2.wechat.AuthController/silenceAuthNoLogin');
  406. //小程序静默授权登陆
  407. Route::get('wechat/silence_auth_login', 'v2.wechat.AuthController/silenceAuth');
  408. //小程序授权绑定手机号
  409. Route::post('auth_bindind_phone', 'v2.wechat.AuthController/authBindingPhone');
  410. //小程序手机号登录直接绑定
  411. Route::post('phone_silence_auth', 'v2.wechat.AuthController/silenceAuthBindingPhone');
  412. //公众号授权登录
  413. Route::get('wechat/auth', 'v2.wechat.WechatController/auth');
  414. //公众号静默授权
  415. Route::get('wechat/wx_silence_auth', 'v2.wechat.WechatController/silenceAuthNoLogin');
  416. //公众号静默授权登陆
  417. Route::get('wechat/wx_silence_auth_login', 'v2.wechat.WechatController/silenceAuth');
  418. //微信手机号登录直接绑定
  419. Route::post('phone_wx_silence_auth', 'v2.wechat.WechatController/silenceAuthBindingPhone');
  420. //DIY接口
  421. Route::get('diy/get_diy/[:name]', 'v2.PublicController/getDiy');
  422. //是否强制绑定手机号
  423. Route::get('bind_status', 'v2.PublicController/bindPhoneStatus');
  424. //获取门店自提开启状态
  425. Route::get('diy/get_store_status', 'v2.PublicController/getStoreStatus');
  426. //一键换色
  427. Route::get('diy/color_change/:name', 'v2.PublicController/colorChange');
  428. //商品详情diy
  429. Route::get('diy/product_detail', 'v2.PublicController/productDetailDiy');
  430. //获取地址列表
  431. Route::get('cityList', 'v2.PublicController/cityList');
  432. //活动优惠活动商品列表
  433. Route::get('promotions/productList/:type', 'v2.activity.StorePromotions/productList');
  434. //优惠活动赠品信息
  435. Route::get('promotions/give_info/:id', 'v2.activity.StorePromotions/getPromotionsGive');
  436. });
  437. //需要授权
  438. Route::group(function () {
  439. Route::post('reset_cart', 'v2.order.StoreCartController/resetCart')->name('resetCart');
  440. Route::get('new_coupon', 'v2.activity.StoreCouponsController/getNewCoupon')->name('getNewCoupon');//获取新人券
  441. Route::post('user/user_update', 'v2.wechat.AuthController/updateInfo');
  442. Route::post('order/product_coupon/:orderId', 'v2.activity.StoreCouponsController/getOrderProductCoupon');//获取订单商品关联优惠券
  443. Route::get('user/service/record', 'v2.user.StoreService/record')->name('userServiceRecord');//客服聊天记录
  444. Route::get('cart_list', 'v2.order.StoreCartController/getCartList');
  445. Route::get('get_attr/:id/:type', 'v2.product.StoreProductController/getProductAttr');
  446. Route::post('set_cart_num', 'v2.order.StoreCartController/setCartNum');
  447. //订单申请发票
  448. Route::post('order/make_up_invoice', 'v2.order.StoreOrderInvoiceController/makeUp')->name('orderMakeUpInvoice');
  449. //用户发票列表
  450. Route::get('invoice', 'v2.user.UserInvoiceController/invoiceList')->name('userInvoiceLIst');
  451. //单个发票详情
  452. Route::get('invoice/detail/:id', 'v2.user.UserInvoiceController/invoice')->name('userInvoiceDetail');
  453. //修改|添加发票
  454. Route::post('invoice/save', 'v2.user.UserInvoiceController/saveInvoice')->name('userInvoiceSave');
  455. //设置默认发票
  456. Route::post('invoice/set_default/:id', 'v2.user.UserInvoiceController/setDefaultInvoice')->name('userInvoiceSetDefault');
  457. //获取默认发票
  458. Route::get('invoice/get_default/:type', 'v2.user.UserInvoiceController/getDefaultInvoice')->name('userInvoiceGetDefault');
  459. //删除发票
  460. Route::get('invoice/del/:id', 'v2.user.UserInvoiceController/delInvoice')->name('userInvoiceDel');
  461. //订单申请开票记录
  462. Route::get('order/invoice_list', 'v2.order.StoreOrderInvoiceController/list')->name('orderInvoiceList');
  463. //订单开票详情
  464. Route::get('order/invoice_detail/:uni', 'v2.order.StoreOrderInvoiceController/detail')->name('orderInvoiceList');
  465. //清除搜索记录
  466. Route::get('user/clean_search', 'v2.user.UserSearchController/cleanUserSearch')->name('cleanUserSearch');
  467. //更新公众号用户信息
  468. Route::get('user/wechat', 'v2.user.UserController/updateUserInfo')->name('updateUserInfo');
  469. //抽奖活动详情
  470. Route::get('lottery/info/[:factor]', 'v2.activity.LuckLotteryController/lotteryInfo')->name('lotteryInfo');
  471. //参与抽奖
  472. Route::post('lottery', 'v2.activity.LuckLotteryController/luckLottery')->middleware(BlockerMiddleware::class)->name('luckLottery');
  473. //领取奖品
  474. Route::post('lottery/receive', 'v2.activity.LuckLotteryController/lotteryReceive')->name('lotteryReceive');
  475. //抽奖记录
  476. Route::get('lottery/record', 'v2.activity.LuckLotteryController/lotteryRecord')->name('lotteryRecord');
  477. //获取分销等级列表
  478. Route::get('agent/level_list', 'v2.agent.AgentLevel/levelList')->name('agentLevelList');
  479. //获取分销等级任务列表
  480. Route::get('agent/level_task_list', 'v2.agent.AgentLevel/levelTaskList')->name('agentLevelTaskList');
  481. //获取用户余额、佣金、提现明细列表
  482. Route::get('user/money_list/:type', 'v2.user.UserController/userMoneyList')->name('userMoneyList');
  483. //获取用户推广用户列表
  484. Route::get('agent/agent_user_list/:type', 'v2.agent.AgentController/agentUserList')->name('agentUserList');
  485. //获取用户推广获得收益,佣金轮播,分销规则
  486. Route::get('agent/agent_info', 'v2.agent.AgentController/agentInfo')->name('agentInfo');
  487. //优惠活动凑单商品列表
  488. Route::get('promotions/collect_order/product', 'v2.activity.StorePromotions/collectOrderProduct');
  489. //拼单接口
  490. //验证是否在配送范围
  491. Route::get('is/within', 'v2.activity.UserCollageController/isWithinScopeDistribution')->name('isWithinScopeDistribution');
  492. //发起拼单
  493. Route::get('user/initiate/collage', 'v2.activity.UserCollageController/userInitiateCollage')->name('userInitiateCollage');
  494. //检查用户是否发起拼单
  495. Route::get('is/user/initiate/collage', 'v2.activity.UserCollageController/isUserInitiateCollage')->name('isUserInitiateCollage');
  496. //检查拼单
  497. Route::get('is/initiate/collage', 'v2.activity.UserCollageController/isInitiateCollage')->name('isInitiateCollage');
  498. //购物车 统计 数量
  499. Route::get('user/initiate/collage/count', 'v2.activity.UserCollageController/count')->name('count');
  500. //拼单购物车列表
  501. Route::get('user/initiate/collage/cart_list', 'v2.activity.UserCollageController/getCartList')->name('getCartList');
  502. //拼单购物车删除商品
  503. Route::post('del/collage/cart', 'v2.activity.UserCollageController/delUserCollagePartake')->name('delUserCollagePartake');
  504. //获取自提门店信息
  505. Route::get('collage/store/data', 'v2.activity.UserCollageController/getStoredata')->name('getStoredata');
  506. //用户添加拼单商品
  507. Route::post('add/collage/partake', 'v2.activity.UserCollageController/addCollagePartake')->name('addCollagePartake');
  508. //用户清空拼单数据
  509. Route::get('empty/collage/partake', 'v2.activity.UserCollageController/emptyCollagePartake')->name('emptyCollagePartake');
  510. //复制他人拼单商品
  511. Route::get('duplicate/collage/partake', 'v2.activity.UserCollageController/duplicateCollagePartake')->name('duplicateCollagePartake');
  512. //获取用户拼单数据
  513. Route::get('user/collage/partake', 'v2.activity.UserCollageController/getUserCollagePartake')->name('getUserCollagePartake');
  514. //取消拼单
  515. Route::get('user/cancel', 'v2.activity.UserCollageController/cancelInitiateCollage')->name('cancelInitiateCollage');
  516. //结算拼单
  517. Route::get('user/settle/collage', 'v2.activity.UserCollageController/userSettleAccountsCollage')->name('userSettleAccountsCollage');
  518. //桌码
  519. //门店桌码配置
  520. Route::get('table/data', 'v2.activity.UserCodeController/getData')->name('getData');
  521. //记录桌码
  522. Route::get('add/table/code', 'v2.activity.UserCodeController/setTableCode')->name('setTableCode');
  523. //检查是否开启桌码
  524. Route::get('is/table/code', 'v2.activity.UserCodeController/isUserTableCode')->name('isUserTableCode');
  525. //处理换桌商品
  526. Route::get('changing/table', 'v2.activity.UserCodeController/userChangingTables')->name('userChangingTables');
  527. //获取桌码记录
  528. Route::get('get/table/code', 'v2.activity.UserCodeController/getTableCode')->name('getTableCode');
  529. //获取门店信息
  530. Route::get('get/store/data', 'v2.activity.UserCodeController/getStoredata')->name('getStoredata');
  531. //获取二维码信息
  532. Route::get('get/code/data', 'v2.activity.UserCodeController/getTableCodeData')->name('getTableCodeData');
  533. //购物车 统计 数量
  534. Route::get('cart/count', 'v2.activity.UserCodeController/count')->name('count');
  535. //获取购物车
  536. Route::get('get/cate/list', 'v2.activity.UserCodeController/getCartList')->name('getCartList');
  537. //桌码购物车删除商品
  538. Route::post('del/table/cart', 'v2.activity.UserCodeController/delUserTableCodePartake')->name('delUserTableCodePartake');
  539. //确认下单
  540. Route::get('user/place/order', 'v2.activity.UserCodeController/userPlaceOrder')->name('userPlaceOrder');
  541. //用户添加桌码商品
  542. Route::get('add/table/cate', 'v2.activity.UserCodeController/addTableCodePartake')->name('addTableCodePartake');
  543. //用户清空购物车
  544. Route::get('user/empty/data', 'v2.activity.UserCodeController/emptyTablePartake')->name('emptyTablePartake');
  545. //获取桌码数据
  546. Route::get('get/table/partake', 'v2.activity.UserCodeController/getUserTableCodePartake')->name('getUserTableCodePartake');
  547. //结算拼单
  548. Route::get('user/settle/table', 'v2.activity.UserCodeController/userSettleAccountsCollage')->name('userSettleAccountsCollage');
  549. })->middleware(AuthTokenMiddleware::class, true);
  550. //授权不通过,不会抛出异常继续执行
  551. Route::group(function () {
  552. //用户搜索记录
  553. Route::get('user/search_list', 'v2.user.UserSearchController/getUserSeachList')->name('userSearchList');
  554. Route::get('get_today_coupon', 'v2.activity.StoreCouponsController/getTodayCoupon');//新优惠券弹窗接口
  555. Route::get('subscribe', 'v2.PublicController/subscribe')->name('WechatSubscribe');// 微信公众号用户是否关注
  556. //公共类
  557. Route::get('index', 'v2.PublicController/index')->name('index');//首页
  558. //优惠券
  559. Route::get('coupons', 'v2.activity.StoreCouponsController/lst')->name('couponsList'); //可领取优惠券列表
  560. //商品评价列表
  561. Route::get('reply/list/:id', 'v2.product.StoreProductController/reply_list')->name('v2replyList');//商品评价列表
  562. })->middleware(AuthTokenMiddleware::class, false);
  563. })->middleware(StationOpenMiddleware::class);
  564. /**
  565. * 营销路由
  566. */
  567. Route::group('marketing', function () {
  568. //无需登录接口
  569. Route::group(function () {
  570. });
  571. //未授权接口---不会抛异常
  572. Route::group(function () {
  573. Route::get('short_video', 'v1.activity.VideoController/list')->name('shortVideoList');//短视频列表
  574. Route::get('short_video/comment/:id', 'v1.activity.VideoController/commentList')->name('shortVideoCommentList');//短视频评论列表
  575. Route::get('short_video/product/:id', 'v1.activity.VideoController/productList')->name('shortVideoProductList');//短视频关联商品列表
  576. //新人礼
  577. Route::get('newcomer/product_list', 'v1.activity.StoreNewcomerController/lst')->name('newcomerProductList');//新人专享商品
  578. Route::get('newcomer/product_detail/:id', 'v1.activity.StoreNewcomerController/detail')->name('newcomerProductInfo');//新人商品详情
  579. })->middleware(AuthTokenMiddleware::class, false);
  580. //需要授权接口
  581. Route::group(function () {
  582. Route::post('short_video/comment/:id/:pid', 'v1.activity.VideoController/saveComment')->name('shortVideoComment');//短视频评论
  583. Route::get('short_video/comment_reply/:pid', 'v1.activity.VideoController/commentReplyList')->name('shortVideoCommentReplyList');//短视频评论回复列表
  584. Route::delete('short_video/comment/:id', 'v1.activity.VideoController/commentDelete')->name('shortVideoCommentDelete');//删除短视频评论
  585. Route::get('short_video/comment/:type/:id', 'v1.activity.VideoController/commentRelation')->name('shortVideoCommentRelation');//短视频评论点赞
  586. Route::get('short_video/:type/:id', 'v1.activity.VideoController/relation')->name('shortVideoRelation');//短视频点赞、收藏、分享
  587. //新人礼
  588. Route::get('newcomer/info', 'v1.activity.StoreNewcomerController/getInfo')->name('newcomerInfo');//新人礼信息
  589. Route::get('newcomer/gift', 'v1.activity.StoreNewcomerController/getGift')->name('newcomerInfo');//新人大礼包弹窗信息
  590. })->middleware(AuthTokenMiddleware::class, true);
  591. })->middleware(StationOpenMiddleware::class);
  592. /**
  593. * pc 路由
  594. */
  595. Route::group('pc', function () {
  596. //登陆接口
  597. Route::group(function () {
  598. Route::get('key', 'pc.LoginController/getLoginKey')->name('getLoginKey');//获取扫码登录key
  599. Route::get('scan/:key', 'pc.LoginController/scanLogin')->name('scanLogin');//检测扫码情况
  600. Route::get('get_appid', 'pc.LoginController/getAppid')->name('getAppid');//检测扫码情况
  601. Route::get('wechat_auth', 'pc.LoginController/wechatAuth')->name('wechatAuth');//检测扫码情况
  602. });
  603. //未授权接口
  604. Route::group(function () {
  605. Route::get('get_pay_vip_code', 'pc.HomeController/getPayVipCode')->name('getPayVipCode');//获取付费会员购买页面二维码
  606. Route::get('get_product_phone_buy', 'pc.HomeController/getProductPhoneBuy')->name('getProductPhoneBuy');//手机购买跳转url配置
  607. Route::get('get_banner', 'pc.HomeController/getBanner')->name('getBanner');//PC首页轮播图
  608. Route::get('get_category_product', 'pc.HomeController/getCategoryProduct')->name('getCategoryProduct');//首页分类尚品
  609. Route::get('get_products', 'pc.ProductController/getProductList')->name('getProductList');//商品列表
  610. Route::get('get_product_code/:product_id', 'pc.ProductController/getProductRoutineCode')->name('getProductRoutineCode');//商品详情小程序二维码
  611. Route::get('get_city/:pid', 'pc.PublicController/getCity')->name('getCity');//获取城市数据
  612. Route::get('check_order_status/:order_id/:end_time', 'pc.OrderController/checkOrderStatus')->name('checkOrderStatus');//轮询订单状态接口
  613. Route::get('get_company_info', 'pc.PublicController/getCompanyInfo')->name('getCompanyInfo');//获取公司信息
  614. Route::get('get_recommend/:type', 'pc.ProductController/getRecommendList')->name('getRecommendList');//获取推荐商品
  615. Route::get('get_wechat_qrcode', 'pc.PublicController/getWechatQrcode')->name('getWechatQrcode');//获取关注二维码
  616. Route::get('get_good_product', 'pc.ProductController/getGoodProduct')->name('getGoodProduct');//获取优品推荐
  617. })->middleware(AuthTokenMiddleware::class, false);
  618. //会员授权接口
  619. Route::group(function () {
  620. Route::get('get_cart_list', 'pc.CartController/getCartList')->name('getCartList');//购物车列表
  621. Route::get('get_balance_record/:type', 'pc.UserController/getBalanceRecord')->name('getBalanceRecord');//余额记录
  622. Route::get('get_order_list', 'pc.OrderController/getOrderList')->name('getOrderList');//订单列表
  623. Route::get('get_collect_list', 'pc.UserController/getCollectList')->name('getCollectList');//收藏列表
  624. Route::post('order/refund/cart_info', 'pc.OrderController/refundCartInfoList')->name('StoreOrderRefundCartInfoList');//获取退款商品列表
  625. Route::get('order/refund/list', 'pc.OrderController/refundList')->name('orderRefundList'); //售后订单列表
  626. })->middleware(AuthTokenMiddleware::class, true);
  627. })->middleware(StationOpenMiddleware::class);
  628. /**
  629. * 管理员订单操作类
  630. */
  631. Route::post('order/order_verific', 'v1.admin.StoreOrderController/order_verific')
  632. ->middleware(StationOpenMiddleware::class)
  633. ->middleware(AuthTokenMiddleware::class, true)
  634. ->middleware(\app\http\middleware\api\CustomerMiddleware::class)->name('order');//订单核销
  635. Route::group('admin', function () {
  636. Route::get('erp/config', 'v1.admin.StoreOrderController/getErpConfig')->name('getErpConfig');//获取erp配置
  637. Route::get('order/statistics', 'v1.admin.StoreOrderController/statistics')->name('adminOrderStatistics');//订单数据统计
  638. Route::get('order/data', 'v1.admin.StoreOrderController/data')->name('adminOrderData');//订单每月统计数据
  639. Route::get('order/list', 'v1.admin.StoreOrderController/lst')->name('adminOrderList');//订单列表
  640. Route::get('refund_order/list', 'v1.admin.StoreOrderController/refundOrderList')->name('RefundOrderList');//退款订单列表
  641. Route::get('refund_order/detail/:uni', 'v1.admin.StoreOrderController/refundOrderDetail')->name('RefundOrderDetail');//退款订单详情
  642. Route::post('refund_order/remark', 'v1.admin.StoreOrderController/refundRemark')->name('refundRemark');//退款订单备注
  643. Route::get('order/detail/:orderId', 'v1.admin.StoreOrderController/detail')->name('adminOrderDetail');//订单详情
  644. Route::get('order/delivery/gain/:orderId', 'v1.admin.StoreOrderController/delivery_gain')->name('adminOrderDeliveryGain');//订单发货获取订单信息
  645. Route::post('order/delivery/keep/:id', 'v1.admin.StoreOrderController/delivery_keep')->name('adminOrderDeliveryKeep');//订单发货
  646. Route::post('order/price', 'v1.admin.StoreOrderController/price')->name('adminOrderPrice');//订单改价
  647. Route::post('order/remark', 'v1.admin.StoreOrderController/remark')->name('adminOrderRemark');//订单备注
  648. Route::get('order/time', 'v1.admin.StoreOrderController/time')->name('adminOrderTime');//订单交易额时间统计
  649. Route::post('order/offline', 'v1.admin.StoreOrderController/offline')->name('adminOrderOffline');//订单支付
  650. Route::post('order/refund', 'v1.admin.StoreOrderController/refund')->name('adminOrderRefund');//订单退款
  651. Route::post('order/refund_agree/:id', 'v1.admin.StoreOrderController/agreeRefund')->name('adminOrderAgreeRefund');//商家同意退货退款
  652. Route::get('order/delivery', 'v1.admin.StoreOrderController/getDeliveryAll')->name('getDeliveryAll');//获取配送员
  653. Route::get('order/delivery_info/:orderId', 'v1.admin.StoreOrderController/getDeliveryInfo')->name('getDeliveryInfo');//获取电子面单默认信息
  654. Route::get('order/export_temp', 'v1.admin.StoreOrderController/getExportTemp')->name('getExportTemp');//获取电子面单模板获取
  655. Route::get('order/export_all', 'v1.admin.StoreOrderController/getExportAll')->name('getExportAll');//获取物流公司
  656. Route::get('order/split_cart_info/:id', 'v1.admin.StoreOrderController/split_cart_info')->name('StoreOrderSplitCartInfo')->option(['real_name' => '获取订单可拆分商品列表']);//获取订单可拆分商品列表
  657. Route::put('order/split_delivery/:id', 'v1.admin.StoreOrderController/split_delivery')->name('StoreOrderSplitDelivery')->option(['real_name' => '拆单发送货']);//拆单发送货
  658. })->middleware(StationOpenMiddleware::class)->middleware(AuthTokenMiddleware::class, true)->middleware(\app\http\middleware\api\CustomerMiddleware::class);
  659. /**
  660. * 移动端门店中心 路由
  661. */
  662. Route::group('store', function () {
  663. //无需登录接口
  664. Route::group(function () {
  665. Route::get('category', 'v1.store.CategoryController/category')->name('category');//商品分类
  666. });
  667. //未授权接口---不会抛异常
  668. Route::group(function () {
  669. Route::get('list', 'v1.store.StoreController/getStoreList')->name('storeList');//门店列表
  670. Route::get('customer/list/:store_id', 'v1.store.StoreController/getCustomerList')->name('customerList');//客服列表
  671. Route::get('customer/info/:id', 'v1.store.StoreController/getCustomerInfo')->name('customerInfo');//客服详情
  672. Route::get('products', 'v1.store.StoreProductController/lst')->name('storeProducts');//商品列表
  673. Route::get('brand', 'v1.store.StoreProductController/brand')->name('brand');//品牌列表
  674. })->middleware(AuthTokenMiddleware::class, false);
  675. //需要授权接口
  676. Route::group(function () {
  677. //门店店员订单操作类
  678. Route::get('staff/info', 'store.StoreStaffController/info')->name('storeStaffInfo');//门店店员信息
  679. Route::get('staff/statistics', 'store.StoreStaffController/statistics')->name('storeStatistics');//门店|店员统计信息
  680. Route::get('staff/data/:type', 'store.StoreStaffController/data');//详细信息列表
  681. Route::get('order/statistics', 'store.StoreOrderController/statistics')->name('adminOrderStatistics');//订单数据统计
  682. Route::get('order/data', 'store.StoreOrderController/data')->name('adminOrderData');//订单每月统计数据
  683. Route::get('staff/card/code', 'store.StoreStaffController/code');//详细信息列表
  684. Route::get('delivery/info', 'store.StoreDeliveryController/info')->name('storeStaffInfo');//配送员信息
  685. Route::get('delivery/statistics', 'store.StoreDeliveryController/statistics')->name('deliveryStatistics');//门店配送员统计信息
  686. Route::get('delivery/data', 'store.StoreDeliveryController/data')->name('deliveryData');//每月配送统计列表数据
  687. Route::get('delivery/order', 'store.StoreDeliveryController/orderList')->name('deliveryOrder');//配送员订单列表
  688. Route::get('delivery/list', 'store.StoreDeliveryController/getDeliveryAll')->name('getDeliveryAll');//获取配送员列表
  689. Route::get('order/list', 'store.StoreOrderController/lst')->name('storeOrderList');//订单列表
  690. Route::get('refund/list', 'store.StoreOrderController/refundList')->name('refundList');//订单列表
  691. Route::get('refund/detail/:id', 'store.StoreOrderController/refundDetail')->name('refundDetail');//订单列表
  692. Route::get('order/detail/:id', 'store.StoreOrderController/detail')->name('storeOrderDetail');//订单详情
  693. Route::get('order/delivery_info/:orderId', 'store.StoreOrderController/deliveryInfo')->name('storeOrderDeliveryInfo');//订单发货获取订单信息
  694. Route::post('order/delivery/:id', 'store.StoreOrderController/delivery')->name('storeOrderDelivery');//订单发货
  695. Route::get('order/split_cart_info/:id', 'store.StoreOrderController/split_cart_info')->name('StoreOrderSplitCartInfo');//获取订单可拆分商品列表
  696. Route::put('order/split_delivery/:id', 'store.StoreOrderController/split_delivery')->name('StoreOrderSplitDelivery');//拆单发送货
  697. Route::post('order/price', 'store.StoreOrderController/price')->name('storeOrderPrice');//订单改价
  698. Route::post('order/remark', 'store.StoreOrderController/remark')->name('storeOrderRemark');//订单备注
  699. Route::post('refund/remark', 'store.StoreOrderController/refundRemark')->name('refundRemark');//订单备注
  700. Route::post('order/offline', 'store.StoreOrderController/offline')->name('storeOrderOffline');//订单支付
  701. Route::post('order/refund', 'store.StoreOrderController/refund')->name('storeOrderRefund');//订单退款
  702. Route::post('order/refund_agree/:id', 'store.StoreOrderController/agreeRefund')->name('storeOrderAgreeRefund');//商家同意退货退款
  703. Route::get('order/export_temp', 'store.StoreOrderController/getExportTemp')->name('storeOrderExportTemp');//获取电子面单模板获取
  704. Route::get('order/export_all', 'store.StoreOrderController/getExportAll')->name('storeOrderExportAll');//获取物流公司
  705. Route::post('order/cancel/:id', 'store.StoreOrderController/cancel')->name('storeOrderCancel'); //订单取消
  706. Route::delete('order/del/:id', 'store.StoreOrderController/del')->name('storeOrderDel');//订单删除
  707. Route::get('order/writeoff_info/:type', 'store.StoreOrderController/writeoffOrderinfo')->name('writeoffOrderinfo');//扫码核销获取订单信息
  708. Route::get('order/cart_info/:type', 'store.StoreOrderController/orderCartInfo')->name('writeoffOrderCartInfo');//核销获取商品信息
  709. Route::post('order/writeoff/:type', 'store.StoreOrderController/wirteoff')->name('storeOrderWriteoff');//订单核销
  710. })->middleware(AuthTokenMiddleware::class, true);
  711. })->middleware(StationOpenMiddleware::class);
  712. /**
  713. * 企业微信
  714. */
  715. Route::group('work', function () {
  716. //获取企业微信jsSDK配置
  717. Route::get('config', 'v1.work.WorkController/config')->name('WorkConfig');
  718. //获取企业微信应用jsSDK配置
  719. Route::get('agentConfig', 'v1.work.WorkController/agentConfig')->name('agentConfig');
  720. //获取客户群详情
  721. Route::get('groupInfo', 'v1.work.GroupChatController/getGroupInfo')->name('getGroupInfo');
  722. //获取群成员列表
  723. Route::get('groupMember/:id', 'v1.work.GroupChatController/getChatMemberList')->name('getChatMemberList');
  724. Route::group(function () {
  725. //获取客户信息详情
  726. Route::get('client/info', 'v1.work.ClientController/getClientInfo')->name('getClientInfo');
  727. //获取客户订单列表
  728. Route::get('order/list', 'v1.work.OrderController/getUserOrderList')->name('getWorkOrderList');
  729. //获取客户订单详情
  730. Route::get('order/info/:id', 'v1.work.OrderController/orderInfo')->name('getWorkOrderInfo');
  731. //购买商品记录
  732. Route::get('product/cart_list', 'v1.work.ProductController/getCartProductList')->name('getCartProductList');
  733. //浏览记录商品记录
  734. Route::get('product/visit_list', 'v1.work.ProductController/getVisitProductList')->name('getVisitProductList');
  735. })->middleware(ClientMiddleware::class);
  736. });
  737. /**
  738. * miss 路由
  739. */
  740. Route::miss(function () {
  741. if (app()->request->isOptions()) {
  742. $header = Config::get('cookie.header');
  743. $header['Access-Control-Allow-Origin'] = app()->request->header('origin');
  744. return Response::create('ok')->code(200)->header($header);
  745. } else
  746. return Response::create()->code(404);
  747. });
  748. })->prefix('api.')->middleware(InstallMiddleware::class)->middleware(AllowOriginMiddleware::class)->middleware(StationOpenMiddleware::class);