修改MySlider的样式

This commit is contained in:
al 2024-09-09 15:13:44 +08:00
parent bc7c1b113a
commit 81c0d446d2
4 changed files with 78 additions and 19 deletions

View File

@ -254,7 +254,7 @@ export default function MySlider({
style={{
...tailwind("flex flex-row justify-between items-center"),
position: "absolute",
top: -48,
top: -54,
right: 24,
}}
>
@ -284,7 +284,7 @@ export default function MySlider({
color: "#ff75c8",
}}
>
-
</Text>
<Text
style={{
@ -292,7 +292,7 @@ export default function MySlider({
color: "#ff75c8",
}}
>
{hasInfinity && rightProcess >= 1 ? ">" + upper_bound : rightValue}
{hasInfinity && rightProcess >= 1 ? "∞" : rightValue}
</Text>
{unitSite == "right" && (
<Text
@ -334,7 +334,7 @@ export default function MySlider({
color: "#ffffff80",
}}
>
{hasInfinity ? ">" + upper_bound : upper_bound}
{hasInfinity ? "∞" : upper_bound}
</Text>
</View>
</View>

View File

@ -4,13 +4,52 @@ import {
Image as NativeImage,
Text,
} from "react-native";
import React, { useState, useCallback } from "react";
import React, { useState, useEffect, useCallback } from "react";
import { useTailwind } from "tailwind-rn";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import baseRequest from "../../../utils/baseRequest";
import { generateSignature } from "../../../utils/crypto";
export default function Message({ navigation }) {
const [data, setData] = useState([]);
const tailwind = useTailwind();
const insets = useSafeAreaInsets();
useEffect(() => {
getData();
}, []);
const getData = async (searchValue) => {
const apiUrl = process.env.EXPO_PUBLIC_API_URL;
try {
const base = await baseRequest();
const body = {
mid: base.b_mid,
...base,
};
const signature = await generateSignature(body);
const _response = await fetch(
`${apiUrl}/api/notification/list_unread_by_mid?signature=${signature}`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(body),
}
);
const _data = await _response.json();
if (_data.ret === -1) {
Toast.show({
type: "error",
text1: _data.msg,
topOffset: 60,
});
return;
}
setData(_data.data.list);
console.log("_data.data.list", _data.data);
} catch (error) {
console.error(error);
}
};
return (
<View
@ -18,7 +57,7 @@ export default function Message({ navigation }) {
paddingTop: insets.top,
paddingLeft: insets.left,
paddingRight: insets.right,
...tailwind("flex flex-1"),
...tailwind("flex flex-1 p-4 mt-4"),
}}
>
{/* 广告轮播 */}

View File

@ -5,6 +5,7 @@ import {
Text,
} from "react-native";
import React from "react";
import { Icon } from "@rneui/themed";
import { useTailwind } from "tailwind-rn";
import { useSafeAreaInsets } from "react-native-safe-area-context";
export default function NoticeItem({ leftIcon, hasLink }) {
@ -48,9 +49,9 @@ export default function NoticeItem({ leftIcon, hasLink }) {
>
<View
style={{
...tailwind("mr-2 bg-white rounded-xl"),
width: 100,
height: 100,
...tailwind("mr-2 bg-white rounded-lg"),
width: 50,
height: 50,
}}
>
{/* <NativeImage
@ -62,7 +63,7 @@ export default function NoticeItem({ leftIcon, hasLink }) {
</View>
<View
style={{
...tailwind("flex justify-center flex-1"),
...tailwind("flex flex-row justify-between flex-1 px-4"),
alignItems: "center",
}}
>
@ -71,6 +72,14 @@ export default function NoticeItem({ leftIcon, hasLink }) {
>
{hasLink.text}
</Text>
<TouchableOpacity onPress={() => {}}>
<Icon
type="ionicon"
name="chevron-forward"
color="white"
size={24}
/>
</TouchableOpacity>
</View>
</TouchableOpacity>
)}

View File

@ -81,11 +81,11 @@ export default function Search({ navigation, route }) {
upper_bound: 200,
lower_bound: 1,
default: 24,
step: 200 / 10,
step: 200 / 9,
type: "slider",
unit: "万",
key: "fans",
stepValues: [1, 3, 5, 10, 20, 50, 75, 100, 150, 200, 1000],
stepValues: [1, 5, 10, 20, 50, 75, 100, 150, 200, 1000],
},
{
name: "身高",
@ -194,25 +194,26 @@ export default function Search({ navigation, route }) {
const priceFilters = [
{
name: "空间价格",
upper_bound: 200,
upper_bound: 300,
lower_bound: 0,
default: 24,
step: 200 / 7,
step: 300 / 7,
type: "slider",
unit: "¥",
key: "zone",
stepValues: [0, 1, 10, 50, 100, 150, 200, 4000],
stepValues: [0, 10, 50, 100, 150, 200, 300, 4000],
},
{
name: "微信价格",
upper_bound: 10000,
desc: "10金币=¥1",
upper_bound: 30000,
lower_bound: 0,
default: 24,
step: 10000 / 8,
step: 30000 / 9,
type: "slider",
unit: "金币",
key: "wechat",
stepValues: [0, 10, 100, 200, 500, 1000, 5000, 10000, 100000],
stepValues: [0, 100, 300, 500, 1000, 5000, 10000, 20000, 30000, 100000],
},
];
const [filtersValue, setFiltersValue] = useState({
@ -377,6 +378,8 @@ export default function Search({ navigation, route }) {
// offset: 0,
// limit: 20,
});
console.log(querryParams);
const response = await fetch(`${apiUrl}${api}?signature=${signature}`, {
method: "POST",
headers: {
@ -1187,6 +1190,14 @@ export default function Search({ navigation, route }) {
/>
</View>
))}
<Text
style={{
...tailwind("text-sm font-medium mt-1 px-4"),
color: "#ffffff80",
}}
>
*{priceFilters[1]?.desc}
</Text>
<View
style={{
...tailwind("flex-row justify-around items-center mb-4 p-4"),