anln_0000001_1.8 (#32)
Co-authored-by: al <al@cdhncy.com> Reviewed-on: https://git.wishpal.cn/wishpal_ironfan/tiefen_space_app/pulls/32
This commit is contained in:
parent
7eda5e4fd6
commit
f5f107994f
2
App.jsx
2
App.jsx
|
@ -563,7 +563,7 @@ const App = () => {
|
||||||
onPress={() => navigation.goBack()}
|
onPress={() => navigation.goBack()}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
title: "动态",
|
title: "广场动态",
|
||||||
headerTitleStyle: { color: "white" },
|
headerTitleStyle: { color: "white" },
|
||||||
headerStyle: { backgroundColor: "#07050A" },
|
headerStyle: { backgroundColor: "#07050A" },
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -14,7 +14,6 @@ import { useImageViewer } from "../../context/ImageViewProvider";
|
||||||
import VideoModal from "../VideoModal";
|
import VideoModal from "../VideoModal";
|
||||||
import * as ImagePicker from "expo-image-picker";
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import * as VideoThumbnails from "expo-video-thumbnails";
|
import * as VideoThumbnails from "expo-video-thumbnails";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
props格式:
|
props格式:
|
||||||
setDragging 返回正在拖动的状态,用于该组件嵌套在ScrollView中的时候禁用ScrollView的滚动
|
setDragging 返回正在拖动的状态,用于该组件嵌套在ScrollView中的时候禁用ScrollView的滚动
|
||||||
|
@ -65,6 +64,7 @@ export default function MediaPicker({
|
||||||
allowsMultipleSelection: true,
|
allowsMultipleSelection: true,
|
||||||
selectionLimit: maxCount - _assets.length,
|
selectionLimit: maxCount - _assets.length,
|
||||||
quality: 1,
|
quality: 1,
|
||||||
|
// exif: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
|
|
|
@ -129,6 +129,7 @@ export default function Post({ data, isOwn = false, tagElement = null }) {
|
||||||
...tailwind(
|
...tailwind(
|
||||||
"ml-1 justify-center items-center rounded-full px-3 h-6"
|
"ml-1 justify-center items-center rounded-full px-3 h-6"
|
||||||
),
|
),
|
||||||
|
display: !isOwn ? "flex" : "none",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text style={tailwind("text-white text-xs")}>
|
<Text style={tailwind("text-white text-xs")}>
|
||||||
|
@ -166,51 +167,60 @@ export default function Post({ data, isOwn = false, tagElement = null }) {
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
...tailwind("flex flex-row items-center justify-between h-8"),
|
...tailwind("flex flex-row items-center justify-between h-8"),
|
||||||
display: !isOwn ? "flex" : "none",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{data?.streamer_ext?.is_active_within_a_week === 1 ? (
|
<View
|
||||||
<TouchableOpacity
|
style={{
|
||||||
onPress={() =>
|
display: !isOwn ? "flex" : "none",
|
||||||
navigation.navigate("SpaceIntroduce", { mid: data?.mid })
|
}}
|
||||||
}
|
>
|
||||||
style={tailwind("flex flex-row items-center")}
|
{data?.streamer_ext?.is_active_within_a_week === 1 ? (
|
||||||
>
|
|
||||||
<NativeImage
|
|
||||||
source={require("../../assets/icon/others/space_new_post.png")}
|
|
||||||
/>
|
|
||||||
<Text style={tailwind("text-[#FF669E] font-medium text-xs")}>
|
|
||||||
空间
|
|
||||||
{formatZoneUpdateTime(
|
|
||||||
data?.streamer_ext
|
|
||||||
?.days_elapsed_since_the_last_zones_update
|
|
||||||
)}
|
|
||||||
有更新
|
|
||||||
</Text>
|
|
||||||
<NativeImage
|
|
||||||
source={require("../../assets/icon/others/pinklink.png")}
|
|
||||||
/>
|
|
||||||
</TouchableOpacity>
|
|
||||||
) : (
|
|
||||||
data?.streamer_ext?.zones?.length !== 0 && (
|
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
navigation.navigate("SpaceIntroduce", { mid: data?.mid })
|
navigation.navigate("SpaceIntroduce", { mid: data?.mid })
|
||||||
}
|
}
|
||||||
style={tailwind("flex flex-row items-center")}
|
style={tailwind("flex flex-row items-center")}
|
||||||
>
|
>
|
||||||
|
<NativeImage
|
||||||
|
source={require("../../assets/icon/others/space_new_post.png")}
|
||||||
|
/>
|
||||||
<Text
|
<Text
|
||||||
style={tailwind("text-[#FFFFFFB2] font-medium text-xs")}
|
style={tailwind("text-[#FF669E] font-medium text-xs")}
|
||||||
>
|
>
|
||||||
查看TA的空间
|
空间
|
||||||
|
{formatZoneUpdateTime(
|
||||||
|
data?.streamer_ext
|
||||||
|
?.days_elapsed_since_the_last_zones_update
|
||||||
|
)}
|
||||||
|
有更新
|
||||||
</Text>
|
</Text>
|
||||||
<NativeImage
|
<NativeImage
|
||||||
style={{ right: 10, transform: [{ scale: 0.75 }] }}
|
source={require("../../assets/icon/others/pinklink.png")}
|
||||||
source={require("../../assets/icon/32DP/smalllink.png")}
|
|
||||||
/>
|
/>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)
|
) : (
|
||||||
)}
|
data?.streamer_ext?.zones?.length !== 0 && (
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() =>
|
||||||
|
navigation.navigate("SpaceIntroduce", {
|
||||||
|
mid: data?.mid,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
style={tailwind("flex flex-row items-center")}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={tailwind("text-[#FFFFFFB2] font-medium text-xs")}
|
||||||
|
>
|
||||||
|
查看TA的空间
|
||||||
|
</Text>
|
||||||
|
<NativeImage
|
||||||
|
style={{ right: 10, transform: [{ scale: 0.75 }] }}
|
||||||
|
source={require("../../assets/icon/32DP/smalllink.png")}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
<View style={tailwind("flex flex-row items-center ml-auto")}>
|
<View style={tailwind("flex flex-row items-center ml-auto")}>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={tailwind("flex flex-row items-center")}
|
style={tailwind("flex flex-row items-center")}
|
||||||
|
|
|
@ -189,7 +189,7 @@ export default function CreateImagePost({ navigation, route }) {
|
||||||
//提交成功后显示Toast并返回上一页
|
//提交成功后显示Toast并返回上一页
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "success",
|
type: "success",
|
||||||
text1: "发布成功",
|
text1: "上传成功,请耐心等待审核",
|
||||||
topOffset: 60,
|
topOffset: 60,
|
||||||
});
|
});
|
||||||
navigation.goBack();
|
navigation.goBack();
|
||||||
|
|
|
@ -95,7 +95,7 @@ export default function CreatePost({ navigation, route }) {
|
||||||
//提交成功后显示Toast并返回上一页
|
//提交成功后显示Toast并返回上一页
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "success",
|
type: "success",
|
||||||
text1: "发布成功",
|
text1: "上传成功,请耐心等待审核",
|
||||||
topOffset: 60,
|
topOffset: 60,
|
||||||
});
|
});
|
||||||
navigation.goBack();
|
navigation.goBack();
|
||||||
|
|
|
@ -165,7 +165,7 @@ export default function CreateVideoPost({ navigation, route }) {
|
||||||
//提交成功后显示Toast并返回上一页
|
//提交成功后显示Toast并返回上一页
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "success",
|
type: "success",
|
||||||
text1: "发布成功",
|
text1: "上传成功,请耐心等待审核",
|
||||||
topOffset: 60,
|
topOffset: 60,
|
||||||
});
|
});
|
||||||
navigation.goBack();
|
navigation.goBack();
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
Platform,
|
Platform,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import React, { useState, useEffect, useCallback } from "react";
|
import React, { useState, useEffect } 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 MediaPicker from "../../components/MediaPicker";
|
import MediaPicker from "../../components/MediaPicker";
|
||||||
|
@ -17,8 +17,6 @@ import Toast from "react-native-toast-message";
|
||||||
import { multiUpload } from "../../utils/upload";
|
import { multiUpload } from "../../utils/upload";
|
||||||
import baseRequest from "../../utils/baseRequest";
|
import baseRequest from "../../utils/baseRequest";
|
||||||
import { generateSignature } from "../../utils/crypto";
|
import { generateSignature } from "../../utils/crypto";
|
||||||
import { Image } from "expo-image";
|
|
||||||
import { Icon } from "@rneui/themed";
|
|
||||||
import { Button, Switch } from "@rneui/themed";
|
import { Button, Switch } from "@rneui/themed";
|
||||||
import MediaGrid from "../../components/MediaGrid";
|
import MediaGrid from "../../components/MediaGrid";
|
||||||
import requireAPI from "../../utils/requireAPI";
|
import requireAPI from "../../utils/requireAPI";
|
||||||
|
@ -92,6 +90,7 @@ export default function EditSpacePost({ navigation, route }) {
|
||||||
paid_text,
|
paid_text,
|
||||||
price,
|
price,
|
||||||
media_visible_range,
|
media_visible_range,
|
||||||
|
text_visible_range,
|
||||||
is_creating_paid_text,
|
is_creating_paid_text,
|
||||||
is_ironfan_visible,
|
is_ironfan_visible,
|
||||||
is_blurring_cover,
|
is_blurring_cover,
|
||||||
|
@ -99,13 +98,16 @@ export default function EditSpacePost({ navigation, route }) {
|
||||||
media_component,
|
media_component,
|
||||||
} = _data.data.list[0];
|
} = _data.data.list[0];
|
||||||
setContent(
|
setContent(
|
||||||
paid_text ? text.slice(0, text.length - paid_text.length) : text
|
is_creating_paid_text
|
||||||
|
? text.slice(0, text.length - paid_text.length)
|
||||||
|
: text
|
||||||
);
|
);
|
||||||
setPrice(price ? price / 100 : 0);
|
setPrice((price ? price / 100 : 0).toString());
|
||||||
setTextVisibleRange(media_visible_range);
|
setTextVisibleRange(text_visible_range.toString());
|
||||||
|
setImageVisibleRange(media_visible_range.toString());
|
||||||
setBlurCover(is_blurring_cover === 1);
|
setBlurCover(is_blurring_cover === 1);
|
||||||
setIsFreeForIronfan(is_ironfan_visible === 1);
|
setIsFreeForIronfan(is_ironfan_visible === 1);
|
||||||
setPaidText(!paid_text ?? paid_text.substring(1));
|
setPaidText(paid_text ? paid_text.substring(1) : "");
|
||||||
setIsCreatingPaidText(is_creating_paid_text === 1);
|
setIsCreatingPaidText(is_creating_paid_text === 1);
|
||||||
setOldMediaAssets(
|
setOldMediaAssets(
|
||||||
m_type === 1 ? media_component.images : media_component.videos
|
m_type === 1 ? media_component.images : media_component.videos
|
||||||
|
@ -411,7 +413,11 @@ export default function EditSpacePost({ navigation, route }) {
|
||||||
|
|
||||||
<MediaPicker
|
<MediaPicker
|
||||||
setDragging={setDragging}
|
setDragging={setDragging}
|
||||||
maxCount={initalData.m_type === 1 ? 30 : 1}
|
maxCount={
|
||||||
|
initalData.m_type === 1
|
||||||
|
? 30 - oldMediaAssets.length
|
||||||
|
: 1 - oldMediaAssets.length
|
||||||
|
}
|
||||||
type={initalData.m_type === 1 ? "image" : "video"}
|
type={initalData.m_type === 1 ? "image" : "video"}
|
||||||
setAssets={setNewMediaAssets}
|
setAssets={setNewMediaAssets}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -4,12 +4,10 @@ import {
|
||||||
TextInput,
|
TextInput,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Modal,
|
|
||||||
KeyboardAvoidingView,
|
KeyboardAvoidingView,
|
||||||
TouchableOpacity,
|
|
||||||
Platform,
|
Platform,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import React, { useState, useEffect, useCallback } from "react";
|
import React, { useState, useEffect } 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 MediaPicker from "../../components/MediaPicker";
|
import MediaPicker from "../../components/MediaPicker";
|
||||||
|
@ -85,7 +83,7 @@ export default function EditStreamerPost({ navigation, route }) {
|
||||||
</Text>
|
</Text>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
}, [isSubmitting, handleSubmit, formData, mediaAssets]);
|
}, [isSubmitting, handleSubmit, formData, mediaAssets, oldMediaAssets]);
|
||||||
//是否正在拖动图片,用于禁用ScrollView的滚动
|
//是否正在拖动图片,用于禁用ScrollView的滚动
|
||||||
const [dragging, setDragging] = useState(false);
|
const [dragging, setDragging] = useState(false);
|
||||||
|
|
||||||
|
@ -231,7 +229,11 @@ export default function EditStreamerPost({ navigation, route }) {
|
||||||
)}
|
)}
|
||||||
<MediaPicker
|
<MediaPicker
|
||||||
setDragging={setDragging}
|
setDragging={setDragging}
|
||||||
maxCount={mType === 1 ? 30 : 1}
|
maxCount={
|
||||||
|
mType === 1
|
||||||
|
? 9 - oldMediaAssets.length
|
||||||
|
: 1 - oldMediaAssets.length
|
||||||
|
}
|
||||||
type={mType === 1 ? "image" : "video"}
|
type={mType === 1 ? "image" : "video"}
|
||||||
setAssets={setMediaAssets}
|
setAssets={setMediaAssets}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue