admin.js 44 KB

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