requests.ts 29 KB

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