gift.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. return [
  3. 'balance' => [
  4. 'key' => 'balance',
  5. 'name' => '送红包', // 礼包名称
  6. 'desc' => '发放红包', // 礼包说明
  7. 'component' => '/src/app/views/member/components/gift-balance.vue',
  8. 'grant' => function($site_id, $member_id, $config, $param) {
  9. $account_type = \app\dict\member\MemberAccountTypeDict::BALANCE;
  10. $service = new \app\service\core\member\CoreMemberAccountService();
  11. $service->addLog($member_id, $account_type, $config['money'], $param['from_type'] ?? '', $param['memo'] ?? '', $param['related_id'] ?? '');
  12. },
  13. 'content' => [
  14. 'admin' => function($site_id, $config) {
  15. return "{$config['money']}元红包";
  16. },
  17. // 会员等级
  18. 'member_level' => function($site_id, $config) {
  19. $content = [];
  20. $content[] = [
  21. 'text' => "{$config['money']}元",
  22. 'background' => '/static/resource/images/member/gift/gift_balance_bg.png'
  23. ];
  24. return $content;
  25. },
  26. // 会员签到(日签)
  27. 'member_sign' => function($site_id, $config) {
  28. $content = [];
  29. $content[] = [
  30. 'text' => "{$config['money']}元",
  31. 'icon' => '/static/resource/images/member/sign/packet.png'
  32. ];
  33. return $content;
  34. },
  35. // 会员签到(连签)
  36. 'member_sign_continue' => function($site_id, $config) {
  37. $content = [];
  38. $content[] = [
  39. 'text' => "{$config['money']}元",
  40. 'icon' => '/static/resource/images/member/sign/packet01.png'
  41. ];
  42. return $content;
  43. }
  44. ]
  45. ],
  46. 'point' => [
  47. 'key' => 'point',
  48. 'name' => '送积分', // 礼包名称
  49. 'desc' => '发放积分', // 礼包说明
  50. 'component' => '/src/app/views/member/components/gift-point.vue',
  51. 'grant' => function($site_id, $member_id, $config, $param) {
  52. $account_type = \app\dict\member\MemberAccountTypeDict::POINT;
  53. $service = new \app\service\core\member\CoreMemberAccountService();
  54. $service->addLog($member_id, $account_type, $config['num'], $param['from_type'] ?? '', $param['memo'] ?? '', $param['related_id'] ?? '');
  55. },
  56. 'content' => [
  57. 'admin' => function($site_id, $config) {
  58. return "{$config['num']}积分";
  59. },
  60. 'member_level' => function($site_id, $config) {
  61. $content = [];
  62. $content[] = [
  63. 'text' => "{$config['num']}积分",
  64. 'background' => '/static/resource/images/member/gift/gift_point_bg.png'
  65. ];
  66. return $content;
  67. },
  68. // 会员签到(日签)
  69. 'member_sign' => function($site_id, $config) {
  70. $content = [];
  71. $content[] = [
  72. 'text' => "{$config['num']}积分",
  73. 'icon' => '/static/resource/images/member/sign/point.png'
  74. ];
  75. return $content;
  76. },
  77. // 会员签到(连签)
  78. 'member_sign_continue' => function($site_id, $config) {
  79. $content = [];
  80. $content[] = [
  81. 'text' => "{$config['num']}积分",
  82. 'icon' => '/static/resource/images/member/sign/point01.png'
  83. ];
  84. return $content;
  85. }
  86. ]
  87. ]
  88. ];