api.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. import request from "@/utils/request.js";
  2. //获取首页数据 无需授权
  3. export function getIndexData()
  4. {
  5. return request.get("index/getIndex",{},{ noAuth : true});
  6. }
  7. //公告列表
  8. export function getNotice()
  9. {
  10. return request.post("index/newsList",{},{ noAuth : true});
  11. }
  12. //公告详情
  13. export function newsDetail(data)
  14. {
  15. return request.post("index/news",data,{ noAuth : true});
  16. }
  17. //仓库列表
  18. export function getWarehouse()
  19. {
  20. return request.get("pub/warehouse",{},{ noAuth : true});
  21. }
  22. //产品列表
  23. export function productList(data)
  24. {
  25. return request.post("index/proList",data,{ noAuth : true});
  26. }
  27. //产品详情
  28. export function productDetail(data)
  29. {
  30. return request.post("index/proItem",data,{ noAuth : true});
  31. }
  32. //推荐产品
  33. export function recommend()
  34. {
  35. return request.post("index/proRand",{},{ noAuth : true});
  36. }
  37. //获取验证码
  38. export function registerVerify(data)
  39. {
  40. return request.post("login/yzm",data,{ noAuth : true});
  41. }
  42. //注册一
  43. export function ApiReg1(data)
  44. {
  45. return request.post("login/reg1",data,{ noAuth : true});
  46. }
  47. //注册二
  48. export function ApiReg2(data)
  49. {
  50. return request.post("login/reg2",data,{ noAuth : true});
  51. }
  52. //登录
  53. export function loginApi(data)
  54. {
  55. return request.post("login/l",data,{ noAuth : true});
  56. }
  57. /**
  58. * 获取登录授权login
  59. *
  60. */
  61. export function getLogo()
  62. {
  63. return request.get('wechat/get_logo', {}, { noAuth : true});
  64. }
  65. /**
  66. * 保存form_id
  67. * @param string formId
  68. */
  69. export function setFormId(formId) {
  70. return request.post("wechat/set_form_id", { formId: formId});
  71. }
  72. /**
  73. * 领取优惠卷
  74. * @param int couponId
  75. *
  76. */
  77. export function setCouponReceive(couponId){
  78. return request.post('coupon/receive', { couponId: couponId});
  79. }
  80. /**
  81. * 优惠券列表
  82. * @param object data
  83. */
  84. export function getCoupons(data){
  85. return request.get('coupons',data,{noAuth:true})
  86. }
  87. /**
  88. * 我的优惠券
  89. * @param int types 0全部 1未使用 2已使用
  90. */
  91. export function getUserCoupons(types){
  92. return request.get('coupons/user/'+types)
  93. }
  94. /**
  95. * 文章分类列表
  96. *
  97. */
  98. export function getArticleCategoryList(){
  99. return request.get('article/category/list',{},{noAuth:true})
  100. }
  101. /**
  102. * 文章列表
  103. * @param int cid
  104. *
  105. */
  106. export function getArticleList(cid,data){
  107. return request.get('article/list/' + cid, data,{noAuth:true})
  108. }
  109. /**
  110. * 文章 热门列表
  111. *
  112. */
  113. export function getArticleHotList(){
  114. return request.get('article/hot/list',{},{noAuth:true});
  115. }
  116. /**
  117. * 文章 轮播列表
  118. *
  119. */
  120. export function getArticleBannerList(){
  121. return request.get('article/banner/list',{},{noAuth:true})
  122. }
  123. /**
  124. * 文章详情
  125. * @param int id
  126. *
  127. */
  128. export function getArticleDetails(id){
  129. return request.get('article/details/'+id,{},{noAuth:true});
  130. }
  131. /**
  132. * 手机号+验证码登录接口
  133. * @param object data
  134. */
  135. export function loginMobile(data){
  136. return request.post('login/mobile',data,{noAuth:true})
  137. }
  138. /**
  139. * 手机号注册
  140. * @param object data
  141. *
  142. */
  143. export function phoneRegister(data){
  144. return request.post('register',data,{noAuth:true});
  145. }
  146. /**
  147. * 手机号修改密码
  148. * @param object data
  149. *
  150. */
  151. export function phoneRegisterReset(data){
  152. return request.post('register/reset',data,{noAuth:true})
  153. }
  154. /**
  155. * 手机号+密码登录
  156. * @param object data
  157. *
  158. */
  159. export function phoneLogin(data){
  160. return request.post('login',data,{noAuth:true})
  161. }
  162. /**
  163. * 切换H5登录
  164. * @param object data
  165. */
  166. // #ifdef MP
  167. export function switchH5Login(){
  168. return request.post('switch_h5', { 'from':'routine'});
  169. }
  170. // #endif
  171. /*
  172. * h5切换公众号登陆
  173. * */
  174. // #ifdef H5
  175. export function switchH5Login() {
  176. return request.post("switch_h5", { 'from': "wechat" });
  177. }
  178. // #endif
  179. /**
  180. * 绑定手机号
  181. *
  182. */
  183. export function bindingPhone(data){
  184. return request.post('binding',data);
  185. }
  186. /**
  187. * 退出登錄
  188. *
  189. */
  190. export function logout(){
  191. return request.get('logout');
  192. }
  193. /**
  194. * 获取订阅消息id
  195. */
  196. export function getTemlIds()
  197. {
  198. return request.get('wechat/teml_ids', {}, { noAuth:true});
  199. }
  200. /**
  201. * 首页拼团数据
  202. */
  203. export function pink()
  204. {
  205. return request.get('pink', {}, { noAuth:true});
  206. }
  207. /**
  208. * 获取城市信息
  209. */
  210. export function getCity() {
  211. return request.get('city_list', { }, { noAuth: true });
  212. }
  213. /**
  214. * 获取小程序直播列表
  215. */
  216. export function getLiveList(page,limit) {
  217. return request.get('wechat/live', { page, limit}, { noAuth: true });
  218. }