good.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. import http from '../utils/http'
  2. const GoodApi = {
  3. async GetCateList() {
  4. return http.get('/api/services/wxapp/Product/GetCateList') as Promise<IRestResult<any[]>>
  5. },
  6. async GetBorderList() {
  7. return http.get('/api/services/wxapp/Product/GetBorderList') as Promise<
  8. IRestResult<WxOptionLongExtraDto[]>
  9. >
  10. },
  11. async GetFilterOption() {
  12. return http.get('/api/services/wxapp/Product/GetFilterOption') as Promise<
  13. IRestResult<WxGetFilterOptionOutputDto[]>
  14. >
  15. },
  16. async GetHomeCarousel() {
  17. return http.get('/api/services/wxapp/Product/GetHomeCarousel') as Promise<
  18. IRestResult<WxCarouselListItemDto[]>
  19. >
  20. },
  21. async GetHomeDetail() {
  22. return http.get('/api/services/wxapp/Product/GetHomeDetail') as Promise<
  23. IRestResult<WxAlbumCategoryDetailItemDto[]>
  24. >
  25. },
  26. async GetHomeDisplay() {
  27. return http.get('/api/services/wxapp/Product/GetHomeDisplay') as Promise<
  28. IRestResult<WxDisplayListItemDto[]>
  29. >
  30. },
  31. async GetCateScene(input: WxGetAlbumInput) {
  32. return http.get('/api/services/wxapp/Product/GetCateScene', input) as Promise<
  33. IRestResult<PagedResultDto<WxGetAlbumOutputDto>>
  34. >
  35. },
  36. async GetCateAlbum(input: WxGetAlbumInput) {
  37. return http.get('/api/services/wxapp/Product/GetCateAlbum', input) as Promise<
  38. IRestResult<PagedResultDto<WxGetAlbumOutputDto>>
  39. >
  40. },
  41. async GetHomeRecommend(input: WxGetAlbumInput) {
  42. return http.get('/api/services/wxapp/Product/GetHomeRecommend', input) as Promise<
  43. IRestResult<PagedResultDto<WxGetAlbumOutputDto>>
  44. >
  45. },
  46. async GetRecommend(input: WxGetAlbumInput) {
  47. return http.get('/api/services/wxapp/Product/GetRecommend', input) as Promise<
  48. IRestResult<PagedResultDto<WxGetAlbumOutputDto>>
  49. >
  50. },
  51. async GetProduct(input: WxGetProductInput) {
  52. return http.get('/api/services/wxapp/Product/GetProduct', input) as Promise<
  53. IRestResult<WxGetProductOutput>
  54. >
  55. },
  56. async GetAddr() {
  57. return http.get('/api/services/wxapp/Product/GetAddr') as Promise<IRestResult<any>>
  58. },
  59. async GetFav(input: WxGetFavInput) {
  60. return http.get('/api/services/wxapp/Product/GetFav', input) as Promise<
  61. IRestResult<WxCateAlbumItemDto[]>
  62. >
  63. },
  64. async UpdateFav(input: WxUpdateFavInput) {
  65. return http.put('/api/services/wxapp/Product/UpdateFav', input) as Promise<IRestResult<number>>
  66. },
  67. async GetCart() {
  68. return http.get('/api/services/wxapp/Product/GetCart') as Promise<IRestResult<any>>
  69. },
  70. async GetOrderDetail(input: WxGetOrderDetailInput) {
  71. return http.get('/api/services/wxapp/WxGoodOrder/GetOrderDetail', input) as Promise<
  72. IRestResult<any>
  73. >
  74. },
  75. async PreviewOrder(input: WxPreviewOrderInputDto) {
  76. return http.post('/api/services/wxapp/WxGoodOrder/PreviewOrder', input) as Promise<
  77. IRestResult<WxGoodGenOrderDto>
  78. >
  79. },
  80. async MakeOrder(input: WxGoodComOrderDto) {
  81. return http.post('/api/services/wxapp/WxGoodOrder/MakeOrder', input) as Promise<
  82. IRestResult<string>
  83. >
  84. },
  85. async GetOrderList(input: WxOrderListInput) {
  86. return http.get('/api/services/wxapp/WxGoodOrder/GetOrderList', input) as Promise<
  87. IRestResult<PagedResultDto<WxOrderListOutput>>
  88. >
  89. },
  90. async OrderDeplicate(input: WxGetOrderDetailInput) {
  91. return http.post('/api/services/wxapp/WxGoodOrder/OrderDeplicate', input) as Promise<
  92. IRestResult<string>
  93. >
  94. },
  95. async GetComments(input: WxGetAlbumInput) {
  96. return http.get('/api/services/wxapp/Product/GetComments', input) as Promise<
  97. IRestResult<WxCateAlbumItemDto[]>
  98. >
  99. },
  100. async GetCommentlist(input: WxGetAlbumInput) {
  101. return http.get('/api/services/wxapp/Comments/GetPaged', input) as Promise<IRestResult<any>>
  102. },
  103. async GetDrawLink(input: { id: number; goodId: number; type: string }) {
  104. return http.get('/api/services/wxapp/Product/GetDrawLink', input) as Promise<
  105. IRestResult<string>
  106. >
  107. },
  108. async GetInspireLink(input: { id: number; type: string }) {
  109. return http.get('/api/services/wxapp/Product/GetInspireLink', input) as Promise<
  110. IRestResult<string>
  111. >
  112. },
  113. async AddCart(input: WxAddCartInput) {
  114. return http.post('/api/services/wxapp/Product/AddCart', input) as Promise<IRestResult<string>>
  115. },
  116. async RemoveCartItem(input: WxRemoveCartItemInput) {
  117. return http.delete('/api/services/wxapp/Product/RemoveCartItem', input) as Promise<
  118. IRestResult<string>
  119. >
  120. },
  121. async SelectAllCartItem() {
  122. return http.post('/api/services/wxapp/Product/SelectAllCartItem') as Promise<
  123. IRestResult<string>
  124. >
  125. },
  126. async UnSelectAllCartItem() {
  127. return http.post('/api/services/wxapp/Product/UnSelectAllCartItem') as Promise<
  128. IRestResult<string>
  129. >
  130. },
  131. async SelectCartItem(input: WxSelectCartItemInput) {
  132. return http.post('/api/services/wxapp/Product/SelectCartItem', input) as Promise<
  133. IRestResult<string>
  134. >
  135. },
  136. async NumCartItem(input: WxNumCartItemInput) {
  137. return http.post('/api/services/wxapp/Product/NumCartItem', input) as Promise<
  138. IRestResult<string>
  139. >
  140. },
  141. }
  142. export default GoodApi