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