diff --git a/pages/home/home.js b/pages/home/home.js
index dfe5aac..410a81d 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -10,12 +10,21 @@ import {
import {
getHomeCategoryListApi
} from '~/services/home/getHomeCategoryListApi';
+import {
+ getNoticeList
+} from '~/services/home/getNoticeList';
import Toast from 'tdesign-miniprogram/toast/index';
Page({
data: {
imgSrcs: [],
tabList: [],
+ noticeList: [],
+ marquee: {
+ speed: 40,
+ loop: -1,
+ delay: 0,
+ },
goodsList: [],
goodsListLoadStatus: 0,
pageLoading: false,
@@ -95,6 +104,20 @@ Page({
});
this.loadGoodsList(true);
});
+ // 获取公告列表
+ getNoticeList().then((res) => {
+ if (res.code == 200) {
+ const _noticeData = res.data.map((v) => {
+ return {
+ ...v,
+ visible: true
+ };
+ });
+ this.setData({
+ noticeList: _noticeData,
+ });
+ }
+ });
},
tabChangeHandle(e) {
diff --git a/pages/home/home.json b/pages/home/home.json
index e722c9a..436c0ce 100644
--- a/pages/home/home.json
+++ b/pages/home/home.json
@@ -14,6 +14,7 @@
"t-tabs": "tdesign-miniprogram/tabs/tabs",
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
"goods-list": "/components/goods-list/index",
- "load-more": "/components/load-more/index"
+ "load-more": "/components/load-more/index",
+ "t-notice-bar": "tdesign-miniprogram/notice-bar/notice-bar"
}
}
\ No newline at end of file
diff --git a/pages/home/home.wxml b/pages/home/home.wxml
index be82e2b..f2bf96e 100644
--- a/pages/home/home.wxml
+++ b/pages/home/home.wxml
@@ -3,56 +3,28 @@
-
-
+
+
-
-
+
+
+
+ {{item.noticeTitle}}
+
+
+
+
-
+
\ No newline at end of file
diff --git a/pages/home/home.wxss b/pages/home/home.wxss
index e0e7d6f..74b9dbb 100644
--- a/pages/home/home.wxss
+++ b/pages/home/home.wxss
@@ -60,6 +60,7 @@ page {
.home-page-container .tab.order-nav .order-nav-item.scroll-width {
min-width: 165rpx;
}
+
.home-page-container .tab .order-nav-item.active {
color: #fa550f !important;
}
@@ -105,3 +106,13 @@ page {
--td-tab-item-color: #666;
--td-tab-track-color: red;
}
+
+.notice-bar {}
+
+.notice-bar .t-notice-bar__content {
+ color: #666 !important;
+}
+
+.notice-title {
+ font-size: 28rpx;
+}
\ No newline at end of file
diff --git a/services/home/getNoticeList.js b/services/home/getNoticeList.js
new file mode 100644
index 0000000..c324a08
--- /dev/null
+++ b/services/home/getNoticeList.js
@@ -0,0 +1,19 @@
+import {
+ request
+} from '../_utils/request';
+
+/** 获取公告列表 */
+export function getNoticeList() {
+ return new Promise((resolve, reject) => {
+ request({
+ url: `NoticeApi/getNoticeList`,
+ method: 'GET',
+ success: function (res) {
+ resolve(res);
+ },
+ fail: function (error) {
+ reject(error);
+ }
+ });
+ });
+}
\ No newline at end of file