Merge pull request '修复bug;优化ui' (#10) from fixbug into main
Reviewed-on: https://git.wishpal.cn/wishpal_ironfan/tiefen_space_app/pulls/10
This commit is contained in:
commit
746caa61fb
3
App.jsx
3
App.jsx
|
@ -56,7 +56,7 @@ import UpdateModal from "./components/UpdateModal";
|
|||
import StreamerNavigatorModal from "./components/StreamerNavigatorModal";
|
||||
import { Icon } from "@rneui/themed";
|
||||
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 { generateSignature } from "./utils/crypto";
|
||||
import * as Clipboard from "expo-clipboard";
|
||||
|
@ -161,6 +161,7 @@ const App = () => {
|
|||
const [versionData, setVersionData] = useState({});
|
||||
useEffect(() => {
|
||||
async function prepare() {
|
||||
await storeAppInfo();
|
||||
try {
|
||||
const token = await get("token");
|
||||
const account = await get("account");
|
||||
|
|
|
@ -44,24 +44,24 @@ export default function SpacePost({ data }) {
|
|||
const handleOnTextLayout = (event) => {
|
||||
if (!textInit) return;
|
||||
const line = event.nativeEvent.lines.length;
|
||||
if (line > 5 && data.is_zone_moment_unlocked === 1) {
|
||||
setNumberOfLines(5);
|
||||
if (line > 7 && data.is_zone_moment_unlocked === 1) {
|
||||
setNumberOfLines(7);
|
||||
setIsFullTextBtnShow(true);
|
||||
}
|
||||
if (line > 5 && data.is_zone_moment_unlocked === 0) {
|
||||
if (data.text_visible_range <= 5)
|
||||
if (line > 7 && data.is_zone_moment_unlocked === 0) {
|
||||
if (data.text_visible_range <= 7)
|
||||
setNumberOfLines(data.text_visible_range);
|
||||
if (data.text_visible_range > 5) {
|
||||
setNumberOfLines(5);
|
||||
if (data.text_visible_range > 7) {
|
||||
setNumberOfLines(7);
|
||||
setIsFullTextBtnShow(true);
|
||||
}
|
||||
}
|
||||
if (line <= 5 && data.is_zone_moment_unlocked === 1) {
|
||||
if (line <= 7 && data.is_zone_moment_unlocked === 1) {
|
||||
setNumberOfLines(0);
|
||||
if (line <= 5 && data.is_zone_moment_unlocked === 0) {
|
||||
if (data.text_visible_range <= 5)
|
||||
if (line <= 7 && data.is_zone_moment_unlocked === 0) {
|
||||
if (data.text_visible_range <= 7)
|
||||
setNumberOfLines(data.text_visible_range);
|
||||
if (data.text_visible_range > 5) setNumberOfLines(0);
|
||||
if (data.text_visible_range > 7) setNumberOfLines(0);
|
||||
}
|
||||
}
|
||||
setTextInit(false);
|
||||
|
@ -76,9 +76,9 @@ export default function SpacePost({ data }) {
|
|||
} else {
|
||||
setIsTextCollapsed(true);
|
||||
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
|
||||
: 5
|
||||
: 7
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -610,7 +610,7 @@ function ImageDisplay({
|
|||
|
||||
const { showImageViewer } = useImageViewer();
|
||||
const images = displayMedia.map((item) => {
|
||||
return { url: item.urls[0] };
|
||||
return { url: item?.urls[0] };
|
||||
});
|
||||
|
||||
const [isCollapsed, setIsCollapsed] = useState(true);
|
||||
|
|
|
@ -157,7 +157,6 @@ export default function CreateImagePost({ navigation, route }) {
|
|||
body: JSON.stringify(body),
|
||||
}
|
||||
);
|
||||
console.log(response);
|
||||
const data = await response.json();
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
|
|
|
@ -236,6 +236,7 @@ export default function EditSpacePost({ navigation, route }) {
|
|||
: 1,
|
||||
is_blurring_cover: blurCover ? 1 : 0,
|
||||
is_ironfan_visible: isFreeForIronfan ? 1 : 0,
|
||||
price: parseFloat(price) ? parseInt(parseFloat(price) * 100, 10) : null,
|
||||
};
|
||||
const signature = await generateSignature(body);
|
||||
const _response = await fetch(
|
||||
|
|
|
@ -81,10 +81,11 @@ export default function SpaceIntroduce({ navigation, route }) {
|
|||
}, [])
|
||||
);
|
||||
|
||||
const images = data?.streamer_ext?.album?.images?.map((image, index) => {
|
||||
if (index > 4) return;
|
||||
return image?.urls[0];
|
||||
});
|
||||
const images = data?.streamer_ext?.album?.images
|
||||
?.slice(0, 5)
|
||||
?.map((image) => {
|
||||
return image?.urls[0];
|
||||
});
|
||||
const imagesForImageViewer = images?.map((url) => ({ url }));
|
||||
|
||||
//当空间价格为0时,直接加入空间
|
||||
|
@ -149,7 +150,7 @@ export default function SpaceIntroduce({ navigation, route }) {
|
|||
transition={500}
|
||||
cachePolicy="disk"
|
||||
style={{
|
||||
aspectRatio: "25/17",
|
||||
aspectRatio: "1/1",
|
||||
...tailwind("w-full"),
|
||||
}}
|
||||
/>
|
||||
|
@ -183,7 +184,7 @@ export default function SpaceIntroduce({ navigation, route }) {
|
|||
>
|
||||
{data?.streamer_ext?.name}
|
||||
</Text>
|
||||
<View style={tailwind("flex-row flex-wrap mt-1.5")}>
|
||||
<View style={tailwind("flex-row flex-nowrap mt-1.5")}>
|
||||
<View
|
||||
style={tailwind(
|
||||
"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}
|
||||
</Text>
|
||||
</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>
|
||||
<TouchableOpacity
|
||||
|
@ -222,6 +211,26 @@ export default function SpaceIntroduce({ navigation, route }) {
|
|||
</Text>
|
||||
</TouchableOpacity>
|
||||
</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
|
||||
style={tailwind(
|
||||
"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={() =>
|
||||
navigation.navigate("WebWithHeader", {
|
||||
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")}
|
||||
|
|
Loading…
Reference in New Issue