parent
							
								
									31726188ef
								
							
						
					
					
						commit
						4aa3240003
					
				
				 5 changed files with 154 additions and 0 deletions
			
			
		@ -0,0 +1,25 @@ | 
				
			||||
import request from '@/utils/request' | 
				
			||||
// 封装请求的方式
 | 
				
			||||
export function addAddress(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/address/', | 
				
			||||
    method: 'post', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function getAddress(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/address/', | 
				
			||||
    method: 'get', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function updateAddress(id, data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/address/' + id + '/', | 
				
			||||
    method: 'patch', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
@ -0,0 +1,43 @@ | 
				
			||||
import request from '@/utils/requests' | 
				
			||||
 | 
				
			||||
// get方式请求商品分类
 | 
				
			||||
export function getGoodsCategory () { | 
				
			||||
  return request({ | 
				
			||||
    url: '/goodscategory()', method: 'get', | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
// 获取某个商品分类
 | 
				
			||||
export function getGoodsCategoryById (id) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/goodscategory/' + id + '/', method: 'get', | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
// 获取分类下的商品
 | 
				
			||||
export function getCategoryGoods () { | 
				
			||||
  return request({ | 
				
			||||
    url: '/indexgoods/', method: 'get', | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
// 通过参数方式获取商品
 | 
				
			||||
export function getGoods (data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/goods/', method: 'get', params: data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
// 通过id获取某个商品
 | 
				
			||||
export function getGoodsByID (id) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/goods/' + id + '/', method: 'get', | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function getSlide () { | 
				
			||||
  return request({ | 
				
			||||
    url: '/slide/', method: 'get', | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
@ -0,0 +1,44 @@ | 
				
			||||
import request from '@/utils/request' | 
				
			||||
 | 
				
			||||
// 封装请求的方式
 | 
				
			||||
export function addCart(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/cart/', | 
				
			||||
    method: 'post', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function getCart(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/cart/', | 
				
			||||
    method: 'get', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function updateCart(id,data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/cart/'+id+'/', | 
				
			||||
    method: 'patch', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function addOrder(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/order/', | 
				
			||||
    method: 'post', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function getOrder(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/order/', | 
				
			||||
    method: 'get', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
 | 
				
			||||
@ -0,0 +1,41 @@ | 
				
			||||
import request from '@/utils/request' | 
				
			||||
 | 
				
			||||
// 封装请求的方式
 | 
				
			||||
export function login(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/login/', | 
				
			||||
    method: 'post', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function reg(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/users/', | 
				
			||||
    method: 'post', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function getUsersByID() { | 
				
			||||
  return request({ | 
				
			||||
    url: '/users/1/', | 
				
			||||
    method: 'get', | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function updateUsers(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/users/1/', | 
				
			||||
    method: 'patch', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
 | 
				
			||||
export function updatePwd(data) { | 
				
			||||
  return request({ | 
				
			||||
    url: '/users/1/', | 
				
			||||
    method: 'patch', | 
				
			||||
    data | 
				
			||||
  }) | 
				
			||||
} | 
				
			||||
					Loading…
					
					
				
		Reference in new issue