1234567891011121314151617181920212223242526272829303132333435 |
- import request from '../utils/request.js'
- class product extends request {
- // static errorHandel(res) {
- // console.log(res);
- // }
- static async getProductList(productType=1,page = 1, pageSize = 10,type=1,storeId=0) {
- const res = await this.getRequest(`${this.BASE_URL}Product/index?productTypeId=${productType}&page=${page}&pageSize=${pageSize}&type=${type}&storeId=${storeId}`)
- return res.data;
- }
- static async getProductById(id,shopId) {
- const res = await this.getRequest(`${this.BASE_URL}Product/read?id=${id}&storeId=${shopId}`)
- return res.data;
- }
- static async getProductTypeList(page = 1, pageSize = 10,type=1,storeId=0) {
- const res = await this.getRequest(`${this.BASE_URL}Product/typeList?page=${page}&pageSize=${pageSize}&type=${type}&storeId=${storeId}`)
- return res.data;
- }
- static async getCart(data) {
- const res= await this.postRequest(`${this.BASE_URL}Order/getCart`,data)
- return res.data
- }
- static async updateCart(data) {
- const res = await this.postRequest(`${this.BASE_URL}Order/updateCart`,data)
- return res.data
- }
-
- }
- export default product
|