user.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. * @param object data
  85. */
  86. export function TodayCommission(type){
  87. return request.post('user/daijiesuan',type);
  88. }
  89. /**
  90. *
  91. * 推广佣金/提现总和
  92. * @param int type
  93. */
  94. export function spreadCount(type){
  95. return request.get('spread/count/'+type);
  96. }
  97. /**
  98. *
  99. * 推广订单
  100. * @param object data
  101. */
  102. export function spreadOrder(data){
  103. return request.post('spread/order',data);
  104. }
  105. /**
  106. * 提现申请
  107. * @param object data
  108. */
  109. export function extractCash(data){
  110. return request.post('extract/cash',data)
  111. }
  112. /**
  113. * 提现银行/提现最低金额
  114. *
  115. */
  116. export function extractBank(){
  117. return request.get('extract/bank');
  118. }
  119. /**
  120. * 关于我们
  121. *
  122. *
  123. */
  124. export function getAboutus(){
  125. return request.get('about_us');
  126. }
  127. /**
  128. * 联系店长
  129. *
  130. *
  131. */
  132. export function getStore(){
  133. return request.get('store');
  134. }
  135. /**
  136. * 活动状态
  137. *
  138. */
  139. export function userActivity(){
  140. return request.get('user/activity');
  141. }
  142. /**
  143. * 小程序充值
  144. *
  145. */
  146. export function rechargeRoutine(data){
  147. return request.post('recharge/routine',data)
  148. }
  149. /**
  150. * 我的钱包
  151. *
  152. */
  153. export function GetBalance(){
  154. return request.get('user/balance');
  155. }
  156. /**
  157. * 今日收入
  158. *
  159. */
  160. export function GetTodaymoney(){
  161. return request.get('user/shouru');
  162. }
  163. /**
  164. *
  165. * 地址列表
  166. * @param object data
  167. */
  168. export function getAddressList(data){
  169. return request.get('address/list',data);
  170. }
  171. /**
  172. * 设置默认地址
  173. * @param int id
  174. */
  175. export function setAddressDefault(id){
  176. return request.post('address/default/set',{id:id})
  177. }
  178. /**
  179. * 获取默认地址
  180. *
  181. */
  182. export function getAddressDefault(){
  183. return request.get('address/default');
  184. }
  185. /**
  186. * 删除地址
  187. * @param int id
  188. *
  189. */
  190. export function delAddress(id){
  191. return request.post('address/del',{id:id})
  192. }
  193. /**
  194. * 修改 添加地址
  195. * @param object data
  196. */
  197. export function editAddress(data){
  198. return request.post('address/edit',data);
  199. }
  200. /**
  201. * 获取单个地址
  202. * @param int id
  203. */
  204. export function getAddressDetail(id){
  205. return request.get('address/detail/'+id);
  206. }
  207. /**
  208. * 设置用户分享
  209. *
  210. */
  211. export function userShare(){
  212. return request.post('user/share');
  213. }
  214. /**
  215. * 获取签到配置
  216. *
  217. */
  218. export function getSignConfig(){
  219. return request.get('sign/config')
  220. }
  221. /**
  222. * 获取签到列表
  223. * @param object data
  224. */
  225. export function getSignList(data){
  226. return request.get('sign/list',data);
  227. }
  228. /**
  229. * 签到列表(年月)
  230. * @param object data
  231. *
  232. */
  233. export function getSignMonthList(data){
  234. return request.get('sign/month',data)
  235. }
  236. /**
  237. * 用户签到
  238. */
  239. export function setSignIntegral(){
  240. return request.post('sign/integral')
  241. }
  242. /*
  243. * 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)
  244. * */
  245. export function getCommissionInfo(q, types) {
  246. return request.get("spread/commission/" + types, q);
  247. }
  248. /*
  249. * 签到用户信息
  250. * */
  251. export function postSignUser(sign) {
  252. return request.post("sign/user", sign);
  253. }
  254. /*
  255. * 积分记录
  256. * */
  257. export function getIntegralList(q) {
  258. return request.get("integral/list", q);
  259. }
  260. /*
  261. * 点击领取优惠券
  262. * */
  263. export function getCouponReceive(couponId) {
  264. return request.post("coupon/receive", couponId);
  265. }
  266. /*
  267. * 领取优惠券列表
  268. * */
  269. export function getCoupon(q) {
  270. return request.get("coupons", q);
  271. }
  272. /*
  273. * 获取推广人排行
  274. * */
  275. export function getRankList(q) {
  276. return request.get("rank", q);
  277. }
  278. /*
  279. * 获取佣金排名
  280. * */
  281. export function getBrokerageRank(q) {
  282. return request.get("brokerage_rank", q);
  283. }