Initial commit

This commit is contained in:
Dev
2026-09-17 16:25:31 +08:00
commit 382a3069b9
1268 changed files with 266342 additions and 0 deletions
@@ -0,0 +1,35 @@
import { config } from '../../config/index';
/** 获取商品详情页评论数 */
function mockFetchGoodDetailsCommentsCount(spuId = 0) {
const { delay } = require('../_utils/delay');
const {
getGoodsDetailsCommentsCount,
} = require('../../model/detailsComments');
return delay().then(() => getGoodsDetailsCommentsCount(spuId));
}
/** 获取商品详情页评论数 */
export function getGoodsDetailsCommentsCount(spuId = 0) {
if (config.useMock) {
return mockFetchGoodDetailsCommentsCount(spuId);
}
return new Promise((resolve) => {
resolve('real api');
});
}
/** 获取商品详情页评论 */
function mockFetchGoodDetailsCommentList(spuId = 0) {
const { delay } = require('../_utils/delay');
const { getGoodsDetailsComments } = require('../../model/detailsComments');
return delay().then(() => getGoodsDetailsComments(spuId));
}
/** 获取商品详情页评论 */
export function getGoodsDetailsCommentList(spuId = 0) {
if (config.useMock) {
return mockFetchGoodDetailsCommentList(spuId);
}
return {homePageComments: []}
}