api.js 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. import request from '@/utils/request'
  2. const IndexUrl= 'wx/home/index'; //首页数据接口
  3. export function getHome() {
  4. return request({
  5. url: IndexUrl,
  6. method: 'get'
  7. })
  8. }
  9. const CatalogList='wx/catalog/index'; //分类目录全部分类数据接口
  10. export function catalogList() {
  11. return request({
  12. url: CatalogList,
  13. method: 'get'
  14. })
  15. }
  16. const CatalogCurrent='wx/catalog/current'; //分类目录当前分类数据接口
  17. export function catalogCurrent(query) {
  18. return request({
  19. url: CatalogCurrent,
  20. method: 'get',
  21. params: query
  22. })
  23. }
  24. const AuthLoginByWeixin='wx/auth/login_by_weixin'; //微信登录
  25. const AuthLoginByAccount='wx/auth/login'; //账号登录
  26. export function authLoginByAccount(data) {
  27. return request({
  28. url: AuthLoginByAccount,
  29. method: 'post',
  30. data
  31. })
  32. }
  33. const AuthLogout='wx/auth/logout'; //账号登出
  34. export function authLogout() {
  35. return request({
  36. url: AuthLogout,
  37. method: 'post'
  38. })
  39. }
  40. const AuthInfo='wx/auth/info'; //用户信息
  41. export function authInfo() {
  42. return request({
  43. url: AuthInfo,
  44. method: 'get'
  45. })
  46. }
  47. const AuthProfile='wx/auth/profile'; //账号修改
  48. export function authProfile(data) {
  49. return request({
  50. url: AuthProfile,
  51. method: 'post',
  52. data
  53. })
  54. }
  55. const AuthRegister='wx/auth/register'; //账号注册
  56. const AuthReset='wx/auth/reset'; //账号密码重置
  57. export function authReset(data) {
  58. return request({
  59. url: AuthReset,
  60. method: 'post',
  61. data
  62. })
  63. }
  64. const AuthRegisterCaptcha='wx/auth/regCaptcha'; //注册验证码
  65. export function authRegisterCaptcha(data) {
  66. return request({
  67. url: AuthRegisterCaptcha,
  68. method: 'post',
  69. data
  70. })
  71. }
  72. const AuthCaptcha='wx/auth/captcha'; //验证码
  73. export function authCaptcha(data) {
  74. return request({
  75. url: AuthCaptcha,
  76. method: 'post',
  77. data
  78. })
  79. }
  80. const GoodsCount='wx/goods/count'; //统计商品总数
  81. export function goodsCount() {
  82. return request({
  83. url: GoodsCount,
  84. method: 'get'
  85. })
  86. }
  87. export const GoodsList='wx/goods/list'; //获得商品列表
  88. export function goodsList(query) {
  89. return request({
  90. url: GoodsList,
  91. method: 'get',
  92. params: query
  93. })
  94. }
  95. const GoodsCategory='wx/goods/category'; //获得分类数据
  96. export function goodsCategory(query) {
  97. return request({
  98. url: GoodsCategory,
  99. method: 'get',
  100. params: query
  101. })
  102. }
  103. const GoodsDetail='wx/goods/detail'; //获得商品的详情
  104. export function goodsDetail(query) {
  105. return request({
  106. url: GoodsDetail,
  107. method: 'get',
  108. params: query
  109. })
  110. }
  111. const GoodsRelated='wx/goods/related'; //商品详情页的关联商品(大家都在看)
  112. const BrandList='wx/brand/list'; //品牌列表
  113. export function brandList(query) {
  114. return request({
  115. url: BrandList,
  116. method: 'get',
  117. params: query
  118. })
  119. }
  120. const BrandDetail='wx/brand/detail'; //品牌详情
  121. export function brandDetail(query) {
  122. return request({
  123. url: BrandDetail,
  124. method: 'get',
  125. params: query
  126. })
  127. }
  128. const CartList='wx/cart/index'; //获取购物车的数据
  129. export function cartList(query) {
  130. return request({
  131. url: CartList,
  132. method: 'get',
  133. params: query
  134. })
  135. }
  136. const CartAdd='wx/cart/add'; // 添加商品到购物车
  137. export function cartAdd(data) {
  138. return request({
  139. url: CartAdd,
  140. method: 'post',
  141. data
  142. })
  143. }
  144. const CartFastAdd='wx/cart/fastadd'; // 立即购买商品
  145. export function cartFastAdd(data) {
  146. return request({
  147. url: CartFastAdd,
  148. method: 'post',
  149. data
  150. })
  151. }
  152. const CartUpdate='wx/cart/update'; // 更新购物车的商品
  153. export function cartUpdate(data) {
  154. return request({
  155. url: CartUpdate,
  156. method: 'post',
  157. data
  158. })
  159. }
  160. const CartDelete='wx/cart/delete'; // 删除购物车的商品
  161. export function cartDelete(data) {
  162. return request({
  163. url: CartDelete,
  164. method: 'post',
  165. data
  166. })
  167. }
  168. const CartChecked='wx/cart/checked'; // 选择或取消选择商品
  169. export function cartChecked(data) {
  170. return request({
  171. url: CartChecked,
  172. method: 'post',
  173. data
  174. })
  175. }
  176. const CartGoodsCount='wx/cart/goodscount'; // 获取购物车商品件数
  177. export function cartGoodsCount() {
  178. return request({
  179. url: CartGoodsCount,
  180. method: 'get'
  181. })
  182. }
  183. const CartCheckout='wx/cart/checkout'; // 下单前信息确认
  184. export function cartCheckout(query) {
  185. return request({
  186. url: CartCheckout,
  187. method: 'get',
  188. params: query
  189. })
  190. }
  191. const CollectList='wx/collect/list'; //收藏列表
  192. export function collectList(query) {
  193. return request({
  194. url: CollectList,
  195. method: 'get',
  196. params: query
  197. })
  198. }
  199. const CollectAddOrDelete='wx/collect/addordelete'; //添加或取消收藏
  200. export function collectAddOrDelete(data) {
  201. return request({
  202. url: CollectAddOrDelete,
  203. method: 'post',
  204. data
  205. })
  206. }
  207. const CommentList='wx/comment/list'; //评论列表
  208. const CommentCount='wx/comment/count'; //评论总数
  209. const CommentPost='wx/comment/post'; //发表评论
  210. const TopicList='wx/topic/list'; //专题列表
  211. export function topicList(query) {
  212. return request({
  213. url: TopicList,
  214. method: 'get',
  215. params: query
  216. })
  217. }
  218. const TopicDetail='wx/topic/detail'; //专题详情
  219. export function topicDetail(query) {
  220. return request({
  221. url: TopicDetail,
  222. method: 'get',
  223. params: query
  224. })
  225. }
  226. const TopicRelated='wx/topic/related'; //相关专题
  227. export function topicRelated(query) {
  228. return request({
  229. url: TopicRelated,
  230. method: 'get',
  231. params: query
  232. })
  233. }
  234. const SearchIndex='wx/search/index'; //搜索关键字
  235. const SearchResult='wx/search/result'; //搜索结果
  236. const SearchHelper='wx/search/helper'; //搜索帮助
  237. const SearchClearHistory='wx/search/clearhistory'; //搜索历史清楚
  238. const AddressList='wx/address/list'; //收货地址列表
  239. export function addressList(query) {
  240. return request({
  241. url: AddressList,
  242. method: 'get',
  243. params: query
  244. })
  245. }
  246. const AddressDetail='wx/address/detail'; //收货地址详情
  247. export function addressDetail(query) {
  248. return request({
  249. url: AddressDetail,
  250. method: 'get',
  251. params: query
  252. })
  253. }
  254. const AddressSave='wx/address/save'; //保存收货地址
  255. export function addressSave(data) {
  256. return request({
  257. url: AddressSave,
  258. method: 'post',
  259. data
  260. })
  261. }
  262. const AddressDelete='wx/address/delete'; //保存收货地址
  263. export function addressDelete(data) {
  264. return request({
  265. url: AddressDelete,
  266. method: 'post',
  267. data
  268. })
  269. }
  270. const ExpressQuery='wx/express/query'; //物流查询
  271. const OrderSubmit='wx/order/submit'; // 提交订单
  272. export function orderSubmit(data) {
  273. return request({
  274. url: OrderSubmit,
  275. method: 'post',
  276. data
  277. })
  278. }
  279. const OrderPrepay='wx/order/prepay'; // 订单的预支付会话
  280. export function orderPrepay(data) {
  281. return request({
  282. url: OrderPrepay,
  283. method: 'post',
  284. data
  285. })
  286. }
  287. const OrderH5pay = 'wx/order/h5pay'; // h5支付
  288. export function orderH5pay(data) {
  289. return request({
  290. url: OrderH5pay,
  291. method: 'post',
  292. data
  293. });
  294. }
  295. export const OrderList='wx/order/list'; //订单列表
  296. export function orderList(query) {
  297. return request({
  298. url: OrderList,
  299. method: 'get',
  300. params: query
  301. })
  302. }
  303. const OrderDetail='wx/order/detail'; //订单详情
  304. export function orderDetail(query) {
  305. return request({
  306. url: OrderDetail,
  307. method: 'get',
  308. params: query
  309. })
  310. }
  311. const OrderCancel='wx/order/cancel'; //取消订单
  312. export function orderCancel(data) {
  313. return request({
  314. url: OrderCancel,
  315. method: 'post',
  316. data
  317. })
  318. }
  319. const OrderRefund='wx/order/refund'; //退款取消订单
  320. export function orderRefund(data) {
  321. return request({
  322. url: OrderRefund,
  323. method: 'post',
  324. data
  325. })
  326. }
  327. const OrderDelete='wx/order/delete'; //删除订单
  328. export function orderDelete(data) {
  329. return request({
  330. url: OrderDelete,
  331. method: 'post',
  332. data
  333. })
  334. }
  335. const OrderConfirm='wx/order/confirm'; //确认收货
  336. export function orderConfirm(data) {
  337. return request({
  338. url: OrderConfirm,
  339. method: 'post',
  340. data
  341. })
  342. }
  343. const OrderGoods='wx/order/goods'; // 代评价商品信息
  344. const OrderComment='wx/order/comment'; // 评价订单商品信息
  345. const FeedbackAdd='wx/feedback/submit'; //添加反馈
  346. export function feedbackAdd(data) {
  347. return request({
  348. url: FeedbackAdd,
  349. method: 'post',
  350. data
  351. })
  352. }
  353. const FootprintList='wx/footprint/list'; //足迹列表
  354. const FootprintDelete='wx/footprint/delete'; //删除足迹
  355. const GrouponList='wx/groupon/list'; //团购列表
  356. export function grouponList(query) {
  357. return request({
  358. url: GrouponList,
  359. method: 'get',
  360. params: query
  361. })
  362. }
  363. const GroupOn='wx/groupon/query'; //团购API-查询
  364. const GroupOnMy='wx/groupon/my'; //团购API-我的团购
  365. const GroupOnDetail='wx/groupon/detail'; //团购API-详情
  366. const GroupOnJoin='wx/groupon/join'; //团购API-详情
  367. const CouponList='wx/coupon/list'; //优惠券列表
  368. export function couponList(query) {
  369. return request({
  370. url: CouponList,
  371. method: 'get',
  372. params: query
  373. })
  374. }
  375. export const CouponMyList='wx/coupon/mylist'; //我的优惠券列表
  376. export function couponMyList(query) {
  377. return request({
  378. url: CouponMyList,
  379. method: 'get',
  380. params: query
  381. })
  382. }
  383. const CouponSelectList='wx/coupon/selectlist'; //当前订单可用优惠券列表
  384. export function couponSelectList(query) {
  385. return request({
  386. url: CouponSelectList,
  387. method: 'get',
  388. params: query
  389. })
  390. }
  391. const CouponReceive='wx/coupon/receive'; //优惠券领取
  392. export function couponReceive(data) {
  393. return request({
  394. url: CouponReceive,
  395. method: 'post',
  396. data
  397. })
  398. }
  399. const CouponExchange='wx/coupon/exchange'; //优惠券兑换
  400. const StorageUpload='wx/storage/upload'; //图片上传,
  401. const UserIndex='wx/user/index'; //个人页面用户相关信息
  402. export function userIndex() {
  403. return request({
  404. url: UserIndex,
  405. method: 'get'
  406. })
  407. }
  408. const IssueList='wx/issue/list'; //帮助信息
  409. export function issueList() {
  410. return request({
  411. url: IssueList,
  412. method: 'get'
  413. })
  414. }
  415. export function getList(api, query) {
  416. return request({
  417. url: api,
  418. method: 'get',
  419. params: query
  420. })
  421. }
  422. export const REFUND_LIST = '';