requests.ts 29 KB

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