behalfcustomerorder.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. use app\common\middleware\AllowOriginMiddleware;
  12. use app\common\middleware\LogMiddleware;
  13. use app\common\middleware\MerchantAuthMiddleware;
  14. use app\common\middleware\MerchantTokenMiddleware;
  15. use think\facade\Route;
  16. use app\common\middleware\MerchantCheckBaseInfoMiddleware;
  17. Route::group(function () {
  18. // 代客下单
  19. Route::group('store/behalf', function () {
  20. Route::get('productCategory', 'Product/category')->name('behalfProductCategory')->option([
  21. '_alias' => '商品分类',
  22. ]);
  23. Route::get('productList', 'Product/list')->name('behalfProductList')->option([
  24. '_alias' => '商品列表',
  25. ]);
  26. Route::get('productDetail/:id', 'Product/detail')->name('behalfProductDetail')->option([
  27. '_alias' => '商品规格详情',
  28. ]);
  29. Route::get('userQuery', 'User/query')->name('behalfUserQuery')->option([
  30. '_alias' => '会员查询',
  31. ]);
  32. Route::get('userInfo', 'User/info')->name('behalfUserInfo')->option([
  33. '_alias' => '会员详情',
  34. ]);
  35. Route::post('userCreate', 'User/create')->name('behalfUserCreate')->option([
  36. '_alias' => '会员添加',
  37. ]);
  38. Route::get('userAddressList', 'User/addressList')->name('behalfUserAddressList')->option([
  39. '_alias' => '地址列表',
  40. ]);
  41. Route::post('userAddressCreate', 'User/addressCreate')->name('behalfUserAddressCreate')->option([
  42. '_alias' => '地址添加',
  43. ]);
  44. Route::get('cartList', 'Cart/list')->name('behalfCartList')->option([
  45. '_alias' => '购物车列表',
  46. ]);
  47. Route::post('cartCreate', 'Cart/create')->name('behalfCartCreate')->option([
  48. '_alias' => '添加购物车',
  49. ]);
  50. Route::post('cartChange/:id', 'Cart/change')->name('behalfCartChange')->option([
  51. '_alias' => '修改购物车数据',
  52. ]);
  53. Route::delete('cartDelete/:id', 'Cart/delete')->name('behalfCartDelete')->option([
  54. '_alias' => '删除购物数据',
  55. ]);
  56. Route::post('cartClear', 'Cart/clear')->name('behalfCartClear')->option([
  57. '_alias' => '清空购物车',
  58. ]);
  59. Route::get('cartCount', 'Cart/count')->name('behalfCartCount')->option([
  60. '_alias' => '购物车总数量',
  61. ]);
  62. Route::post('cartUpdatePrice/:id', 'Cart/updatePrice')->name('behalfCartUpdatePrice')->option([
  63. '_alias' => '修改价格',
  64. ]);
  65. Route::post('cartBatchUpdatePrice', 'Cart/batchUpdatePrice')->name('behalfCartBatchUpdatePrice')->option([
  66. '_alias' => '批量修改价格',
  67. ]);
  68. Route::post('orderCheck', 'Order/check')->name('behalfCheck')->option([
  69. '_alias' => '校验订单',
  70. ]);
  71. Route::post('payConfig', 'Order/payConfig')->name('behalfPayConfig')->option([
  72. '_alias' => '支付配置',
  73. ]);
  74. Route::post('orderCreate', 'Order/create')->name('behalfCreate')->option([
  75. '_alias' => '创建订单',
  76. ]);
  77. Route::post('orderPay/:id', 'Order/pay')->name('behalfPay')->option([
  78. '_alias' => '支付',
  79. ]);
  80. Route::post('payStatus/:id', 'Order/payStatus')->name('behalfPayStatus')->option([
  81. '_alias' => '获取结果',
  82. ]);
  83. Route::post('orderVerify', 'Order/verify')->name('behalfVerify')->option([
  84. '_alias' => '余额支付获取验证码',
  85. ]);
  86. })->prefix('merchant.store.behalfcustomerorder.')->option([
  87. '_path'=>'/order/customer',
  88. '_auth' => true
  89. ]);
  90. })->middleware(AllowOriginMiddleware::class)
  91. ->middleware(MerchantTokenMiddleware::class, true)
  92. ->middleware(MerchantAuthMiddleware::class)
  93. ->middleware(MerchantCheckBaseInfoMiddleware::class)
  94. ->middleware(LogMiddleware::class);