webview改为隐身模式;视频显示封面;去除推荐滚动到最上动画;钱包每次聚焦都刷新;完善待添加微信
This commit is contained in:
parent
9002e59541
commit
3ccca0a488
|
@ -261,11 +261,11 @@ export default function EditStreamerProfile({ navigation, route }) {
|
||||||
{
|
{
|
||||||
notChanged: true,
|
notChanged: true,
|
||||||
id: { video_ids: streamerData.data.streamer.shorts.video_ids },
|
id: { video_ids: streamerData.data.streamer.shorts.video_ids },
|
||||||
//todo:将下方uri改为视频封面图片
|
old_uri:
|
||||||
uri: streamerData?.data?.streamer?.shorts?.videos[0]?.urls[0],
|
streamerData?.data?.streamer?.shorts?.videos[0]?.cover_urls[0],
|
||||||
},
|
},
|
||||||
setOldPhotos(streamerData.data.streamer.album.images),
|
|
||||||
]);
|
]);
|
||||||
|
setOldPhotos(streamerData.data.streamer.album.images);
|
||||||
setIsloading(false);
|
setIsloading(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
|
@ -175,7 +175,7 @@ export default function FeedStream() {
|
||||||
//下拉刷新
|
//下拉刷新
|
||||||
const handleRefresh = async () => {
|
const handleRefresh = async () => {
|
||||||
startRotation();
|
startRotation();
|
||||||
flatListRef.current.scrollToOffset({ animated: true, offset: 0 });
|
flatListRef.current.scrollToOffset({ animated: false, offset: 0 });
|
||||||
setRefreshing(true);
|
setRefreshing(true);
|
||||||
await getData("top");
|
await getData("top");
|
||||||
setRefreshing(false);
|
setRefreshing(false);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { View, Text, Image, TouchableOpacity } from "react-native";
|
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 { useTailwind } from "tailwind-rn";
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
import { Divider, Icon } from "@rneui/themed";
|
import { Divider, Icon } from "@rneui/themed";
|
||||||
|
@ -10,6 +10,7 @@ import baseRequest from "../../utils/baseRequest";
|
||||||
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 { generateSignature } from "../../utils/crypto";
|
import { generateSignature } from "../../utils/crypto";
|
||||||
|
import { useFocusEffect } from "@react-navigation/native";
|
||||||
|
|
||||||
export default function Wallet({ navigation, route }) {
|
export default function Wallet({ navigation, route }) {
|
||||||
const tailwind = useTailwind();
|
const tailwind = useTailwind();
|
||||||
|
@ -19,52 +20,57 @@ export default function Wallet({ navigation, route }) {
|
||||||
const [tokenAndMobilePhone, setTokenAndMobilePhone] = useState("");
|
const [tokenAndMobilePhone, setTokenAndMobilePhone] = useState("");
|
||||||
const [data, setData] = useState("");
|
const [data, setData] = useState("");
|
||||||
//每次focus都更新一次数据
|
//每次focus都更新一次数据
|
||||||
useEffect(() => {
|
useFocusEffect(
|
||||||
const getData = async () => {
|
useCallback(() => {
|
||||||
//获取环境变量
|
const getData = async () => {
|
||||||
const apiUrl = process.env.EXPO_PUBLIC_API_URL;
|
//获取环境变量
|
||||||
const account = await get("account");
|
const apiUrl = process.env.EXPO_PUBLIC_API_URL;
|
||||||
const base = await baseRequest();
|
const account = await get("account");
|
||||||
const signature = await generateSignature({
|
const base = await baseRequest();
|
||||||
...base,
|
const signature = await generateSignature({
|
||||||
mid: account.mid,
|
...base,
|
||||||
});
|
mid: account.mid,
|
||||||
try {
|
});
|
||||||
//获取账号基本信息
|
try {
|
||||||
const accountResponse = await fetch(
|
//获取账号基本信息
|
||||||
`${apiUrl}/api/account/list_by_mid?signature=${signature}`,
|
const accountResponse = await fetch(
|
||||||
{
|
`${apiUrl}/api/account/list_by_mid?signature=${signature}`,
|
||||||
method: "POST",
|
{
|
||||||
headers: {
|
method: "POST",
|
||||||
"Content-Type": "application/json",
|
headers: {
|
||||||
},
|
"Content-Type": "application/json",
|
||||||
body: JSON.stringify({
|
},
|
||||||
...base,
|
body: JSON.stringify({
|
||||||
mid: account.mid,
|
...base,
|
||||||
}),
|
mid: account.mid,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const accountData = await accountResponse.json();
|
||||||
|
if (accountData.ret === -1) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: accountData.msg,
|
||||||
|
topOffset: 60,
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
);
|
await save("account", accountData.data.account);
|
||||||
const accountData = await accountResponse.json();
|
setData(accountData.data.account);
|
||||||
if (accountData.ret === -1) {
|
const tokenCache = await get("token");
|
||||||
Toast.show({
|
const temToken = encodeURIComponent(tokenCache);
|
||||||
type: "error",
|
const mobilePhone = await get("mobile_phone");
|
||||||
text1: accountData.msg,
|
setTokenAndMobilePhone({
|
||||||
topOffset: 60,
|
token: temToken,
|
||||||
|
mobile_phone: mobilePhone,
|
||||||
});
|
});
|
||||||
return;
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
}
|
}
|
||||||
await save("account", accountData.data.account);
|
};
|
||||||
setData(accountData.data.account);
|
getData();
|
||||||
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();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
|
|
@ -143,6 +143,7 @@ export default function WebWithHeader({ navigation, route }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<WebView
|
<WebView
|
||||||
|
incognito
|
||||||
source={{
|
source={{
|
||||||
uri: route.params.uri,
|
uri: route.params.uri,
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
Modal,
|
Modal,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
Image as NativeImage,
|
Image as NativeImage,
|
||||||
|
Alert,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { Image } from "expo-image";
|
import { Image } from "expo-image";
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
|
@ -49,7 +50,7 @@ export default function AlreadyAddWechat({}) {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
tab: 1,
|
tab: 2,
|
||||||
offset: top ? 0 : offset, //如果是下拉刷新则更新最新数据
|
offset: top ? 0 : offset, //如果是下拉刷新则更新最新数据
|
||||||
limit: 20,
|
limit: 20,
|
||||||
...base,
|
...base,
|
||||||
|
@ -97,11 +98,7 @@ export default function AlreadyAddWechat({}) {
|
||||||
//保存内容到剪贴板
|
//保存内容到剪贴板
|
||||||
const copy = async (data) => {
|
const copy = async (data) => {
|
||||||
await Clipboard.setStringAsync(data);
|
await Clipboard.setStringAsync(data);
|
||||||
Toast.show({
|
Alert.alert(null, "复制成功");
|
||||||
type: "success",
|
|
||||||
text1: "已复制到剪贴板",
|
|
||||||
topOffset: 60,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
|
@ -123,7 +120,7 @@ export default function AlreadyAddWechat({}) {
|
||||||
style={tailwind("p-4 rounded-2xl bg-[#1E1C29] items-center w-3/4")}
|
style={tailwind("p-4 rounded-2xl bg-[#1E1C29] items-center w-3/4")}
|
||||||
>
|
>
|
||||||
{currentOrder.consumer_wechat ? (
|
{currentOrder.consumer_wechat ? (
|
||||||
<View style={tailwind("flex flex-col")}>
|
<View style={tailwind("flex flex-col w-full")}>
|
||||||
<View
|
<View
|
||||||
style={tailwind("flex flex-row items-center justify-center")}
|
style={tailwind("flex flex-row items-center justify-center")}
|
||||||
>
|
>
|
||||||
|
@ -139,10 +136,14 @@ export default function AlreadyAddWechat({}) {
|
||||||
{currentOrder?.account?.name}
|
{currentOrder?.account?.name}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<Text style={tailwind("text-white text-base font-medium")}>
|
<Text style={tailwind("mt-2 text-white text-base font-medium")}>
|
||||||
Ta的微信号:
|
Ta的微信号:
|
||||||
</Text>
|
</Text>
|
||||||
<View style={tailwind("flex flex-row")}>
|
<View
|
||||||
|
style={tailwind(
|
||||||
|
"flex flex-row bg-[#FFFFFF1A] px-4 py-2 rounded-lg justify-between"
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Text style={tailwind("text-white text-base font-medium")}>
|
<Text style={tailwind("text-white text-base font-medium")}>
|
||||||
{currentOrder?.consumer_wechat}
|
{currentOrder?.consumer_wechat}
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -158,10 +159,14 @@ export default function AlreadyAddWechat({}) {
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
<Text style={tailwind("text-white text-base font-medium")}>
|
<Text style={tailwind("mt-2 text-white text-base font-medium")}>
|
||||||
添加时请备注:
|
添加时请备注:
|
||||||
</Text>
|
</Text>
|
||||||
<View style={tailwind("flex flex-row")}>
|
<View
|
||||||
|
style={tailwind(
|
||||||
|
"flex flex-row bg-[#FFFFFF1A] mb-4 px-4 py-2 rounded-lg justify-between"
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Text style={tailwind("text-white text-base font-medium")}>
|
<Text style={tailwind("text-white text-base font-medium")}>
|
||||||
{currentOrder?.consumer_note}
|
{currentOrder?.consumer_note}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
Modal,
|
Modal,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
Image as NativeImage,
|
Image as NativeImage,
|
||||||
|
Alert,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { Image } from "expo-image";
|
import { Image } from "expo-image";
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
|
@ -97,11 +98,7 @@ export default function HaveNotAddWechat({}) {
|
||||||
//保存内容到剪贴板
|
//保存内容到剪贴板
|
||||||
const copy = async (data) => {
|
const copy = async (data) => {
|
||||||
await Clipboard.setStringAsync(data);
|
await Clipboard.setStringAsync(data);
|
||||||
Toast.show({
|
Alert.alert(null, "复制成功");
|
||||||
type: "success",
|
|
||||||
text1: "已复制到剪贴板",
|
|
||||||
topOffset: 60,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
//点击我已完成添加按钮
|
//点击我已完成添加按钮
|
||||||
const handleConfirm = async () => {
|
const handleConfirm = async () => {
|
||||||
|
@ -160,7 +157,7 @@ export default function HaveNotAddWechat({}) {
|
||||||
style={tailwind("p-4 rounded-2xl bg-[#1E1C29] items-center w-3/4")}
|
style={tailwind("p-4 rounded-2xl bg-[#1E1C29] items-center w-3/4")}
|
||||||
>
|
>
|
||||||
{currentOrder.consumer_wechat ? (
|
{currentOrder.consumer_wechat ? (
|
||||||
<View style={tailwind("flex flex-col")}>
|
<View style={tailwind("flex flex-col w-full")}>
|
||||||
<View
|
<View
|
||||||
style={tailwind("flex flex-row items-center justify-center")}
|
style={tailwind("flex flex-row items-center justify-center")}
|
||||||
>
|
>
|
||||||
|
@ -176,10 +173,14 @@ export default function HaveNotAddWechat({}) {
|
||||||
{currentOrder?.account?.name}
|
{currentOrder?.account?.name}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<Text style={tailwind("text-white text-base font-medium")}>
|
<Text style={tailwind("mt-2 text-white text-base font-medium")}>
|
||||||
Ta的微信号:
|
Ta的微信号:
|
||||||
</Text>
|
</Text>
|
||||||
<View style={tailwind("flex flex-row")}>
|
<View
|
||||||
|
style={tailwind(
|
||||||
|
"flex flex-row bg-[#FFFFFF1A] px-4 py-2 rounded-lg justify-between"
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Text style={tailwind("text-white text-base font-medium")}>
|
<Text style={tailwind("text-white text-base font-medium")}>
|
||||||
{currentOrder?.consumer_wechat}
|
{currentOrder?.consumer_wechat}
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -195,10 +196,14 @@ export default function HaveNotAddWechat({}) {
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
<Text style={tailwind("text-white text-base font-medium")}>
|
<Text style={tailwind("mt-2 text-white text-base font-medium")}>
|
||||||
添加时请备注:
|
添加时请备注:
|
||||||
</Text>
|
</Text>
|
||||||
<View style={tailwind("flex flex-row")}>
|
<View
|
||||||
|
style={tailwind(
|
||||||
|
"flex flex-row bg-[#FFFFFF1A] mb-4 px-4 py-2 rounded-lg justify-between"
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Text style={tailwind("text-white text-base font-medium")}>
|
<Text style={tailwind("text-white text-base font-medium")}>
|
||||||
{currentOrder?.consumer_note}
|
{currentOrder?.consumer_note}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
12
tailwind.css
12
tailwind.css
|
@ -593,10 +593,6 @@
|
||||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity))
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity))
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-white\/30 {
|
|
||||||
background-color: rgb(255 255 255 / 0.3)
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-yellow-400 {
|
.bg-yellow-400 {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(250 204 21 / var(--tw-bg-opacity))
|
background-color: rgb(250 204 21 / var(--tw-bg-opacity))
|
||||||
|
@ -721,6 +717,14 @@
|
||||||
text-align: right
|
text-align: right
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-start {
|
||||||
|
text-align: start
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-end {
|
||||||
|
text-align: end
|
||||||
|
}
|
||||||
|
|
||||||
.text-2xl {
|
.text-2xl {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
line-height: 2rem
|
line-height: 2rem
|
||||||
|
|
|
@ -788,11 +788,6 @@
|
||||||
"backgroundColor": "rgb(255 255 255 / var(--tw-bg-opacity))"
|
"backgroundColor": "rgb(255 255 255 / var(--tw-bg-opacity))"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bg-white/30": {
|
|
||||||
"style": {
|
|
||||||
"backgroundColor": "rgb(255 255 255 / 0.3)"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bg-yellow-400": {
|
"bg-yellow-400": {
|
||||||
"style": {
|
"style": {
|
||||||
"--tw-bg-opacity": 1,
|
"--tw-bg-opacity": 1,
|
||||||
|
@ -960,6 +955,16 @@
|
||||||
"textAlign": "right"
|
"textAlign": "right"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"text-start": {
|
||||||
|
"style": {
|
||||||
|
"textAlign": "start"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"text-end": {
|
||||||
|
"style": {
|
||||||
|
"textAlign": "end"
|
||||||
|
}
|
||||||
|
},
|
||||||
"text-2xl": {
|
"text-2xl": {
|
||||||
"style": {
|
"style": {
|
||||||
"fontSize": 24,
|
"fontSize": 24,
|
||||||
|
|
Loading…
Reference in New Issue