user.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. import request from "./../utils/request.js";
  2. /**
  3. *
  4. * 用户相关接口
  5. *
  6. */
  7. /**
  8. * 小程序用户登录
  9. * @param data object 小程序用户登陆信息
  10. */
  11. export function login(data) {
  12. return request.post("wechat/mp_auth", data, { noAuth : true });
  13. }
  14. /**
  15. * 获取用户中心菜单
  16. *
  17. */
  18. export function getMenuList() {
  19. return request.get("menu/user");
  20. }
  21. /**
  22. * 获取用户信息
  23. *
  24. */
  25. export function getUserInfo(){
  26. return request.get('user');
  27. }
  28. /**
  29. * 修改用户信息
  30. * @param object
  31. */
  32. export function userEdit(data){
  33. return request.post('user/edit',data);
  34. }
  35. /**
  36. * 会员等级列表
  37. *
  38. */
  39. export function userLevelGrade(){
  40. return request.get('user/level/grade');
  41. }
  42. /**
  43. * 获取某个等级任务
  44. * @param int id 任务id
  45. */
  46. export function userLevelTask(id){
  47. return request.get('user/level/task/'+id);
  48. }
  49. /**
  50. * 检查用户是否可以成为会员
  51. *
  52. */
  53. export function userLevelDetection(){
  54. return request.get('user/level/detection');
  55. }
  56. /**
  57. * 获取分销海报图片
  58. *
  59. */
  60. export function spreadBanner(){
  61. return request.get('spread/banner',{type:1});
  62. }
  63. /**
  64. *
  65. * 获取推广用户一级和二级
  66. * @param object data
  67. */
  68. export function spreadPeople(data){
  69. return request.post('spread/people',data);
  70. }
  71. /**
  72. *
  73. * 推广佣金明细
  74. * @param int type
  75. * @param object data
  76. */
  77. export function spreadCommission(type,data){
  78. return request.get('spread/commission/'+type,data);
  79. }
  80. /**
  81. *
  82. * 推广佣金/提现总和
  83. * @param int type
  84. */
  85. export function spreadCount(type){
  86. return request.get('spread/count/'+type);
  87. }
  88. /**
  89. *
  90. * 推广订单
  91. * @param object data
  92. */
  93. export function spreadOrder(data){
  94. return request.post('spread/order',data);
  95. }
  96. /**
  97. * 提现申请
  98. * @param object data
  99. */
  100. export function extractCash(data){
  101. return request.post('extract/cash',data)
  102. }
  103. /**
  104. * 提现银行/提现最低金额
  105. *
  106. */
  107. export function extractBank(){
  108. return request.get('extract/bank');
  109. }
  110. /**
  111. * 活动状态
  112. *
  113. */
  114. export function userActivity(){
  115. return request.get('user/activity');
  116. }
  117. /**
  118. * 小程序充值
  119. *
  120. */
  121. export function rechargeRoutine(data){
  122. return request.post('recharge/routine',data)
  123. }
  124. /**
  125. *
  126. * 地址列表
  127. * @param object data
  128. */
  129. export function getAddressList(data){
  130. return request.get('address/list',data);
  131. }
  132. /**
  133. * 设置默认地址
  134. * @param int id
  135. */
  136. export function setAddressDefault(id){
  137. return request.post('address/default/set',{id:id})
  138. }
  139. /**
  140. * 获取默认地址
  141. *
  142. */
  143. export function getAddressDefault(){
  144. return request.get('address/default');
  145. }
  146. /**
  147. * 删除地址
  148. * @param int id
  149. *
  150. */
  151. export function delAddress(id){
  152. return request.post('address/del',{id:id})
  153. }
  154. /**
  155. * 修改 添加地址
  156. * @param object data
  157. */
  158. export function editAddress(data){
  159. return request.post('address/edit',data);
  160. }
  161. /**
  162. * 获取单个地址
  163. * @param int id
  164. */
  165. export function getAddressDetail(id){
  166. return request.get('address/detail/'+id);
  167. }
  168. /**
  169. * 设置用户分享
  170. *
  171. */
  172. export function userShare(){
  173. return request.post('user/share');
  174. }
  175. /**
  176. * 获取签到配置
  177. *
  178. */
  179. export function getSignConfig(){
  180. return request.get('sign/config')
  181. }
  182. /**
  183. * 获取签到列表
  184. * @param object data
  185. */
  186. export function getSignList(data){
  187. return request.get('sign/list',data);
  188. }
  189. /**
  190. * 签到列表(年月)
  191. * @param object data
  192. *
  193. */
  194. export function getSignMonthList(data){
  195. return request.get('sign/month',data)
  196. }
  197. /**
  198. * 用户签到
  199. */
  200. export function setSignIntegral(){
  201. return request.post('sign/integral')
  202. }
  203. /*
  204. * 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)
  205. * */
  206. export function getCommissionInfo(q, types) {
  207. return request.get("spread/commission/" + types, q);
  208. }
  209. /*
  210. * 签到用户信息
  211. * */
  212. export function postSignUser(sign) {
  213. return request.post("sign/user", sign);
  214. }
  215. /*
  216. * 积分记录
  217. * */
  218. export function getIntegralList(q) {
  219. return request.get("integral/list", q);
  220. }
  221. /*
  222. * 点击领取优惠券
  223. * */
  224. export function getCouponReceive(couponId) {
  225. return request.post("coupon/receive", couponId);
  226. }
  227. /*
  228. * 领取优惠券列表
  229. * */
  230. export function getCoupon(q) {
  231. return request.get("coupons", q);
  232. }
  233. /*
  234. * 获取推广人排行
  235. * */
  236. export function getRankList(q) {
  237. return request.get("rank", q);
  238. }
  239. /*
  240. * 获取佣金排名
  241. * */
  242. export function getBrokerageRank(q) {
  243. return request.get("brokerage_rank", q);
  244. }
  245. /**
  246. * 充值金额选择
  247. */
  248. export function getRechargeApi() {
  249. return request.get('recharge/index')
  250. }