requests.ts 28 KB

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