Ver código fonte

```
feat(common): 添加首页宣传文案字典列表API

新增getDictList函数用于获取首页宣传文案数据,
通过dictType=bus_promotion_text查询后台字典数据
```

zhangningning 1 semana atrás
pai
commit
b034167e19
2 arquivos alterados com 19 adições e 1 exclusões
  1. 5 0
      src/api/common.js
  2. 14 1
      src/pages/Home.vue

+ 5 - 0
src/api/common.js

@@ -19,6 +19,11 @@ export function purchase(data = {}) {
 export function getDictType(data = {}) {
   return request.get('/common/dictData',data)
 }
+// 首页宣传文案
+// dictType=bus_promotion_text
+export function getDictList(data = {}) {
+  return request.get('/common/dictList',data)
+}
 // 查询协议
 //发布提示  release_hint
 //发布规则  release_rules

+ 14 - 1
src/pages/Home.vue

@@ -10,7 +10,8 @@
             <div class="gradient-text-fallback" data-text="AI工作流">AI工作流</div>
           </div> -->
           <div class="font_size24 line_height30">
-            一站式发现、交易与运行自动化工作流。连接n8n、Coze、Dify 等主流平台,释放生产力潜能。
+            <!-- 一站式发现、交易与运行自动化工作流。连接n8n、Coze、Dify 等主流平台,释放生产力潜能。 -->
+            {{ promotionText }}
           </div>
           <img :src="userTotal" alt="" style="height:52px" class="list_item_animation">
         </div>
@@ -101,6 +102,7 @@ import CourseCard from '@/components/course-card.vue'
 import { isLogin, openFullScreenLoading } from '@/utils/util.js'
 
 import { getCategoryListTree } from '@/api/category.js'
+import { getDictList } from '@/api/common.js'
 import { getPublishList } from '@/api/publish.js'
 
 
@@ -116,6 +118,7 @@ onMounted(() => {
   getCategoryListTreeFn();
   // getList();
   loadMore();
+  getDictListFn();
 })
 
 const router = useRouter()
@@ -209,6 +212,16 @@ const loadMore = async () => {
   }
 };
 
+// 首页宣传文案
+const promotionText = ref('');
+const getDictListFn = () => {
+  getDictList({dictType:'bus_promotion_text'}).then(res => {
+    console.log('bus_promotion_text',res)
+    promotionText.value = res.rows[0]?.dictLabel || '';
+  })
+}
+
+
 defineExpose({
   loadMore
 });