admin.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202
  1. import request from '@/utils/request'
  2. // 用户管理
  3. export function getUserList(params) {
  4. return request({
  5. url: '/api/admin/users',
  6. method: 'post',
  7. data: params
  8. })
  9. }
  10. export function getUserDetail(id) {
  11. return request({
  12. url: `/api/admin/users/${id}`,
  13. method: 'post'
  14. })
  15. }
  16. export function updateUser(id, data) {
  17. return request({
  18. url: `/api/admin/users/${id}/update`,
  19. method: 'post',
  20. data
  21. })
  22. }
  23. export function deleteUser(id) {
  24. return request({
  25. url: `/api/admin/users/${id}/delete`,
  26. method: 'post'
  27. })
  28. }
  29. export function resetUserPassword(id, password) {
  30. return request({
  31. url: `/api/admin/users/${id}/reset-password`,
  32. method: 'post',
  33. data: { password }
  34. })
  35. }
  36. // ========== 商品配送与履约 API ==========
  37. export function vendorConfirmOrder(orderNo) {
  38. return request({
  39. url: '/api/product/order/vendor-confirm',
  40. method: 'post',
  41. data: { orderNo }
  42. })
  43. }
  44. // ===== 线上服务配置(批量接口,路由 /api/product/delivery-config/*)=====
  45. export function listDeliveryServicePersons(productId) {
  46. return request({
  47. url: '/api/product/delivery-config/service-person/list',
  48. method: 'post',
  49. data: { productId }
  50. })
  51. }
  52. export function saveDeliveryServicePersons(productId, persons) {
  53. return request({
  54. url: '/api/product/delivery-config/service-person/save',
  55. method: 'post',
  56. data: { productId, persons }
  57. })
  58. }
  59. export function listDeliveryOnlineSlots(productId) {
  60. return request({
  61. url: '/api/product/delivery-config/online-slot/list',
  62. method: 'post',
  63. data: { productId }
  64. })
  65. }
  66. export function saveDeliveryOnlineSlots(productId, slots) {
  67. return request({
  68. url: '/api/product/delivery-config/online-slot/save',
  69. method: 'post',
  70. data: { productId, slots }
  71. })
  72. }
  73. // 家庭管理
  74. export function getFamilyList(params) {
  75. return request({
  76. url: '/api/admin/families',
  77. method: 'post',
  78. data: params
  79. })
  80. }
  81. export function getFamilyDetail(id) {
  82. return request({
  83. url: `/api/admin/families/${id}`,
  84. method: 'post'
  85. })
  86. }
  87. export function updateFamily(id, data) {
  88. return request({
  89. url: `/api/admin/families/${id}/update`,
  90. method: 'post',
  91. data
  92. })
  93. }
  94. export function deleteFamily(id) {
  95. return request({
  96. url: `/api/admin/families/${id}/delete`,
  97. method: 'post'
  98. })
  99. }
  100. export function getFamilyMembers(id) {
  101. return request({
  102. url: `/api/admin/families/${id}/members`,
  103. method: 'post'
  104. })
  105. }
  106. export function setMemberAdminRole(familyId, memberId, isAdmin) {
  107. return request({
  108. url: `/api/admin/families/${familyId}/members/set-admin`,
  109. method: 'post',
  110. data: { memberId, isAdmin }
  111. })
  112. }
  113. // 任务模板管理
  114. export function getTaskTemplateList(params) {
  115. return request({
  116. url: '/api/admin/task-templates',
  117. method: 'post',
  118. data: params
  119. })
  120. }
  121. export function createTaskTemplate(data) {
  122. return request({
  123. url: '/api/admin/task-templates/create',
  124. method: 'post',
  125. data
  126. })
  127. }
  128. export function updateTaskTemplate(id, data) {
  129. return request({
  130. url: `/api/admin/task-templates/${id}/update`,
  131. method: 'post',
  132. data
  133. })
  134. }
  135. export function deleteTaskTemplate(id) {
  136. return request({
  137. url: `/api/admin/task-templates/${id}/delete`,
  138. method: 'post'
  139. })
  140. }
  141. // 孩子管理
  142. export function getChildrenList(params) {
  143. return request({
  144. url: '/api/admin/children',
  145. method: 'post',
  146. data: params
  147. })
  148. }
  149. export function getChildDetail(id) {
  150. return request({
  151. url: `/api/admin/children/${id}`,
  152. method: 'post'
  153. })
  154. }
  155. export function updateChild(id, data) {
  156. return request({
  157. url: `/api/admin/children/${id}/update`,
  158. method: 'post',
  159. data
  160. })
  161. }
  162. export function deleteChild(id) {
  163. return request({
  164. url: `/api/admin/children/${id}/delete`,
  165. method: 'post'
  166. })
  167. }
  168. export function adjustChildPoints(id, data) {
  169. return request({
  170. url: `/api/admin/children/${id}/adjust-points`,
  171. method: 'post',
  172. data
  173. })
  174. }
  175. // 任务管理
  176. export function getTasksList(params) {
  177. return request({
  178. url: '/api/admin/tasks',
  179. method: 'post',
  180. data: params
  181. })
  182. }
  183. export function getTaskStats() {
  184. return request({
  185. url: '/api/admin/tasks/stats',
  186. method: 'post'
  187. })
  188. }
  189. export function getPendingReviewTasks(params) {
  190. return request({
  191. url: '/api/admin/tasks/pending-review',
  192. method: 'post',
  193. data: params || {}
  194. })
  195. }
  196. export function reviewAdminTask(taskId, data) {
  197. return request({
  198. url: `/api/admin/tasks/${taskId}/review`,
  199. method: 'post',
  200. data
  201. })
  202. }
  203. // 奖励管理
  204. export function getRewardsList(params) {
  205. return request({
  206. url: '/api/admin/rewards',
  207. method: 'post',
  208. data: params
  209. })
  210. }
  211. export function getRewardTemplates() {
  212. return request({
  213. url: '/api/admin/rewards/templates',
  214. method: 'post'
  215. })
  216. }
  217. export function createRewardTemplate(data) {
  218. return request({
  219. url: '/api/admin/rewards/create',
  220. method: 'post',
  221. data
  222. })
  223. }
  224. export function deleteRewardTemplate(id) {
  225. return request({
  226. url: `/api/admin/rewards/templates/${id}/delete`,
  227. method: 'post'
  228. })
  229. }
  230. export function updateRewardTemplate(id, data) {
  231. return request({
  232. url: `/api/admin/rewards/templates/${id}/update`,
  233. method: 'post',
  234. data
  235. })
  236. }
  237. export function approveReward(id, data) {
  238. return request({
  239. url: `/api/admin/rewards/${id}/approve`,
  240. method: 'post',
  241. data
  242. })
  243. }
  244. // 积分管理
  245. export function getPointsLogs(params) {
  246. return request({
  247. url: '/api/admin/points/logs',
  248. method: 'post',
  249. data: params
  250. })
  251. }
  252. export function getPointsStats() {
  253. return request({
  254. url: '/api/admin/points/stats',
  255. method: 'post'
  256. })
  257. }
  258. // ========== 心愿管理 API(新版) ==========
  259. // 获取心愿列表
  260. export function getWishesList(params) {
  261. return request({
  262. url: '/api/wishes/list',
  263. method: 'post',
  264. data: params
  265. })
  266. }
  267. // 获取待处理列表(家长)
  268. export function getPendingWishes(familyId) {
  269. return request({
  270. url: '/api/wishes/pending',
  271. method: 'post',
  272. data: { familyId }
  273. })
  274. }
  275. // 获取心愿详情
  276. export function getWishDetail(id) {
  277. return request({
  278. url: `/api/wishes/${id}`,
  279. method: 'post'
  280. })
  281. }
  282. // 家长定价
  283. export function setWishPrice(id, pointsRequired) {
  284. return request({
  285. url: `/api/wishes/${id}/set-price`,
  286. method: 'post',
  287. data: { pointsRequired }
  288. })
  289. }
  290. // 家长拒绝心愿
  291. export function rejectWish(id, reason) {
  292. return request({
  293. url: `/api/wishes/${id}/reject`,
  294. method: 'post',
  295. data: { reason }
  296. })
  297. }
  298. // 家长审批兑换
  299. export function approveWishExchange(id, approved, reason) {
  300. return request({
  301. url: `/api/wishes/${id}/approve-exchange`,
  302. method: 'post',
  303. data: { approved, reason }
  304. })
  305. }
  306. // 家长标记已购买
  307. export function markWishFulfilled(id) {
  308. return request({
  309. url: `/api/wishes/${id}/fulfill`,
  310. method: 'post'
  311. })
  312. }
  313. // 取消心愿
  314. export function deleteWish(id, reason) {
  315. return request({
  316. url: `/api/wishes/${id}/cancel`,
  317. method: 'post',
  318. data: { reason }
  319. })
  320. }
  321. // ========== 成长规划师相关 API ==========
  322. // 获取成长规划师关联的家庭列表
  323. export function getTeacherFamilies() {
  324. return request({
  325. url: '/api/admin/teacher/families',
  326. method: 'post'
  327. })
  328. }
  329. // 获取成长规划师发布的任务模板
  330. export function getTeacherTaskTemplates() {
  331. return request({
  332. url: '/api/admin/teacher/task-templates',
  333. method: 'post'
  334. })
  335. }
  336. // 成长规划师创建任务模板
  337. export function createTeacherTaskTemplate(data) {
  338. return request({
  339. url: '/api/admin/teacher/task-templates/create',
  340. method: 'post',
  341. data
  342. })
  343. }
  344. // 成长规划师删除任务模板
  345. export function deleteTeacherTaskTemplate(id) {
  346. return request({
  347. url: `/api/admin/teacher/task-templates/${id}/delete`,
  348. method: 'post'
  349. })
  350. }
  351. // 获取指定家庭的任务列表
  352. export function getTeacherFamilyTasks(familyId, params) {
  353. return request({
  354. url: `/api/admin/teacher/families/${familyId}/tasks`,
  355. method: 'post',
  356. data: params
  357. })
  358. }
  359. // 获取指定家庭的奖励列表
  360. export function getTeacherFamilyRewards(familyId, params) {
  361. return request({
  362. url: `/api/admin/teacher/families/${familyId}/rewards`,
  363. method: 'post',
  364. data: params
  365. })
  366. }
  367. // ========== 成长规划师审核 API ==========
  368. // 获取成长规划师审核列表
  369. export function getGuideApplications(params) {
  370. return request({
  371. url: '/api/admin/guide/applications',
  372. method: 'post',
  373. data: params
  374. })
  375. }
  376. // 通过成长规划师审核
  377. export function approveGuide(userId) {
  378. return request({
  379. url: `/api/admin/guide/approve/${userId}`,
  380. method: 'post'
  381. })
  382. }
  383. // 拒绝成长规划师审核
  384. export function rejectGuide(userId, reason) {
  385. return request({
  386. url: `/api/admin/guide/reject/${userId}`,
  387. method: 'post',
  388. data: { reason }
  389. })
  390. }
  391. // 获取营养师审核列表
  392. export function getNutritionistApplications(params) {
  393. return request({
  394. url: '/api/admin/nutritionist/applications',
  395. method: 'post',
  396. data: params
  397. })
  398. }
  399. // 通过营养师审核
  400. export function approveNutritionist(userId) {
  401. return request({
  402. url: `/api/admin/nutritionist/approve/${userId}`,
  403. method: 'post'
  404. })
  405. }
  406. // 拒绝营养师审核
  407. export function rejectNutritionist(userId, reason) {
  408. return request({
  409. url: `/api/admin/nutritionist/reject/${userId}`,
  410. method: 'post',
  411. data: { reason }
  412. })
  413. }
  414. // 获取待审核营养师数量
  415. export function getPendingNutritionistCount() {
  416. return request({
  417. url: '/api/admin/nutritionist/pending-count',
  418. method: 'post'
  419. })
  420. }
  421. // 获取待审核成长规划师数量
  422. export function getPendingGuideCount() {
  423. return request({
  424. url: '/api/admin/guide/pending-count',
  425. method: 'post'
  426. })
  427. }
  428. export function getPendingPackageCount() {
  429. return request({
  430. url: '/api/admin/package/pending-count',
  431. method: 'post'
  432. })
  433. }
  434. // 管理员个人信息
  435. export function updateAdminInfo(data) {
  436. return request({
  437. url: '/api/admin-auth/update-info',
  438. method: 'post',
  439. data
  440. })
  441. }
  442. // ========== 管理后台仪表盘汇总 API ==========
  443. export function getDashboardStats() {
  444. return request({
  445. url: '/api/stats/dashboard',
  446. method: 'post'
  447. })
  448. }
  449. export function getDashboardOverview() {
  450. return request({
  451. url: '/api/stats/overview',
  452. method: 'post'
  453. })
  454. }
  455. export function getRevenueStats() {
  456. return request({
  457. url: '/api/stats/revenue',
  458. method: 'post'
  459. })
  460. }
  461. export function getMembershipStats() {
  462. return request({
  463. url: '/api/stats/membership',
  464. method: 'post'
  465. })
  466. }
  467. export function getTrendStats() {
  468. return request({
  469. url: '/api/stats/trend',
  470. method: 'post',
  471. data: {}
  472. })
  473. }
  474. // ========== 商品管理 API ==========
  475. export function getProductList(params) {
  476. return request({
  477. url: '/api/admin/product/list',
  478. method: 'post',
  479. data: params
  480. })
  481. }
  482. export function reviewProduct(productId, data) {
  483. return request({
  484. url: '/api/admin/product/review',
  485. method: 'post',
  486. data: { productId, ...data }
  487. })
  488. }
  489. export function shelveProduct(productId, data) {
  490. return request({
  491. url: '/api/admin/product/shelve',
  492. method: 'post',
  493. data: { productId, ...data }
  494. })
  495. }
  496. export function batchShelveProduct(productIds, shelve) {
  497. return request({
  498. url: '/api/admin/product/batch-shelve',
  499. method: 'post',
  500. data: { productIds, shelve }
  501. })
  502. }
  503. export function getProduct(id) {
  504. return request({
  505. url: '/api/admin/product/detail',
  506. method: 'post',
  507. data: { productId: id }
  508. })
  509. }
  510. export function createProduct(data) {
  511. return request({
  512. url: '/api/admin/product/create',
  513. method: 'post',
  514. data
  515. })
  516. }
  517. export function updateProduct(data) {
  518. return request({
  519. url: '/api/admin/product/update',
  520. method: 'post',
  521. data
  522. })
  523. }
  524. export function deleteProduct(id) {
  525. return request({
  526. url: '/api/admin/product/delete',
  527. method: 'post',
  528. data: { productId: id }
  529. })
  530. }
  531. export function copyProduct(id) {
  532. return request({
  533. url: '/api/admin/product/copy',
  534. method: 'post',
  535. data: { productId: id }
  536. })
  537. }
  538. export function getGrowthArchiveProduct(productId) {
  539. return request({
  540. url: '/api/admin/growth-archive-product/detail',
  541. method: 'post',
  542. data: { productId }
  543. })
  544. }
  545. export function saveGrowthArchiveProduct(data) {
  546. return request({
  547. url: '/api/admin/growth-archive-product/save',
  548. method: 'post',
  549. data
  550. })
  551. }
  552. // ========== SKU 管理 API ==========
  553. export function getProductSkuList(productId) {
  554. return request({
  555. url: '/api/admin/product/sku/list',
  556. method: 'post',
  557. data: { productId }
  558. })
  559. }
  560. export function createProductSku(data) {
  561. return request({
  562. url: '/api/admin/product/sku/create',
  563. method: 'post',
  564. data
  565. })
  566. }
  567. export function updateProductSku(data) {
  568. return request({
  569. url: '/api/admin/product/sku/update',
  570. method: 'post',
  571. data
  572. })
  573. }
  574. export function linkedProductList(params) {
  575. return request({
  576. url: '/api/admin/product/linked/list',
  577. method: 'post',
  578. data: params
  579. })
  580. }
  581. export function deleteProductSku(id) {
  582. return request({
  583. url: '/api/admin/product/sku/delete',
  584. method: 'post',
  585. data: { id }
  586. })
  587. }
  588. // ========== 购买信息采集 API ==========
  589. export function getPredefinedPurchaseFields() {
  590. return request({
  591. url: '/api/admin/product/purchase_fields/predefined',
  592. method: 'post'
  593. })
  594. }
  595. export function getProductPurchaseFields(productId) {
  596. return request({
  597. url: '/api/admin/product/purchase_fields/list',
  598. method: 'post',
  599. data: { productId }
  600. })
  601. }
  602. export function saveProductPurchaseFields(productId, fields) {
  603. return request({
  604. url: '/api/admin/product/purchase_fields/save',
  605. method: 'post',
  606. data: { productId, fields }
  607. })
  608. }
  609. export function saveProductGiftRule(productId, status, levelCode) {
  610. return request({
  611. url: '/api/admin/product-gift-rule/save',
  612. method: 'post',
  613. data: { productId, status, levelCode }
  614. })
  615. }
  616. export function listProductGiftRules(productId) {
  617. return request({
  618. url: '/api/admin/product-gift-rule/list',
  619. method: 'post',
  620. data: { productId }
  621. })
  622. }
  623. export function saveProductGift(data) {
  624. return request({
  625. url: '/api/admin/product-gift/save',
  626. method: 'post',
  627. data
  628. })
  629. }
  630. export function getProductGiftList(productId) {
  631. return request({
  632. url: '/api/admin/product-gift/list',
  633. method: 'post',
  634. data: { productId }
  635. })
  636. }
  637. export function listMembershipLevels() {
  638. return request({
  639. url: '/api/membership/levels',
  640. method: 'post'
  641. })
  642. }
  643. export function updateMembershipLevel(data) {
  644. return request({
  645. url: '/api/admin/membership/level/update',
  646. method: 'post',
  647. data
  648. })
  649. }
  650. export function updateMembershipUser(data) {
  651. return request({
  652. url: '/api/admin/membership/user-update',
  653. method: 'post',
  654. data
  655. })
  656. }
  657. // ========== 分类管理 API ==========
  658. export function getCategoryTree(includeDisabled) {
  659. return request({
  660. url: '/api/admin/shop/category/tree',
  661. method: 'post',
  662. data: { includeDisabled }
  663. })
  664. }
  665. export function createCategory(data) {
  666. return request({
  667. url: '/api/admin/shop/category/create',
  668. method: 'post',
  669. data
  670. })
  671. }
  672. export function updateCategory(data) {
  673. return request({
  674. url: '/api/admin/shop/category/update',
  675. method: 'post',
  676. data
  677. })
  678. }
  679. export function deleteCategory(id) {
  680. return request({
  681. url: '/api/admin/shop/category/delete',
  682. method: 'post',
  683. data: { id }
  684. })
  685. }
  686. export function toggleCategory(id) {
  687. return request({
  688. url: '/api/admin/shop/category/toggle',
  689. method: 'post',
  690. data: { id }
  691. })
  692. }
  693. // ========== 订单管理 API ==========
  694. export function getOrderList(params) {
  695. return request({
  696. url: '/api/admin/product/order/list',
  697. method: 'post',
  698. data: params
  699. })
  700. }
  701. export function getOrderDetail(orderNo) {
  702. return request({
  703. url: '/api/admin/product/order/detail',
  704. method: 'post',
  705. data: { orderNo }
  706. })
  707. }
  708. export function shipOrder(orderNo, trackingNumber, expressCompany, extra) {
  709. return request({
  710. url: '/api/admin/product/order/ship',
  711. method: 'post',
  712. data: { orderNo, trackingNumber, expressCompany, ...extra }
  713. })
  714. }
  715. export function closeOrder(orderNo) {
  716. return request({
  717. url: '/api/admin/product/order/close',
  718. method: 'post',
  719. data: { orderNo }
  720. })
  721. }
  722. export function approveRefund(orderNo) {
  723. return request({
  724. url: '/api/admin/product/order/refund/approve',
  725. method: 'post',
  726. data: { orderNo }
  727. })
  728. }
  729. export function rejectRefund(orderNo, reason) {
  730. return request({
  731. url: '/api/admin/product/order/refund/reject',
  732. method: 'post',
  733. data: { orderNo, reason }
  734. })
  735. }
  736. // ========== 系统配置 API ==========
  737. export function getSysConfigList(params) {
  738. return request({
  739. url: '/api/admin/config/list',
  740. method: 'post',
  741. data: params
  742. })
  743. }
  744. export function createSysConfig(data) {
  745. return request({
  746. url: '/api/admin/config/update',
  747. method: 'post',
  748. data: { configKey: data.configKey, configValue: data.configValue }
  749. })
  750. }
  751. export function updateSysConfig(id, data) {
  752. return request({
  753. url: '/api/admin/config/update',
  754. method: 'post',
  755. data: { configKey: data.configKey, configValue: data.configValue }
  756. })
  757. }
  758. export function deleteSysConfig(id) {
  759. return request({
  760. url: `/api/admin/config/delete/${id}`,
  761. method: 'post'
  762. })
  763. }
  764. // ========== 通关解锁关卡配置 API ==========
  765. export function getUnlockGateList(params) {
  766. return request({
  767. url: '/api/admin/unlock-gates/list',
  768. method: 'post',
  769. data: params || {}
  770. })
  771. }
  772. export function saveUnlockGate(data) {
  773. return request({
  774. url: '/api/admin/unlock-gates/save',
  775. method: 'post',
  776. data
  777. })
  778. }
  779. export function deleteUnlockGate(id) {
  780. return request({
  781. url: '/api/admin/unlock-gates/delete',
  782. method: 'post',
  783. data: { id }
  784. })
  785. }
  786. export function sortUnlockGates(sortList) {
  787. return request({
  788. url: '/api/admin/unlock-gates/sort',
  789. method: 'post',
  790. data: sortList
  791. })
  792. }
  793. export function toggleUnlockGate(id, enabled) {
  794. return request({
  795. url: '/api/admin/unlock-gates/toggle',
  796. method: 'post',
  797. data: { id, enabled }
  798. })
  799. }
  800. export function resetFamilyGates(familyId) {
  801. return request({
  802. url: '/api/admin/unlock-gates/reset-family',
  803. method: 'post',
  804. data: { familyId }
  805. })
  806. }
  807. export function getFamilyGateProgress(familyId) {
  808. return request({
  809. url: '/api/admin/unlock-gates/family-progress',
  810. method: 'post',
  811. data: { familyId }
  812. })
  813. }
  814. // ========== 佣金推荐系统 API ==========
  815. export function getWithdrawalList(params) {
  816. return request({
  817. url: '/api/admin/commission/withdrawals',
  818. method: 'post',
  819. data: params
  820. })
  821. }
  822. export function auditWithdrawal(requestId, status, remark) {
  823. return request({
  824. url: '/api/admin/commission/audit',
  825. method: 'post',
  826. data: { requestId, status, remark }
  827. })
  828. }
  829. export function updateProductProfitRate(productId, profitRate) {
  830. return request({
  831. url: '/api/admin/commission/update-profit-rate',
  832. method: 'post',
  833. data: { productId, profitRate }
  834. })
  835. }
  836. // ========== 星座配置管理 API ==========
  837. export function listZodiacConfigs() {
  838. return request({
  839. url: '/api/admin/zodiac-config/list',
  840. method: 'post'
  841. })
  842. }
  843. export function createZodiacConfig(data) {
  844. return request({
  845. url: '/api/admin/zodiac-config/create',
  846. method: 'post',
  847. data
  848. })
  849. }
  850. export function updateZodiacConfig(data) {
  851. return request({
  852. url: '/api/admin/zodiac-config/update',
  853. method: 'post',
  854. data
  855. })
  856. }
  857. export function deleteZodiacConfig(id) {
  858. return request({
  859. url: '/api/admin/zodiac-config/delete',
  860. method: 'post',
  861. data: { id }
  862. })
  863. }
  864. // ========== 先天画像来源权重配置 API ==========
  865. export function listInnatePortraitConfigs() {
  866. return request({
  867. url: '/api/admin/innate-portrait-config/list',
  868. method: 'post'
  869. })
  870. }
  871. export function updateInnatePortraitConfig(data) {
  872. return request({
  873. url: '/api/admin/innate-portrait-config/update',
  874. method: 'post',
  875. data
  876. })
  877. }
  878. export function invalidateInnatePortraitScores() {
  879. return request({
  880. url: '/api/admin/innate-portrait-config/invalidate',
  881. method: 'post'
  882. })
  883. }
  884. // ========== 数字能量详细配置 API ==========
  885. export function listNumSoulDetailConfigs(data) {
  886. return request({
  887. url: '/api/admin/numsoul-detail-config/list',
  888. method: 'post',
  889. data
  890. })
  891. }
  892. export function createNumSoulDetailConfig(data) {
  893. return request({
  894. url: '/api/admin/numsoul-detail-config/create',
  895. method: 'post',
  896. data
  897. })
  898. }
  899. export function updateNumSoulDetailConfig(data) {
  900. return request({
  901. url: '/api/admin/numsoul-detail-config/update',
  902. method: 'post',
  903. data
  904. })
  905. }
  906. export function deleteNumSoulDetailConfig(id) {
  907. return request({
  908. url: '/api/admin/numsoul-detail-config/delete',
  909. method: 'post',
  910. data: { id }
  911. })
  912. }
  913. // ========== 八字配置管理 API ==========
  914. export function listBaziConfigs() {
  915. return request({
  916. url: '/api/admin/bazi-config/list',
  917. method: 'post'
  918. })
  919. }
  920. export function createBaziConfig(data) {
  921. return request({
  922. url: '/api/admin/bazi-config/create',
  923. method: 'post',
  924. data
  925. })
  926. }
  927. export function updateBaziConfig(data) {
  928. return request({
  929. url: '/api/admin/bazi-config/update',
  930. method: 'post',
  931. data
  932. })
  933. }
  934. export function deleteBaziConfig(id) {
  935. return request({
  936. url: '/api/admin/bazi-config/delete',
  937. method: 'post',
  938. data: { id }
  939. })
  940. }
  941. // ========== 血型配置管理 API ==========
  942. export function listBloodTypeConfigs() {
  943. return request({
  944. url: '/api/admin/blood-type-config/list',
  945. method: 'post'
  946. })
  947. }
  948. export function createBloodTypeConfig(data) {
  949. return request({
  950. url: '/api/admin/blood-type-config/create',
  951. method: 'post',
  952. data
  953. })
  954. }
  955. export function updateBloodTypeConfig(data) {
  956. return request({
  957. url: '/api/admin/blood-type-config/update',
  958. method: 'post',
  959. data
  960. })
  961. }
  962. export function deleteBloodTypeConfig(id) {
  963. return request({
  964. url: '/api/admin/blood-type-config/delete',
  965. method: 'post',
  966. data: { id }
  967. })
  968. }
  969. // ========== 服务器运行状态 ==========
  970. export function getSystemHealth() {
  971. return request({
  972. url: '/api/system/health',
  973. method: 'post'
  974. })
  975. }
  976. // ========== 虚拟服务商团队管理 API ==========
  977. export function listVirtualTeams(params) {
  978. return request({
  979. url: '/api/admin/virtual-team/list',
  980. method: 'post',
  981. data: params
  982. })
  983. }
  984. export function createVirtualTeam(data) {
  985. return request({
  986. url: '/api/admin/virtual-team/create',
  987. method: 'post',
  988. data
  989. })
  990. }
  991. export function updateVirtualTeam(data) {
  992. return request({
  993. url: '/api/admin/virtual-team/update',
  994. method: 'post',
  995. data
  996. })
  997. }
  998. export function toggleVirtualTeam(id) {
  999. return request({
  1000. url: '/api/admin/virtual-team/toggle',
  1001. method: 'post',
  1002. data: { id }
  1003. })
  1004. }
  1005. export function getVirtualTeamMembers(systemId) {
  1006. return request({
  1007. url: '/api/admin/virtual-team/members',
  1008. method: 'post',
  1009. data: { systemId }
  1010. })
  1011. }
  1012. export function addVirtualTeamMember(data) {
  1013. return request({
  1014. url: '/api/admin/virtual-team/add-member',
  1015. method: 'post',
  1016. data
  1017. })
  1018. }
  1019. export function removeVirtualTeamMember(id) {
  1020. return request({
  1021. url: '/api/admin/virtual-team/remove-member',
  1022. method: 'post',
  1023. data: { id }
  1024. })
  1025. }
  1026. export function updateVirtualTeamMember(data) {
  1027. return request({
  1028. url: '/api/admin/virtual-team/update-member',
  1029. method: 'post',
  1030. data
  1031. })
  1032. }
  1033. export function getVirtualTeamTree(systemId) {
  1034. return request({
  1035. url: '/api/admin/virtual-team/tree',
  1036. method: 'post',
  1037. data: { systemId }
  1038. })
  1039. }
  1040. export function searchUsers(params) {
  1041. return request({
  1042. url: '/api/admin/user/search',
  1043. method: 'post',
  1044. data: params
  1045. })
  1046. }
  1047. // ========== 情绪告警管理 API ==========
  1048. export function getEmotionAlertList(params) {
  1049. return request({
  1050. url: '/api/mind/alert/admin/list',
  1051. method: 'post',
  1052. data: params
  1053. })
  1054. }
  1055. export function resolveEmotionAlert(alertId) {
  1056. return request({
  1057. url: '/api/mind/alert/resolve',
  1058. method: 'post',
  1059. data: { alertId, source: 'checkin' }
  1060. })
  1061. }
  1062. // ========== 食材管理 API ==========
  1063. export function getFoodList(params) {
  1064. return request({
  1065. url: '/api/admin/foods/list',
  1066. method: 'post',
  1067. data: params
  1068. })
  1069. }
  1070. export function createFood(data) {
  1071. return request({
  1072. url: '/api/admin/foods/create',
  1073. method: 'post',
  1074. data
  1075. })
  1076. }
  1077. export function updateFood(data) {
  1078. return request({
  1079. url: '/api/admin/foods/update',
  1080. method: 'post',
  1081. data
  1082. })
  1083. }
  1084. export function deleteFood(id) {
  1085. return request({
  1086. url: '/api/admin/foods/delete',
  1087. method: 'post',
  1088. data: { id }
  1089. })
  1090. }
  1091. export function getFoodDetail(id) {
  1092. return request({
  1093. url: '/api/admin/foods/detail',
  1094. method: 'post',
  1095. data: { id }
  1096. })
  1097. }
  1098. export function saveFoodMonths(id, months) {
  1099. return request({
  1100. url: '/api/admin/foods/saveMonths',
  1101. method: 'post',
  1102. data: { id, months }
  1103. })
  1104. }
  1105. // 供应商体系管理
  1106. export function getSupplySystemList(params) {
  1107. return request({
  1108. url: '/api/admin/supply-system/list',
  1109. method: 'post',
  1110. data: params || {}
  1111. })
  1112. }
  1113. export function getSupplySystemDetail(id) {
  1114. return request({
  1115. url: '/api/admin/supply-system/detail',
  1116. method: 'post',
  1117. data: { id }
  1118. })
  1119. }
  1120. export function createSupplySystem(data) {
  1121. return request({
  1122. url: '/api/admin/supply-system/create',
  1123. method: 'post',
  1124. data
  1125. })
  1126. }
  1127. export function updateSupplySystem(data) {
  1128. return request({
  1129. url: '/api/admin/supply-system/update',
  1130. method: 'post',
  1131. data
  1132. })
  1133. }
  1134. export function toggleSupplySystemStatus(id) {
  1135. return request({
  1136. url: '/api/admin/supply-system/toggle-status',
  1137. method: 'post',
  1138. data: { id }
  1139. })
  1140. }
  1141. export function listAllSupplySystems() {
  1142. return request({
  1143. url: '/api/admin/supply-system/list-all',
  1144. method: 'post'
  1145. })
  1146. }
  1147. export function getSupplySystemMembers(systemId) {
  1148. return request({
  1149. url: '/api/admin/supply-system/member/list',
  1150. method: 'post',
  1151. data: { systemId }
  1152. })
  1153. }
  1154. export function addSupplySystemMember(systemId, userId) {
  1155. return request({
  1156. url: '/api/admin/supply-system/member/add',
  1157. method: 'post',
  1158. data: { systemId, userId }
  1159. })
  1160. }
  1161. export function removeSupplySystemMember(memberId) {
  1162. return request({
  1163. url: '/api/admin/supply-system/member/remove',
  1164. method: 'post',
  1165. data: { memberId }
  1166. })
  1167. }
  1168. export function changeSupplySystemMemberRole(memberId, role) {
  1169. return request({
  1170. url: '/api/admin/supply-system/member/change-role',
  1171. method: 'post',
  1172. data: { memberId, role }
  1173. })
  1174. }
  1175. // ========== 供应商产品管理 API (supplier_admin) ==========
  1176. export function getMySupplySystem() {
  1177. return request({
  1178. url: '/api/admin/supply-system/my-system',
  1179. method: 'post'
  1180. })
  1181. }
  1182. export function getSupplierProductList(params) {
  1183. return request({
  1184. url: '/api/admin/supplier/product/list',
  1185. method: 'post',
  1186. data: params
  1187. })
  1188. }
  1189. export function createSupplierProduct(data) {
  1190. return request({
  1191. url: '/api/admin/supplier/product/create',
  1192. method: 'post',
  1193. data
  1194. })
  1195. }
  1196. export function updateSupplierProduct(data) {
  1197. return request({
  1198. url: '/api/admin/supplier/product/update',
  1199. method: 'post',
  1200. data
  1201. })
  1202. }
  1203. export function getSupplierProductDetail(id) {
  1204. return request({
  1205. url: '/api/admin/supplier/product/detail',
  1206. method: 'post',
  1207. data: { productId: id }
  1208. })
  1209. }
  1210. export function deleteSupplierProduct(id) {
  1211. return request({
  1212. url: '/api/admin/supplier/product/delete',
  1213. method: 'post',
  1214. data: { productId: id }
  1215. })
  1216. }
  1217. export function shelveSupplierProduct(productId, shelve) {
  1218. return request({
  1219. url: '/api/admin/supplier/product/shelve',
  1220. method: 'post',
  1221. data: { productId, shelve }
  1222. })
  1223. }
  1224. // 结算管理
  1225. export function getSupplySettlementList(params) {
  1226. return request({
  1227. url: '/api/admin/supply-settlement/list',
  1228. method: 'post',
  1229. data: params || {}
  1230. })
  1231. }
  1232. export function getSupplySettlementDetail(id) {
  1233. return request({
  1234. url: '/api/admin/supply-settlement/detail',
  1235. method: 'post',
  1236. data: { id }
  1237. })
  1238. }
  1239. export function getSupplySettlementDetailItems(settlementId) {
  1240. return request({
  1241. url: '/api/admin/supply-settlement/detail-items',
  1242. method: 'post',
  1243. data: { settlementId }
  1244. })
  1245. }
  1246. export function createSupplySettlement(systemId, periodStart, periodEnd, remark) {
  1247. return request({
  1248. url: '/api/admin/supply-settlement/create',
  1249. method: 'post',
  1250. data: { systemId, periodStart, periodEnd, remark }
  1251. })
  1252. }
  1253. export function confirmSupplySettlement(id) {
  1254. return request({
  1255. url: '/api/admin/supply-settlement/confirm',
  1256. method: 'post',
  1257. data: { id }
  1258. })
  1259. }
  1260. // ========== 供应商管理 (supplier_admin) ==========
  1261. export function getSupplyManageList(params) {
  1262. return request({
  1263. url: '/api/admin/supply-manage/list',
  1264. method: 'post',
  1265. data: params
  1266. })
  1267. }
  1268. export function getSupplyManageDetail(params) {
  1269. return request({
  1270. url: '/api/admin/supply-manage/detail',
  1271. method: 'post',
  1272. data: params
  1273. })
  1274. }
  1275. export function createSupplyManage(params) {
  1276. return request({
  1277. url: '/api/admin/supply-manage/create',
  1278. method: 'post',
  1279. data: params
  1280. })
  1281. }
  1282. export function updateSupplyManage(params) {
  1283. return request({
  1284. url: '/api/admin/supply-manage/update',
  1285. method: 'post',
  1286. data: params
  1287. })
  1288. }
  1289. export function deleteSupplyManage(params) {
  1290. return request({
  1291. url: '/api/admin/supply-manage/delete',
  1292. method: 'post',
  1293. data: params
  1294. })
  1295. }
  1296. export function addSupplierRole(params) {
  1297. return request({
  1298. url: '/api/admin/supply-manage/add-role',
  1299. method: 'post',
  1300. data: params
  1301. })
  1302. }
  1303. export function removeSupplierRole(params) {
  1304. return request({
  1305. url: '/api/admin/supply-manage/remove-role',
  1306. method: 'post',
  1307. data: params
  1308. })
  1309. }
  1310. export function adjustSupplyTier(params) {
  1311. return request({
  1312. url: '/api/admin/supply-manage/adjust-tier',
  1313. method: 'post',
  1314. data: params
  1315. })
  1316. }
  1317. // 供应商层级关系管理
  1318. export function getSupplyHierarchyTree(systemId) {
  1319. return request({
  1320. url: '/api/admin/supply-hierarchy/tree',
  1321. method: 'post',
  1322. data: { systemId }
  1323. })
  1324. }
  1325. export function setSupplyHierarchy(data) {
  1326. return request({
  1327. url: '/api/admin/supply-hierarchy/set',
  1328. method: 'post',
  1329. data
  1330. })
  1331. }
  1332. export function removeSupplyHierarchy(data) {
  1333. return request({
  1334. url: '/api/admin/supply-hierarchy/remove',
  1335. method: 'post',
  1336. data
  1337. })
  1338. }
  1339. export function getSupplyHierarchyDirectChildren(data) {
  1340. return request({
  1341. url: '/api/admin/supply-hierarchy/direct-children',
  1342. method: 'post',
  1343. data
  1344. })
  1345. }
  1346. export function getSupplyHierarchyAllChildren(data) {
  1347. return request({
  1348. url: '/api/admin/supply-hierarchy/all-children',
  1349. method: 'post',
  1350. data
  1351. })
  1352. }
  1353. export function getSupplyHierarchyParent(data) {
  1354. return request({
  1355. url: '/api/admin/supply-hierarchy/parent',
  1356. method: 'post',
  1357. data
  1358. })
  1359. }
  1360. export function getSupplyHierarchyParentChain(data) {
  1361. return request({
  1362. url: '/api/admin/supply-hierarchy/parent-chain',
  1363. method: 'post',
  1364. data
  1365. })
  1366. }
  1367. export function getSupplyHierarchyMy(data) {
  1368. return request({
  1369. url: '/api/admin/supply-hierarchy/my',
  1370. method: 'post',
  1371. data
  1372. })
  1373. }
  1374. export function getSupplyHierarchyChangeRequests(data) {
  1375. return request({
  1376. url: '/api/admin/supply-hierarchy/change-requests',
  1377. method: 'post',
  1378. data
  1379. })
  1380. }
  1381. export function applySupplyHierarchyChange(data) {
  1382. return request({
  1383. url: '/api/admin/supply-hierarchy/change/apply',
  1384. method: 'post',
  1385. data
  1386. })
  1387. }
  1388. export function reviewSupplyHierarchyChange(data) {
  1389. return request({
  1390. url: '/api/admin/supply-hierarchy/change/review',
  1391. method: 'post',
  1392. data
  1393. })
  1394. }
  1395. // ========== 家庭会员订阅管理 API ==========
  1396. export function getSubscriptionList(params) {
  1397. return request({
  1398. url: '/api/admin/subscription/list',
  1399. method: 'post',
  1400. data: params
  1401. })
  1402. }
  1403. export function activateSubscription(data) {
  1404. return request({
  1405. url: '/api/admin/subscription/activate',
  1406. method: 'post',
  1407. data
  1408. })
  1409. }
  1410. export function cancelSubscriptionAdmin(data) {
  1411. return request({
  1412. url: '/api/admin/subscription/cancel',
  1413. method: 'post',
  1414. data
  1415. })
  1416. }
  1417. export function getBenefitConfig() {
  1418. return request({
  1419. url: '/api/admin/subscription/benefits',
  1420. method: 'post'
  1421. })
  1422. }
  1423. export function updateBenefitConfig(data) {
  1424. return request({
  1425. url: '/api/admin/subscription/benefits/update',
  1426. method: 'post',
  1427. data
  1428. })
  1429. }
  1430. // ========== 推广等级配置 API ==========
  1431. export function getPromotionTierList(params) {
  1432. return request({
  1433. url: '/api/admin/promotion/tier/list',
  1434. method: 'post',
  1435. data: params
  1436. })
  1437. }
  1438. export function adjustPromotionTier(data) {
  1439. return request({
  1440. url: '/api/admin/promotion/tier/adjust',
  1441. method: 'post',
  1442. data
  1443. })
  1444. }
  1445. // ========== 佣金/返利记录 API ==========
  1446. export function getCommissionRecords(params) {
  1447. return request({
  1448. url: '/api/admin/commission/records',
  1449. method: 'post',
  1450. data: params
  1451. })
  1452. }
  1453. export function settleCommission(data) {
  1454. return request({
  1455. url: '/api/admin/commission/settle',
  1456. method: 'post',
  1457. data
  1458. })
  1459. }
  1460. export function refundCommission(data) {
  1461. return request({
  1462. url: '/api/admin/commission/refund',
  1463. method: 'post',
  1464. data
  1465. })
  1466. }
  1467. // ========== 产品 P 点配置 API ==========
  1468. export function getProductPpointList(params) {
  1469. return request({
  1470. url: '/api/admin/product-ppoint/list',
  1471. method: 'post',
  1472. data: params
  1473. })
  1474. }
  1475. export function saveProductPpoint(data) {
  1476. return request({
  1477. url: '/api/admin/product-ppoint/save',
  1478. method: 'post',
  1479. data
  1480. })
  1481. }
  1482. export function deleteProductPpoint(data) {
  1483. return request({
  1484. url: '/api/admin/product-ppoint/delete',
  1485. method: 'post',
  1486. data
  1487. })
  1488. }
  1489. export function getProductPpointByProduct(data) {
  1490. return request({
  1491. url: '/api/admin/product-ppoint/by-product',
  1492. method: 'post',
  1493. data
  1494. })
  1495. }
  1496. // ========== 推广等级配置 (R0-R4) API ==========
  1497. export function getPromotionTierConfig() {
  1498. return request({
  1499. url: '/api/admin/promotion/config',
  1500. method: 'post'
  1501. })
  1502. }
  1503. export function updatePromotionTierConfig(data) {
  1504. return request({
  1505. url: '/api/admin/promotion/config/update',
  1506. method: 'post',
  1507. data
  1508. })
  1509. }
  1510. // ========== 待退款管理 API ==========
  1511. export function getPendingRefundList(params) {
  1512. return request({
  1513. url: '/api/admin/commission/refunds/pending',
  1514. method: 'post',
  1515. data: params
  1516. })
  1517. }
  1518. export function getPendingRefundSummary() {
  1519. return request({
  1520. url: '/api/admin/commission/refunds/summary',
  1521. method: 'post'
  1522. })
  1523. }
  1524. export function cancelPendingRefund(params) {
  1525. return request({
  1526. url: '/api/admin/commission/refunds/cancel',
  1527. method: 'post',
  1528. data: params
  1529. })
  1530. }
  1531. // ========== 佣金配置 API ==========
  1532. export function getCommissionConfig() {
  1533. return request({
  1534. url: '/api/admin/commission/config',
  1535. method: 'post'
  1536. })
  1537. }
  1538. export function updateCommissionConfig(data) {
  1539. return request({
  1540. url: '/api/admin/commission/config/update',
  1541. method: 'post',
  1542. data
  1543. })
  1544. }
  1545. // 电商供应商管理(已合并至供应商体系,接口指向 /api/admin/supply-system)
  1546. // 保留旧函数名但指向新接口,避免前端报错
  1547. export function getEcomSupplierList(params) {
  1548. return request({
  1549. url: '/api/admin/supply-system/list',
  1550. method: 'post',
  1551. data: params
  1552. })
  1553. }
  1554. export function saveEcomSupplier(data) {
  1555. return request({
  1556. url: '/api/admin/supply-system/create',
  1557. method: 'post',
  1558. data
  1559. })
  1560. }
  1561. export function updateEcomSupplier(data) {
  1562. return request({
  1563. url: '/api/admin/supply-system/update',
  1564. method: 'post',
  1565. data
  1566. })
  1567. }
  1568. export function deleteEcomSupplier(id) {
  1569. return request({
  1570. url: '/api/admin/supply-system/toggle-status',
  1571. method: 'post',
  1572. data: { id }
  1573. })
  1574. }
  1575. export function getAllSuppliers() {
  1576. return request({
  1577. url: '/api/admin/supplier/all',
  1578. method: 'post'
  1579. })
  1580. }
  1581. // ===== 家庭收益管理 =====
  1582. export function getFamilyEarningsList() {
  1583. return request({
  1584. url: '/api/admin/earnings/families',
  1585. method: 'post',
  1586. data: {}
  1587. })
  1588. }
  1589. export function getFamilyEarningsDetail(familyId) {
  1590. return request({
  1591. url: '/api/admin/earnings/family/' + familyId + '/summary',
  1592. method: 'post',
  1593. data: { familyId: familyId }
  1594. })
  1595. }
  1596. export function getFamilyEarningsRecords(familyId, type) {
  1597. return request({
  1598. url: '/api/admin/earnings/family/' + familyId + '/records',
  1599. method: 'post',
  1600. data: { familyId: familyId, type: type || '' }
  1601. })
  1602. }
  1603. // ===== 测评待分配规划师 =====
  1604. export function getPendingAssessmentList(params) {
  1605. return request({
  1606. url: '/api/admin/assessment/pending-list',
  1607. method: 'post',
  1608. data: params || {}
  1609. })
  1610. }
  1611. export function getAvailableGuides() {
  1612. return request({
  1613. url: '/api/admin/assessment/available-guides',
  1614. method: 'post',
  1615. data: {}
  1616. })
  1617. }
  1618. export function assignGuide(appointmentId, guideId) {
  1619. return request({
  1620. url: '/api/admin/assessment/assign-guide',
  1621. method: 'post',
  1622. data: { appointmentId, guideId }
  1623. })
  1624. }
  1625. // ===== 测评订单管理 =====
  1626. export function getAssessmentOrderList(params) {
  1627. return request({
  1628. url: '/api/admin/assessment/orders',
  1629. method: 'post',
  1630. data: params || {}
  1631. })
  1632. }
  1633. export function changeAssessmentGuide(orderId, guideId) {
  1634. return request({
  1635. url: '/api/admin/assessment/change-guide',
  1636. method: 'post',
  1637. data: { orderId, guideId }
  1638. })
  1639. }
  1640. // ========== 库存管理 API ==========
  1641. export function createInboundOrder(data) {
  1642. return request({
  1643. url: '/api/admin/inventory/inbound/create',
  1644. method: 'post',
  1645. data
  1646. })
  1647. }
  1648. export function getInboundOrderList(params) {
  1649. return request({
  1650. url: '/api/admin/inventory/inbound/list',
  1651. method: 'post',
  1652. data: params
  1653. })
  1654. }
  1655. export function getInboundOrderDetail(id) {
  1656. return request({
  1657. url: '/api/admin/inventory/inbound/detail',
  1658. method: 'post',
  1659. data: { id }
  1660. })
  1661. }
  1662. export function confirmInbound(id) {
  1663. return request({
  1664. url: '/api/admin/inventory/inbound/confirm',
  1665. method: 'post',
  1666. data: { id }
  1667. })
  1668. }
  1669. export function cancelInbound(id) {
  1670. return request({
  1671. url: '/api/admin/inventory/inbound/cancel',
  1672. method: 'post',
  1673. data: { id }
  1674. })
  1675. }
  1676. export function getInventoryTransactions(params) {
  1677. return request({
  1678. url: '/api/admin/inventory/transactions/list',
  1679. method: 'post',
  1680. data: params
  1681. })
  1682. }
  1683. export function createCountingRecord(data) {
  1684. return request({
  1685. url: '/api/admin/inventory/counting/create',
  1686. method: 'post',
  1687. data
  1688. })
  1689. }
  1690. export function confirmCounting(id) {
  1691. return request({
  1692. url: '/api/admin/inventory/counting/confirm',
  1693. method: 'post',
  1694. data: { id }
  1695. })
  1696. }
  1697. export function getCountingList(params) {
  1698. return request({
  1699. url: '/api/admin/inventory/counting/list',
  1700. method: 'post',
  1701. data: params
  1702. })
  1703. }
  1704. export function getStockAlerts() {
  1705. return request({
  1706. url: '/api/admin/inventory/alert/list',
  1707. method: 'post'
  1708. })
  1709. }
  1710. export function getProductStock(productId) {
  1711. return request({
  1712. url: '/api/admin/inventory/product/stock',
  1713. method: 'post',
  1714. data: { productId }
  1715. })
  1716. }
  1717. export function saveBundleItems(bundleProductId, items) {
  1718. return request({
  1719. url: '/api/admin/inventory/bundle/items',
  1720. method: 'post',
  1721. data: { bundleProductId, items }
  1722. })
  1723. }
  1724. export function getBundleItems(bundleProductId) {
  1725. return request({
  1726. url: '/api/admin/inventory/bundle/items/list',
  1727. method: 'post',
  1728. data: { bundleProductId }
  1729. })
  1730. }
  1731. export function checkBundleStock(bundleProductId, quantity) {
  1732. return request({
  1733. url: '/api/admin/inventory/bundle/check-stock',
  1734. method: 'post',
  1735. data: { bundleProductId, quantity }
  1736. })
  1737. }
  1738. export function createManualOutbound(data) {
  1739. return request({
  1740. url: '/api/admin/inventory/outbound/create',
  1741. method: 'post',
  1742. data
  1743. })
  1744. }
  1745. export function getManualOutboundList(params) {
  1746. return request({
  1747. url: '/api/admin/inventory/outbound/list',
  1748. method: 'post',
  1749. data: params
  1750. })
  1751. }
  1752. export function getFamilyMemberList(params) {
  1753. return request({
  1754. url: '/api/family/member/list',
  1755. method: 'post',
  1756. data: params
  1757. })
  1758. }
  1759. export function updateOrderExpress(data) {
  1760. return request({
  1761. url: '/api/admin/product/order/update-express',
  1762. method: 'post',
  1763. data
  1764. })
  1765. }
  1766. // ========== 健康报告代上传 ==========
  1767. export function proxyParseReport(data) {
  1768. const formData = new FormData()
  1769. formData.append('file', data.file)
  1770. formData.append('familyId', data.familyId)
  1771. if (data.subjectId) formData.append('subjectId', data.subjectId)
  1772. if (data.note) formData.append('note', data.note)
  1773. return request({
  1774. url: '/api/health/report/proxy-parse',
  1775. method: 'post',
  1776. data: formData,
  1777. headers: { 'Content-Type': 'multipart/form-data' }
  1778. })
  1779. }
  1780. export function proxyConfirmReport(data) {
  1781. return request({
  1782. url: '/api/health/report/proxy-confirm',
  1783. method: 'post',
  1784. data
  1785. })
  1786. }
  1787. export function listHealthReports(params) {
  1788. return request({
  1789. url: '/api/health/report/list',
  1790. method: 'post',
  1791. data: params
  1792. })
  1793. }
  1794. export function adminListHealthReports(params) {
  1795. return request({
  1796. url: '/api/health/report/admin-list',
  1797. method: 'post',
  1798. data: params
  1799. })
  1800. }
  1801. export function getHealthReportDetail(reportId) {
  1802. return request({
  1803. url: '/api/health/report/detail',
  1804. method: 'post',
  1805. data: { reportId }
  1806. })
  1807. }
  1808. export function archiveReport(reportId) {
  1809. return request({
  1810. url: '/api/health/report/archive',
  1811. method: 'post',
  1812. data: { reportId }
  1813. })
  1814. }
  1815. export function archiveReportsBatch(reportIds) {
  1816. return request({
  1817. url: '/api/health/report/archive-batch',
  1818. method: 'post',
  1819. data: { reportIds }
  1820. })
  1821. }
  1822. export function editHealthReport(data) {
  1823. return request({
  1824. url: '/api/health/report/edit',
  1825. method: 'post',
  1826. data
  1827. })
  1828. }
  1829. export function reassignHealthReport(data) {
  1830. return request({
  1831. url: '/api/health/report/reassign',
  1832. method: 'post',
  1833. data
  1834. })
  1835. }
  1836. export function getUnlinkedReports(data) {
  1837. return request({
  1838. url: '/api/health/report/unlinked',
  1839. method: 'post',
  1840. data
  1841. })
  1842. }
  1843. // ===== CF值(平台积分)管理 =====
  1844. export function getCfValueBalance(data) {
  1845. return request({
  1846. url: '/api/admin/cf-value/balance',
  1847. method: 'post',
  1848. data
  1849. })
  1850. }
  1851. export function getCfValueLogs(data) {
  1852. return request({
  1853. url: '/api/admin/cf-value/logs',
  1854. method: 'post',
  1855. data
  1856. })
  1857. }
  1858. export function getCfValueAllBalances(data) {
  1859. return request({
  1860. url: '/api/admin/cf-value/all-balances',
  1861. method: 'post',
  1862. data
  1863. })
  1864. }
  1865. // 获取已入驻的服务商列表(用于商品编辑下拉选择)
  1866. export function getApprovedGuides() {
  1867. return request({
  1868. url: '/api/admin/guide/guides/approved',
  1869. method: 'post'
  1870. })
  1871. }
  1872. // 用户画像管理
  1873. export function getProfile(memberId) {
  1874. return request({
  1875. url: '/api/admin/profile/get',
  1876. method: 'post',
  1877. data: { memberId }
  1878. })
  1879. }
  1880. export function getProfileTrend(memberId, days) {
  1881. return request({
  1882. url: '/api/admin/profile/trend',
  1883. method: 'post',
  1884. data: { memberId, days: days || 30 }
  1885. })
  1886. }
  1887. // ========== 引导配置 API ==========
  1888. export function getGuideConfig() {
  1889. return request({
  1890. url: '/api/admin/guide-config/get',
  1891. method: 'post'
  1892. })
  1893. }
  1894. export function saveGuideConfig(configValue) {
  1895. return request({
  1896. url: '/api/admin/guide-config/save',
  1897. method: 'post',
  1898. data: { configValue }
  1899. })
  1900. }