api.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. import request from "@/utils/request.js";
  2. /**
  3. * 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册
  4. *
  5. */
  6. /**
  7. * 获取主页数据 无需授权
  8. *
  9. */
  10. export function getIndexData()
  11. {
  12. return request.get("index",{},{ noAuth : true});
  13. }
  14. /**
  15. * 获取登录授权login
  16. *
  17. */
  18. export function getLogo()
  19. {
  20. return request.get('wechat/getLogo', {}, { noAuth : true});
  21. }
  22. /**
  23. * 保存form_id
  24. * @param string formId
  25. */
  26. export function setFormId(formId) {
  27. return request.post("wechat/set_form_id", { formId: formId});
  28. }
  29. /**
  30. * 领取优惠券
  31. * @param int couponId
  32. *
  33. */
  34. export function setCouponReceive(couponId){
  35. return request.post('coupon/receive', { couponId: couponId});
  36. }
  37. /**
  38. * 优惠券列表
  39. * @param object data
  40. */
  41. export function getCoupons(data){
  42. return request.get('coupons',data,{noAuth:true})
  43. }
  44. /**
  45. * 手机号+验证码登录接口
  46. * @param object data
  47. */
  48. export function loginMobile(data){
  49. return request.post('login/mobile',data,{noAuth:true})
  50. }
  51. /**
  52. * 获取短信KEY
  53. * @param object phone
  54. */
  55. export function verifyCode(){
  56. return request.get('verify_code', {},{noAuth:true})
  57. }
  58. /**
  59. * 验证码发送
  60. * @param object phone
  61. */
  62. export function registerVerify(phone){
  63. return request.post('sendCode', { phone: phone },{noAuth:true},1)
  64. }
  65. /**
  66. * 手机号注册
  67. * @param object data
  68. *
  69. */
  70. export function phoneRegister(data){
  71. return request.post('register',data,{noAuth:true});
  72. }
  73. /**
  74. * 手机号修改密码
  75. * @param object data
  76. *
  77. */
  78. export function phoneRegisterReset(data){
  79. return request.post('register/reset',data,{noAuth:true})
  80. }
  81. /**
  82. * 手机号+密码登录
  83. * @param object data
  84. *
  85. */
  86. export function phoneLogin(data){
  87. return request.post('login',data,{noAuth:true})
  88. }
  89. /**
  90. * 切换H5登录
  91. * @param object data
  92. */
  93. // #ifdef MP
  94. export function switchH5Login(){
  95. return request.post('switch_h5', { 'from':'routine'});
  96. }
  97. // #endif
  98. /*
  99. * h5切换公众号登录
  100. * */
  101. // #ifdef H5
  102. export function switchH5Login() {
  103. return request.post("switch_h5", { 'from': "wechat" });
  104. }
  105. // #endif
  106. /**
  107. * 换绑手机号
  108. *
  109. */
  110. export function bindingPhone(data){
  111. return request.post('update/binding',data);
  112. }
  113. /**
  114. * 换绑手机号校验
  115. *
  116. */
  117. export function bindingVerify(data){
  118. return request.post('update/binding/verify',data);
  119. }
  120. /**
  121. * 退出登錄
  122. *
  123. */
  124. export function logout(){
  125. return request.get('logout');
  126. }
  127. /**
  128. * 获取订阅消息id
  129. */
  130. export function getTemlIds(data)
  131. {
  132. return request.get('wechat/program/my/temp/list', data , { noAuth:true});
  133. }
  134. /**
  135. * 获取小程序直播列表
  136. */
  137. export function getLiveList(page,limit) {
  138. return request.get('wechat/live', { page, limit}, { noAuth: true });
  139. }
  140. /**
  141. * 获取小程序二维码
  142. */
  143. export function getQrcode(data) {
  144. return request.post('qrcode/get',data,{ noAuth: true });
  145. }