From 81c0d446d20ddddabee4227d87d0e9286bf5ddd5 Mon Sep 17 00:00:00 2001 From: al Date: Mon, 9 Sep 2024 15:13:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9MySlider=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/MySlider/index.jsx | 8 ++-- screeens/NoticeDetail/NoticeNav/index.jsx | 45 +++++++++++++++++-- .../components/NoticeItem/index.jsx | 17 +++++-- screeens/Search/index.jsx | 27 +++++++---- 4 files changed, 78 insertions(+), 19 deletions(-) diff --git a/components/MySlider/index.jsx b/components/MySlider/index.jsx index 47eb34d..7c404d0 100644 --- a/components/MySlider/index.jsx +++ b/components/MySlider/index.jsx @@ -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", }} > - - + ~ - {hasInfinity && rightProcess >= 1 ? ">" + upper_bound : rightValue} + {hasInfinity && rightProcess >= 1 ? "∞" : rightValue} {unitSite == "right" && ( - {hasInfinity ? ">" + upper_bound : upper_bound} + {hasInfinity ? "∞" : upper_bound} diff --git a/screeens/NoticeDetail/NoticeNav/index.jsx b/screeens/NoticeDetail/NoticeNav/index.jsx index 0970452..b7132a5 100644 --- a/screeens/NoticeDetail/NoticeNav/index.jsx +++ b/screeens/NoticeDetail/NoticeNav/index.jsx @@ -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 ( {/* 广告轮播 */} diff --git a/screeens/NoticeDetail/components/NoticeItem/index.jsx b/screeens/NoticeDetail/components/NoticeItem/index.jsx index 3232ba1..2f12063 100644 --- a/screeens/NoticeDetail/components/NoticeItem/index.jsx +++ b/screeens/NoticeDetail/components/NoticeItem/index.jsx @@ -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 }) { > {/* @@ -71,6 +72,14 @@ export default function NoticeItem({ leftIcon, hasLink }) { > {hasLink.text} + {}}> + + )} diff --git a/screeens/Search/index.jsx b/screeens/Search/index.jsx index 82ee457..7e0bf6d 100644 --- a/screeens/Search/index.jsx +++ b/screeens/Search/index.jsx @@ -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 }) { /> ))} + + *{priceFilters[1]?.desc} +