瀏覽代碼

fix: 修改系统通知数据显示顺序

Before 7 月之前
父節點
當前提交
1be3e33119
共有 3 個文件被更改,包括 27 次插入24 次删除
  1. 2 1
      messages/br.json
  2. 1 0
      messages/en.json
  3. 24 23
      src/app/[locale]/(TabBar)/[[...share]]/_home/HomeMessage.tsx

+ 2 - 1
messages/br.json

@@ -381,7 +381,8 @@
     "1200":"Insufficient inventory",
     "1201": "",
     "1202":"",
-    "1203": "VIP rebate is now claimed",
+    "1203": "O rabato VIP é agora reclamado",
+    "1204": "A coleção de caixa VIP fechou",
     "1300": "",
     "1301":"",
     "1400": "",

+ 1 - 0
messages/en.json

@@ -381,6 +381,7 @@
     "1201": "",
     "1202":"",
     "1203": "VIP rebate is now claimed",
+    "1204": "VIP cashback collection closed",
     "1300": "",
     "1301":"",
     "1400": "",

+ 24 - 23
src/app/[locale]/(TabBar)/[[...share]]/_home/HomeMessage.tsx

@@ -16,32 +16,33 @@ const HomeMessage: FC<Props> = (props) => {
         notices: state.notices,
     }));
 
+    const newNotices = notices
+        .filter((item) => {
+            return !item.is_read && !hasValue(item.id) && item.is_window !== 2;
+        })
+        .reverse();
+
     return (
         <>
             <AnimatePresence>
-                {notices.map(
-                    (item, index) =>
-                        !item.is_read &&
-                        !hasValue(item.id) &&
-                        item.is_window !== 2 && (
-                            <motion.div
-                                key={index}
-                                className={`absolute z-10 flex w-[100%] bg-[rgba(1,1,1,0.8)] px-[0.1389rem] py-[0.0333rem] text-[0.13rem]`}
-                                initial={{ opacity: 0 }}
-                                animate={{ opacity: 1 }}
-                                exit={{ opacity: 0 }}
-                                transition={{ type: "spring" }}
-                            >
-                                <div className={"flex-1 break-all"}>{item?.content?.text}</div>
-                                <div className={"h-[100%] flex-shrink-0"}>
-                                    <i
-                                        className={"iconfont icon-guanbi"}
-                                        onClick={() => setSourceMap(item.id, item)}
-                                    ></i>
-                                </div>
-                            </motion.div>
-                        )
-                )}
+                {newNotices.map((item, index) => (
+                    <motion.div
+                        key={index}
+                        className={`absolute z-10 flex w-[100%] bg-[rgba(1,1,1,0.8)] px-[0.1389rem] py-[0.0333rem] text-[0.13rem]`}
+                        initial={{ opacity: 0 }}
+                        animate={{ opacity: 1 }}
+                        exit={{ opacity: 0 }}
+                        transition={{ type: "spring" }}
+                    >
+                        <div className={"flex-1 break-all"}>{item?.content?.text}</div>
+                        <div className={"h-[100%] flex-shrink-0"}>
+                            <i
+                                className={"iconfont icon-guanbi"}
+                                onClick={() => setSourceMap(item.id, item)}
+                            ></i>
+                        </div>
+                    </motion.div>
+                ))}
             </AnimatePresence>
         </>
     );