requests.ts 28 KB

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