requests.ts 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035
  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 }) =>
  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. setMemberRights: {
  863. createTime: string
  864. updateTime: string
  865. creator: string
  866. updater: string
  867. deleted: boolean
  868. id: number
  869. rightsName: string
  870. rightsType: number
  871. rightsImage: string
  872. rightsDescription: string
  873. associatedMemberRightsLevel: string
  874. status: number
  875. }[]
  876. }[]
  877. >('/app-api/basicsetting/app-set-member-level-config/listAndRights')
  878. /**
  879. * 到店打卡
  880. */
  881. export const storeAndPunchIn = (data: { id: number }) =>
  882. http<boolean>({
  883. url: '/app-api/member/user-auth-info/storeAndPunchIn',
  884. data,
  885. hideErrorToast: true,
  886. method: 'POST',
  887. })
  888. /**
  889. * 获取优惠券
  890. */
  891. export const getCoupons = (query) =>
  892. httpGet<ResPageData<Coupon>>('/app-api/member/coupon-user/page', query)
  893. /**
  894. * 获取商品优惠券
  895. */
  896. export const getProductCoupons = (query) =>
  897. httpGet<Coupon[]>('/app-api/member/coupon-user/coupon-user-by-product-ids-page', query)
  898. /**
  899. * 获取积分券
  900. */
  901. export const getPointsCoupons = (query) =>
  902. httpGet<Coupon[]>('/app-api/member/coupon-user/coupon-user-by-point-ids-page', query)
  903. /**
  904. * 获取已报名的游学
  905. */
  906. export const getMyStudyTours = (query = {}) =>
  907. httpGet<MyStudyTour[]>('/app-api/member/app-study-abroad/getSignUpStudyAbroad', query)
  908. /**
  909. * /app-api/member/stylist-honor/updatePopUp 更新弹窗
  910. */
  911. export const updateHonorPopUp = (query: { bizId: string; bizType: string }) =>
  912. httpGet('/app-api/member/stylist-honor/updatePopUp', query)
  913. /**
  914. * 获取徽章列表
  915. */
  916. export const getBadges = (query = {}) =>
  917. httpGet<{ [key: string]: Badge[] }>('/app-api/member/stylist-honor/get-badge-list', query)
  918. /**
  919. * 获取个人徽章
  920. */
  921. export const getOwnBadges = (query = {}) =>
  922. httpGet<Badge[]>('/app-api/member/stylist-honor/getConferBadgeList', query)
  923. /**
  924. * 获取证书列表
  925. */
  926. export const getCertificates = (query = {}) =>
  927. httpGet<Certificate[]>('/app-api/member/stylist-honor/get-certificate-list', query)
  928. /**
  929. * 获取荣誉统计
  930. */
  931. export const getHonorStatistics = (query = {}) =>
  932. httpGet<{
  933. certCount: number
  934. badgeCount: number
  935. }>('/app-api/member/stylist-honor/get-honor-count', query)
  936. /**
  937. * 获取骑行下拉
  938. */
  939. export const getRidingOptions = () =>
  940. httpGet<
  941. {
  942. id: string
  943. name: string
  944. }[]
  945. >('/app-api/member/app-riding/listFinishedRidingActivity')
  946. /**
  947. * 获取骑行数据
  948. */
  949. export const getRidings = (query) =>
  950. httpGet<
  951. ResPageData<{
  952. memberStylistName: string
  953. avatar: string
  954. radeKmTotal: string
  955. }>
  956. >('/app-api/member/app-riding/page', query)
  957. /**
  958. * 获取客服列表
  959. */
  960. export const getAgents = () =>
  961. httpGet<
  962. {
  963. id?: number
  964. brokeId?: string
  965. headImgUrl: string
  966. brokerName: string
  967. password?: string
  968. mobile: string
  969. status?: number
  970. channelType?: number
  971. designersNumber: any
  972. yearPoints: any
  973. yearOrders: any
  974. createTime?: number
  975. inviteCode?: string
  976. customer: number
  977. customerName: string
  978. }[]
  979. >('/app-api/member/user/getCustomerServiceList')
  980. export const fakeThis = (query: { agreement: AgreementType }) =>
  981. httpGet<string>('/app-api/infra/file/download', query)
  982. export const fuckYouMom = (query: { id: string }) =>
  983. httpGet('/app-api/member/message-manage/get', query)
  984. export const fuckYou = (data: { id: number }) =>
  985. httpPost('/app-api/member/message-manage/isRead', data)
  986. export const refreshToken = (refreshToken: string) =>
  987. httpPost<any>('/app-api/member/auth/refresh-token', {}, { refreshToken })
  988. export const httpGetMock = <T>(data: T) =>
  989. new Promise<IResData<T>>((resolve) => resolve({ code: 1, msg: '', data } as IResData<T>))
  990. export interface Circle {
  991. headUrl: string
  992. stylistId: string | number
  993. stylistName: string
  994. marketing: string
  995. circleDesc: string
  996. tagName: string
  997. detailsType: string
  998. detailsUrl: string
  999. detailsDesc: string
  1000. circleType: string
  1001. spaceType: string
  1002. designStyle: string
  1003. spaceAddr: string
  1004. customerDemand: string
  1005. bannerUrls: string[]
  1006. tagIds?: number[]
  1007. }
  1008. export interface CircleRes {
  1009. id: number
  1010. headUrl?: string
  1011. stylistId?: number
  1012. stylistName?: string
  1013. marketing?: string
  1014. circleDesc?: string
  1015. tagName?: string
  1016. detailsType?: string
  1017. detailsUrl?: string
  1018. detailsDesc?: string
  1019. circleType?: string
  1020. spaceType?: string
  1021. designStyle?: string
  1022. spaceAddr?: string
  1023. customerDemand?: string
  1024. createTime: number
  1025. bannerUrls: string[]
  1026. shareCount?: number
  1027. upvoteCount?: number
  1028. ownUpvote: boolean
  1029. reviewCount: number
  1030. caseName?: string
  1031. spaceExtent?: string
  1032. levelId?: number
  1033. }