requests.ts 31 KB

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