修复bug;优化ui
This commit is contained in:
parent
efa9f07ee7
commit
5b869b5151
3
App.jsx
3
App.jsx
|
@ -56,7 +56,7 @@ import UpdateModal from "./components/UpdateModal";
|
||||||
import StreamerNavigatorModal from "./components/StreamerNavigatorModal";
|
import StreamerNavigatorModal from "./components/StreamerNavigatorModal";
|
||||||
import { Icon } from "@rneui/themed";
|
import { Icon } from "@rneui/themed";
|
||||||
import { StatusBar } from "expo-status-bar";
|
import { StatusBar } from "expo-status-bar";
|
||||||
import { save, get, remove } from "./utils/storeInfo";
|
import { save, get, remove, storeAppInfo } from "./utils/storeInfo";
|
||||||
import baseRequest from "./utils/baseRequest";
|
import baseRequest from "./utils/baseRequest";
|
||||||
import { generateSignature } from "./utils/crypto";
|
import { generateSignature } from "./utils/crypto";
|
||||||
import * as Clipboard from "expo-clipboard";
|
import * as Clipboard from "expo-clipboard";
|
||||||
|
@ -161,6 +161,7 @@ const App = () => {
|
||||||
const [versionData, setVersionData] = useState({});
|
const [versionData, setVersionData] = useState({});
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function prepare() {
|
async function prepare() {
|
||||||
|
await storeAppInfo();
|
||||||
try {
|
try {
|
||||||
const token = await get("token");
|
const token = await get("token");
|
||||||
const account = await get("account");
|
const account = await get("account");
|
||||||
|
|
|
@ -44,24 +44,24 @@ export default function SpacePost({ data }) {
|
||||||
const handleOnTextLayout = (event) => {
|
const handleOnTextLayout = (event) => {
|
||||||
if (!textInit) return;
|
if (!textInit) return;
|
||||||
const line = event.nativeEvent.lines.length;
|
const line = event.nativeEvent.lines.length;
|
||||||
if (line > 5 && data.is_zone_moment_unlocked === 1) {
|
if (line > 7 && data.is_zone_moment_unlocked === 1) {
|
||||||
setNumberOfLines(5);
|
setNumberOfLines(7);
|
||||||
setIsFullTextBtnShow(true);
|
setIsFullTextBtnShow(true);
|
||||||
}
|
}
|
||||||
if (line > 5 && data.is_zone_moment_unlocked === 0) {
|
if (line > 7 && data.is_zone_moment_unlocked === 0) {
|
||||||
if (data.text_visible_range <= 5)
|
if (data.text_visible_range <= 7)
|
||||||
setNumberOfLines(data.text_visible_range);
|
setNumberOfLines(data.text_visible_range);
|
||||||
if (data.text_visible_range > 5) {
|
if (data.text_visible_range > 7) {
|
||||||
setNumberOfLines(5);
|
setNumberOfLines(7);
|
||||||
setIsFullTextBtnShow(true);
|
setIsFullTextBtnShow(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (line <= 5 && data.is_zone_moment_unlocked === 1) {
|
if (line <= 7 && data.is_zone_moment_unlocked === 1) {
|
||||||
setNumberOfLines(0);
|
setNumberOfLines(0);
|
||||||
if (line <= 5 && data.is_zone_moment_unlocked === 0) {
|
if (line <= 7 && data.is_zone_moment_unlocked === 0) {
|
||||||
if (data.text_visible_range <= 5)
|
if (data.text_visible_range <= 7)
|
||||||
setNumberOfLines(data.text_visible_range);
|
setNumberOfLines(data.text_visible_range);
|
||||||
if (data.text_visible_range > 5) setNumberOfLines(0);
|
if (data.text_visible_range > 7) setNumberOfLines(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setTextInit(false);
|
setTextInit(false);
|
||||||
|
@ -76,9 +76,9 @@ export default function SpacePost({ data }) {
|
||||||
} else {
|
} else {
|
||||||
setIsTextCollapsed(true);
|
setIsTextCollapsed(true);
|
||||||
setNumberOfLines(
|
setNumberOfLines(
|
||||||
data.is_zone_moment_unlocked === 0 && data.text_visible_range <= 5
|
data.is_zone_moment_unlocked === 0 && data.text_visible_range <= 7
|
||||||
? data.text_visible_range
|
? data.text_visible_range
|
||||||
: 5
|
: 7
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -610,7 +610,7 @@ function ImageDisplay({
|
||||||
|
|
||||||
const { showImageViewer } = useImageViewer();
|
const { showImageViewer } = useImageViewer();
|
||||||
const images = displayMedia.map((item) => {
|
const images = displayMedia.map((item) => {
|
||||||
return { url: item.urls[0] };
|
return { url: item?.urls[0] };
|
||||||
});
|
});
|
||||||
|
|
||||||
const [isCollapsed, setIsCollapsed] = useState(true);
|
const [isCollapsed, setIsCollapsed] = useState(true);
|
||||||
|
|
|
@ -157,7 +157,6 @@ export default function CreateImagePost({ navigation, route }) {
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
console.log(response);
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (data.ret === -1) {
|
if (data.ret === -1) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
|
|
|
@ -236,6 +236,7 @@ export default function EditSpacePost({ navigation, route }) {
|
||||||
: 1,
|
: 1,
|
||||||
is_blurring_cover: blurCover ? 1 : 0,
|
is_blurring_cover: blurCover ? 1 : 0,
|
||||||
is_ironfan_visible: isFreeForIronfan ? 1 : 0,
|
is_ironfan_visible: isFreeForIronfan ? 1 : 0,
|
||||||
|
price: parseFloat(price) ? parseInt(parseFloat(price) * 100, 10) : null,
|
||||||
};
|
};
|
||||||
const signature = await generateSignature(body);
|
const signature = await generateSignature(body);
|
||||||
const _response = await fetch(
|
const _response = await fetch(
|
||||||
|
|
|
@ -81,10 +81,11 @@ export default function SpaceIntroduce({ navigation, route }) {
|
||||||
}, [])
|
}, [])
|
||||||
);
|
);
|
||||||
|
|
||||||
const images = data?.streamer_ext?.album?.images?.map((image, index) => {
|
const images = data?.streamer_ext?.album?.images
|
||||||
if (index > 4) return;
|
?.slice(0, 5)
|
||||||
return image?.urls[0];
|
?.map((image) => {
|
||||||
});
|
return image?.urls[0];
|
||||||
|
});
|
||||||
const imagesForImageViewer = images?.map((url) => ({ url }));
|
const imagesForImageViewer = images?.map((url) => ({ url }));
|
||||||
|
|
||||||
//当空间价格为0时,直接加入空间
|
//当空间价格为0时,直接加入空间
|
||||||
|
@ -149,7 +150,7 @@ export default function SpaceIntroduce({ navigation, route }) {
|
||||||
transition={500}
|
transition={500}
|
||||||
cachePolicy="disk"
|
cachePolicy="disk"
|
||||||
style={{
|
style={{
|
||||||
aspectRatio: "25/17",
|
aspectRatio: "1/1",
|
||||||
...tailwind("w-full"),
|
...tailwind("w-full"),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -183,7 +184,7 @@ export default function SpaceIntroduce({ navigation, route }) {
|
||||||
>
|
>
|
||||||
{data?.streamer_ext?.name}
|
{data?.streamer_ext?.name}
|
||||||
</Text>
|
</Text>
|
||||||
<View style={tailwind("flex-row flex-wrap mt-1.5")}>
|
<View style={tailwind("flex-row flex-nowrap mt-1.5")}>
|
||||||
<View
|
<View
|
||||||
style={tailwind(
|
style={tailwind(
|
||||||
"flex-row items-center py-0.5 px-2 mr-2 bg-[#FFFFFF1A] rounded-full"
|
"flex-row items-center py-0.5 px-2 mr-2 bg-[#FFFFFF1A] rounded-full"
|
||||||
|
@ -196,18 +197,6 @@ export default function SpaceIntroduce({ navigation, route }) {
|
||||||
{data?.streamer_ext?.user_id}
|
{data?.streamer_ext?.user_id}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View
|
|
||||||
style={tailwind(
|
|
||||||
"flex-row items-center py-0.5 px-2 mr-2 bg-[#FFFFFF1A] rounded-full"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<NativeImage
|
|
||||||
source={require("../../assets/icon/12DP/edit.png")}
|
|
||||||
/>
|
|
||||||
<Text style={tailwind("text-white text-xs font-medium ml-0.5")}>
|
|
||||||
{data?.zone_moment_count}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
@ -222,6 +211,26 @@ export default function SpaceIntroduce({ navigation, route }) {
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
<View style={tailwind("flex flex-row flex-nowrap justify-around mt-2")}>
|
||||||
|
<View style={tailwind("flex flex-col items-center")}>
|
||||||
|
<Text style={tailwind("text-white text-2xl font-medium")}>
|
||||||
|
{data?.zone_moment_count}
|
||||||
|
</Text>
|
||||||
|
<Text style={tailwind("text-white text-sm font-medium")}>动态</Text>
|
||||||
|
</View>
|
||||||
|
<View style={tailwind("flex flex-col items-center")}>
|
||||||
|
<Text style={tailwind("text-white text-2xl font-medium")}>
|
||||||
|
{data?.image_count}
|
||||||
|
</Text>
|
||||||
|
<Text style={tailwind("text-white text-sm font-medium")}>照片</Text>
|
||||||
|
</View>
|
||||||
|
<View style={tailwind("flex flex-col items-center")}>
|
||||||
|
<Text style={tailwind("text-white text-2xl font-medium")}>
|
||||||
|
{data?.video_count}
|
||||||
|
</Text>
|
||||||
|
<Text style={tailwind("text-white text-sm font-medium")}>视频</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
<View
|
<View
|
||||||
style={tailwind(
|
style={tailwind(
|
||||||
"flex flex-col w-full rounded-t-3xl bg-[#07050A] mt-4 p-4"
|
"flex flex-col w-full rounded-t-3xl bg-[#07050A] mt-4 p-4"
|
||||||
|
|
|
@ -143,7 +143,7 @@ export default function Wallet({ navigation, route }) {
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
navigation.navigate("WebWithHeader", {
|
navigation.navigate("WebWithHeader", {
|
||||||
title: "收支明细",
|
title: "收支明细",
|
||||||
uri: process.env.EXPO_PUBLIC_WEB_URL + "/bill/cost",
|
uri: process.env.EXPO_PUBLIC_WEB_URL + "/bill/recharge",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
style={tailwind("flex-row justify-between items-center py-4")}
|
style={tailwind("flex-row justify-between items-center py-4")}
|
||||||
|
|
Loading…
Reference in New Issue