requests.ts 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. import { http, httpDelete, httpGet, httpPost, httpPut } from '../../utils/http'
  2. import { Schedule } from '../models/schedule'
  3. import {
  4. Category,
  5. Content,
  6. DictType,
  7. MaterialDealer,
  8. MaterialDealerHomePage,
  9. MaterialDealerRes,
  10. Comment,
  11. Activity,
  12. BannerMode,
  13. Banner,
  14. StudyTour,
  15. PointsOrder,
  16. UserAuthInfo,
  17. ResPageData,
  18. Message,
  19. Coupon,
  20. MyStudyTour,
  21. Badge,
  22. Certificate,
  23. UserBasicInfo,
  24. ActivitySignUp,
  25. Product,
  26. ConfirmOrder,
  27. } from './models'
  28. import dayjs from 'dayjs'
  29. import { AgreementType } from '@/core/libs/enums'
  30. export const getUserInfo = () =>
  31. httpGetMock<any>({
  32. avatar: 'https://via.placeholder.com/21x21',
  33. nickname: '苏小萌',
  34. })
  35. export const getSchedule = () =>
  36. httpGetMock<Schedule>({
  37. name: '东京艺术设计研习营',
  38. cover: 'https://via.placeholder.com/375x297',
  39. items: [
  40. {
  41. title: '早稻田大学课程',
  42. time: '9:00',
  43. content:
  44. '是位于日本东京都新宿区的一所著名的私立大学。它由早稻田大学的创始人大隈重信于1882年创立,是日本超级国际化大学计划(Top Global University Project)选定的大学之一,也是日本顶尖的高等教育机构之一。',
  45. momentExample: 'https://via.placeholder.com/285x157',
  46. monentHint: '*说明:打卡地XX,收集上课素材',
  47. },
  48. {
  49. title: '早稻田大学博物馆参观',
  50. time: '11:00',
  51. content:
  52. '早稻田大学拥有多座博物馆,‌其中最著名的是早稻田大学历史馆。‌早稻田大学历史馆收藏、‌展示着著名校友在运动方面的杰出表现和成就,‌馆内的解说牌以日语和英语标示,‌展现了传统样式风格的建筑。',
  53. momentExample: 'https://via.placeholder.com/285x157',
  54. monentHint: '*说明:打卡地XX,收集上课素材',
  55. },
  56. ],
  57. })
  58. export const getClassmates = () =>
  59. httpGetMock<any[]>([
  60. {
  61. avatar: 'https://via.placeholder.com/35x35',
  62. nickname: '苏小萌',
  63. level: '0',
  64. },
  65. {
  66. avatar: 'https://via.placeholder.com/35x35',
  67. nickname: '苏小萌',
  68. level: '0',
  69. },
  70. {
  71. avatar: 'https://via.placeholder.com/35x35',
  72. },
  73. ])
  74. export const getClassmate = () =>
  75. httpGetMock<any>({
  76. title: '2023同学荟|清华空间环境艺术设计研修班 阔步向未来',
  77. author: {
  78. avatar: 'https://via.placeholder.com/35x35',
  79. nickname: '苏小萌',
  80. level: '0',
  81. },
  82. viewNum: 125,
  83. createdAt: dayjs('2024-07-15').toDate(),
  84. content: '<div>111111</div>',
  85. })
  86. export const getMaterialDealers = () =>
  87. httpGetMock<any[]>([
  88. {
  89. name: 'IMOLA瓷砖',
  90. icon: 'https://via.placeholder.com/78x78',
  91. brandType: '进口品牌',
  92. type: '瓷砖',
  93. views: 1000,
  94. createdAt: dayjs('2024-07-15').toDate(),
  95. },
  96. {
  97. name: 'IMOLA瓷砖',
  98. icon: 'https://via.placeholder.com/78x78',
  99. brandType: '进口品牌',
  100. type: '瓷砖',
  101. views: 1000,
  102. createdAt: dayjs('2024-07-15').toDate(),
  103. },
  104. ])
  105. export const weixinMiniAppLogin = (phoneCode: string, loginCode: string, state: string) =>
  106. httpPost<any>('/app-api/member/auth/weixin-mini-app-login', {
  107. phoneCode,
  108. loginCode,
  109. state,
  110. })
  111. export const getPhoneCode = (data: { mobile: string; scene: 2 }) =>
  112. httpPost<any>('/app-api/member/auth/send-sms-code', data)
  113. export const testLogin = (data: { mobile: string; password: string }) =>
  114. httpPost<any>('/app-api/member/auth/login2', data)
  115. /**
  116. * 修改手机号
  117. */
  118. export const updateMobile = (data: { mobile: string; code: string }) =>
  119. httpPut('/app-api/member/user/update-mobile', data)
  120. export const getMemberUserInfo = () => httpGet<any>('/app-api/member/user/get')
  121. export const updateMemberUserInfo = (data = {}) => httpPut<any>('/app-api/member/user/update', data)
  122. export const getByDictType = (
  123. type: string | 'member_channel_source' | 'member_spatial_expertise_type' | DictType,
  124. ) =>
  125. httpGet<
  126. {
  127. label: string
  128. value: string
  129. dictType: string
  130. status: number
  131. }[]
  132. >('/app-api/system/dict-data/type', { type })
  133. export const validateReferrerCode = (data: { code: string; channelSource: string }) =>
  134. httpPost('/app-api/member/user-auth-info/referrer-validate-code', {}, data)
  135. export const createUserAuthInfo = (
  136. data: Partial<{
  137. id: number
  138. userId: number
  139. designerName: string
  140. gender: number
  141. mobile: string
  142. channelSource: number
  143. referrer: string
  144. employer: string
  145. spatialExpertiseType: number
  146. attachment: string
  147. auditStatus: number
  148. remark: string
  149. }>,
  150. ) => httpPost<any>('/app-api/member/user-auth-info/create', data)
  151. /**
  152. * 获取设计师基本信息
  153. */
  154. export const getUserBasicInfo = (query: { userId: string }) =>
  155. httpGet<UserBasicInfo>('/app-api/member/stylist-basic-info/get', query)
  156. /**
  157. * 更新设计师基本信息
  158. */
  159. export const updateUserBasicInfo = (data: Partial<UserBasicInfo>) =>
  160. httpPut('/app-api/member/stylist-basic-info/update', data)
  161. /**
  162. * 获取设计师审核信息
  163. */
  164. export const getUserAuthInfo = () => httpGet<UserAuthInfo>('/app-api/member/user-auth-info/get')
  165. /**
  166. * 更新设计师审核信息
  167. */
  168. export const updateUserAuthInfo = (data: Partial<UserAuthInfo>) =>
  169. httpPost('/app-api/member/user-auth-info/update', data)
  170. export const getCircles = (query: { tagName?: string; circleType?: string; stylistId?: string }) =>
  171. httpGet<{
  172. list: {
  173. id: number
  174. headUrl?: string
  175. stylistId?: number
  176. stylistName?: string
  177. marketing?: string
  178. circleDesc?: string
  179. tagName?: string
  180. detailsType?: string
  181. detailsUrl?: string
  182. detailsDesc?: string
  183. circleType?: string
  184. spaceType?: string
  185. designStyle?: string
  186. spaceAddr?: string
  187. customerDemand?: string
  188. createTime: number
  189. bannerUrls: string[]
  190. shareCount?: number
  191. upvoteCount?: number
  192. ownUpvote: boolean
  193. reviewCount: number
  194. }[]
  195. }>('/app-api/member/circle/page', query)
  196. export const createCircle = (data: Partial<Circle>) =>
  197. httpPost<any>('/app-api/member/circle/create', data)
  198. export const getCircle = (id: string) =>
  199. httpGet<Partial<CircleRes>>('/app-api/member/circle/get', { id })
  200. /**
  201. * 删除个人圈子
  202. */
  203. export const deleteCircle = (id: string) => httpDelete('/app-api/member/circle/delete', { id })
  204. export const shareCircle = (id: string) => httpGet('/app-api/member/circle/share', { id })
  205. /**
  206. * /app-api/member/designer/shareHomeHistory 分享设计师主页
  207. */
  208. export const shareDesignerHome = (data: {
  209. stylistId: number
  210. bizId: number
  211. // shareType:
  212. }) => httpPost('/app-api/member/designer/shareHomeHistory', data)
  213. export const getCircleUpvotes = (id) =>
  214. httpGet<{
  215. total: number
  216. list: {
  217. id: number
  218. circleId: number
  219. userId: number
  220. upvpteTime: number
  221. createTime: number
  222. userName: string
  223. }[]
  224. }>('/app-api/member/circle-upvote/page', { circleId: id })
  225. export const createCircleUpvote = (data: { circleId: number; userId: number; userName: string }) =>
  226. httpPost('/app-api/member/circle-upvote/create', data)
  227. /**
  228. * 取消圈子点赞
  229. */
  230. export const cancelCircleUpvote = (query: { id: string }) =>
  231. httpGet('/app-api/member/circle-upvote/delete', query)
  232. export const createCircleReview = (
  233. data: Partial<{
  234. circleId: string
  235. userId: string | number
  236. userName: string
  237. reviewContent: string
  238. replayReviewId: string
  239. }>,
  240. ) => httpPost<any>('/app-api/member/circle-review/create', data)
  241. export const deleteCircleReview = (id) => httpGet('/app-api/member/circle-review/delete', { id })
  242. export const getCircleReviews = (query: { circleId: string ,hot:boolean}) =>
  243. httpGet<{
  244. list: Comment[]
  245. }>('/app-api/member/circle-review/getCircleReviewByCircleId', query)
  246. /**
  247. * 获取圈子评论回复
  248. */
  249. export const getCircleReviewReplaies = (query = {}) =>
  250. httpGet<any>('/app-api/member/circle-review/getReviewReplay', query)
  251. export const createCircleReviewUpvote = (data: {
  252. circleId: number
  253. userId: number
  254. userName: string
  255. reviewId: number
  256. }) => httpPost('/app-api/member/circle-review-upvote/create', data)
  257. export const cancelCircleReviewUpvote = (query: {
  258. circleId: string
  259. userId: string
  260. reviewId: string
  261. }) => httpGet('/app-api/member/circle-review-upvote/cancel', query)
  262. export const getCircleReviewUpvotes = (query: { circleId: string; reviewId?: string }) =>
  263. httpGet('/app-api/member/circle-review-upvote/page', query)
  264. export const getReviewReplay = (query: { id: string }) =>
  265. httpGet('/app-api/member/circle-review/getReviewReplay', query)
  266. export const getTasks = (query) =>
  267. httpGet<{
  268. list: {
  269. id: number
  270. taskKey: string
  271. taskValue: string
  272. createTime: string
  273. sort: number
  274. status: number
  275. }[]
  276. }>('/app-api/basicsetting/set-task-center/page', query)
  277. /**
  278. * 获取发布圈子任务状态
  279. */
  280. export const getCircleTaskStatus = () => httpGet('/app-api/member/circle/taskIntegral')
  281. export const getCircleTags = (query) =>
  282. httpGet<{
  283. list: {
  284. id: number
  285. labelName: string
  286. labelType: number
  287. usageCount: number
  288. creator: string
  289. createTime: number
  290. }[]
  291. }>('/app-api/basicsetting/set-label/page', query)
  292. /**
  293. * 获取用户标签
  294. */
  295. export const getMemberTags = (query: { stylistId: string }) =>
  296. httpGet<
  297. {
  298. id: number
  299. stylistId: number
  300. stylistName: string
  301. tagName: string
  302. createTime: string
  303. }[]
  304. >('/app-api/member/circle/pageUerTag', query)
  305. /**
  306. * 创建用户标签
  307. */
  308. export const createMemberTag = (
  309. data: Partial<{
  310. stylistId: number
  311. stylistName: string
  312. tagName: string
  313. }>,
  314. ) => httpPost('/app-api/member/circle/createUserTag', data)
  315. /**
  316. * 删除用户标签
  317. */
  318. export const deleteMemberTag = (id: string) =>
  319. httpDelete('/app-api/member/circle/deleteUserTag', { id })
  320. export const getSetIndexConfigs = (query = {}) =>
  321. httpGet<{
  322. list: {
  323. id: number
  324. name: string
  325. indexPromotionalVideoImage: string
  326. coverVideoImage: string
  327. sort: number
  328. playCount: number
  329. status: number
  330. createTime: string
  331. }[]
  332. }>('/app-api/basicsetting/set-index-config/page', query)
  333. export const updateSetIndexConfig = (data: { id: number; status: number }) =>
  334. httpPut('/app-api/basicsetting/set-index-config/update', data)
  335. /**
  336. * 获取材料商列表
  337. * @param query {{brandLevel: '1'|'2'}}
  338. * @returns {Promise<*>}
  339. */
  340. export const getMaterials = (query = {}) =>
  341. httpGet<{
  342. list: MaterialDealer[]
  343. }>('/app-api/member/materials/page', query)
  344. export const getAppMaterials = () =>
  345. httpGet<MaterialDealerRes[]>('/app-api/member/materials/appMaterialsList')
  346. export const getAppMaterial = (id: number) =>
  347. httpGet<MaterialDealer>('/app-api/member/materials/queryHomePage', { materialsId: id })
  348. export const getMaterialHomePage = (id: number) =>
  349. httpGet<Partial<MaterialDealerHomePage>>('/app-api/member/materials/queryHomePage', {
  350. materialsId: id,
  351. })
  352. export const getMaterialDetail = (query: { id: string }) =>
  353. httpGet<MaterialDealer>('/app-api/member/materials/getDetail', query)
  354. /**
  355. * 下载材料商
  356. */
  357. export const downloadMaterials = (query: { materialsId: string }) =>
  358. httpGet('/app-api/member/materials/download', query)
  359. export const createMaterialsReferrer = (data) =>
  360. httpPost('/app-api/member/materials-referrer/create', data)
  361. export const getContents = (query: {
  362. contentType?: '1' | '2' | '3'
  363. contentCategory?: string
  364. pageSize?: string
  365. }) => httpGet<{ list: Content[] }>('/app-api/member/content-manger/page', query)
  366. export const getAllCategories = () =>
  367. httpGet<Category[]>('/app-api/member/categories/getAllCategories')
  368. export const getContent = (query: { id: string }) =>
  369. httpGet<Content>('/app-api/member/content-manger/get', query)
  370. export const getProductCategories = () =>
  371. httpGet<Category[]>('/app-api/member/product-type/getAllProductCategories', {})
  372. export const getProducts = (query: { oneCategory?: string; secondCategory?: string }) =>
  373. httpGet<{
  374. list: {
  375. prodcutName: string
  376. productId: string
  377. needPoints: number
  378. points: number
  379. productPrice: string
  380. productCoverImgUrl: string
  381. productDetailsImgUrl: string
  382. contentDesc: string
  383. productType: string
  384. oneCategory: any
  385. secondCategory: string
  386. }[]
  387. }>('/app-api/member/product/page', query)
  388. /**
  389. * 获取超值划算商品
  390. */
  391. export const getFavourableProducts = () =>
  392. httpPost<Product[]>('/app-api/member/product/listFavourableProduct')
  393. export const getProduct = (id: string) =>
  394. httpGet<Product>('/app-api/member/product/detail', { productId: id })
  395. export const getProductItemBuy = (query: { userId: number }) =>
  396. httpPost<{
  397. list: Partial<{
  398. productId: string
  399. prodcutName: string
  400. oneCategory: any
  401. secondCategory: string
  402. isRestrict: number
  403. productRepertory: any
  404. productPrice: string
  405. productType: string
  406. vendorId: any
  407. vendorName: string
  408. needPoints: number
  409. points?: number
  410. gainType: number
  411. exchangeDesc: any
  412. productCoverImgUrl: string
  413. productDetailsImgUrl: string
  414. contentDesc: string
  415. status: number
  416. exchangeCount: any
  417. memberLevelId: any
  418. memberLevelName: any
  419. favourablePoints?: number
  420. favourableEndDate?: number
  421. favourableStatus: number
  422. count: number
  423. createTime: any
  424. userId: number
  425. nums: number
  426. deleted?: boolean
  427. }>[]
  428. total: number
  429. }>('/app-api/member/product-item-buy/select', query)
  430. /**
  431. * 商品添加到购物车
  432. */
  433. export const createProductItemBuy = (data: {
  434. doList: {
  435. createTime?: string
  436. updateTime?: string
  437. creator?: string
  438. updater?: string
  439. deleted?: boolean
  440. id?: number
  441. productId?: string
  442. userId?: number
  443. points: number
  444. nums: number
  445. }[]
  446. }) => httpPost('/app-api/member/product-item-buy/create', data)
  447. /**
  448. * 从购物车删除商品
  449. */
  450. export const deleteProductItemBuy = (data: {
  451. doList: {
  452. createTime?: string
  453. updateTime?: string
  454. creator?: string
  455. updater?: string
  456. deleted?: boolean
  457. id?: number
  458. productId?: string
  459. userId?: number
  460. nums?: number
  461. }[]
  462. }) => httpPost('/app-api/member/product-item-buy/delete', data)
  463. /**
  464. * 购物车商品数量增减
  465. */
  466. // export const updateProductItemNums = (data: {
  467. // userId: number
  468. // productId: string
  469. // changingNum: number
  470. // }) => httpPost('/app-api/member/product-item-buy/increase-or-decrease/product/num', data)
  471. /**
  472. * 商城下单
  473. */
  474. export const productPlacing = (data: {
  475. isShoppingCart: number
  476. userId: number
  477. /**
  478. * 1-游学项目,2-线下活动,3-品质商城,4-案例拍摄,5-微信代运营,6-积分支付,7-其他
  479. */
  480. item: number | 1 | 2 | 3 | 4 | 5 | 6 | 7
  481. list: {
  482. orderNo?: string
  483. productId?: string
  484. points?: number
  485. nums?: number
  486. productName: string
  487. orderImgUrl: string
  488. /**
  489. * 商家id
  490. */
  491. vendorId: string | number
  492. }[]
  493. couponList: {
  494. couponId: number
  495. brandPoints: number
  496. }[]
  497. totalsPoints?: number
  498. totalsCouponPoints?: number
  499. totalsCurrPoints?: number
  500. }) => httpPost('/app-api/member/points-order/placing', data)
  501. /**
  502. * 获取订单金额
  503. */
  504. export const getOrderAmount = (data: {
  505. isShoppingCart: number
  506. userId: number
  507. list: {
  508. orderNo?: string
  509. productId?: string
  510. points?: number
  511. nums?: number
  512. }[]
  513. couponList: {
  514. couponId: number
  515. brandPoints: number
  516. }[]
  517. totalsPoints?: number
  518. totalsCouponPoints?: number
  519. totalsCurrPoints?: number
  520. }) => httpPost<ConfirmOrder>('/app-api/member/points-order/orderAmount', data)
  521. /**
  522. * 订单结算
  523. */
  524. export const orderPay = (data: {
  525. isShoppingCart: number
  526. userId: number
  527. list: {
  528. orderNo?: string
  529. productId?: string
  530. points?: number
  531. nums?: number
  532. }[]
  533. couponList: {
  534. couponId: number
  535. brandPoints: number
  536. }[]
  537. totalsPoints?: number
  538. totalsCouponPoints?: number
  539. totalsCurrPoints?: number
  540. }) => httpPost(`/app-api/member/points-order/placingPay`, data)
  541. /**
  542. * 积分结账
  543. */
  544. export const pointsPay = (data: {
  545. userId: number
  546. points: number
  547. vendorId: number
  548. orderMoney?: number
  549. }) => httpPost('/app-api/member/points-order/orderAndPaymentCompleted', data)
  550. export const getPointsOrders = (query) =>
  551. httpGet<{
  552. list: PointsOrder[]
  553. total: number
  554. }>('/app-api/member/points-order/page', query)
  555. export const getPointsOrder = (id) =>
  556. httpGet<Partial<PointsOrder>>('/app-api/member/points-order/get', { id })
  557. /**
  558. * 取消订单
  559. */
  560. export const cancelOrder = (id) => httpGet('/app-api/member/points-order/orderCancel', { id })
  561. export const getActivities = (query) =>
  562. httpGet<{
  563. list: Activity[]
  564. }>('/app-api/member/activity/page', query)
  565. export const getActivity = (id: string) =>
  566. httpGet<Partial<Activity>>('/app-api/member/activity/get', { id })
  567. export const activitySignup = (data: { id: number }) =>
  568. httpPost('/app-api/member/activity/signup', data)
  569. /**
  570. * 获取活动报名列表
  571. */
  572. export const getActivitySignups = (query: { activityId: string; pageSize?: number }) =>
  573. httpGet<ResPageData<ActivitySignUp>>('/app-api/member/activity/signup/page', query)
  574. /**
  575. * 获取游学列表
  576. */
  577. export const getStudyTours = (query) =>
  578. httpGet<{ list: StudyTour[]; total: number }>('/app-api/member/app-study-abroad/page', query)
  579. /**
  580. * 获取游学详情
  581. */
  582. export const getStudyTour = (id: string) =>
  583. httpGet<StudyTour>('/app-api/member/app-study-abroad/get', { id })
  584. /**
  585. * 游学报名
  586. */
  587. export const studyTourSignup = (data: { id: number }) =>
  588. httpPost('/app-api/member/app-study-abroad/signup', data)
  589. /**
  590. * 获取游学报名列表
  591. */
  592. export const getStudyTourSignups = (query: { studyId: string; pageSize?: number }) =>
  593. httpGet<ResPageData<ActivitySignUp>>('/app-api/member/app-study-abroad/signup/page', query)
  594. /**
  595. * 获取游学或活动的照片列表
  596. * @param query {{bizId: string; bizType: '1'|'2'}} bizId: 游学或活动id, bizType: 2-游学, 1-活动
  597. */
  598. export const getPhotoList = (query: { bizId: string; bizType: '1' | '2'; pageSize?: number }) =>
  599. httpGet<
  600. ResPageData<{
  601. id: number
  602. bizId: number
  603. bizType: string
  604. bizTypeName: string
  605. travelDate: string
  606. video: any[]
  607. picture: any[]
  608. createTime: string
  609. }>
  610. >('/app-api/member/app-study-abroad/pageStudyActivityPhoto', query)
  611. /**
  612. * 获取Banner列表
  613. */
  614. export const getBanners = (query: { mode: BannerMode }) =>
  615. httpGet<Banner[]>('/app-api/member/banner/get-by-mode', query)
  616. /**
  617. * 获取消息列表
  618. */
  619. export const getMessages = (query) =>
  620. httpGet<ResPageData<Message>>('/app-api/member/message-manage/page', query)
  621. /**
  622. * 删除消息
  623. */
  624. export const deleteMessage = (id: string) =>
  625. httpPost('/app-api/member/message-manage/delete', {}, { id })
  626. /**
  627. * 更新消息
  628. */
  629. export const updateMessage = (data: Partial<Message>) =>
  630. httpPut('/app-api/member/message-manage/update', data)
  631. /**
  632. * 积分订单取消
  633. */
  634. export const orderPointsCancel = (query: { id: string; cancelReason: string }) =>
  635. httpGet('/app-api/member/points-details/points-cancel', query)
  636. /**
  637. * 积分订单确认
  638. */
  639. export const orderPointsSubmit = (data: { id: number; userId: number; couponUserId: number }) =>
  640. httpPost('/app-api/member/points-details/confirm', data)
  641. /**
  642. * 获取Banner
  643. */
  644. export const getBanner = (id) => httpGet<Banner>('/app-api/member/banner/get-by-id', { id })
  645. /**
  646. * 获取积分明细列表
  647. */
  648. export const getPoints = (query) =>
  649. httpGet<{
  650. list: {
  651. id: number
  652. pointsType: string
  653. typeName: string
  654. pointsCategory: string
  655. categoryName: string
  656. sourceId: number
  657. name: string
  658. pointsStauts: string
  659. points: number
  660. orderMoney: string
  661. materialsId: number
  662. materialsBrand: string
  663. stylistId: number
  664. brokerId: number
  665. stylistName: string
  666. brokerName: string
  667. generateTime: string
  668. verifyTime: string
  669. completeTime: string
  670. turnDownTime: string
  671. cancelTime: string
  672. cancelReason: string
  673. turnDownReason: string
  674. remark: string
  675. couponId: number
  676. orderNo: string
  677. createTime: string
  678. }[]
  679. total: number
  680. }>(`/app-api/member/points-details/pageAllByYear/${query.year}`, query)
  681. /**
  682. * 获取会员等级列表
  683. */
  684. export const getMemberLevels = () =>
  685. httpGet<
  686. {
  687. id: number
  688. memberLevel: number
  689. memberLevelName: string
  690. upgradeCriteria: number
  691. points: number
  692. retentionDaysCriteria: number
  693. retentionDays?: number
  694. memberBgImage: string
  695. associatedMemberRights: string
  696. associatedMemberRightsName: any
  697. status: number
  698. createTime: number
  699. }[]
  700. >('/app-api/basicsetting/set-member-level-config/list')
  701. /**
  702. * 获取设计师信息
  703. */
  704. export const getDesignerInfo = (userId) =>
  705. httpGet<
  706. Partial<{
  707. id: number
  708. userId: number
  709. brokerId: number
  710. brokerName: string
  711. status: string
  712. authTime: number
  713. points: number
  714. homePageName?: string
  715. headImgUrl: string
  716. shareCount: number
  717. viewCount: number
  718. winCustomerCount: number
  719. serviceYears: string
  720. serviceCustomerCount: number
  721. designFee: string
  722. memberValidTime: number
  723. personalIdentity: string
  724. designDesc: string
  725. followFocus: string
  726. homePageUrl: string
  727. sharePageUrl: string
  728. retryStatus: number
  729. videoNumber: string
  730. }>
  731. >('/app-api/member/designer/getDesignerInfo', { userId })
  732. /**
  733. * 更新设计师信息
  734. */
  735. export const updateDesignerInfo = (data) =>
  736. httpPost<any>('/app-api/member/designer/updateDesignerInfo', data)
  737. /**
  738. * 预约设计师
  739. */
  740. export const reserveDesigner = (data: {
  741. stylistId: number
  742. stylistName: string
  743. appointmentName: string
  744. appointmentPhone: string
  745. }) => httpPost<any>('/app-api/member/designer/reserveDesigner', data)
  746. /**
  747. * 本年获客统计
  748. */
  749. export const countThisYear = (data: { year: number; userId: number }) =>
  750. httpPost<
  751. {
  752. bizType: string
  753. quantity: number
  754. }[]
  755. >('/app-api/member/designer/countThisYear', data)
  756. /**
  757. * 创建设计师主页浏览记录
  758. */
  759. export const createBrowseHistory = (data: {
  760. stylistId: number
  761. /**
  762. * 业务id
  763. */
  764. bizId?: string
  765. /**
  766. * 业务类型,可用值:分享,获客,浏览 [1,2,3]
  767. */
  768. bizType?: string | number
  769. /**
  770. * 时长:单位-秒
  771. */
  772. duration?: string
  773. }) => httpPost('/app-api/member/designer/browseHistory', data)
  774. /**
  775. * 浏览记录
  776. */
  777. export const createBrowseRecord = (data: any) =>
  778. httpPost('/app-api/member/browse-record/create', data)
  779. export const getBrowseHistories = (query) =>
  780. httpGet<
  781. ResPageData<{
  782. createTime: number
  783. updateTime: number
  784. creator: string
  785. updater: string
  786. deleted: boolean
  787. id: number
  788. stylistId: number
  789. stylistName: string
  790. bizId: any
  791. bizType: number
  792. duration: string
  793. creatorName: string
  794. }>
  795. >('/app-api/member/designer/getBrowseHistory', query)
  796. /**
  797. * 获取获客记录
  798. */
  799. export const getReserveHistory = (query) =>
  800. httpGet<
  801. ResPageData<{
  802. id: number
  803. stylistId: number
  804. stylistName: string
  805. appointmentName: string
  806. appointmentPhone: string
  807. appointmentTime: string
  808. createTime: string
  809. }>
  810. >('/app-api/member/designer/getReserveHistory', query)
  811. /**
  812. * 通过ID获取用户信息
  813. */
  814. export const getUserInfoById = (id) =>
  815. httpGet<
  816. Partial<{
  817. mobile: string
  818. status: string
  819. nickname: string
  820. avatar: string
  821. name: string
  822. sex: string
  823. areaId: number
  824. areaName: string
  825. birthday: string
  826. mark: string
  827. tagIds: string
  828. levelId: number
  829. groupId: number
  830. id: number
  831. registerIp: string
  832. loginIp: string
  833. loginDate: string
  834. createTime: string
  835. point: number
  836. totalPoint: number
  837. tagNames: string
  838. levelName: string
  839. groupName: string
  840. experience: number
  841. }>
  842. >('/app-api/member/user/getByUserId', { id })
  843. /**
  844. * 获取会员等级配置
  845. */
  846. export const getAppMemberLevelConfigs = () =>
  847. httpGet<
  848. {
  849. id: number
  850. memberLevel: number
  851. memberLevelName: string
  852. upgradeCriteria: number
  853. points: number
  854. retentionDaysCriteria: number
  855. retentionDays: number
  856. memberBgImage: string
  857. associatedMemberRights: string
  858. associatedMemberRightsName: string
  859. status: number
  860. createTime: string
  861. logo: string
  862. avatar?: string
  863. setMemberRights: {
  864. createTime: string
  865. updateTime: string
  866. creator: string
  867. updater: string
  868. deleted: boolean
  869. id: number
  870. rightsName: string
  871. rightsType: number
  872. rightsImage: string
  873. rightsDescription: string
  874. associatedMemberRightsLevel: string
  875. status: number
  876. }[]
  877. }[]
  878. >('/app-api/basicsetting/app-set-member-level-config/listAndRights')
  879. /**
  880. * 到店打卡
  881. */
  882. export const storeAndPunchIn = (data: { id: number }) =>
  883. http<boolean>({
  884. url: '/app-api/member/user-auth-info/storeAndPunchIn',
  885. data,
  886. hideErrorToast: true,
  887. method: 'POST',
  888. })
  889. /**
  890. * 获取优惠券
  891. */
  892. export const getCoupons = (query) =>
  893. httpGet<ResPageData<Coupon>>('/app-api/member/coupon-user/page', query)
  894. /**
  895. * 获取商品优惠券
  896. */
  897. export const getProductCoupons = (query) =>
  898. httpGet<Coupon[]>('/app-api/member/coupon-user/coupon-user-by-product-ids-page', query)
  899. /**
  900. * 获取积分券
  901. */
  902. export const getPointsCoupons = (query) =>
  903. httpGet<Coupon[]>('/app-api/member/coupon-user/coupon-user-by-point-ids-page', query)
  904. /**
  905. * 获取已报名的游学
  906. */
  907. export const getMyStudyTours = (query = {}) =>
  908. httpGet<MyStudyTour[]>('/app-api/member/app-study-abroad/getSignUpStudyAbroad', query)
  909. /**
  910. * /app-api/member/stylist-honor/updatePopUp 更新弹窗
  911. */
  912. export const updateHonorPopUp = (query: { bizId: string; bizType: string }) =>
  913. httpGet('/app-api/member/stylist-honor/updatePopUp', query)
  914. /**
  915. * 获取徽章列表
  916. */
  917. export const getBadges = (query = {}) =>
  918. httpGet<{ [key: string]: Badge[] }>('/app-api/member/stylist-honor/get-badge-list', query)
  919. /**
  920. * 获取个人徽章
  921. */
  922. export const getOwnBadges = (query = {}) =>
  923. httpGet<Badge[]>('/app-api/member/stylist-honor/getConferBadgeList', query)
  924. /**
  925. * 获取证书列表
  926. */
  927. export const getCertificates = (query = {}) =>
  928. httpGet<Certificate[]>('/app-api/member/stylist-honor/get-certificate-list', query)
  929. /**
  930. * 获取荣誉统计
  931. */
  932. export const getHonorStatistics = (query = {}) =>
  933. httpGet<{
  934. certCount: number
  935. badgeCount: number
  936. }>('/app-api/member/stylist-honor/get-honor-count', query)
  937. /**
  938. * 获取骑行下拉
  939. */
  940. export const getRidingOptions = () =>
  941. httpGet<
  942. {
  943. id: string
  944. name: string
  945. }[]
  946. >('/app-api/member/app-riding/listFinishedRidingActivity')
  947. /**
  948. * 获取骑行数据
  949. */
  950. export const getRidings = (query) =>
  951. httpGet<
  952. ResPageData<{
  953. memberStylistName: string
  954. avatar: string
  955. radeKmTotal: string
  956. }>
  957. >('/app-api/member/app-riding/page', query)
  958. /**
  959. * 获取客服列表
  960. */
  961. export const getAgents = () =>
  962. httpGet<
  963. {
  964. id?: number
  965. brokeId?: string
  966. headImgUrl: string
  967. brokerName: string
  968. password?: string
  969. mobile: string
  970. status?: number
  971. channelType?: number
  972. designersNumber: any
  973. yearPoints: any
  974. yearOrders: any
  975. createTime?: number
  976. inviteCode?: string
  977. customer: number
  978. customerName: string
  979. }[]
  980. >('/app-api/member/user/getCustomerServiceList')
  981. export const fakeThis = (query: { agreement: AgreementType }) =>
  982. httpGet<string>('/app-api/infra/file/download', query)
  983. export const fuckYouMom = (query: { id: string }) =>
  984. httpGet('/app-api/member/message-manage/get', query)
  985. export const fuckYou = (data: { id: number }) =>
  986. httpPost('/app-api/member/message-manage/isRead', data)
  987. export const refreshToken = (refreshToken: string) =>
  988. httpPost<any>('/app-api/member/auth/refresh-token', {}, { refreshToken })
  989. export const httpGetMock = <T>(data: T) =>
  990. new Promise<IResData<T>>((resolve) => resolve({ code: 1, msg: '', data } as IResData<T>))
  991. export interface Circle {
  992. headUrl: string
  993. stylistId: string | number
  994. stylistName: string
  995. marketing: string
  996. circleDesc: string
  997. tagName: string
  998. detailsType: string
  999. detailsUrl: string
  1000. detailsDesc: string
  1001. circleType: string
  1002. spaceType: string
  1003. designStyle: string
  1004. spaceAddr: string
  1005. customerDemand: string
  1006. bannerUrls: string[]
  1007. tagIds?: number[]
  1008. }
  1009. export interface CircleRes {
  1010. id: number
  1011. headUrl?: string
  1012. stylistId?: number
  1013. stylistName?: string
  1014. marketing?: string
  1015. circleDesc?: string
  1016. tagName?: string
  1017. detailsType?: string
  1018. detailsUrl?: string
  1019. detailsDesc?: string
  1020. circleType?: string
  1021. spaceType?: string
  1022. designStyle?: string
  1023. spaceAddr?: string
  1024. customerDemand?: string
  1025. createTime: number
  1026. bannerUrls: string[]
  1027. shareCount?: number
  1028. upvoteCount?: number
  1029. ownUpvote: boolean
  1030. reviewCount: number
  1031. caseName?: string
  1032. spaceExtent?: string
  1033. levelId?: number
  1034. }