Merge pull request '修改样式问题' (#26) from anln_0000001_1.5 into main
Reviewed-on: https://git.wishpal.cn/wishpal_ironfan/tiefen_space_app/pulls/26
This commit is contained in:
commit
5940726a37
|
@ -89,35 +89,37 @@ export default function SystemNotice({ navigation, route, ...props }) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<ScrollView style={tailwind("p-4")}>
|
<ScrollView>
|
||||||
{data.map((it) => (
|
<View style={tailwind("p-4")}>
|
||||||
<NoticeItem
|
{data.map((it) => (
|
||||||
key={it.id}
|
<NoticeItem
|
||||||
data={it}
|
key={it.id}
|
||||||
navigation={navigation}
|
data={it}
|
||||||
hasLink={{ url: it.url, text: it.link_text }}
|
navigation={navigation}
|
||||||
leftIcon={
|
hasLink={{ url: it.url, text: it.link_text }}
|
||||||
<View>
|
leftIcon={
|
||||||
<Image
|
<View>
|
||||||
source={
|
<Image
|
||||||
it.n_type === 0
|
source={
|
||||||
? systemIcon
|
it.n_type === 0
|
||||||
: it.n_type === 1
|
? systemIcon
|
||||||
? examIcon
|
: it.n_type === 1
|
||||||
: it.n_type === 2
|
? examIcon
|
||||||
? payIcon
|
: it.n_type === 2
|
||||||
: activeIcon
|
? payIcon
|
||||||
}
|
: activeIcon
|
||||||
contentFit="cover"
|
}
|
||||||
cachePolicy="disk"
|
contentFit="cover"
|
||||||
transition={1000}
|
cachePolicy="disk"
|
||||||
style={{ width: 32, height: 32 }}
|
transition={1000}
|
||||||
/>
|
style={{ width: 32, height: 32 }}
|
||||||
</View>
|
/>
|
||||||
}
|
</View>
|
||||||
/>
|
}
|
||||||
))}
|
/>
|
||||||
{!data.length && <Empty type="nodata" />}
|
))}
|
||||||
|
{!data.length && <Empty type="nodata" />}
|
||||||
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { formatDate, goToPage } from "../../../../utils/tools";
|
||||||
import { Image } from "expo-image";
|
import { Image } from "expo-image";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
import * as Linking from "expo-linking";
|
import * as Linking from "expo-linking";
|
||||||
|
import dayjs from "dayjs";
|
||||||
export default function NoticeItem({ navigation, leftIcon, hasLink, data }) {
|
export default function NoticeItem({ navigation, leftIcon, hasLink, data }) {
|
||||||
const tailwind = useTailwind();
|
const tailwind = useTailwind();
|
||||||
// const currentLink = useMemo(() => {
|
// const currentLink = useMemo(() => {
|
||||||
|
@ -16,6 +17,17 @@ export default function NoticeItem({ navigation, leftIcon, hasLink, data }) {
|
||||||
// return hasAppLink ?? null;
|
// return hasAppLink ?? null;
|
||||||
// }
|
// }
|
||||||
// }, [data]);
|
// }, [data]);
|
||||||
|
//日期格式
|
||||||
|
const renderDay = (time) => {
|
||||||
|
const now = dayjs();
|
||||||
|
if (now.diff(dayjs(time * 1000), "hour") - now.hour() < 1) {
|
||||||
|
return dayjs(time * 1000).format("HH:mm");
|
||||||
|
} else if (now.diff(dayjs(time * 1000), "hour") - now.hour() < 24) {
|
||||||
|
return "昨天" + dayjs(time * 1000).format("HH:mm");
|
||||||
|
} else {
|
||||||
|
return dayjs(time * 1000).format("MM-DD");
|
||||||
|
}
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
|
@ -201,7 +213,7 @@ export default function NoticeItem({ navigation, leftIcon, hasLink, data }) {
|
||||||
{/* 时间 */}
|
{/* 时间 */}
|
||||||
<View>
|
<View>
|
||||||
<Text style={{ ...tailwind("text-xs"), color: "#FFFFFF80" }}>
|
<Text style={{ ...tailwind("text-xs"), color: "#FFFFFF80" }}>
|
||||||
{formatDate(data?.push_time || data?.ct)}
|
{renderDay(data?.push_time || data?.ct)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -247,7 +247,7 @@ export default function HostList() {
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
{/* Banner预留位置 */}
|
{/* Banner预留位置 */}
|
||||||
<View style={tailwind("mt-4")}>
|
<View style={tailwind("mt-4 mb-10")}>
|
||||||
<Banner banners={bannerList} navigation={navigation} />
|
<Banner banners={bannerList} navigation={navigation} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
Loading…
Reference in New Issue