diff --git a/screeens/EditStreamerProfile/index.jsx b/screeens/EditStreamerProfile/index.jsx index af7b1e9..506163b 100644 --- a/screeens/EditStreamerProfile/index.jsx +++ b/screeens/EditStreamerProfile/index.jsx @@ -261,11 +261,11 @@ export default function EditStreamerProfile({ navigation, route }) { { notChanged: true, id: { video_ids: streamerData.data.streamer.shorts.video_ids }, - //todo:将下方uri改为视频封面图片 - uri: streamerData?.data?.streamer?.shorts?.videos[0]?.urls[0], + old_uri: + streamerData?.data?.streamer?.shorts?.videos[0]?.cover_urls[0], }, - setOldPhotos(streamerData.data.streamer.album.images), ]); + setOldPhotos(streamerData.data.streamer.album.images); setIsloading(false); } catch (error) { console.error(error); diff --git a/screeens/Stream/FeedStream/index.jsx b/screeens/Stream/FeedStream/index.jsx index 6b413b3..8f19119 100644 --- a/screeens/Stream/FeedStream/index.jsx +++ b/screeens/Stream/FeedStream/index.jsx @@ -175,7 +175,7 @@ export default function FeedStream() { //下拉刷新 const handleRefresh = async () => { startRotation(); - flatListRef.current.scrollToOffset({ animated: true, offset: 0 }); + flatListRef.current.scrollToOffset({ animated: false, offset: 0 }); setRefreshing(true); await getData("top"); setRefreshing(false); diff --git a/screeens/Wallet/index.jsx b/screeens/Wallet/index.jsx index 93eee99..e412dc3 100644 --- a/screeens/Wallet/index.jsx +++ b/screeens/Wallet/index.jsx @@ -1,5 +1,5 @@ import { View, Text, Image, TouchableOpacity } from "react-native"; -import React, { useState, useEffect } from "react"; +import React, { useState, useEffect, useCallback } from "react"; import { useTailwind } from "tailwind-rn"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Divider, Icon } from "@rneui/themed"; @@ -10,6 +10,7 @@ import baseRequest from "../../utils/baseRequest"; import Toast from "react-native-toast-message"; import * as Linking from "expo-linking"; import { generateSignature } from "../../utils/crypto"; +import { useFocusEffect } from "@react-navigation/native"; export default function Wallet({ navigation, route }) { const tailwind = useTailwind(); @@ -19,52 +20,57 @@ export default function Wallet({ navigation, route }) { const [tokenAndMobilePhone, setTokenAndMobilePhone] = useState(""); const [data, setData] = useState(""); //每次focus都更新一次数据 - useEffect(() => { - const getData = async () => { - //获取环境变量 - const apiUrl = process.env.EXPO_PUBLIC_API_URL; - const account = await get("account"); - const base = await baseRequest(); - const signature = await generateSignature({ - ...base, - mid: account.mid, - }); - try { - //获取账号基本信息 - const accountResponse = await fetch( - `${apiUrl}/api/account/list_by_mid?signature=${signature}`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - ...base, - mid: account.mid, - }), + useFocusEffect( + useCallback(() => { + const getData = async () => { + //获取环境变量 + const apiUrl = process.env.EXPO_PUBLIC_API_URL; + const account = await get("account"); + const base = await baseRequest(); + const signature = await generateSignature({ + ...base, + mid: account.mid, + }); + try { + //获取账号基本信息 + const accountResponse = await fetch( + `${apiUrl}/api/account/list_by_mid?signature=${signature}`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + ...base, + mid: account.mid, + }), + } + ); + const accountData = await accountResponse.json(); + if (accountData.ret === -1) { + Toast.show({ + type: "error", + text1: accountData.msg, + topOffset: 60, + }); + return; } - ); - const accountData = await accountResponse.json(); - if (accountData.ret === -1) { - Toast.show({ - type: "error", - text1: accountData.msg, - topOffset: 60, + await save("account", accountData.data.account); + setData(accountData.data.account); + const tokenCache = await get("token"); + const temToken = encodeURIComponent(tokenCache); + const mobilePhone = await get("mobile_phone"); + setTokenAndMobilePhone({ + token: temToken, + mobile_phone: mobilePhone, }); - return; + } catch (error) { + console.error(error); } - await save("account", accountData.data.account); - setData(accountData.data.account); - const tokenCache = await get("token"); - const temToken = encodeURIComponent(tokenCache); - const mobilePhone = await get("mobile_phone"); - setTokenAndMobilePhone({ token: temToken, mobile_phone: mobilePhone }); - } catch (error) { - console.error(error); - } - }; - getData(); - }, []); + }; + getData(); + }, []) + ); return ( { await Clipboard.setStringAsync(data); - Toast.show({ - type: "success", - text1: "已复制到剪贴板", - topOffset: 60, - }); + Alert.alert(null, "复制成功"); }; return ( {currentOrder.consumer_wechat ? ( - + @@ -139,10 +136,14 @@ export default function AlreadyAddWechat({}) { {currentOrder?.account?.name} - + Ta的微信号: - + {currentOrder?.consumer_wechat} @@ -158,10 +159,14 @@ export default function AlreadyAddWechat({}) { - + 添加时请备注: - + {currentOrder?.consumer_note} diff --git a/screeens/WechatWaitingToAdd/HaveNotAddWechat/index.jsx b/screeens/WechatWaitingToAdd/HaveNotAddWechat/index.jsx index 8c50a5a..6d8c466 100644 --- a/screeens/WechatWaitingToAdd/HaveNotAddWechat/index.jsx +++ b/screeens/WechatWaitingToAdd/HaveNotAddWechat/index.jsx @@ -6,6 +6,7 @@ import { Modal, TouchableOpacity, Image as NativeImage, + Alert, } from "react-native"; import { Image } from "expo-image"; import React, { useState, useEffect } from "react"; @@ -97,11 +98,7 @@ export default function HaveNotAddWechat({}) { //保存内容到剪贴板 const copy = async (data) => { await Clipboard.setStringAsync(data); - Toast.show({ - type: "success", - text1: "已复制到剪贴板", - topOffset: 60, - }); + Alert.alert(null, "复制成功"); }; //点击我已完成添加按钮 const handleConfirm = async () => { @@ -160,7 +157,7 @@ export default function HaveNotAddWechat({}) { style={tailwind("p-4 rounded-2xl bg-[#1E1C29] items-center w-3/4")} > {currentOrder.consumer_wechat ? ( - + @@ -176,10 +173,14 @@ export default function HaveNotAddWechat({}) { {currentOrder?.account?.name} - + Ta的微信号: - + {currentOrder?.consumer_wechat} @@ -195,10 +196,14 @@ export default function HaveNotAddWechat({}) { - + 添加时请备注: - + {currentOrder?.consumer_note} diff --git a/tailwind.css b/tailwind.css index 9937f2b..779ba3b 100644 --- a/tailwind.css +++ b/tailwind.css @@ -593,10 +593,6 @@ background-color: rgb(255 255 255 / var(--tw-bg-opacity)) } -.bg-white\/30 { - background-color: rgb(255 255 255 / 0.3) -} - .bg-yellow-400 { --tw-bg-opacity: 1; background-color: rgb(250 204 21 / var(--tw-bg-opacity)) @@ -721,6 +717,14 @@ text-align: right } +.text-start { + text-align: start +} + +.text-end { + text-align: end +} + .text-2xl { font-size: 1.5rem; line-height: 2rem diff --git a/tailwind.json b/tailwind.json index 9edfa66..054f3b3 100644 --- a/tailwind.json +++ b/tailwind.json @@ -788,11 +788,6 @@ "backgroundColor": "rgb(255 255 255 / var(--tw-bg-opacity))" } }, - "bg-white/30": { - "style": { - "backgroundColor": "rgb(255 255 255 / 0.3)" - } - }, "bg-yellow-400": { "style": { "--tw-bg-opacity": 1, @@ -960,6 +955,16 @@ "textAlign": "right" } }, + "text-start": { + "style": { + "textAlign": "start" + } + }, + "text-end": { + "style": { + "textAlign": "end" + } + }, "text-2xl": { "style": { "fontSize": 24,