user.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. import request from "@/utils/request.js";
  2. /**
  3. * 获取用户信息
  4. *
  5. */
  6. export function getUserInfo(){
  7. return request.get('user');
  8. }
  9. /**
  10. * 设置用户分享
  11. *
  12. */
  13. export function userShare(){
  14. return request.post('user/share');
  15. }
  16. /**
  17. * h5用户登录
  18. * @param data object 用户账号密码
  19. */
  20. export function loginH5(data) {
  21. return request.post("/login", data, { noAuth : true });
  22. }
  23. /**
  24. * h5用户手机号登录
  25. * @param data object 用户手机号 也只能
  26. */
  27. export function loginMobile(data) {
  28. return request.post("/login/mobile", data, { noAuth : true });
  29. }
  30. /**
  31. * 验证码key
  32. */
  33. export function getCodeApi() {
  34. return request.get("verify_code", {}, { noAuth: true });
  35. }
  36. /**
  37. * h5用户发送验证码
  38. * @param data object 用户手机号
  39. */
  40. export function registerVerify(data) {
  41. return request.post("/register/verify", data, { noAuth : true });
  42. }
  43. /**
  44. * h5用户手机号注册
  45. * @param data object 用户手机号 验证码 密码
  46. */
  47. export function register(data) {
  48. return request.post("/register", data, { noAuth : true });
  49. }
  50. /**
  51. * 用户手机号修改密码
  52. * @param data object 用户手机号 验证码 密码
  53. */
  54. export function registerReset(data) {
  55. return request.post("/register/reset", data, { noAuth: true });
  56. }
  57. /**
  58. * 获取用户中心菜单
  59. *
  60. */
  61. export function getMenuList() {
  62. return request.get("menu/user");
  63. }
  64. /*
  65. * 签到用户信息
  66. * */
  67. export function postSignUser(sign) {
  68. return request.post("sign/user", sign);
  69. }
  70. /**
  71. * 获取签到配置
  72. *
  73. */
  74. export function getSignConfig(){
  75. return request.get('sign/config')
  76. }
  77. /**
  78. * 获取签到列表
  79. * @param object data
  80. */
  81. export function getSignList(data){
  82. return request.get('sign/list',data);
  83. }
  84. /**
  85. * 用户签到
  86. */
  87. export function setSignIntegral(){
  88. return request.post('sign/integral')
  89. }
  90. /**
  91. * 签到列表(年月)
  92. * @param object data
  93. *
  94. */
  95. export function getSignMonthList(data){
  96. return request.get('sign/month',data)
  97. }
  98. /**
  99. * 活动状态
  100. *
  101. */
  102. export function userActivity(){
  103. return request.get('user/activity');
  104. }
  105. /*
  106. * 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)
  107. * */
  108. export function getCommissionInfo(q, types) {
  109. return request.get("spread/commission/" + types, q);
  110. }
  111. /*
  112. * 积分记录
  113. * */
  114. export function getIntegralList(q) {
  115. return request.get("integral/list", q);
  116. }
  117. /**
  118. * 获取分销海报图片
  119. *
  120. */
  121. export function spreadBanner(){
  122. //#ifdef H5
  123. return request.get('spread/banner',{type:2});
  124. //#endif
  125. //#ifdef MP
  126. return request.get('spread/banner',{type:1});
  127. //#endif
  128. }
  129. /**
  130. *
  131. * 获取推广用户一级和二级
  132. * @param object data
  133. */
  134. export function spreadPeople(data){
  135. return request.post('spread/people',data);
  136. }
  137. /**
  138. *
  139. * 推广佣金/提现总和
  140. * @param int type
  141. */
  142. export function spreadCount(type){
  143. return request.get('spread/count/'+type);
  144. }
  145. /*
  146. * 推广数据
  147. * */
  148. export function getSpreadInfo() {
  149. return request.get("/commission");
  150. }
  151. /**
  152. *
  153. * 推广订单
  154. * @param object data
  155. */
  156. export function spreadOrder(data){
  157. return request.post('spread/order',data);
  158. }
  159. /*
  160. * 获取推广人排行
  161. * */
  162. export function getRankList(q) {
  163. return request.get("rank", q);
  164. }
  165. /*
  166. * 获取佣金排名
  167. * */
  168. export function getBrokerageRank(q) {
  169. return request.get("brokerage_rank", q);
  170. }
  171. /**
  172. * 提现申请
  173. * @param object data
  174. */
  175. export function extractCash(data){
  176. return request.post('extract/cash',data)
  177. }
  178. /**
  179. * 提现银行/提现最低金额
  180. *
  181. */
  182. export function extractBank(){
  183. return request.get('extract/bank');
  184. }
  185. /**
  186. * 会员等级列表
  187. *
  188. */
  189. export function userLevelGrade(){
  190. return request.get('user/level/grade');
  191. }
  192. /**
  193. * 获取某个等级任务
  194. * @param int id 任务id
  195. */
  196. export function userLevelTask(id){
  197. return request.get('user/level/task/'+id);
  198. }
  199. /**
  200. * 检查用户是否可以成为会员
  201. *
  202. */
  203. export function userLevelDetection(){
  204. return request.get('user/level/detection');
  205. }
  206. /**
  207. *
  208. * 地址列表
  209. * @param object data
  210. */
  211. export function getAddressList(data){
  212. return request.get('address/list',data);
  213. }
  214. /**
  215. * 设置默认地址
  216. * @param int id
  217. */
  218. export function setAddressDefault(id){
  219. return request.post('address/default/set',{id:id})
  220. }
  221. /**
  222. * 修改 添加地址
  223. * @param object data
  224. */
  225. export function editAddress(data){
  226. return request.post('address/edit',data);
  227. }
  228. /**
  229. * 删除地址
  230. * @param int id
  231. *
  232. */
  233. export function delAddress(id){
  234. return request.post('address/del',{id:id})
  235. }
  236. /**
  237. * 获取单个地址
  238. * @param int id
  239. */
  240. export function getAddressDetail(id){
  241. return request.get('address/detail/'+id);
  242. }
  243. /**
  244. * 修改用户信息
  245. * @param object
  246. */
  247. export function userEdit(data){
  248. return request.post('user/edit',data);
  249. }
  250. export function userUpdate(data){
  251. return request.post('user/update',data);
  252. }
  253. /*
  254. * 退出登录
  255. * */
  256. export function getLogout() {
  257. return request.get("logout");
  258. }
  259. /**
  260. * 小程序充值
  261. *
  262. */
  263. export function rechargeRoutine(data){
  264. return request.post('recharge/routine',data)
  265. }
  266. /*
  267. * 公众号充值
  268. * */
  269. export function rechargeWechat(data) {
  270. return request.post("recharge/wechat", data);
  271. }
  272. /**
  273. * 获取默认地址
  274. *
  275. */
  276. export function getAddressDefault(){
  277. return request.get('address/default');
  278. }
  279. /**
  280. * 充值金额选择
  281. */
  282. export function getRechargeApi() {
  283. return request.get("recharge/index");
  284. }
  285. /**
  286. * 登陆记录
  287. */
  288. export function setVisit(data)
  289. {
  290. return request.post('user/set_visit', {...data}, { noAuth:true});
  291. }
  292. /**
  293. * 客服列表
  294. */
  295. export function serviceList() {
  296. return request.get("user/service/list");
  297. }
  298. /**
  299. * 客服详情
  300. */
  301. export function getChatRecord(to_uid, data) {
  302. return request.get("user/service/record/" + to_uid, data);
  303. }
  304. /**
  305. * 静默绑定推广人
  306. * @param {Object} puid
  307. */
  308. export function spread(puid)
  309. {
  310. return request.post("user/spread",{puid:puid});
  311. }