修复问题
This commit is contained in:
parent
890fd7dcba
commit
19010a214d
|
@ -38,4 +38,4 @@ next-env.d.ts
|
|||
package-lock.json
|
||||
yarn.lock
|
||||
|
||||
questions.text
|
||||
# questions.text
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { useRouter, useParams } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import {
|
||||
faAngleLeft,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
export default function PersonSpace() {
|
||||
const { src } = useParams();
|
||||
const router = useRouter();
|
||||
return (
|
||||
<div>
|
||||
<div className="p-4 fixed top-0 z-10 w-full">
|
||||
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full absolute">
|
||||
<FontAwesomeIcon
|
||||
icon={faAngleLeft}
|
||||
size="xl"
|
||||
onClick={() => {
|
||||
router.back();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-base text-center leading-9"></p>
|
||||
</div>
|
||||
{/* 内容 */}
|
||||
<iframe src={`${process.env.NEXT_PUBLIC_WEB_URL}/doc/`+src} className="w-full h-[100vh]"/>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -9,16 +9,17 @@ import {
|
|||
Divider,
|
||||
Checkbox,
|
||||
Toast,
|
||||
Image,
|
||||
} from "antd-mobile";
|
||||
import { useRouter } from "next/navigation";
|
||||
import styles from "./index.module.css";
|
||||
import { JSEncrypt } from "jsencrypt";
|
||||
import { handleLogin } from "@/store/actions";
|
||||
import { saveUserInfo,removeUserInfo } from "@/utils/storeInfo";
|
||||
import { saveUserInfo, removeUserInfo } from "@/utils/storeInfo";
|
||||
import { connect } from "react-redux";
|
||||
import { cryptoPassword } from "@/utils/crypto";
|
||||
import require from "@/utils/require";
|
||||
import {signOut,signIn} from "@/utils/auth";
|
||||
import { signOut, signIn } from "@/utils/auth";
|
||||
/*
|
||||
params格式:
|
||||
{
|
||||
|
@ -44,9 +45,9 @@ function Login({ handleLogin }) {
|
|||
const swiperRef = useRef(null);
|
||||
useEffect(() => {
|
||||
handleLogin({ isSignin: false, userToken: null });
|
||||
signOut()
|
||||
signOut();
|
||||
removeUserInfo();
|
||||
},[])
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
let interval;
|
||||
if (isCounting && seconds > 0) {
|
||||
|
@ -196,7 +197,12 @@ function Login({ handleLogin }) {
|
|||
};
|
||||
return (
|
||||
<div className={`${styles.loginBox}`}>
|
||||
<div className="mt-32 flex justify-between items-center px-2 text-gray-400 sticky top-0 z-10 bg-deepBg">
|
||||
<Image
|
||||
src={process.env.NEXT_PUBLIC_CDN_URL + "/public/images/slogan.png"}
|
||||
alt=""
|
||||
className="mt-24 w-96"
|
||||
/>
|
||||
<div className="mt-6 flex justify-between items-center px-2 text-gray-400 sticky top-0 z-10 bg-deepBg">
|
||||
<Tabs
|
||||
activeKey={tabItems[activeIndex].key}
|
||||
onChange={(key) => {
|
||||
|
@ -320,6 +326,12 @@ function Login({ handleLogin }) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
onClick={() => router.push(`/my/setting/editPassword`)}
|
||||
className="w-full text-[#FF669E] text-xs mt-2 text-right"
|
||||
>
|
||||
忘记密码?
|
||||
</div>
|
||||
<LoginBtn
|
||||
loginInfo={loginInfo}
|
||||
setLoginInfo={setLoginInfo}
|
||||
|
@ -350,24 +362,16 @@ const LoginBtn = ({ loginInfo, setLoginInfo, type, handleSubmit }) => {
|
|||
}}
|
||||
></Checkbox>
|
||||
<span className="text-[#FFFFFF80] font-medium text-xs ml-2">
|
||||
我确认已满18周岁并同意
|
||||
我已阅读并同意
|
||||
<span
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`${process.env.NEXT_PUBLIC_WEB_URL}/doc/useragreement`
|
||||
)
|
||||
}
|
||||
onClick={() => router.push(`/doc/useragreement`)}
|
||||
className="text-[#FF669E] text-xs"
|
||||
>
|
||||
《用户协议》
|
||||
</span>
|
||||
、
|
||||
<span
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`${process.env.NEXT_PUBLIC_WEB_URL}/doc/useragreement`
|
||||
)
|
||||
}
|
||||
onClick={() => router.push(`/doc/useragreement`)}
|
||||
className="text-[#FF669E] text-xs"
|
||||
>
|
||||
《隐私政策》
|
||||
|
|
|
@ -5,7 +5,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||
import { faAngleRight } from "@fortawesome/free-solid-svg-icons";
|
||||
import { Avatar, Image, Toast } from "antd-mobile";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import withAuth from "@/components/WithAuth";
|
||||
import { get } from "@/utils/storeInfo";
|
||||
import require from "@/utils/require";
|
||||
const My = () => {
|
||||
|
@ -345,4 +344,4 @@ const My = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default withAuth(My);
|
||||
export default My;
|
||||
|
|
|
@ -39,7 +39,7 @@ export default function AboutUs() {
|
|||
<ul>
|
||||
<li
|
||||
className="flex justify-between items-center p-3"
|
||||
onClick={() => router.push("my/wallet")}
|
||||
onClick={() => router.push(`/doc/useragreement`)}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<FontAwesomeIcon
|
||||
|
@ -55,7 +55,10 @@ export default function AboutUs() {
|
|||
className="h-4 text-gray-300"
|
||||
/>
|
||||
</li>
|
||||
<li className="flex justify-between items-center p-3" >
|
||||
<li
|
||||
className="flex justify-between items-center p-3"
|
||||
onClick={() => router.push(`/doc/privatypolicy`)}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<FontAwesomeIcon
|
||||
icon={faEye}
|
||||
|
|
|
@ -1,16 +1,117 @@
|
|||
"use client";
|
||||
|
||||
import React, { useState } from "react";
|
||||
import { Button } from "antd-mobile";
|
||||
import React, { useState, useEffect, useRef } from "react";
|
||||
import { Button,Dialog } from "antd-mobile";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import {
|
||||
faAngleLeft,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { formatDeadline } from "@/utils/tools";
|
||||
import require from "@/utils/require";
|
||||
export default function DeleteAccount() {
|
||||
const [deadline, setDeadline] = useState();
|
||||
const router = useRouter();
|
||||
const showMobal = useRef()
|
||||
useEffect(() => {
|
||||
checkAccountStatus();
|
||||
}, []);
|
||||
//查询用户是否在注销中
|
||||
const checkAccountStatus = async () => {
|
||||
try {
|
||||
const _data = await require("POST", "/api/account_cancellation/list_by_mid");
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: _data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (_data.data.status === 0) setDeadline(_data.data.due_time);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
//提交注销申请
|
||||
const handleDeleteAccount = async () => {
|
||||
try {
|
||||
const _data = await require("POST", "/api/account/cancel");
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: _data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
checkAccountStatus();
|
||||
showMobal.current?.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
//取消注销
|
||||
const undoDeleteAccount = async () => {
|
||||
try {
|
||||
const _data = await require("POST", "/api/account/abort_cancellation");
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: _data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
setDeadline();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
const handleShowDialog = () => {
|
||||
showMobal.current = Dialog.show({
|
||||
title: "您确认要注销此账号吗?",
|
||||
content:
|
||||
"注销后无法恢复,请仔细阅读《注销必看须知》后确认。",
|
||||
bodyStyle: {
|
||||
maxHeight: "none",
|
||||
width: "80vw",
|
||||
position: "fixed",
|
||||
top: "200px",
|
||||
left: "10vw",
|
||||
"--text-color": "#fff",
|
||||
color: "#fff",
|
||||
},
|
||||
// cancelText:"确认",
|
||||
// confirmText:"取消",
|
||||
style: {
|
||||
"--text-color": "#fff",
|
||||
},
|
||||
closeOnAction: true,
|
||||
actions: [
|
||||
[
|
||||
{
|
||||
key: "submit",
|
||||
text: "确认",
|
||||
style: { color: "#ffffff80" },
|
||||
onClick: handleDeleteAccount,
|
||||
},
|
||||
{
|
||||
key: "close",
|
||||
text: "取消",
|
||||
bold: true,
|
||||
style: { color: "#fff" },
|
||||
onClick: () => {
|
||||
showMobal.current?.close();
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
});
|
||||
// if (result) {
|
||||
// Toast.show({ content: "点击了确认", position: "bottom" });
|
||||
// }
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<div className="p-4 fixed top-0 z-10 w-full">
|
||||
|
@ -23,7 +124,7 @@ export default function DeleteAccount() {
|
|||
}}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-base text-center leading-9">注销用户</p>
|
||||
<p className="text-base text-center leading-9">帐号注销</p>
|
||||
</div>
|
||||
{/* 内容 */}
|
||||
<div className="pt-16 p-4">
|
||||
|
@ -59,7 +160,7 @@ export default function DeleteAccount() {
|
|||
shape="rounded"
|
||||
size="middle"
|
||||
block
|
||||
// onClick={handleSubmit}
|
||||
onClick={deadline?undoDeleteAccount:handleShowDialog}
|
||||
style={{ "--background-color": "#FF669E", color: "#FFFFFF" }}
|
||||
>
|
||||
{deadline ? "取消注销" : "确认注销账号"}
|
||||
|
|
|
@ -32,7 +32,7 @@ export default function EditPassword() {
|
|||
const region_code = get("region_code");
|
||||
if (mobile_phone && region_code) {
|
||||
setMobilePhone(mobile_phone);
|
||||
setRegionCode(region_code);
|
||||
// setRegionCode(region_code);
|
||||
}
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
|
|
|
@ -160,7 +160,13 @@ export default function PersonSpace() {
|
|||
}
|
||||
};
|
||||
return (
|
||||
<div className={`${!!streamerInfo?.is_superfanship_enabled ? "spaceBoxThree":"spaceBoxTwo"}`}>
|
||||
<div
|
||||
className={`${
|
||||
!!streamerInfo?.is_superfanship_enabled
|
||||
? "spaceBoxThree"
|
||||
: "spaceBoxTwo"
|
||||
}`}
|
||||
>
|
||||
<div className="flex justify-between items-center p-4 fixed top-0 z-10 w-full">
|
||||
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full">
|
||||
<FontAwesomeIcon
|
||||
|
@ -176,7 +182,21 @@ export default function PersonSpace() {
|
|||
height={42}
|
||||
src="/icons/setting.png"
|
||||
placeholder=""
|
||||
onClick={() => router.push("setting?data="+encodeURIComponent(JSON.stringify(streamerInfo?.streamer_ext)))}
|
||||
onClick={() =>
|
||||
router.push(
|
||||
"setting?data=" +
|
||||
encodeURIComponent(
|
||||
JSON.stringify({
|
||||
mid: streamerInfo?.mid,
|
||||
id: streamerInfo?.streamer_ext?.mid,
|
||||
ct: streamerInfo?.streamer_ext?.ct,
|
||||
user_id: streamerInfo?.streamer_ext?.user_id,
|
||||
name: streamerInfo?.streamer_ext?.name,
|
||||
avatar: streamerInfo?.streamer_ext?.cover?.images[0]?.urls[0],
|
||||
})
|
||||
)
|
||||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{/* 内容 */}
|
||||
|
@ -227,7 +247,9 @@ export default function PersonSpace() {
|
|||
</div>
|
||||
<div
|
||||
className="flex flex-col items-center"
|
||||
onClick={() => router.push("/share/"+streamerInfo?.streamer_ext?.mid)}
|
||||
onClick={() =>
|
||||
router.push("/share/" + streamerInfo?.streamer_ext?.mid)
|
||||
}
|
||||
>
|
||||
<p className="text-base px-3 py-1 rounded-full bg-primary">
|
||||
分享
|
||||
|
@ -374,7 +396,11 @@ export default function PersonSpace() {
|
|||
)}
|
||||
{postList.map((item, index) => (
|
||||
<List.Item key={item.id + "_" + index} className="!p-0">
|
||||
<PostItem type="space" data={item} date={new Date(item.ct*1000)}/>
|
||||
<PostItem
|
||||
type="space"
|
||||
data={item}
|
||||
date={new Date(item.ct * 1000)}
|
||||
/>
|
||||
</List.Item>
|
||||
))}
|
||||
<InfiniteScroll loadMore={loadMore} hasMore={hasMore} />
|
||||
|
|
|
@ -167,7 +167,7 @@ export default function Space() {
|
|||
<div>
|
||||
{!loading ? (
|
||||
<div className="px-4 pb-8">
|
||||
{dataList.length > 0 ? (
|
||||
{dataList?.length > 0 ? (
|
||||
<ul className="grid grid-cols-2 gap-2 overflow-y-auto">
|
||||
{dataList?.map((item) => (
|
||||
<li key={item.id}>
|
||||
|
@ -266,7 +266,7 @@ export default function Space() {
|
|||
))}
|
||||
<InfiniteScroll loadMore={loadMore} hasMore={hasMore} />
|
||||
</List>
|
||||
{!dataList.length && (
|
||||
{!dataList?.length && (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center`}
|
||||
style={{ height: `${scrollHeight}px` }}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import React, { useEffect, useState, useRef } from "react";
|
||||
import { Image, ImageViewer, Dialog } from "antd-mobile";
|
||||
import { useRouter, useParams } from "next/navigation";
|
||||
import { useRouter, useParams, redirect } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import {
|
||||
faAngleLeft,
|
||||
|
@ -84,6 +84,29 @@ export default function PersonSpaceIntroduce() {
|
|||
},
|
||||
});
|
||||
};
|
||||
//当空间价格为0时,直接加入空间
|
||||
const handleJoinFreeSpace = async () => {
|
||||
try {
|
||||
const body = {
|
||||
zid: data?.id,
|
||||
product_id: "h5_zone_admission",
|
||||
};
|
||||
const _data = await require("POST", "/api/zone/free_join", {
|
||||
body,
|
||||
});
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: _data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
redirect("/space/" + mid);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="">
|
||||
<div className="flex justify-between items-center p-4 fixed top-0 z-10 w-full">
|
||||
|
@ -265,7 +288,17 @@ export default function PersonSpaceIntroduce() {
|
|||
<div
|
||||
className="flex items-center py-2 text-base"
|
||||
onClick={() => {
|
||||
router.push("/pay");
|
||||
if (data?.admission_price === 0) {
|
||||
handleJoinFreeSpace();
|
||||
} else {
|
||||
// router.push("/pay");
|
||||
router.push(
|
||||
process.env.NEXT_PUBLIC_WEB_URL +
|
||||
"/zone/pay/" +
|
||||
data?.id +
|
||||
"/h5_zone_admission/0"
|
||||
);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{data?.admission_price !== 0 && (
|
||||
|
|
|
@ -2,21 +2,29 @@
|
|||
|
||||
import React, { useEffect, useState, useCallback } from "react";
|
||||
import { Image, Avatar, Divider, Dialog, Toast } from "antd-mobile";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { redirect, useRouter, useSearchParams } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import {
|
||||
faAngleLeft,
|
||||
faAngleRight,
|
||||
faCalendar,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { getSpaceData } from "@/api/space";
|
||||
export default function Setting() {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const [streamerInfo, setStreamerInfo] = useState(null);
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
useEffect(() => {
|
||||
let data = JSON.parse(decodeURIComponent(searchParams.get("data")));
|
||||
setStreamerInfo(data);
|
||||
(async () => {
|
||||
const currentData = searchParams.get("data");
|
||||
if (currentData) {
|
||||
let data = await JSON.parse(decodeURIComponent(searchParams.get("data")));
|
||||
console.log("data",data)
|
||||
await getSpaceData(Number(data.mid)).then((res) => {
|
||||
setStreamerInfo({ ...data, refund_enable: res?.refund_enable });
|
||||
});
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
const handleShowDialog = () => {
|
||||
const result = Dialog.show({
|
||||
|
@ -58,9 +66,9 @@ export default function Setting() {
|
|||
],
|
||||
],
|
||||
});
|
||||
if (result) {
|
||||
Toast.show({ content: "点击了确认", position: "bottom" });
|
||||
}
|
||||
// if (result) {
|
||||
// Toast.show({ content: "点击了确认", position: "bottom" });
|
||||
// }
|
||||
};
|
||||
//格式化时间
|
||||
const formatDate = useCallback((timestamp) => {
|
||||
|
@ -72,10 +80,11 @@ export default function Setting() {
|
|||
}, []);
|
||||
const handleExitSpace = async () => {
|
||||
try {
|
||||
const _data =
|
||||
await require("POST", "/api/account_relation/count", {body:{
|
||||
const _data = await require("POST", "/api/account_relation/count", {
|
||||
body: {
|
||||
zid: streamerInfo?.id,
|
||||
}});
|
||||
},
|
||||
});
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
|
@ -89,7 +98,7 @@ export default function Setting() {
|
|||
content: "退出空间成功",
|
||||
position: "top",
|
||||
});
|
||||
setTimeout(() => router.replace("HomeTab"), 500);
|
||||
setTimeout(() => redirect("/"), 500);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
@ -115,7 +124,7 @@ export default function Setting() {
|
|||
<Avatar
|
||||
rounded-full
|
||||
mr-4
|
||||
src={streamerInfo?.cover?.images[0]?.urls[0]}
|
||||
src={streamerInfo?.avatar}
|
||||
className="mr-4"
|
||||
style={{ "--size": "52px", "--border-radius": "50%" }}
|
||||
/>
|
||||
|
@ -157,6 +166,20 @@ export default function Setting() {
|
|||
</div>
|
||||
<Divider />
|
||||
</li>
|
||||
{streamerInfo?.refund_enable && (
|
||||
<li>
|
||||
<div
|
||||
onClick={() =>
|
||||
router.push("setting/spaceRefund?id=" + streamerInfo.mid)
|
||||
}
|
||||
className="flex justify-between"
|
||||
>
|
||||
<span className="text-base text-white">空间退款</span>
|
||||
<FontAwesomeIcon icon={faAngleRight} size="xl" />
|
||||
</div>
|
||||
<Divider />
|
||||
</li>
|
||||
)}
|
||||
<li onClick={handleShowDialog}>
|
||||
<div className="flex justify-between">
|
||||
<span className="text-base text-white">退出空间</span>
|
||||
|
|
|
@ -0,0 +1,219 @@
|
|||
"use client";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { redirect, useRouter, useSearchParams } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
|
||||
import { TextArea, Divider, Button, Toast } from "antd-mobile";
|
||||
import require from "@/utils/require";
|
||||
import { getSpaceData } from "@/api/space";
|
||||
export default function SpaceRefund() {
|
||||
//页面数据
|
||||
const [data, setData] = useState();
|
||||
//联系人
|
||||
const [name, setName] = useState();
|
||||
//联系方式
|
||||
const [contact, setContact] = useState();
|
||||
//备注
|
||||
const [remark, setRemark] = useState();
|
||||
//提交中
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
useEffect(() => {
|
||||
getSpaceData(Number(id)).then((res) => {
|
||||
if (res) {
|
||||
const { isRefunding, noRole } = res;
|
||||
isRefunding && router.push("/");
|
||||
noRole && router.replace("person_space_introduce/" + id);
|
||||
}
|
||||
});
|
||||
getData();
|
||||
}, []);
|
||||
//提交退款
|
||||
const handleSubmit = async () => {
|
||||
if (!name || !contact || !remark) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "请完善信息后提交",
|
||||
topOffset: 60,
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (remark.length < 15) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "请填写15字以上退款原因",
|
||||
topOffset: 60,
|
||||
});
|
||||
return;
|
||||
}
|
||||
//提交数据
|
||||
if (isSubmitting) return;
|
||||
setIsSubmitting(true);
|
||||
try {
|
||||
const _data = await require("POST", "/api/zone/refund", {
|
||||
body: {
|
||||
zid: Number(searchParams.get("id")),
|
||||
contact_name: name,
|
||||
contact_phone: contact,
|
||||
note: remark,
|
||||
},
|
||||
});
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: _data.msg,
|
||||
topOffset: 60,
|
||||
});
|
||||
return;
|
||||
}
|
||||
Toast.show({
|
||||
icon: "success",
|
||||
content: "提交成功,请关注原支付渠道通知",
|
||||
position: "top",
|
||||
});
|
||||
redirect("/");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
//获取页面数据
|
||||
|
||||
const getData = async () => {
|
||||
try {
|
||||
const _data = await require("POST", "/api/zone/refund_page", {
|
||||
body: { zid: Number(searchParams.get("id")) },
|
||||
});
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: _data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
setData(_data.data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<div className="p-4 fixed top-0 z-10 w-full">
|
||||
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left">
|
||||
<FontAwesomeIcon
|
||||
icon={faAngleLeft}
|
||||
size="xl"
|
||||
onClick={() => {
|
||||
router.back();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-base text-center leading-9">空间退款</p>
|
||||
</div>
|
||||
<div className="mt-14 p-4">
|
||||
<div className="flex-row justify-between items-center">
|
||||
<p className="text-base text-white font-medium">
|
||||
<span className="text-[#F53030]">*</span>
|
||||
退款商品
|
||||
</p>
|
||||
<p className="text-base text-white font-medium">{data?.name}</p>
|
||||
</div>
|
||||
<Divider className="my-2" />
|
||||
<div className="flex-row justify-between items-center">
|
||||
<p className="text-base text-white font-medium">
|
||||
<span className="text-[#F53030]">*</span>
|
||||
退款价格
|
||||
</p>
|
||||
<p className="text-base text-white font-medium">
|
||||
¥{data?.price / 100}
|
||||
</p>
|
||||
</div>
|
||||
<Divider className="my-2" />
|
||||
<div className="flex-row justify-between items-center">
|
||||
<p className="text-base text-white font-medium">
|
||||
<span className="text-[#F53030]">*</span>
|
||||
联系人
|
||||
</p>
|
||||
<TextArea
|
||||
placeholder="请输入联系人姓名"
|
||||
onChange={(value) => setName(value)}
|
||||
value={name}
|
||||
maxLength={20}
|
||||
className="h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 p-2"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "14px",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Divider className="my-2" />
|
||||
<div className="flex-row justify-between items-center">
|
||||
<p className="text-base text-white font-medium">
|
||||
<span className="text-[#F53030]">*</span>
|
||||
联系方式
|
||||
</p>
|
||||
<TextArea
|
||||
placeholder="请输入联系方式"
|
||||
onChange={(value) => setContact(value)}
|
||||
value={contact}
|
||||
maxLength={20}
|
||||
className="h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 p-2"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "14px",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Divider className="my-2" />
|
||||
<div className="flex flex-col">
|
||||
<p className="text-base text-white font-medium">
|
||||
<span className="text-[#F53030]">*</span>
|
||||
退款原因
|
||||
</p>
|
||||
<div className="flex flex-row items-center">
|
||||
<TextArea
|
||||
placeholder="请输入退款原因"
|
||||
onChange={(value) => setRemark(value)}
|
||||
value={remark}
|
||||
className="h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 p-2"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "14px",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Divider className="my-2" />
|
||||
<p className="text-[#F53030] text-base font-medium">退款须知</p>
|
||||
<div className="text-[#FFFFFF80] text-sm font-medium">
|
||||
<p>
|
||||
1、当前退款内容为本空间的成员身份,退款后您将无法再次加入本空间;
|
||||
</p>
|
||||
<p>
|
||||
2、平台将在24小时内处理您的退款申请,为了退款进程的顺利,请您详细填写您的退款原因;
|
||||
</p>
|
||||
<p>
|
||||
3、一旦退款成功,退款金额将原路返回您的支付账户,请确保您的支付账户可正常接受款项;
|
||||
</p>
|
||||
<p>4、您在12小时内只能进行一次自助退款,请合理利用权利;</p>
|
||||
<p>5、本条款最终解释权归平台所有。</p>
|
||||
</div>
|
||||
<Button
|
||||
shape="rounded"
|
||||
size="middle"
|
||||
block
|
||||
onClick={() => handleSubmit()}
|
||||
style={{ "--background-color": "#FF669E", color: "#FFFFFF" }}
|
||||
className="mt-2"
|
||||
>
|
||||
{isSubmitting && <ActivityIndicator size="small" color="white" />}
|
||||
{isSubmitting ? "正在提交..." : "提交退款"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -9,17 +9,44 @@ export default function UploadImgs({ getImgs }) {
|
|||
const [loading, setLoading] = useState(false);
|
||||
const handleUploadImage = async (e) => {
|
||||
let file = e.target.files[0];
|
||||
console.log("ddddd", file.type);
|
||||
|
||||
if (!file) return;
|
||||
setLoading(true);
|
||||
if (file.type.indexOf("image/")!=-1) {
|
||||
const image = await uploadImage(file);
|
||||
getImgs((old) => [...old, image.id]);
|
||||
setFileList((old) => [...old, image]);
|
||||
}else if(file.type.indexOf("video/")!=-1){
|
||||
const video = await uploadVideo(file);
|
||||
getImgs((old) => [...old, video.id]);
|
||||
setFileList((old) => [...old, video]);
|
||||
if (file.type.indexOf("image/") != -1) {
|
||||
// const image = await uploadImage(file);
|
||||
// getImgs((old) => [...old, image.id]);
|
||||
const assets = [
|
||||
...fileList,
|
||||
{ type: "img", src: URL.createObjectURL(file) },
|
||||
];
|
||||
setFileList(assets);
|
||||
} else if (file.type.indexOf("video/") != -1) {
|
||||
const videoD = document.getElementById("videoD");
|
||||
const videoC = document.getElementById("videoC");
|
||||
console.log("videoC", videoC);
|
||||
const ctx = videoC?.getContext("2d");
|
||||
// 设置Canvas的宽度和高度与视频一致
|
||||
videoC.width = videoD.videoWidth;
|
||||
videoC.height = videoD.videoHeight;
|
||||
// 在Canvas上绘制当前视频帧
|
||||
ctx.drawImage(videoD, 0, 0, videoC.width, videoC.height);
|
||||
// 将Canvas转换为图片URL
|
||||
const frameImageUrl = videoC.toDataURL();
|
||||
|
||||
// 输出图片URL
|
||||
console.log(frameImageUrl);
|
||||
console.log("ddddd", file, {
|
||||
type: "video",
|
||||
src: frameImageUrl,
|
||||
});
|
||||
// const video = await uploadVideo(file);
|
||||
// getImgs((old) => [...old, video.id]);
|
||||
// setFileList((old) => [...old, video]);
|
||||
const assets = [
|
||||
...fileList,
|
||||
{ type: "video", src: URL.createObjectURL(file) },
|
||||
];
|
||||
setFileList(assets);
|
||||
}
|
||||
|
||||
setLoading(false);
|
||||
|
@ -57,7 +84,7 @@ export default function UploadImgs({ getImgs }) {
|
|||
return (
|
||||
<div key={index} className="rounded relative">
|
||||
<Image
|
||||
src={"https://file.wishpaldev.tech/" + item.src_id}
|
||||
src={item?.src}
|
||||
width="100%"
|
||||
height="100%"
|
||||
className="rounded"
|
||||
|
@ -94,6 +121,13 @@ export default function UploadImgs({ getImgs }) {
|
|||
// capture="camera"
|
||||
onChange={handleUploadImage}
|
||||
/>
|
||||
<div>
|
||||
<video id="videoD">
|
||||
<source src={fileList[0]?.src} />
|
||||
您的浏览器不支持 Video 标签。
|
||||
</video>
|
||||
<canvas id="videoC" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
遇到的问题:
|
||||
1. 退出登录后,验证token有限性似乎有问题
|
||||
2. 视频上传问题
|
||||
3.
|
||||
4.
|
||||
5。
|
||||
6.
|
||||
7.
|
||||
8.
|
||||
9。
|
||||
|
||||
待修复的问题:
|
||||
1. 空间内没加视频封面是否模糊的判断 (>>>靠后)
|
||||
2. 空间内多张图片的付费贴,需要根据可预览图片数字段展示可见图片,并模糊剩余图片 (>>>靠后)
|
||||
11. 空间内生成分享卡片页面需要在现有项目里面写 (>>>靠后)
|
||||
12. 退出空间的弹窗样式错误,确认按钮应该是灰色并且放在左边 (完成)
|
||||
13. 空间设置中,创建时间字段放错了,放成id了 (完成)
|
||||
14. 空间tab为空的时候,不需要有“查看推荐”这个按钮 (完成)
|
||||
15. 需要增加会员功能
|
||||
16. 需要支持保存图片和视频,只有会员可以保存 (>>>靠后)
|
||||
17. 搜索页面,进入空间应该先到空间介绍页,然后判断是否解锁,如果解锁就重定向到空间内 (完成)
|
||||
18. 加微信组件中/api/vas/query_wechat这个接口应该在确认用户已经解锁微信了才去调用 (完成)
|
||||
19. 主播主页,空间动态的预览图,应该根据是否已经解锁空间来决定是否模糊,以及跳转空间介绍页还是空间内 (>>>靠后)
|
||||
20. 修改密码页面,显示未获取到手机号请重新登录 (完成)(待验证!!!)
|
||||
21. 意见反馈页面没完善 (>>>靠后)
|
||||
22. 关于我们页面没完善 (完成)
|
||||
23. 账号注销页面没完善、页面改成“账号注销” (完成)(待验证!!!)
|
||||
24. 登录页面底部用户协议部分文案改成“我已阅读并同意《用户协议》、《隐私政策》” (完成)
|
||||
25. 登录页面顶部加头图:和tiefen_space_web项目相同 (完成)
|
||||
26. 登录页面和修改密码页面输入框的placeholder文本颜色不统一 (疑惑🤔)
|
||||
27. 登录页面缺少了忘记密码页面 (完成)
|
||||
28. 缺少支付相关页面
|
||||
29. 空间卡片,“付费”标签出现两次,同时缺少“创建者”标签,这两个标签需要横向排列 (完成)
|
||||
30. 切换账号之后,baseRequest没有更新 (完成)
|
||||
31. 空间设置中缺少空间内用户提交退款申请功能 (完成)(待验证!!!)
|
||||
32. 空间介绍页的空间价格目前是写死的,同时这里要判断空间价格是否为0,如果是0的话和不为0的点击事件有区别;此外,还有个退款后的用户不显示付费按钮的逻辑 (完成)(待验证!!!)
|
||||
待开发的功能:
|
||||
|
||||
|
||||
正在开发的功能:
|
||||
|
||||
已完成功能:
|
||||
1. 我的页面中的关注和粉丝 (完成)
|
||||
2. 用户添加主播微信 (完成)
|
||||
3. 搜索单条的样式 (完成)
|
|
@ -12,5 +12,6 @@ export default function baseRequest() {
|
|||
b_ts: b_ts,
|
||||
b_token: token,
|
||||
};
|
||||
console.log("baseRequest",baseRequest)
|
||||
return baseRequest;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import baseRequest from "./baseRequest";
|
||||
import { get } from "./storeInfo";
|
||||
import { Toast } from "antd-mobile";
|
||||
import { checkAuth } from "./auth";
|
||||
// import { useRouter } from "next/navigation";
|
||||
// import webviewBaseRequest from "@/utils/webviewBaseRequest";
|
||||
const base = baseRequest();
|
||||
|
||||
// 创建一个封装 fetch 的函数
|
||||
export default function customFetch(method, url, options = {}, mid) {
|
||||
const base = baseRequest();
|
||||
// 默认选项
|
||||
const defaultOptions = {
|
||||
method: method,
|
||||
|
|
|
@ -191,7 +191,7 @@ export async function uploadImage(asset) {
|
|||
//上传单个视频
|
||||
export async function uploadVideo(asset) {
|
||||
const auth = await getAuth(2);
|
||||
const fileType = "video";
|
||||
const fileType = asset?.type;
|
||||
const generateThumbnail = async () => {
|
||||
try {
|
||||
const videoCover = await VideoThumbnails.getThumbnailAsync(asset?.uri);
|
||||
|
@ -218,7 +218,7 @@ export async function uploadVideo(asset) {
|
|||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
|
||||
console.log("uploadResponse",uploadResponse)
|
||||
if (uploadResponse.status === 200) {
|
||||
const md5 = uploadResponse.headers.map.etag.substring(
|
||||
1,
|
||||
|
|
Loading…
Reference in New Issue