index.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. //我的相关:
  2. const {
  3. http
  4. } = uni.$u
  5. //用户相关
  6. export const getAfterSaleCon = (params, config = {}) => http.post('/api/users/bindingAfterSale', params, config)
  7. // 请求首页顶部轮播
  8. export const getIndexTopPics = (params, config = {}) => http.post('/api/users/bindingAfterSale', params, config)
  9. // 微信授权登陆
  10. export const wxAuthLoginReq = (params, config = {}) => http.post('/api/auth/mnplogin', params, config)
  11. // 获取用户信息
  12. export const getUserInfoReq = (params, config = {}) => http.get('/api/users/getUserInfo', params, config)
  13. // 获取用户信息
  14. export const getActivityDataReq = (params, config = {}) => http.get('/api/getActivityData', params, config)
  15. // 更新用户信息
  16. export const updateUserInfoReq = (params, config = {}) => http.post('/api/users/updateUserInfo', params, config)
  17. // 获取邀请详情页背景图
  18. export const getInviteDetailBg = (params, config = {}) => http.post('/api/invite/getSharePicTrue', params, config)
  19. // 更新用户信息
  20. export const getUserPhone = (params, config = {}) => http.post('/api/invite/getUserPhone', params, config)
  21. // 更新用户信息
  22. export const addAward = (params, config = {}) => http.post('/api/invite/addAward', params, config)
  23. // 首页相关
  24. // 获取首页配置
  25. export const getIndexConfigReq = (params, config = {}) => http.post('/api/getHomeData', params, config)
  26. // 获取首页配置2
  27. export const getHomeDataNextReq = (params, config = {}) => {
  28. let apiUrl = '/api/getHomeDataNext'
  29. Object.keys(params).forEach((item, index) => {
  30. if (index == 0) {
  31. apiUrl += `?${item}=${params[item]}`
  32. } else {
  33. apiUrl += `&${item}=${params[item]}`
  34. }
  35. })
  36. console.log('处理后的apiUrl', apiUrl);
  37. return http.get(apiUrl, params, config)
  38. }
  39. export const getActivityDataDetailReq = (params, config = {}) => {
  40. let apiUrl = '/api/users/getActivityDataDetail'
  41. Object.keys(params).forEach((item, index) => {
  42. if (index == 0) {
  43. apiUrl += `?${item}=${params[item]}`
  44. } else {
  45. apiUrl += `&${item}=${params[item]}`
  46. }
  47. })
  48. console.log('处理后的apiUrl', apiUrl);
  49. return http.get(apiUrl, params, config)
  50. }
  51. // 订单相关相关
  52. // 提交订单
  53. export const postOrderReq = (params, config = {}) => http.post('/api/order/submitOrder', params, config)
  54. // 获取订单详细
  55. export const getOrderDetailReq = (params, config = {}) => {
  56. let apiUrl = '/api/order/getOrderDetail'
  57. Object.keys(params).forEach((item, index) => {
  58. if (index == 0) {
  59. apiUrl += `?${item}=${params[item]}`
  60. } else {
  61. apiUrl += `&${item}=${params[item]}`
  62. }
  63. })
  64. console.log('处理后的apiUrl', apiUrl);
  65. return http.get(apiUrl, params, config)
  66. }
  67. // 获取商城分类数据
  68. // export const getMallCatReq = (params, config = {}) => http.get('/api/goods/getClassifyData', params, config)
  69. export const getMallCatReq = (params, config = {}) => {
  70. let apiUrl = '/api/goods/getClassifyData'
  71. if (params) {
  72. Object.keys(params).forEach((item, index) => {
  73. if (index == 0) {
  74. apiUrl += `?${item}=${params[item]}`
  75. } else {
  76. apiUrl += `&${item}=${params[item]}`
  77. }
  78. })
  79. }
  80. console.log('处理后的apiUrl', apiUrl);
  81. return http.get(apiUrl, params, config)
  82. }
  83. // 获取商城数据
  84. export const getMallReq = (params, config = {}) => {
  85. let apiUrl = '/api/goods/getGoodsData'
  86. Object.keys(params).forEach((item, index) => {
  87. if (index == 0) {
  88. apiUrl += `?${item}=${params[item]}`
  89. } else {
  90. apiUrl += `&${item}=${params[item]}`
  91. }
  92. })
  93. console.log('处理后的apiUrl', apiUrl);
  94. return http.get(apiUrl, params, config)
  95. }
  96. // 获取商城分类数据
  97. export const getSerDocReq = (params, config = {}) => http.get('/api/server/getServerData', params, config)
  98. // 获取各个身份的价格百分比
  99. export const getPricePercentReq = (params, config = {}) => http.get('/api/common/getPriceConfig', params, config)
  100. // 获取我的售后保障
  101. export const getSerBackReq = (params, config = {}) => http.get('/api/users/getMyAfterSaleData', params, config)
  102. // 获取我的服务流程
  103. export const getSerStepReq = (params, config = {}) => http.get('/api/users/getMyServiceProcess', params, config)
  104. // 获取我的换新流程
  105. export const getChangeStepReq = (params, config = {}) => http.get('/api/users/getRenewFlow', params, config)
  106. // 获取我的售后商品
  107. export const getSerBackGoodsReq = (params, config = {}) => {
  108. let apiUrl = '/api/users/getMyAfterSaleGoods'
  109. Object.keys(params).forEach((item, index) => {
  110. if (index == 0) {
  111. apiUrl += `?${item}=${params[item]}`
  112. } else {
  113. apiUrl += `&${item}=${params[item]}`
  114. }
  115. })
  116. console.log('处理后的apiUrl', apiUrl);
  117. return http.get(apiUrl, params, config)
  118. }
  119. //获取我的售后联系
  120. export const getSerBackConReq = (params, config = {}) => http.get('/api/users/getMyAfterSaleContact', params, config)
  121. // 提交邀请
  122. export const postInviteReq = (params, config = {}) => http.post('/api/invite/submitInviteData', params, config)
  123. //获取我的邀请
  124. export const getMyInviteReq = (params, config = {}) => {
  125. let apiUrl = '/api/invite/getMyInviteData'
  126. Object.keys(params).forEach((item, index) => {
  127. if (index == 0) {
  128. apiUrl += `?${item}=${params[item]}`
  129. } else {
  130. apiUrl += `&${item}=${params[item]}`
  131. }
  132. })
  133. console.log('处理后的apiUrl', apiUrl);
  134. return http.get(apiUrl, params, config)
  135. }
  136. // 添加邀请
  137. export const addInviteReq = (params, config = {}) => http.post('/api/invite/addInvite', params, config)
  138. // 添加收藏
  139. export const addCollReq = (params, config = {}) => http.post('/api/users/addCollect', params, config)
  140. // 取消收藏
  141. export const cancelCollReq = (params, config = {}) => http.post('/api/users/cancelCollect', params, config)
  142. export const getGoodsPriceReq = (params, config = {}) => http.post('/api/goods/getGoodsPrice', params, config)
  143. //获取服务文档
  144. export const getServerDataReq = (params, config = {}) => http.get('/api/server/getServerData', params, config)
  145. // 提交反馈
  146. export const submitFeedbackReq = (params, config = {}) => http.post('/api/users/submitFeedback', params, config)
  147. //获取兑奖信息
  148. export const getAwardDataReq = (params, config = {}) => http.get('/api/users/getAwardData', params, config)
  149. export const getConfigTextByTypeReq = (params, config = {}) => {
  150. let apiUrl = '/api/common/getConfigTextByType'
  151. Object.keys(params).forEach((item, index) => {
  152. if (index == 0) {
  153. apiUrl += `?${item}=${params[item]}`
  154. } else {
  155. apiUrl += `&${item}=${params[item]}`
  156. }
  157. })
  158. console.log('处理后的apiUrl', apiUrl);
  159. return http.get(apiUrl, params, config)
  160. }
  161. // 提交反馈
  162. export const getWxQrCodeReq = (params, config = {}) => http.post('/api/common/getWxQrCode', params, config)
  163. export const getConfigTextByIdReq = (params, config = {}) => {
  164. let apiUrl = '/api/common/getConfigTextById'
  165. Object.keys(params).forEach((item, index) => {
  166. if (index == 0) {
  167. apiUrl += `?${item}=${params[item]}`
  168. } else {
  169. apiUrl += `&${item}=${params[item]}`
  170. }
  171. })
  172. console.log('处理后的apiUrl', apiUrl);
  173. return http.get(apiUrl, params, config)
  174. }
  175. export const getMyGoodsDetailReq = (params, config = {}) => {
  176. let apiUrl = '/api/goods/getGoodsDetail'
  177. Object.keys(params).forEach((item, index) => {
  178. if (index == 0) {
  179. apiUrl += `?${item}=${params[item]}`
  180. } else {
  181. apiUrl += `&${item}=${params[item]}`
  182. }
  183. })
  184. console.log('处理后的apiUrl', apiUrl);
  185. return http.get(apiUrl, params, config)
  186. }