api.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 int types 0全部 1未使用 2已使用
  47. */
  48. export function getUserCoupons(data){
  49. return request.get('coupon/list',data)
  50. }
  51. /**
  52. * 文章分类列表
  53. *
  54. */
  55. export function getArticleCategoryList(){
  56. return request.get('article/category/list',{},{noAuth:true})
  57. }
  58. /**
  59. * 文章列表
  60. * @param int cid
  61. *
  62. */
  63. export function getArticleList(cid,data){
  64. return request.get('article/list/' + cid, data,{noAuth:true})
  65. }
  66. /**
  67. * 文章 热门列表
  68. *
  69. */
  70. export function getArticleHotList(){
  71. return request.get('article/hot/list',{},{noAuth:true});
  72. }
  73. /**
  74. * 文章 轮播列表
  75. *
  76. */
  77. export function getArticleBannerList(){
  78. return request.get('article/banner/list',{},{noAuth:true})
  79. }
  80. /**
  81. * 文章详情
  82. * @param int id
  83. *
  84. */
  85. export function getArticleDetails(id){
  86. return request.get('article/info',id,{noAuth:true});
  87. }
  88. /**
  89. * 手机号+验证码登录接口
  90. * @param object data
  91. */
  92. export function loginMobile(data){
  93. return request.post('login/mobile',data,{noAuth:true})
  94. }
  95. /**
  96. * 获取短信KEY
  97. * @param object phone
  98. */
  99. export function verifyCode(){
  100. return request.get('verify_code', {},{noAuth:true})
  101. }
  102. /**
  103. * 验证码发送
  104. * @param object phone
  105. */
  106. export function registerVerify(phone){
  107. return request.post('sendCode', { phone: phone },{noAuth:true},1)
  108. }
  109. /**
  110. * 手机号注册
  111. * @param object data
  112. *
  113. */
  114. export function phoneRegister(data){
  115. return request.post('register',data,{noAuth:true});
  116. }
  117. /**
  118. * 手机号修改密码
  119. * @param object data
  120. *
  121. */
  122. export function phoneRegisterReset(data){
  123. return request.post('register/reset',data,{noAuth:true})
  124. }
  125. /**
  126. * 手机号+密码登录
  127. * @param object data
  128. *
  129. */
  130. export function phoneLogin(data){
  131. return request.post('login',data,{noAuth:true})
  132. }
  133. /**
  134. * 切换H5登录
  135. * @param object data
  136. */
  137. // #ifdef MP
  138. export function switchH5Login(){
  139. return request.post('switch_h5', { 'from':'routine'});
  140. }
  141. // #endif
  142. /*
  143. * h5切换公众号登录
  144. * */
  145. // #ifdef H5
  146. export function switchH5Login() {
  147. return request.post("switch_h5", { 'from': "wechat" });
  148. }
  149. // #endif
  150. /**
  151. * 换绑手机号
  152. *
  153. */
  154. export function bindingPhone(data){
  155. return request.post('update/binding',data);
  156. }
  157. /**
  158. * 换绑手机号校验
  159. *
  160. */
  161. export function bindingVerify(data){
  162. return request.post('update/binding/verify',data);
  163. }
  164. /**
  165. * 退出登錄
  166. *
  167. */
  168. export function logout(){
  169. return request.get('logout');
  170. }
  171. /**
  172. * 获取订阅消息id
  173. */
  174. export function getTemlIds(data)
  175. {
  176. return request.get('wechat/program/my/temp/list', data , { noAuth:true});
  177. }
  178. /**
  179. * 首页拼团数据
  180. */
  181. export function pink()
  182. {
  183. return request.get('pink', {}, { noAuth:true});
  184. }
  185. /**
  186. * 获取城市信息
  187. */
  188. export function getCity() {
  189. return request.get('city/list', { }, { noAuth: true });
  190. }
  191. /**
  192. * 获取小程序直播列表
  193. */
  194. export function getLiveList(page,limit) {
  195. return request.get('wechat/live', { page, limit}, { noAuth: true });
  196. }
  197. /**
  198. * 获取小程序二维码
  199. */
  200. export function getQrcode(data) {
  201. return request.post('qrcode/get',data,{ noAuth: true });
  202. }