通过微信开发者工具 商城模板 创建新小程序
This commit is contained in:
20
mini-program/services/good/comments/fetchCommentDetail.js
Normal file
20
mini-program/services/good/comments/fetchCommentDetail.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { config } from '../../../config/index';
|
||||
import { queryCommentDetail } from '../../../model/comments/queryDetail';
|
||||
/** 获取商品评价数据 */
|
||||
function mockQueryCommentDetail(params) {
|
||||
const { delay } = require('../../_utils/delay');
|
||||
const data = queryCommentDetail(params);
|
||||
return delay().then(() => {
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取评价详情 */
|
||||
export function getCommentDetail(params) {
|
||||
if (config.useMock) {
|
||||
return mockQueryCommentDetail(params);
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
resolve('real api');
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user