feat(api): 添加帮助中心反馈系统和VIP服务功能

- 在ApiClient中新增submitFeedback、myFeedback、helpArticles、helpArticleDetail、
  siteArticles、promotions、vipPackages、createVipOrder、vipOrders等方法
- 添加帮助文章和站点资讯的参数验证逻辑
- 更新测试文件添加新的API方法测试用例
- 在HTML页面中添加反馈、帮助和VIP服务相关页面的脚本引用
- 更新加入家谱页面为完整的申请流程界面
- 修改资讯详情页面为站点资讯展示页面
- 更新AxiosRequestUtil中认证处理逻辑
- 添加世系树渲染的HTML生成函数用于页面复用
- 更新文档中的API契约说明和页面规划
This commit is contained in:
fizzleaf
2026-07-30 16:04:48 +08:00
parent fb1743aa2a
commit 309598bfa6
53 changed files with 6740 additions and 282 deletions
+63
View File
@@ -511,6 +511,69 @@
return request('DELETE', '/genealogy/pc/genealogies/join-applies/' +
toRequiredPathId(applyId, '申请编号'));
},
submitFeedback: function (body) {
return request('POST', '/genealogy/pc/feedback', {
body: pickDefined(body, ['feedbackType', 'feedbackContent', 'contactInfo'])
});
},
myFeedback: function () {
return request('GET', '/genealogy/pc/feedback');
},
helpArticles: function (query) {
return request('GET', '/genealogy/pc/help-articles', {
query: pickDefined(query, ['helpCategory'])
});
},
helpArticleDetail: function (helpId) {
return request('GET', '/genealogy/pc/help-articles/' +
toRequiredPathId(helpId, '帮助文章编号'));
},
siteArticles: function (query) {
var source = query || {};
var articleType = source.articleType === undefined || source.articleType === null
? ''
: String(source.articleType).trim();
var limit = source.limit;
var params = {};
if (articleType && ['news', 'notice', 'download'].indexOf(articleType) === -1) {
throw new Error('不支持的资讯类型:' + articleType);
}
if (limit !== undefined &&
(typeof limit !== 'number' || !Number.isInteger(limit) || limit < 1 || limit > 100)) {
throw new Error('资讯数量限制必须是 1 到 100 的整数');
}
if (articleType) params.articleType = articleType;
if (limit !== undefined) params.limit = limit;
return request('GET', '/genealogy/pc/site/articles', {
auth: false,
query: params
});
},
promotions: function (query) {
var source = query || {};
var platform = source.platform === undefined || source.platform === null
? ''
: String(source.platform).trim();
if (platform && ['all', 'app', 'pc', 'wechat'].indexOf(platform) === -1) {
throw new Error('不支持的推广平台:' + platform);
}
return request('GET', '/genealogy/pc/promotions', {
query: platform ? { platform: platform } : {}
});
},
vipPackages: function () {
return request('GET', '/genealogy/pc/vip/packages');
},
createVipOrder: function (body) {
return request('POST', '/genealogy/pc/vip/orders', {
body: pickDefined(body, ['packageId', 'genealogyId', 'payType'])
});
},
vipOrders: function () {
return request('GET', '/genealogy/pc/vip/orders');
},
notifications: function (query) {
return request('GET', '/genealogy/pc/notifications', {
query: pickDefined(query, ['readStatus'])
+2 -2
View File
@@ -96,7 +96,7 @@
var responseData = error.response && error.response.data;
var status = error.response && error.response.status;
handleUnauthorized(status);
if (req.auth !== false) handleUnauthorized(status);
throw createHttpError((responseData && responseData.msg) || error.message || '接口请求失败', {
status: status,
@@ -108,7 +108,7 @@
try {
return unwrapResponse(response.data);
} catch (error) {
handleUnauthorized(error.code);
if (req.auth !== false) handleUnauthorized(error.code);
throw error;
}
};