From f71f28fe999df471a2788b576fd84d0c82f03731 Mon Sep 17 00:00:00 2001 From: duanshuwen Date: Thu, 23 Jul 2026 21:04:54 +0800 Subject: [PATCH] refactor(aigc): update aigc consent dialog and apis - set developVersion to false for production build - format api request calls for consistent readability - simplify consent dialog template and remove unused styles - update default consent text and add ruleClick emit event - add new getUserAgreement api endpoint and export it --- .../components/AigcConsentDialog/index.vue | 36 ++++++------------- .../AigcConsentDialog/styles/index.scss | 22 ------------ src/request/api/AigcApi.js | 21 ++++++++--- src/request/base/config.js | 2 +- 4 files changed, 29 insertions(+), 52 deletions(-) diff --git a/src/pages-aigc/home/components/AigcConsentDialog/index.vue b/src/pages-aigc/home/components/AigcConsentDialog/index.vue index 2e479b0..da22666 100644 --- a/src/pages-aigc/home/components/AigcConsentDialog/index.vue +++ b/src/pages-aigc/home/components/AigcConsentDialog/index.vue @@ -6,24 +6,13 @@ 温馨提示 - {{ content }} + {{ content }} @@ -62,19 +51,16 @@ const props = defineProps({ }, }); -const emit = defineEmits(["update:visible", "cancel", "agree"]); +const emit = defineEmits(["update:visible", "cancel", "agree", "ruleClick"]); const popupRef = ref(null); -const experienceContent = - "当前体验版本赠送 400 积分,可生成 1 张高清旅行图片和 1 段 5 秒内动效视频。如需更多生成额度,敬请期待后续版本上线。"; - -const serviceContent = computed( +const defaultContentPrefix = computed( () => - `欢迎使用【${props.companyName}】提供的 AI 内容升级服务。本服务将通过人工智能技术(AIGC),对您上传的照片或视频进行处理,并结合景区场景模板,为您生成具有特定风格的旅行图片或视频内容。` + `欢迎使用【${props.companyName}】提供的AI内容升级服务。本服务通过人工智能技术(AIGC)将您上传的照片或视频与景区场景模板进行创意优化,为您生成具有特定风格的旅行内容。请您仔细阅读` ); -const ruleConsentSuffix = - "。点击“我同意”并继续操作,即表示您已阅读、理解并同意遵守相关规则;如您不同意,可点击“取消”并退出本服务。"; +const defaultContentSuffix = + ",您点击“我同意”等进行下一步操作的行为均视为您同意受本规则约束。如您不同意,您可以直接关闭页面。"; const close = () => { popupRef.value?.close(); diff --git a/src/pages-aigc/home/components/AigcConsentDialog/styles/index.scss b/src/pages-aigc/home/components/AigcConsentDialog/styles/index.scss index f1ad0d6..67e1dcf 100644 --- a/src/pages-aigc/home/components/AigcConsentDialog/styles/index.scss +++ b/src/pages-aigc/home/components/AigcConsentDialog/styles/index.scss @@ -31,28 +31,6 @@ text-align: justify; } -.aigc-consent-section + .aigc-consent-section { - margin-top: 18px; -} - -.aigc-consent-section-title, -.aigc-consent-paragraph { - display: block; -} - -.aigc-consent-section-title { - margin-bottom: 6px; - color: #172033; - font-size: 16px; - line-height: 24px; - font-weight: 900; - text-align: left; -} - -.aigc-consent-paragraph + .aigc-consent-paragraph { - margin-top: 10px; -} - .aigc-consent-rule { color: #18bd78; font-weight: 900; diff --git a/src/request/api/AigcApi.js b/src/request/api/AigcApi.js index 3808533..5377e52 100644 --- a/src/request/api/AigcApi.js +++ b/src/request/api/AigcApi.js @@ -9,18 +9,24 @@ function getAigcTemplateItemList(args) { } function getAigcGeneratorTaskList(args) { - return request.post("/hotelBiz/aigcGeneratorTask/aigcGeneratorTaskList", args); + return request.post( + "/hotelBiz/aigcGeneratorTask/aigcGeneratorTaskList", + args, + ); } function getAigcGeneratorTaskDetail(args) { - return request.post("/hotelBiz/aigcGeneratorTask/aigcGeneratorTaskDetail", args); + return request.post( + "/hotelBiz/aigcGeneratorTask/aigcGeneratorTaskDetail", + args, + ); } function createAigcGeneratorTask(args) { return request.post( "/hotelBiz/aigcGeneratorTask/createAigcGeneratorTask", args, - { sensitive: true } + { sensitive: true }, ); } @@ -36,12 +42,18 @@ function getPointsTopUpAgreement() { return request.get("/hotelBiz/mainScene/pointsTopUpAgreement", {}); } +function getUserAgreement() { + return request.get("/hotelBiz/mainScene/userAgreement", {}); +} + function createAigcGeneratorTaskShare(args) { return request.post("/hotelBiz/aigcGeneratorTask/share/create", args); } function getAigcGeneratorTaskShareDetail(args) { - return request.post("/hotelBiz/aigcGeneratorTask/share/detail", args, { noToken: true }); + return request.post("/hotelBiz/aigcGeneratorTask/share/detail", args, { + noToken: true, + }); } export { @@ -53,6 +65,7 @@ export { getCurrentCredit, getCreditLedgerPage, getPointsTopUpAgreement, + getUserAgreement, createAigcGeneratorTaskShare, getAigcGeneratorTaskShareDetail, }; diff --git a/src/request/base/config.js b/src/request/base/config.js index b885fc4..0329d23 100644 --- a/src/request/base/config.js +++ b/src/request/base/config.js @@ -7,7 +7,7 @@ import { getServiceUrl } from "../api/GetServiceUrlApi"; const versionValue = "1.1.3"; /// 是否是测试版本, 测试版本为true, 发布版本为false -const developVersion = true; +const developVersion = false; // 获取服务地址 const getEvnUrl = async () => {