完善空间功能;完善MyModal组件;部分统一卡片填充色

This commit is contained in:
yezian 2024-04-23 19:08:01 +08:00
parent a9fe9be78e
commit c386fa0158
11 changed files with 143 additions and 71 deletions

View File

@ -21,8 +21,8 @@
"supportsTablet": true,
"bundleIdentifier": "com.jueweijue.ironfans",
"infoPlist": {
"NSPhotoLibraryUsageDescription": "允许铁粉空间访问您的相册",
"NSPhotoLibraryAddUsageDescription": "允许铁粉空间保存图片到相册"
"NSPhotoLibraryUsageDescription": "当您授权允许访问相册后您能够在APP中浏览相册中的图片以便您选择合适的图片进行上传用于头像或其他位置",
"NSPhotoLibraryAddUsageDescription": "当您授权允许保存图片到相册您能够将APP内容保存到本地以便您稍后在相册中继续查看"
}
},
"android": {
@ -52,8 +52,8 @@
[
"expo-media-library",
{
"photosPermission": "允许铁粉空间访问您的相册,以便您选择合适的图片进行上传",
"savePhotosPermission": "允许铁粉空间保存图片到相册,以便您稍后在相册中继续查看",
"photosPermission": "当您授权允许访问相册后您能够在APP中浏览相册中的图片以便您选择合适的图片进行上传用于头像或其他位置",
"savePhotosPermission": "当您授权允许保存图片到相册您能够将APP内容保存到本地,以便您稍后在相册中继续查看",
"isAccessMediaLocationEnabled": true
}
],

View File

@ -73,7 +73,7 @@ export default function CreatePostModal({ visible, setVisible }) {
<TouchableOpacity
activeOpacity={1}
style={tailwind(
"flex flex-col mt-auto mb-2 h-48 bg-[#17171A] rounded-3xl"
"flex flex-col mt-auto mb-2 h-48 bg-[#17161A] rounded-3xl"
)}
>
<View

View File

@ -10,9 +10,6 @@ import baseRequest from "../../utils/baseRequest";
import Toast from "react-native-toast-message";
import { generateSignature } from "../../utils/crypto";
//todo:
//todo:线
export default function GetWechatModal({ visible, setVisible, streamerMid }) {
const tailwind = useTailwind();
const blurhash = "LcKUTa%gOYWBYRt6xuoJo~s8V@fk";

View File

@ -54,7 +54,13 @@ export default function MediaPickerModal({
setPermissionStatus("granted");
return;
}
setRequestModalVisible(true);
if (status === "undetermined") {
setRequestModalVisible(true);
return;
}
if (status === "denied") {
requestMediaLibraryPermissions();
}
}
checkMediaLibraryPermissions();
}
@ -276,9 +282,9 @@ export default function MediaPickerModal({
video: ImagePickerVideo,
}}
onSave={async (assets) => {
setVisible(false);
const editedAssets = await changeToLocalUri(assets);
setAssets(editedAssets);
setVisible(false);
}}
onCancel={() => {
setVisible(false);
@ -300,20 +306,18 @@ export default function MediaPickerModal({
title="权限申请"
content="该功能需要开启存储权限,用于选择上传媒体文件"
confirmText="继续"
cancel={() => {
setRequestModalVisible(false);
}}
confirm={() => {
custom={() => {
setRequestModalVisible(false);
requestMediaLibraryPermissions();
}}
customText="继续"
/>
<MyModal
visible={overlayVisible}
setVisible={setOverlayVisible}
title="您还未打开媒体权限"
content="是否前往设置开启权限?"
confirmText="继续"
title="未获得相册权限"
content="请先前往设置打开相关权限后重试"
confirmText="去设置"
cancel={() => {
setOverlayVisible(false);
}}

View File

@ -8,8 +8,11 @@ export default function MyModal({
title,
content,
confirm,
custom,
customText,
confirmText,
cancelText,
confirmLeft = false,
}) {
const tailwind = useTailwind();
return (
@ -41,32 +44,77 @@ export default function MyModal({
{content}
</Text>
<View style={tailwind("flex-row justify-around")}>
<TouchableOpacity
onPress={() => setVisible(false)}
style={tailwind(
"border-r-2 border-t-2 border-[#2c2b2f] basis-1/2 pt-1 justify-center items-center"
)}
>
<Text
{custom ? (
<TouchableOpacity
onPress={custom}
style={tailwind(
"text-[#FFFFFF80] text-base font-medium text-center"
"border-t-2 border-[#2c2b2f] w-full pt-1 justify-center items-center"
)}
>
{cancelText ? cancelText : "取消"}
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={confirm}
style={tailwind(
"border-t-2 border-[#2c2b2f] basis-1/2 pt-1 justify-center items-center"
)}
>
<Text
style={tailwind("text-white text-base font-medium text-center")}
>
{confirmText ? confirmText : "确认"}
</Text>
</TouchableOpacity>
<Text
style={tailwind(
"text-white text-base font-medium text-center"
)}
>
{customText ? customText : "确认"}
</Text>
</TouchableOpacity>
) : (
<>
{confirmLeft && (
<TouchableOpacity
onPress={confirm}
style={tailwind(
"border-r-2 border-t-2 border-[#2c2b2f] basis-1/2 pt-1 justify-center items-center"
)}
>
<Text
style={tailwind(
"text-white text-base font-medium text-center"
)}
>
{confirmText ? confirmText : "确认"}
</Text>
</TouchableOpacity>
)}
<TouchableOpacity
onPress={() => setVisible(false)}
style={
confirmLeft
? tailwind(
"border-t-2 border-[#2c2b2f] basis-1/2 pt-1 justify-center items-center"
)
: tailwind(
"border-r-2 border-t-2 border-[#2c2b2f] basis-1/2 pt-1 justify-center items-center"
)
}
>
<Text
style={tailwind(
"text-[#FFFFFF80] text-base font-medium text-center"
)}
>
{cancelText ? cancelText : "取消"}
</Text>
</TouchableOpacity>
{!confirmLeft && (
<TouchableOpacity
onPress={confirm}
style={tailwind(
"border-t-2 border-[#2c2b2f] basis-1/2 pt-1 justify-center items-center"
)}
>
<Text
style={tailwind(
"text-white text-base font-medium text-center"
)}
>
{confirmText ? confirmText : "确认"}
</Text>
</TouchableOpacity>
)}
</>
)}
</View>
</View>
</View>

View File

@ -285,7 +285,11 @@ export default function SpacePost({ data }) {
...tailwind("text-sm font-medium"),
}}
>
{data.is_ironfan_visible === 1 ? "铁粉" : "超粉"}免费查看
{data.is_ironfan_visible === 1
? "铁粉免费查看"
: data.is_superfanship_enabled === 1
? "超粉免费查看"
: "付费解锁"}
</Text>
<Icon
type="ionicon"

View File

@ -19,7 +19,6 @@ import baseRequest from "../../utils/baseRequest";
import { generateSignature } from "../../utils/crypto";
import MyModal from "../../components/MyModal";
//todo:使MyModal
export default function CreateImagePost({ navigation, route }) {
const tailwind = useTailwind();
const insets = useSafeAreaInsets();
@ -250,16 +249,14 @@ export default function CreateImagePost({ navigation, route }) {
setVisible={setIsBlockModalVisible}
title="当前无法发帖"
content="您当前审核未通过动态过多,请修改后再试"
cancel={() => {
setIsBlockModalVisible(false);
}}
confirm={() => {
custom={() => {
setIsBlockModalVisible(false);
setTimeout(
() => navigation.replace("VisibleToOneselfSpacePosts"),
500
);
}}
customText="去修改"
/>
<View style={tailwind("p-4")}>
<View style={tailwind("mb-4")}>
@ -335,7 +332,7 @@ export default function CreateImagePost({ navigation, route }) {
style={{
gap: 8,
...tailwind(
"flex flex-col mt-auto mb-2 bg-[#17171A] rounded-3xl"
"flex flex-col mt-auto mb-2 bg-[#17161A] rounded-3xl"
),
}}
>

View File

@ -19,7 +19,6 @@ import baseRequest from "../../utils/baseRequest";
import { generateSignature } from "../../utils/crypto";
import MyModal from "../../components/MyModal";
//todo:使MyModal
export default function CreateVideoPost({ navigation, route }) {
const tailwind = useTailwind();
const insets = useSafeAreaInsets();
@ -226,16 +225,14 @@ export default function CreateVideoPost({ navigation, route }) {
setVisible={setIsBlockModalVisible}
title="当前无法发帖"
content="您当前审核未通过动态过多,请修改后再试"
cancel={() => {
setIsBlockModalVisible(false);
}}
confirm={() => {
custom={() => {
setIsBlockModalVisible(false);
setTimeout(
() => navigation.replace("VisibleToOneselfSpacePosts"),
500
);
}}
customText="去修改"
/>
<View style={tailwind("p-4")}>
<View style={tailwind("mb-4")}>
@ -311,7 +308,7 @@ export default function CreateVideoPost({ navigation, route }) {
style={{
gap: 8,
...tailwind(
"flex flex-col mt-auto mb-2 bg-[#17171A] rounded-3xl"
"flex flex-col mt-auto mb-2 bg-[#17161A] rounded-3xl"
),
}}
>

View File

@ -367,7 +367,7 @@ export default function AgencySetting({ navigation, route }) {
style={{
gap: 12,
...tailwind(
"flex flex-col w-full bg-[#17171A] rounded-3xl px-4 py-6"
"flex flex-col w-full bg-[#17161A] rounded-3xl px-4 py-6"
),
}}
>

View File

@ -350,24 +350,49 @@ export default function CollaboratorSetting({ navigation, route }) {
(item) => item.collaborator_mid === selfMid
);
return (
<View
<ScrollView
style={{
gap: 8,
...tailwind(
"flex flex-col border border-2 border-[#2c2b2f] rounded-2xl p-4 w-full mt-6"
),
paddingBottom: insets.bottom,
paddingLeft: insets.left,
paddingRight: insets.right,
...tailwind("flex-1"),
}}
>
<Text style={tailwind("text-white text-base font-medium")}>
合伙人昵称{selfData.collaborator_account.name}
</Text>
<Text style={tailwind("text-white text-base font-medium")}>
ID{selfData.collaborator_account.user_id}
</Text>
<Text style={tailwind("text-white text-base font-medium")}>
分成比例{data.sharing_ratio * 100}%
</Text>
</View>
<View style={tailwind("px-4")}>
<View
style={{
gap: 8,
...tailwind(
"flex flex-col border border-2 border-[#2c2b2f] rounded-2xl p-4 w-full mt-6"
),
}}
>
<Text style={tailwind("text-white text-base font-medium")}>
合伙人昵称{selfData[0]?.collaborator_account?.name}
</Text>
<Text style={tailwind("text-white text-base font-medium")}>
ID{selfData[0]?.collaborator_account?.user_id}
</Text>
<Text style={tailwind("text-white text-base font-medium")}>
分成比例{selfData[0]?.sharing_ratio * 100}%
</Text>
</View>
<View style={tailwind("mt-8")}>
<Text style={tailwind("text-[#FFFFFF80] text-base font-medium")}>
注意事项
</Text>
<Text style={tailwind("text-[#FFFFFF80] text-sm")}>
1总分成比例由当前空间主人设置您的个人分成比例由代运营进行设置
</Text>
<Text style={tailwind("text-[#FFFFFF80] text-sm")}>
2您的个人收益计算公式为空间收益x个人分成比例=个人收益收益将以钻石形式发放至您的钱包
</Text>
<Text style={tailwind("text-[#FFFFFF80] text-sm")}>
3若您对收益情况存在任何疑问请联系人工客服
</Text>
</View>
</View>
</ScrollView>
);
}
@ -451,7 +476,7 @@ export default function CollaboratorSetting({ navigation, route }) {
style={{
gap: 12,
...tailwind(
"flex flex-col w-full bg-[#17171A] rounded-3xl px-4 py-6"
"flex flex-col w-full bg-[#17161A] rounded-3xl px-4 py-6"
),
}}
>

View File

@ -16,7 +16,6 @@ import baseRequest from "../../../utils/baseRequest";
import { generateSignature } from "../../../utils/crypto";
import Toast from "react-native-toast-message";
//todo:MyModal
export default function SelectSpaceSettingItem({ navigation, route, data }) {
const blurhash = "LcKUTa%gOYWBYRt6xuoJo~s8V@fk";
@ -211,6 +210,7 @@ export default function SelectSpaceSettingItem({ navigation, route, data }) {
setIsExitSpaceModalVisible(false);
handleExitSpace();
}}
confirmLeft
/>
</View>
);