123456789101112131415161718192021222324252627282930 |
- import request from '../utils/request.js'
- class comments extends request {
- static async getCommentsByProduct(page = 1, pageSize = 10, storeId, productId) {
- const res = await this.postRequest(`${this.BASE_URL}Discuss/index?page=${page}&pageSize=${pageSize}&productId=${productId}&storeId=${storeId}`, this._defaultHeader)
- return res.data;
- }
- static async getCommentsByStore(page = 1, pageSize = 10, storeId) {
- const res = await this.postRequest(`${this.BASE_URL}Discuss/index?page=${page}&pageSize=${pageSize}&storeId=${storeId}`, this._defaultHeader)
- return res.data;
- }
- static async getPersonComments(page = 1, pageSize = 10, myDiscuss = 1) {
- const res = await this.postRequest(`${this.BASE_URL}Discuss/index?page=${page}&pageSize=${pageSize}&myDiscuss=${myDiscuss}`, this._defaultHeader)
- return res.data;
- }
- static async sendDiscuss(storeId, productId, orderId, productScore, storeScore, content, imgUrls) {
- const res = await this.postRequest(`${this.BASE_URL}Discuss/save?storeId=${storeId}&productId=${productId}&orderId=${orderId}&productScore=${productScore}&storeScore=${storeScore}&content=${content}&imgUrls=${imgUrls}`, this._defaultHeader)
-
- return res.code;
-
- }
- }
- export default comments;
|