处理退款
This commit is contained in:
parent
e9a559cd6f
commit
7113a8688d
|
@ -79,6 +79,7 @@ export const getSpaceData = async (mid) => {
|
|||
}
|
||||
return {
|
||||
isRefunding: data.data.refund_status === 1,
|
||||
refund_enable: data.data.refund_enable,
|
||||
noRole: data.data.list[0].visitor_role === 4,
|
||||
};
|
||||
} catch (error) {
|
||||
|
|
BIN
app/favicon.ico
BIN
app/favicon.ico
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 5.6 KiB |
|
@ -81,7 +81,7 @@ export default function SelectUserProfileItem() {
|
|||
id="uploadAvatarBtn"
|
||||
style={{ display: "none" }}
|
||||
accept="image/png, image/jpeg"
|
||||
capture="camera"
|
||||
// capture="camera"
|
||||
onChange={uploadHead}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -192,13 +192,14 @@ export default function PersonSpace() {
|
|||
encodeURIComponent(
|
||||
JSON.stringify({
|
||||
mid: streamerInfo?.mid,
|
||||
id: streamerInfo?.streamer_ext?.mid,
|
||||
id: streamerInfo?.id,
|
||||
ct: streamerInfo?.streamer_ext?.ct,
|
||||
user_id: streamerInfo?.streamer_ext?.user_id,
|
||||
name: streamerInfo?.streamer_ext?.name,
|
||||
visitor_role: streamerInfo?.visitor_role,
|
||||
avatar:
|
||||
streamerInfo?.streamer_ext?.avatar?.images[0]?.urls[0],
|
||||
admission_price:streamerInfo?.admission_price
|
||||
})
|
||||
)
|
||||
)
|
||||
|
|
|
@ -21,7 +21,7 @@ export default function Setting() {
|
|||
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 });
|
||||
setStreamerInfo({ ...data,refund_enable:res?.refund_enable });
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@ -173,7 +173,7 @@ export default function Setting() {
|
|||
<li>
|
||||
<div
|
||||
onClick={() =>
|
||||
router.push("setting/spaceRefund?id=" + streamerInfo.mid)
|
||||
router.push("setting/spaceRefund?mid=" + streamerInfo.mid+"&id="+streamerInfo.id)
|
||||
}
|
||||
className="flex justify-between"
|
||||
>
|
||||
|
|
|
@ -3,7 +3,7 @@ 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 { TextArea, Divider, Button, Toast,DotLoading,Input } from "antd-mobile";
|
||||
import requireAPI from "@/utils/requireAPI";
|
||||
import { getSpaceData } from "@/api/space";
|
||||
export default function SpaceRefund() {
|
||||
|
@ -20,11 +20,12 @@ export default function SpaceRefund() {
|
|||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
useEffect(() => {
|
||||
getSpaceData(Number(id)).then((res) => {
|
||||
const mid = searchParams.get("mid");
|
||||
getSpaceData(Number(mid)).then((res) => {
|
||||
if (res) {
|
||||
const { isRefunding, noRole } = res;
|
||||
isRefunding && router.push("/");
|
||||
noRole && router.replace("person_space_introduce/" + id);
|
||||
noRole && router.replace("person_space_introduce/" + mid);
|
||||
}
|
||||
});
|
||||
getData();
|
||||
|
@ -33,17 +34,17 @@ export default function SpaceRefund() {
|
|||
const handleSubmit = async () => {
|
||||
if (!name || !contact || !remark) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "请完善信息后提交",
|
||||
topOffset: 60,
|
||||
icon: "fail",
|
||||
content: "请完善信息后提交",
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (remark.length < 15) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "请填写15字以上退款原因",
|
||||
topOffset: 60,
|
||||
icon: "fail",
|
||||
content: "请填写15字以上退款原因",
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -61,9 +62,9 @@ export default function SpaceRefund() {
|
|||
});
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: _data.msg,
|
||||
topOffset: 60,
|
||||
icon: "fail",
|
||||
content: _data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -138,12 +139,12 @@ export default function SpaceRefund() {
|
|||
<span className="text-[#F53030]">*</span>
|
||||
联系人
|
||||
</p>
|
||||
<TextArea
|
||||
<Input
|
||||
placeholder="请输入联系人姓名"
|
||||
onChange={(value) => setName(value)}
|
||||
value={name}
|
||||
maxLength={20}
|
||||
className="h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 p-2"
|
||||
className="bg-[#FFFFFF1A] text-white rounded-2xl mt-2 p-2"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "14px",
|
||||
|
@ -156,12 +157,12 @@ export default function SpaceRefund() {
|
|||
<span className="text-[#F53030]">*</span>
|
||||
联系方式
|
||||
</p>
|
||||
<TextArea
|
||||
<Input
|
||||
placeholder="请输入联系方式"
|
||||
onChange={(value) => setContact(value)}
|
||||
value={contact}
|
||||
maxLength={20}
|
||||
className="h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 p-2"
|
||||
className="bg-[#FFFFFF1A] text-white rounded-2xl mt-2 p-2"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "14px",
|
||||
|
@ -210,8 +211,7 @@ export default function SpaceRefund() {
|
|||
style={{ "--background-color": "#FF669E", color: "#FFFFFF" }}
|
||||
className="mt-2"
|
||||
>
|
||||
{isSubmitting && <ActivityIndicator size="small" color="white" />}
|
||||
{isSubmitting ? "正在提交..." : "提交退款"}
|
||||
{isSubmitting ? <div className="flex justify-center items-center">正在提交...<DotLoading color="#fff"/></div> : "提交退款"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -116,7 +116,7 @@ export default function PostItem({
|
|||
dangerouslySetInnerHTML={{
|
||||
__html: findLinksInText(data.text),
|
||||
}}
|
||||
className={`mb-2 mt-2 ${
|
||||
className={`mb-2 mt-2 whitespace-normal ${
|
||||
!isOpenText ? "text-ellipsis-7" : ""
|
||||
} ${inter.className}`}
|
||||
// style={{
|
||||
|
@ -128,7 +128,7 @@ export default function PostItem({
|
|||
<div>
|
||||
<span>
|
||||
<pre
|
||||
className={`mb-2 mt-2 ${
|
||||
className={`mb-2 mt-2 whitespace-normal ${
|
||||
!isOpenText ? "text-ellipsis-7" : ""
|
||||
} ${inter.className}`}
|
||||
dangerouslySetInnerHTML={{
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
|
@ -24,7 +24,7 @@ export default function customFetch(method, url, options = {}, mid) {
|
|||
newBody.mid = mid;
|
||||
}
|
||||
const body = JSON.stringify({ ...base, ...newBody });
|
||||
// console.log("newBody", body);
|
||||
// console.log("newBody", body,url);
|
||||
|
||||
// 合并选项
|
||||
const mergedOptions = { ...defaultOptions, body };
|
||||
|
|
Loading…
Reference in New Issue