admin.js 46 KB

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