Parcourir la source

Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

From-wh il y a 2 ans
Parent
commit
0feb7ebc1d
76 fichiers modifiés avec 298 ajouts et 190 suppressions
  1. 1 1
      crmeb/app/adminapi/controller/v1/setting/SystemCrud.php
  2. 12 4
      crmeb/app/adminapi/controller/v1/setting/SystemMenus.php
  3. 1 1
      crmeb/app/adminapi/route/agent.php
  4. 1 1
      crmeb/app/adminapi/route/app.php
  5. 1 1
      crmeb/app/adminapi/route/cms.php
  6. 1 1
      crmeb/app/adminapi/route/common.php
  7. 1 1
      crmeb/app/adminapi/route/crud.php
  8. 1 1
      crmeb/app/adminapi/route/diy.php
  9. 1 1
      crmeb/app/adminapi/route/export.php
  10. 1 1
      crmeb/app/adminapi/route/file.php
  11. 1 1
      crmeb/app/adminapi/route/finance.php
  12. 1 1
      crmeb/app/adminapi/route/freight.php
  13. 1 1
      crmeb/app/adminapi/route/live.php
  14. 3 3
      crmeb/app/adminapi/route/marketing.php
  15. 1 1
      crmeb/app/adminapi/route/merchant.php
  16. 1 1
      crmeb/app/adminapi/route/notify.php
  17. 2 2
      crmeb/app/adminapi/route/order.php
  18. 1 1
      crmeb/app/adminapi/route/product.php
  19. 1 1
      crmeb/app/adminapi/route/serve.php
  20. 1 1
      crmeb/app/adminapi/route/setting.php
  21. 1 1
      crmeb/app/adminapi/route/statistic.php
  22. 2 2
      crmeb/app/adminapi/route/system.php
  23. 1 1
      crmeb/app/adminapi/route/user.php
  24. 1 1
      crmeb/app/api/controller/v1/PublicController.php
  25. 3 0
      crmeb/app/api/controller/v1/order/StoreIntegralOrderController.php
  26. 2 1
      crmeb/app/api/controller/v1/store/StoreCartController.php
  27. 2 0
      crmeb/app/dao/activity/combination/StoreCombinationDao.php
  28. 1 1
      crmeb/app/dao/order/StoreOrderInvoiceDao.php
  29. 13 0
      crmeb/app/dao/system/SystemMenusDao.php
  30. 1 1
      crmeb/app/model/system/SystemRouteCate.php
  31. 1 1
      crmeb/app/services/activity/bargain/StoreBargainUserServices.php
  32. 1 0
      crmeb/app/services/activity/combination/StorePinkServices.php
  33. 6 1
      crmeb/app/services/activity/integral/StoreIntegralOrderServices.php
  34. 8 1
      crmeb/app/services/activity/integral/StoreIntegralServices.php
  35. 1 1
      crmeb/app/services/activity/seckill/StoreSeckillServices.php
  36. 2 2
      crmeb/app/services/order/StoreOrderComputedServices.php
  37. 1 0
      crmeb/app/services/system/SystemCrudServices.php
  38. 1 1
      crmeb/app/services/system/SystemRouteCateServices.php
  39. 43 14
      crmeb/app/services/system/SystemRouteServices.php
  40. 3 3
      crmeb/crmeb/services/crud/Controller.php
  41. 1 1
      crmeb/crmeb/services/crud/Make.php
  42. 3 3
      crmeb/crmeb/services/crud/Service.php
  43. 2 1
      crmeb/crmeb/services/crud/ViewPages.php
  44. 2 0
      crmeb/crmeb/services/crud/stubs/controller/save.stub
  45. 2 0
      crmeb/crmeb/services/crud/stubs/controller/update.stub
  46. 1 1
      crmeb/crmeb/services/crud/stubs/view/pages/crud/index.stub
  47. 1 1
      crmeb/crmeb/utils/Terminal.php
  48. 1 1
      crmeb/public/admin/index.html
  49. 1 0
      crmeb/public/admin/system_static/css/chunk-06565fa8.f33e8737.css
  50. 1 0
      crmeb/public/admin/system_static/css/chunk-0e1bff56.0499104f.css
  51. 1 0
      crmeb/public/admin/system_static/css/chunk-1b2bad82.65d216aa.css
  52. 1 0
      crmeb/public/admin/system_static/css/chunk-27331629.2437fd16.css
  53. 1 0
      crmeb/public/admin/system_static/css/chunk-33dc3354.eae4755a.css
  54. 1 0
      crmeb/public/admin/system_static/css/chunk-472197e0.1a216cc5.css
  55. 1 0
      crmeb/public/admin/system_static/css/chunk-53a4d7e3.7f74963c.css
  56. 1 0
      crmeb/public/admin/system_static/css/chunk-55df0dc3.e15adb10.css
  57. 1 0
      crmeb/public/admin/system_static/css/chunk-5c905c73.95b96584.css
  58. 1 0
      crmeb/public/admin/system_static/css/chunk-731d0dcd.79ec1310.css
  59. 1 0
      crmeb/public/admin/system_static/css/chunk-b12df032.4bb3bb3c.css
  60. 1 0
      crmeb/public/admin/system_static/css/chunk-cc93a18a.b92164ea.css
  61. 1 0
      crmeb/public/admin/system_static/js/app.31344de0.js
  62. 1 0
      crmeb/public/admin/system_static/js/chunk-06565fa8.f863be28.js
  63. 1 0
      crmeb/public/admin/system_static/js/chunk-0e1bff56.b928e897.js
  64. 1 0
      crmeb/public/admin/system_static/js/chunk-1b2bad82.f4303a78.js
  65. 1 0
      crmeb/public/admin/system_static/js/chunk-27331629.2e9f2283.js
  66. 1 0
      crmeb/public/admin/system_static/js/chunk-2d21da46.6c4bd930.js
  67. 1 0
      crmeb/public/admin/system_static/js/chunk-33dc3354.59bdb4de.js
  68. 1 0
      crmeb/public/admin/system_static/js/chunk-472197e0.51c6144a.js
  69. 1 0
      crmeb/public/admin/system_static/js/chunk-53a4d7e3.e1dfb597.js
  70. 7 0
      crmeb/public/admin/system_static/js/chunk-55df0dc3.828e7e2f.js
  71. 1 0
      crmeb/public/admin/system_static/js/chunk-5c905c73.4c6e2192.js
  72. 1 0
      crmeb/public/admin/system_static/js/chunk-731d0dcd.18a5f1aa.js
  73. 1 0
      crmeb/public/admin/system_static/js/chunk-b12df032.5dd38b51.js
  74. 1 0
      crmeb/public/admin/system_static/js/chunk-cc93a18a.d7369fa2.js
  75. 124 124
      template/admin/src/pages/setting/systemMenus/index.vue
  76. 1 0
      template/uni-app/pages/points_mall/exchange_record.vue

+ 1 - 1
crmeb/app/adminapi/controller/v1/setting/SystemCrud.php

@@ -231,7 +231,7 @@ class SystemCrud extends AuthController
     public function getMenus()
     {
         return app('json')->success(app()->make(SystemMenusServices::class)
-            ->getList(['auth_type' => 1], ['pid', 'id', 'menu_name as label', 'id as value']));
+            ->getList(['auth_type' => 1, 'is_show' => 1], ['auth_type', 'pid', 'id', 'menu_name as label', 'id as value']));
     }
 
     /**

+ 12 - 4
crmeb/app/adminapi/controller/v1/setting/SystemMenus.php

@@ -13,6 +13,7 @@ namespace app\adminapi\controller\v1\setting;
 
 use app\adminapi\controller\AuthController;
 use app\services\system\SystemMenusServices;
+use app\services\system\SystemRouteCateServices;
 use app\services\system\SystemRouteServices;
 use think\facade\App;
 use think\facade\Route;
@@ -274,14 +275,21 @@ class SystemMenus extends AuthController
     public function ruleList()
     {
         //获取所有的路由
-        $ruleList = app()->make(SystemRouteServices::class)->selectList(['app_name' => 'adminapi'], 'name,path,method,type,id')->toArray();
+        $ruleList = app()->make(SystemRouteCateServices::class)->selectList(['app_name' => 'adminapi'], 'id,name', 0, 0, 'id asc,sort desc', ['children'])->toArray();
         $menuApiList = $this->services->getColumn(['auth_type' => 2, 'is_del' => 0], "concat(`api_url`,'_',lower(`methods`)) as rule");
         if ($menuApiList) $menuApiList = array_column($menuApiList, 'rule');
         $list = [];
         foreach ($ruleList as $item) {
-            if ($item['type'] || !in_array($item['path'] . '_' . strtolower($item['method']), $menuApiList)) {
-                $item['real_name'] = $item['name'] ?? '';
-                $item['method'] = strtoupper($item['method']);
+            $children = [];
+            foreach ($item['children'] as $value) {
+                if ($value['type'] || !in_array($value['path'] . '_' . strtolower($value['method']), $menuApiList)) {
+                    $value['real_name'] = $value['name'] ?? '';
+                    $value['method'] = strtoupper($value['method']);
+                    $children[] = $value;
+                }
+            }
+            if ($children) {
+                $item['children'] = $children;
                 $list[] = $item;
             }
         }

+ 1 - 1
crmeb/app/adminapi/route/agent.php

@@ -93,4 +93,4 @@ Route::group('agent', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '分销']);

+ 1 - 1
crmeb/app/adminapi/route/app.php

@@ -154,4 +154,4 @@ Route::group('app', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '应用']);

+ 1 - 1
crmeb/app/adminapi/route/cms.php

@@ -52,4 +52,4 @@ Route::group('cms', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '文章']);

+ 1 - 1
crmeb/app/adminapi/route/common.php

@@ -48,5 +48,5 @@ Route::group(function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '公共']);
 

+ 1 - 1
crmeb/app/adminapi/route/crud.php

@@ -32,4 +32,4 @@ Route::group(function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => 'CRUD']);

+ 1 - 1
crmeb/app/adminapi/route/diy.php

@@ -74,4 +74,4 @@ Route::group('diy', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => 'DIY']);

+ 1 - 1
crmeb/app/adminapi/route/export.php

@@ -60,4 +60,4 @@ Route::group('export', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '导出']);

+ 1 - 1
crmeb/app/adminapi/route/file.php

@@ -47,4 +47,4 @@ Route::group('file', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '附件']);

+ 1 - 1
crmeb/app/adminapi/route/finance.php

@@ -54,4 +54,4 @@ Route::group('finance', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '财务']);

+ 1 - 1
crmeb/app/adminapi/route/freight.php

@@ -39,4 +39,4 @@ Route::group('freight', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '物流']);

+ 1 - 1
crmeb/app/adminapi/route/live.php

@@ -68,4 +68,4 @@ Route::group('live', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '直播']);

+ 3 - 3
crmeb/app/adminapi/route/marketing.php

@@ -97,9 +97,9 @@ Route::group('marketing', function () {
     //秒杀统计
     Route::get('seckill/statistics/head/:id', 'v1.marketing.StoreSeckill/seckillStatistics')->option(['real_name' => '秒杀统计']);
     //参与活动人员
-    Route::get('seckill/statistics/people/:id','v1.marketing.StoreSeckill/seckillPeople')->option(['real_name' => '秒杀参与人']);
+    Route::get('seckill/statistics/people/:id', 'v1.marketing.StoreSeckill/seckillPeople')->option(['real_name' => '秒杀参与人']);
     //秒杀订单
-    Route::get('seckill/statistics/order/:id','v1.marketing.StoreSeckill/seckillOrder')->option(['real_name' => '秒杀参与人']);
+    Route::get('seckill/statistics/order/:id', 'v1.marketing.StoreSeckill/seckillOrder')->option(['real_name' => '秒杀参与人']);
 
     //积分日志列表
     Route::get('integral', 'v1.marketing.UserPoint/index')->option(['real_name' => '积分日志列表']);
@@ -196,4 +196,4 @@ Route::group('marketing', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '营销']);

+ 1 - 1
crmeb/app/adminapi/route/merchant.php

@@ -53,4 +53,4 @@ Route::group('merchant', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '物流']);

+ 1 - 1
crmeb/app/adminapi/route/notify.php

@@ -48,4 +48,4 @@ Route::group('notify', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '消息']);

+ 2 - 2
crmeb/app/adminapi/route/order.php

@@ -111,7 +111,7 @@ Route::group('order', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '订单']);
 
 /**
  * 售后 相关路由
@@ -138,4 +138,4 @@ Route::group('refund', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '退款']);

+ 1 - 1
crmeb/app/adminapi/route/product.php

@@ -105,4 +105,4 @@ Route::group('product', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '商品']);

+ 1 - 1
crmeb/app/adminapi/route/serve.php

@@ -65,4 +65,4 @@ Route::group('serve', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '一号通']);

+ 1 - 1
crmeb/app/adminapi/route/setting.php

@@ -322,4 +322,4 @@ Route::group('setting', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '设置']);

+ 1 - 1
crmeb/app/adminapi/route/statistic.php

@@ -76,4 +76,4 @@ Route::group('statistic', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '统计']);

+ 2 - 2
crmeb/app/adminapi/route/system.php

@@ -154,7 +154,7 @@ Route::group('system', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '维护']);
 
 Route::group('system', function () {
 
@@ -182,5 +182,5 @@ Route::group('system', function () {
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminEditorTokenMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '文件']);
 

+ 1 - 1
crmeb/app/adminapi/route/user.php

@@ -164,4 +164,4 @@ Route::group('user', function () {
     \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
     \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
     \app\adminapi\middleware\AdminLogMiddleware::class
-]);
+])->option(['cate_name' => '用户']);

+ 1 - 1
crmeb/app/api/controller/v1/PublicController.php

@@ -681,7 +681,7 @@ class PublicController
         $data['member_card_status'] = sys_config('member_card_status');//是否开启付费会员
         $data['member_price_status'] = sys_config('member_price_status');//商品会员折扣价展示启用
         $data['ali_pay_status'] = sys_config('ali_pay_status') != '0';//支付宝是否启用
-        $data['wechat_pay_status'] = sys_config('pay_weixin_open') != '0';//微信是否启用
+        $data['pay_weixin_open'] = sys_config('pay_weixin_open') != '0';//微信是否启用
         $data['yue_pay_status'] = sys_config('yue_pay_status') == 1 && sys_config('balance_func_status') != 0;//余额是否启用
         $data['offline_pay_status'] = sys_config('offline_pay_status') == 1;//线下是否启用
         $data['friend_pay_status'] = sys_config('friend_pay_status') == 1;//好友是否启用

+ 3 - 0
crmeb/app/api/controller/v1/order/StoreIntegralOrderController.php

@@ -121,6 +121,7 @@ class StoreIntegralOrderController
     /**
      * 订单 查看物流
      * @param Request $request
+     * @param ExpressServices $expressServices
      * @param $uni
      * @return mixed
      */
@@ -128,6 +129,8 @@ class StoreIntegralOrderController
     {
         if (!$uni || !($order = $this->services->getUserOrderDetail($uni, $request->uid()))) return app('json')->fail(410173);
         if ($order['delivery_type'] != 'express' || !$order['delivery_id']) return app('json')->fail(410206);
+        $order['price'] = (int)$order['price'];
+        $order['total_price'] = (int)$order['total_price'];
         $cacheName = 'integral' . $order['order_id'] . $order['delivery_id'];
         return app('json')->success([
             'order' => $order,

+ 2 - 1
crmeb/app/api/controller/v1/store/StoreCartController.php

@@ -124,7 +124,8 @@ class StoreCartController
             ['id', 0],//购物车编号
             ['number', 0],//购物车编号
         ]);
-        if (!$where['id'] || !$where['number'] || !is_numeric($where['id']) || !is_numeric($where['number'])) return app('json')->fail(100100);
+        if (!$where['id'] || !is_numeric($where['id'])) return app('json')->fail(100100);
+        if (!$where['number'] || !is_numeric($where['number'])) return app('json')->fail(100007);
         $res = $this->services->changeUserCartNum($where['id'], $where['number'], $request->uid());
         if ($res) return app('json')->success(100001);
         else return app('json')->fail(100007);

+ 2 - 0
crmeb/app/dao/activity/combination/StoreCombinationDao.php

@@ -59,6 +59,8 @@ class StoreCombinationDao extends BaseDao
                     $query->name('store_category')->where('pid', $where['cid'])->field('id')->select();
                 })->field('product_id')->select();
             });
+        })->when(isset($where['id']) && $where['id'], function ($query) use ($where) {
+            $query->where('id', $where['id']);
         });
     }
 

+ 1 - 1
crmeb/app/dao/order/StoreOrderInvoiceDao.php

@@ -53,7 +53,7 @@ class StoreOrderInvoiceDao extends BaseDao
         return parent::search($where, $search)->when($type, function ($query) use ($type) {
             switch ($type) {
                 case 1://待开
-                    $query->where('is_invoice', 0)->where('invoice_time', 0)->where('is_refund', 0);
+                    $query->where('is_invoice', 0)->where('is_refund', 0);
                     break;
                 case 2://已开
                     $query->where('is_invoice', 1);

+ 13 - 0
crmeb/app/dao/system/SystemMenusDao.php

@@ -145,4 +145,17 @@ class SystemMenusDao extends BaseDao
         return $this->search(['is_show' => 1, 'auth_type' => 1, 'is_del' => 0, 'is_show_path' => 0])
             ->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC')->select();
     }
+
+    /**
+     * @param string $path
+     * @param string $method
+     * @return bool
+     * @author 等风来
+     * @email 136327134@qq.com
+     * @date 2023/4/20
+     */
+    public function deleteMenu(string $path, string $method)
+    {
+        return $this->getModel()->where('api_url', $path)->where('methods', $method)->delete();
+    }
 }

+ 1 - 1
crmeb/app/model/system/SystemRouteCate.php

@@ -39,6 +39,6 @@ class SystemRouteCate extends BaseModel
      */
     public function children()
     {
-        return $this->hasMany(SystemRoute::class, 'cate_id', 'id')->field(['id', 'cate_id', 'name', 'path', 'method'])->order('add_time desc');
+        return $this->hasMany(SystemRoute::class, 'cate_id', 'id')->field(['id', 'type', 'cate_id', 'name', 'name as real_name', 'path', 'method'])->order('add_time desc');
     }
 }

+ 1 - 1
crmeb/app/services/activity/bargain/StoreBargainUserServices.php

@@ -220,7 +220,7 @@ class StoreBargainUserServices extends BaseServices
     public function userBargainStatusFail($bargain_id, $is_true)
     {
         if ($is_true) {
-            $this->dao->delete(['bargain_id' => $bargain_id, 'status' => 1]);
+            $this->dao->delete(['bargain_id' => $bargain_id]);
             /** @var StoreBargainUserHelpServices $service */
             $service = app()->make(StoreBargainUserHelpServices::class);
             $service->delete(['bargain_id' => $bargain_id]);

+ 1 - 0
crmeb/app/services/activity/combination/StorePinkServices.php

@@ -184,6 +184,7 @@ class StorePinkServices extends BaseServices
                 $v['s'] = date('s', (int)$v['stop_time']);
                 $pinkAll[] = $v['id'];//开团团长ID
                 $v['stop_time'] = (int)$v['stop_time'];
+                $v['avatar'] = set_file_url($v['avatar']);
             }
             return [$list, $pinkAll];
         }

+ 6 - 1
crmeb/app/services/activity/integral/StoreIntegralOrderServices.php

@@ -120,6 +120,8 @@ class StoreIntegralOrderServices extends BaseServices
         } else if ($order['status'] == 3) {
             $order['status_name'] = '已完成';
         }
+        $order['price'] = (int)$order['price'];
+        $order['total_price'] = (int)$order['total_price'];
         return $order;
     }
 
@@ -139,6 +141,8 @@ class StoreIntegralOrderServices extends BaseServices
             } else if ($item['status'] == 3) {
                 $item['status_name'] = '已完成';
             }
+            $item['price'] = (int)$item['price'];
+            $item['total_price'] = (int)$item['total_price'];
         }
         return $data;
     }
@@ -338,11 +342,12 @@ class StoreIntegralOrderServices extends BaseServices
         }
         $data = [];
         $attrValue = is_object($attrValue) ? $attrValue->toArray() : $attrValue;
+        $attrValue['price'] = (int)$attrValue['price'];
         /** @var UserBillServices $userBillServices */
         $userBillServices = app()->make(UserBillServices::class);
         $data['integral'] = bcsub((string)$user['integral'], (string)$userBillServices->getBillSum(['uid' => $user['uid'], 'is_frozen' => 1]), 0);
         $data['num'] = $num;
-        $data['total_price'] = bcmul($num, $attrValue['price'], 2);
+        $data['total_price'] = bcmul($num, $attrValue['price']);
         $data['productInfo'] = $attrValue;
         return $data;
     }

+ 8 - 1
crmeb/app/services/activity/integral/StoreIntegralServices.php

@@ -119,7 +119,7 @@ class StoreIntegralServices extends BaseServices
         if (!$data) {
             throw new AdminException(400337);
         }
-        if(!$data['attrs']) throw new AdminException(400337);
+        if (!$data['attrs']) throw new AdminException(400337);
         $attrs = [];
         foreach ($data['attrs'] as $k => $v) {
             $attrs[$v['product_id']][] = $v;
@@ -283,6 +283,7 @@ class StoreIntegralServices extends BaseServices
         $siteUrl = sys_config('site_url');
         $storeInfo['image'] = set_file_url($storeInfo['image'], $siteUrl);
         $storeInfo['image_base'] = set_file_url($storeInfo['image'], $siteUrl);
+        $storeInfo['product_price'] = (int)$storeInfo['product_price'];
         $storeInfo['sale_stock'] = 0;
         if ($storeInfo['stock'] > 0) $storeInfo['sale_stock'] = 1;
         $uid = $request->uid();
@@ -296,6 +297,12 @@ class StoreIntegralServices extends BaseServices
         /** @var StoreProductAttrServices $storeProductAttrServices */
         $storeProductAttrServices = app()->make(StoreProductAttrServices::class);
         list($productAttr, $productValue) = $storeProductAttrServices->getProductAttrDetail($id, $uid, 0, 4, $storeInfo['product_id']);
+        foreach ($productValue as &$item) {
+            $item['cost'] = (int)$item['cost'];
+            $item['ot_price'] = (int)$item['ot_price'];
+            $item['price'] = (int)$item['price'];
+            $item['vip_price'] = (int)$item['vip_price'];
+        }
         $data['productAttr'] = $productAttr;
         $data['productValue'] = $productValue;
         /** @var StoreVisitServices $storeVisit */

+ 1 - 1
crmeb/app/services/activity/seckill/StoreSeckillServices.php

@@ -469,7 +469,7 @@ class StoreSeckillServices extends BaseServices
         /** @var StoreProductServices $storeProductService */
         $storeProductService = app()->make(StoreProductServices::class);
         $productInfo = $storeProductService->get($storeInfo['product_id']);
-        $storeInfo['total'] = $productInfo['sales'] + $productInfo['ficti'];
+        $storeInfo['total'] = $productInfo['sales'] + $productInfo['ficti'] + $storeInfo['sales'];
 
         if (sys_config('share_qrcode', 0) && request()->isWechat()) {
             /** @var QrcodeServices $qrcodeService */

+ 2 - 2
crmeb/app/services/order/StoreOrderComputedServices.php

@@ -226,8 +226,8 @@ class StoreOrderComputedServices extends BaseServices
         // 可用积分
         $usable = bcsub((string)$userInfo['integral'], (string)$userBillServices->getBillSum(['uid' => $userInfo['uid'], 'is_frozen' => 1]), 0);
 
-        $SurplusIntegral = 0;
-        if ($useIntegral && $userInfo['integral'] > 0) {
+        $SurplusIntegral = $usable;
+        if ($useIntegral && $userInfo['integral'] > 0 && $other['integralRatio'] > 0) {
             //积分抵扣上限
             $integralMaxNum = sys_config('integral_max_num', 200);
             if ($integralMaxNum > 0 && $usable > $integralMaxNum) {

+ 1 - 0
crmeb/app/services/system/SystemCrudServices.php

@@ -536,6 +536,7 @@ class SystemCrudServices extends BaseServices
         $controller = app()->make(Controller::class);
         $controller->setFilePathName($filePath['controller'] ?? '')->setbasePath($basePath)->handle($tableName, [
             'usePath' => $service->getUsePath(),
+            'validateName' => '\\' . str_replace('/', '\\', $validate->getUsePath()) . '::class',
             'field' => array_column($options['fromField'], 'field'),
         ]);
         //生成路由

+ 1 - 1
crmeb/app/services/system/SystemRouteCateServices.php

@@ -103,7 +103,7 @@ class SystemRouteCateServices extends BaseServices
         }
         $options = $this->dao->selectList(['app_name' => $appName], 'name as label,id as value,id,pid')->toArray();
         $rule = [
-            FormBuilder::cascader('path', '上级分类', $path)->data(get_tree_children($options)),
+//            FormBuilder::cascader('path', '上级分类', $path)->data(get_tree_children($options)),
             FormBuilder::input('name', '分类名称', $cateInfo['name'] ?? '')->required(),
             FormBuilder::number('sort', '排序', (int)($cateInfo['sort'] ?? 0)),
             FormBuilder::hidden('app_name', $appName)

+ 43 - 14
crmeb/app/services/system/SystemRouteServices.php

@@ -170,13 +170,13 @@ class SystemRouteServices extends BaseServices
      * @email 136327134@qq.com
      * @date 2023/4/11
      */
-    public function topCateId(string $app)
+    public function topCateId(string $app, string $name = '全部权限')
     {
-        $id = app()->make(SystemRouteCateServices::class)->value(['app_name' => $app, 'name' => '全部权限', 'pid' => 0], 'id');
+        $id = app()->make(SystemRouteCateServices::class)->value(['app_name' => $app, 'name' => $name, 'pid' => 0], 'id');
         if (!$id) {
             $res = app()->make(SystemRouteCateServices::class)->save([
                 'app_name' => $app,
-                'name' => '全部权限',
+                'name' => $name,
                 'pid' => 0,
                 'add_time' => time(),
             ]);
@@ -195,21 +195,38 @@ class SystemRouteServices extends BaseServices
     public function syncRoute(string $app = 'adminapi')
     {
         $id = $this->topCateId($app);
+        $commmonId = $this->topCateId($app, '公共权限');
         $listAll = $this->getRouteListAll($app);
+
+        $list = [];
+        foreach ($listAll as $item) {
+            if (isset($item['option']['is_common']) && $item['option']['is_common']) {
+                $cateId = $commmonId;
+            } else {
+                if (!isset($item['option']['cate_name'])) {
+                    $cateId = $id;
+                } else {
+                    $cateId = $this->topCateId($app, $item['option']['cate_name']);
+                }
+            }
+            $list[$cateId][] = $item;
+        }
         //保持新增的权限路由
         $data = $this->dao->selectList(['app_name' => $app], 'path,method')->toArray();
         $save = [];
-        foreach ($listAll as $item) {
-            if (!$this->diffRoute($data, $item['rule'], $item['method']) && strstr($item['rule'], '<MISS>') === false) {
-                $save[] = [
-                    'name' => $item['option']['real_name'] ?? $item['name'],
-                    'path' => $item['rule'],
-                    'cate_id' => $id,
-                    'app_name' => $app,
-                    'type' => isset($item['option']['is_common']) && $item['option']['is_common'] ? 1 : 0,
-                    'method' => $item['method'],
-                    'add_time' => date('Y-m-d H:i:s'),
-                ];
+        foreach ($list as $key => $value) {
+            foreach ($value as $item) {
+                if (!$this->diffRoute($data, $item['rule'], $item['method']) && strstr($item['rule'], '<MISS>') === false) {
+                    $save[] = [
+                        'name' => $item['option']['real_name'] ?? $item['name'],
+                        'path' => $item['rule'],
+                        'cate_id' => $key,
+                        'app_name' => $app,
+                        'type' => isset($item['option']['is_common']) && $item['option']['is_common'] ? 1 : 0,
+                        'method' => $item['method'],
+                        'add_time' => date('Y-m-d H:i:s'),
+                    ];
+                }
             }
         }
 
@@ -219,14 +236,26 @@ class SystemRouteServices extends BaseServices
         //删除不存在的权限路由
         $data = $this->dao->selectList(['app_name' => $app], 'path,method,id')->toArray();
         $delete = [];
+        $deleteData = [];
         foreach ($data as $item) {
             if (!$this->diffRoute($listAll, $item['path'], $item['method'], 'rule') && $item['path'] !== '<MISS>') {
                 $delete[] = $item['id'];
+                $deleteData[] = [
+                    'path' => $item['path'],
+                    'methods' => $item['method']
+                ];
             }
         }
+        //删除不存在的路由
         if ($delete) {
             $this->dao->delete([['id', 'in', $delete]]);
         }
+        //删除不存在的权限
+        if ($deleteData) {
+            foreach ($deleteData as $item) {
+                app()->make(SystemMenusServices::class)->deleteMenu($item['path'], $item['method']);
+            }
+        }
     }
 
     /**

+ 3 - 3
crmeb/crmeb/services/crud/Controller.php

@@ -53,8 +53,8 @@ class Controller extends Make
     {
         $path = $options['path'] ?? '';
         $contentPhp = '';
-        $var = ["{%date%}"];
-        $fieldPhp = [$this->value['date']];
+        $var = ["{%date%}", '{%validateName%}'];
+        $fieldPhp = [$this->value['date'], $options['validateName'] ?? ''];
 
         $action = $options['action'] ?? [];
         $field = $options['field'] ?? [];
@@ -94,7 +94,7 @@ class Controller extends Make
         $this->value['name'] = $className;
         $this->value['path'] = $this->getfolderPath($path);
         $this->value['content-php'] = $contentPhp;
-        $this->value['use-php'] = "use " . $options['usePath'] . "Services;\n";
+        $this->value['use-php'] = "use " . str_replace('/', '\\', $options['usePath']) . "Services;\n";
 
         $contentStr = str_replace($this->var, $this->value, $contentController);
 

+ 1 - 1
crmeb/crmeb/services/crud/Make.php

@@ -236,7 +236,7 @@ abstract class Make
             $this->value['path'] = $this->getfolderPath($path);
         }
         if (isset($this->value['use-php']) && !empty($options['usePath'])) {
-            $this->value['use-php'] = "use " . $options['usePath'] . ";\n";
+            $this->value['use-php'] = "use " . str_replace('/', '\\', $options['usePath']) . ";\n";
         }
 
         $contentStr = str_replace($this->var, $this->value, $content);

+ 3 - 3
crmeb/crmeb/services/crud/Service.php

@@ -75,7 +75,7 @@ class Service extends Make
                         $from[] = $this->tab(2) . $this->getframeImagesPhpContent($item['field'], $item['name'], $item['required'] ?? false) . ';';
                         break;
                     default:
-                        $from[] = $this->tab(2) . '$rule[] = FormBuilder::' . $item['type'] . '("' . $item['field'] . '","' . $item['name'] . '",$info["' . $item['field'] . '"] ?? "")' . $this->getOptionContent($item['option'] ?? []) . (!empty($item['required']) ? '->required()' : '') . ';';
+                        $from[] = $this->tab(2) . '$rule[] = FormBuilder::' . $item['type'] . '("' . $item['field'] . '","' . $item['name'] . '",$info["' . $item['field'] . '"] ?? "")' . $this->getOptionContent(in_array($item['type'], ['radio']), $item['option'] ?? []) . (!empty($item['required']) ? '->required()' : '') . ';';
                         break;
                 }
 
@@ -117,9 +117,9 @@ class Service extends Make
      * @email 136327134@qq.com
      * @date 2023/3/23
      */
-    protected function getOptionContent(array $option = [])
+    protected function getOptionContent(bool $isOption, array $option = [])
     {
-        if (!$option) {
+        if (!$option && $isOption) {
             $option = [
                 ['value' => 1, 'label' => '开启'],
                 ['value' => 0, 'label' => '关闭']

+ 2 - 1
crmeb/crmeb/services/crud/ViewPages.php

@@ -88,8 +88,9 @@ class ViewPages extends Make
             }
             $columnStr[] = ($key == 0 ? $this->tab(2) : '') . "{\n" . $this->tab(3) . "title:\"{$item['name']}\"," . $this->tab(2) . "\n" . $this->tab(3) . "key:\"{$item['field']}\"\n" . $this->tab(2) . "}\n";
         }
-        $this->value['route'] = $route;
         $this->value['auth'] = Str::snake($name);
+        $this->value['componentName'] = $this->value['auth'];
+        $this->value['route'] = $route;
         $this->value['content-vue'] = $columnStr ? "\n" . implode($this->tab(2) . ',', $columnStr) . $this->tab(2) . ',' : '';
         $this->value['pathApiJs'] = $options['pathApiJs'] ?? '';
         $this->value['nameStudly'] = Str::studly($name);

+ 2 - 0
crmeb/crmeb/services/crud/stubs/controller/save.stub

@@ -9,6 +9,8 @@
 {%field-php%}
         ]);
 
+        validate({%validateName%})->check($data);
+
         $this->service->crudSave($data);
 
         return app('json')->success(100021);

+ 2 - 0
crmeb/crmeb/services/crud/stubs/controller/update.stub

@@ -14,6 +14,8 @@
 {%field-php%}
         ]);
 
+        validate({%validateName%})->check($data);
+
         $this->service->crudUpdate((int)$id, $data);
 
         return app('json')->success(100001);

+ 1 - 1
crmeb/crmeb/services/crud/stubs/view/pages/crud/index.stub

@@ -34,7 +34,7 @@
 import { mapState } from 'vuex';
 import { {%nameCamel%}SaveApi, {%nameCamel%}DeleteApi, {%nameCamel%}UpdateApi, get{%nameStudly%}CreateApi, get{%nameStudly%}EditApi, get{%nameStudly%}ListApi} from '{%pathApiJs%}';
 export default {
-  name: 'user_group',
+  name: '{%componentName%}',
   data() {
     return {
       grid: {

+ 1 - 1
crmeb/crmeb/utils/Terminal.php

@@ -180,7 +180,7 @@ class Terminal
      * @email 136327134@qq.com
      * @date 2023/4/13
      */
-    protected function echoOutputFlag(string $message)
+    public function echoOutputFlag(string $message)
     {
         if ($this->output && $this->output instanceof Output) {
             $this->output->info($message);

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
crmeb/public/admin/index.html


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-06565fa8.f33e8737.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-0e1bff56.0499104f.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-1b2bad82.65d216aa.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-27331629.2437fd16.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-33dc3354.eae4755a.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-472197e0.1a216cc5.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-53a4d7e3.7f74963c.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-55df0dc3.e15adb10.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-5c905c73.95b96584.css


+ 1 - 0
crmeb/public/admin/system_static/css/chunk-731d0dcd.79ec1310.css

@@ -0,0 +1 @@
+.tableBox[data-v-3b385f76] .ivu-table-header table{border:none!important}

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-b12df032.4bb3bb3c.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/css/chunk-cc93a18a.b92164ea.css


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/app.31344de0.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-06565fa8.f863be28.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-0e1bff56.b928e897.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-1b2bad82.f4303a78.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-27331629.2e9f2283.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-2d21da46.6c4bd930.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-33dc3354.59bdb4de.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-472197e0.51c6144a.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-53a4d7e3.e1dfb597.js


Fichier diff supprimé car celui-ci est trop grand
+ 7 - 0
crmeb/public/admin/system_static/js/chunk-55df0dc3.828e7e2f.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-5c905c73.4c6e2192.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-731d0dcd.18a5f1aa.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-b12df032.5dd38b51.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
crmeb/public/admin/system_static/js/chunk-cc93a18a.d7369fa2.js


+ 124 - 124
template/admin/src/pages/setting/systemMenus/index.vue

@@ -2,11 +2,11 @@
   <div>
     <Card :bordered="false" dis-hover class="ivu-mt">
       <Form
-        ref="roleData"
-        :model="roleData"
-        :label-width="labelWidth"
-        :label-position="labelPosition"
-        @submit.native.prevent
+          ref="roleData"
+          :model="roleData"
+          :label-width="labelWidth"
+          :label-position="labelPosition"
+          @submit.native.prevent
       >
         <Row type="flex" :gutter="24">
           <Col v-bind="grid">
@@ -19,29 +19,30 @@
           </Col>
           <Col v-bind="grid">
             <FormItem label="按钮名称:" prop="status2" label-for="status2">
-              <Input v-model="roleData.keyword" search enter-button placeholder="请输入按钮名称" @on-search="getData" />
+              <Input v-model="roleData.keyword" search enter-button placeholder="请输入按钮名称" @on-search="getData"/>
             </FormItem>
           </Col>
         </Row>
         <Row type="flex">
           <Col v-bind="grid">
             <Button v-auth="['setting-system_menus-add']" type="primary" @click="menusAdd('添加规则')" icon="md-add"
-              >添加规则</Button
+            >添加规则
+            </Button
             >
           </Col>
         </Row>
       </Form>
       <vxe-table
-        :border="false"
-        class="vxeTable mt25"
-        highlight-hover-row
-        highlight-current-row
-        :loading="loading"
-        ref="xTable"
-        header-row-class-name="false"
-        :tree-config="tabconfig"
-        :data="tableData"
-        row-id="id"
+          :border="false"
+          class="vxeTable mt25"
+          highlight-hover-row
+          highlight-current-row
+          :loading="loading"
+          ref="xTable"
+          header-row-class-name="false"
+          :tree-config="tabconfig"
+          :data="tableData"
+          row-id="id"
       >
         <vxe-table-column field="id" title="ID" tooltip min-width="70"></vxe-table-column>
         <vxe-table-column field="menu_name" tree-node title="按钮名称" min-width="200"></vxe-table-column>
@@ -55,12 +56,12 @@
         <vxe-table-column field="flag" title="规则状态" min-width="120">
           <template v-slot="{ row }">
             <i-switch
-              v-model="row.is_show"
-              :value="row.is_show"
-              :true-value="1"
-              :false-value="0"
-              @on-change="onchangeIsShow(row)"
-              size="large"
+                v-model="row.is_show"
+                :value="row.is_show"
+                :true-value="1"
+                :false-value="0"
+                @on-change="onchangeIsShow(row)"
+                size="large"
             >
               <span slot="open">显示</span>
               <span slot="close">隐藏</span>
@@ -71,63 +72,62 @@
           <template v-slot="{ row, index }">
             <span v-auth="['setting-system_menus-add']">
               <a @click="addRoute(row)" v-if="row.auth_type === 1">添加权限</a>
-              <Divider type="vertical" v-if="row.auth_type === 1" />
+              <Divider type="vertical" v-if="row.auth_type === 1"/>
               <a @click="addE(row, '添加子菜单')" v-if="row.auth_type === 1">添加子菜单</a>
               <!-- <a @click="addE(row, '添加规则')" v-else>添加规则</a> -->
             </span>
-            <Divider type="vertical" v-if="row.auth_type === 1" />
+            <Divider type="vertical" v-if="row.auth_type === 1"/>
             <a @click="edit(row, '编辑')">编辑</a>
-            <Divider type="vertical" />
+            <Divider type="vertical"/>
             <a @click="del(row, '删除规则')">删除</a>
           </template>
         </vxe-table-column>
       </vxe-table>
     </Card>
     <menus-from
-      :formValidate="formValidate"
-      :titleFrom="titleFrom"
-      @getList="getList"
-      @changeMenu="getMenusUnique"
-      ref="menusFrom"
-      @clearFrom="clearFrom"
+        :formValidate="formValidate"
+        :titleFrom="titleFrom"
+        @getList="getList"
+        @changeMenu="getMenusUnique"
+        ref="menusFrom"
+        @clearFrom="clearFrom"
     ></menus-from>
     <Modal
-      v-model="ruleModal"
-      scrollable
-      width="1100"
-      title="权限列表"
-      @on-ok="addRouters"
-      @on-cancel="ruleModal = false"
-      @on-visible-change="modalchange"
+        v-model="ruleModal"
+        scrollable
+        width="1100"
+        title="权限列表"
+        @on-ok="addRouters"
+        @on-cancel="ruleModal = false"
+        @on-visible-change="modalchange"
     >
       <div class="search-rule">
         <Alert>基础接口,可多选,并且添加后不会再展示出现;删除权限后才会出现;公共接口,可多选,并且添加后会继续展示;</Alert>
         <Input
-          class="mr10"
-          v-model="searchRule"
-          placeholder="输入关键词搜索"
-          clearable
-          style="width: 300px"
-          ref="search"
-          @on-enter="searchRules"
-          @on-clear="searchRules"
+            class="mr10"
+            v-model="searchRule"
+            placeholder="输入关键词搜索"
+            clearable
+            style="width: 300px"
+            ref="search"
+            @on-enter="searchRules"
+            @on-clear="searchRules"
         />
         <Button class="mr10" type="primary" @click="searchRules">搜索</Button>
         <Button @click="init">重置</Button>
       </div>
 
       <Tabs v-model="routeType" @on-click="changTab">
-        <TabPane label="公共接口" name="1"></TabPane>
-        <TabPane label="基础接口" name="0"></TabPane>
+        <TabPane :label="item.name" :name="''+index" v-for="(item,index) in foundationList"></TabPane>
       </Tabs>
       <div class="rule">
         <div
-          class="rule-list"
-          v-show="!arrs.length || arrs.includes(item.id)"
-          :class="{ 'select-rule': seletRouteIds.includes(item.id) }"
-          v-for="(item, index) in routeType == 1 ? foundationList : openList"
-          :key="index"
-          @click="selectRule(item)"
+            class="rule-list"
+            v-show="!arrs.length || arrs.includes(item.id)"
+            :class="{ 'select-rule': seletRouteIds.includes(item.id) }"
+            v-for="(item, index) in children"
+            :key="index"
+            @click="selectRule(item)"
         >
           <div>接口名称:{{ item.real_name }}</div>
           <div>请求方式:{{ item.method }}</div>
@@ -139,7 +139,7 @@
 </template>
 
 <script>
-import { mapState } from 'vuex';
+import {mapState} from 'vuex';
 import {
   getTable,
   menusDetailsApi,
@@ -151,13 +151,14 @@ import {
 } from '@/api/systemMenus';
 import formCreate from '@form-create/iview';
 import menusFrom from './components/menusFrom';
-import { formatFlatteningRoutes } from '@/libs/system';
+import {formatFlatteningRoutes} from '@/libs/system';
 
 export default {
   name: 'systemMenus',
   data() {
     return {
-      tabconfig: { children: 'children', reserve: true, accordion: true },
+      children: [],
+      tabconfig: {children: 'children', reserve: true, accordion: true},
       spinShow: false,
       ruleModal: false,
       searchRule: '',
@@ -179,7 +180,7 @@ export default {
       formValidate: {},
       titleFrom: '',
       modalTitleSs: '',
-      routeType: '1',
+      routeType: '0',
       arrs: [],
       foundationList: [], // 基础接口列表
       openList: [], // 公开接口列表
@@ -188,7 +189,7 @@ export default {
       menusId: 0, // 选中分类id
     };
   },
-  components: { menusFrom, formCreate: formCreate.$form() },
+  components: {menusFrom, formCreate: formCreate.$form()},
   computed: {
     ...mapState('admin/layout', ['isMobile']),
     labelWidth() {
@@ -213,13 +214,13 @@ export default {
         menus: this.seletRoute,
       };
       menusBatch(data)
-        .then((res) => {
-          console.log(res);
-          this.getData();
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
+          .then((res) => {
+            console.log(res);
+            this.getData();
+          })
+          .catch((res) => {
+            this.$Message.error(res.msg);
+          });
     },
     selectRule(data) {
       if (this.seletRouteIds.includes(data.id)) {
@@ -238,14 +239,16 @@ export default {
       }
     },
     changTab(name) {
-      console.log(name);
+      this.routeType = name;
+      let index = parseInt(name)
+      this.children = this.foundationList[index] ? this.foundationList[index].children : []
       this.searchRules();
     },
     // 搜索规则
     searchRules() {
       if (this.searchRule.trim()) {
         this.arrs = [];
-        let arr = this.routeType == 1 ? this.foundationList : this.openList;
+        let arr = this.foundationList;
         for (var i = 0; i < arr.length; i++) {
           if (arr[i].real_name.indexOf(this.searchRule) !== -1) {
             this.arrs.push(arr[i].id);
@@ -257,23 +260,19 @@ export default {
     },
     addRoute(row) {
       this.menusId = row.id;
+      this.routeType = '0';
       this.getRuleList();
     },
-    modalchange() {},
+    modalchange() {
+    },
     // 获取权限列表
     getRuleList() {
       getRuleList().then((res) => {
-        this.foundationList = [];
+        this.foundationList = res.data;
+        this.children = this.foundationList[0] ? this.foundationList[0].children : []
         this.openList = [];
         this.seletRouteIds = [];
         this.seletRoute = [];
-        res.data.map((e) => {
-          if (e.type) {
-            this.foundationList.push(e);
-          } else {
-            this.openList.push(e);
-          }
-        });
         this.ruleModal = true;
       });
     },
@@ -284,13 +283,13 @@ export default {
         is_show: row.is_show,
       };
       isShowApi(data)
-        .then(async (res) => {
-          this.$Message.success(res.msg);
-          this.$store.dispatch('menus/getMenusNavList');
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
+          .then(async (res) => {
+            this.$Message.success(res.msg);
+            this.$store.dispatch('menus/getMenusNavList');
+          })
+          .catch((res) => {
+            this.$Message.error(res.msg);
+          });
     },
     // 请求列表
     getList() {
@@ -308,20 +307,20 @@ export default {
       let pid = row.id.toString();
       if (pid) {
         menusDetailsApi(row.id)
-          .then(async (res) => {
-            this.formValidate.path = res.data.path;
-            this.formValidate.path.push(row.id);
-            this.formValidate.pid = pid;
-            this.$refs.menusFrom.modals = true;
-            this.$refs.menusFrom.valids = false;
-            this.titleFrom = title;
-            this.formValidate.auth_type = 1;
-            this.formValidate.is_show = 0;
-            this.formValidate.is_show_path = 0;
-          })
-          .catch((res) => {
-            this.$Message.error(res.msg);
-          });
+            .then(async (res) => {
+              this.formValidate.path = res.data.path;
+              this.formValidate.path.push(row.id);
+              this.formValidate.pid = pid;
+              this.$refs.menusFrom.modals = true;
+              this.$refs.menusFrom.valids = false;
+              this.titleFrom = title;
+              this.formValidate.auth_type = 1;
+              this.formValidate.is_show = 0;
+              this.formValidate.is_show_path = 0;
+            })
+            .catch((res) => {
+              this.$Message.error(res.msg);
+            });
       } else {
         this.formValidate.pid = pid;
         this.$refs.menusFrom.modals = true;
@@ -348,25 +347,25 @@ export default {
       };
 
       this.$modalSure(delfromData)
-        .then((res) => {
-          this.$Message.success(res.msg);
-          this.getData();
-          this.$store.dispatch('menus/getMenusNavList');
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
+          .then((res) => {
+            this.$Message.success(res.msg);
+            this.getData();
+            this.$store.dispatch('menus/getMenusNavList');
+          })
+          .catch((res) => {
+            this.$Message.error(res.msg);
+          });
     },
     // 规则详情
     menusDetails(id) {
       menusDetailsApi(id)
-        .then(async (res) => {
-          this.formValidate = res.data;
-          this.$refs.menusFrom.modals = true;
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
+          .then(async (res) => {
+            this.formValidate = res.data;
+            this.$refs.menusFrom.modals = true;
+          })
+          .catch((res) => {
+            this.$Message.error(res.msg);
+          });
     },
     // 编辑
     edit(row, title, index) {
@@ -404,14 +403,14 @@ export default {
       this.loading = true;
       this.roleData.is_show = this.roleData.is_show || '';
       getTable(this.roleData)
-        .then(async (res) => {
-          this.tableData = res.data;
-          this.loading = false;
-        })
-        .catch((res) => {
-          this.loading = false;
-          this.$Message.error(res.msg);
-        });
+          .then(async (res) => {
+            this.tableData = res.data;
+            this.loading = false;
+          })
+          .catch((res) => {
+            this.loading = false;
+            this.$Message.error(res.msg);
+          });
     },
     getMenusUnique() {
       getMenusUnique().then((res) => {
@@ -429,7 +428,7 @@ export default {
       const cacheList = [];
       arr.forEach((v) => {
         if (v && v.meta && v.meta.keepAlive) {
-          newArr.push({ ...v });
+          newArr.push({...v});
           cacheList.push(v.name);
           this.$store.dispatch('keepAliveNames/setCacheKeepAlive', cacheList);
         }
@@ -446,10 +445,11 @@ export default {
 
 <style scoped lang="scss">
 .vxeTable {
-  >>> .vxe-table--header-wrapper {
+  > > > .vxe-table--header-wrapper {
     background: #fff !important;
   }
 }
+
 .rule {
   display: flex;
   flex-wrap: wrap;

+ 1 - 0
template/uni-app/pages/points_mall/exchange_record.vue

@@ -18,6 +18,7 @@
 						<view class="text acea-row row-column-around">
 							<view class="line1" style="width: 100%;">{{ item.store_name }}</view>
 							<view class="line1 gray-sty">{{item.suk}}</view>
+							<view class="line1 gray-sty">{{$t(`积分`)}}:{{item.total_price}}</view>
 						</view>
 					</view>
 					<view class="bottom acea-row row-between-wrapper">