From 750f1ab18e6af4fee6b20c2253be332c502c9993 Mon Sep 17 00:00:00 2001 From: al Date: Thu, 19 Dec 2024 18:33:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A7=86=E9=A2=91=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/globals.css | 16 +- app/index.css | 17 +- app/login/index.module.scss | 2 +- app/my/page.js | 119 +-- app/my/refund/refundList/index.module.scss | 2 +- .../completeStreamerInformation/page.jsx | 876 +++++++++--------- .../joinEntrance/page.jsx | 12 +- app/my/wechatWaitingToAdd/index.module.scss | 2 +- .../components/MessageList/index.jsx | 35 +- .../components/NoticeItem/index.jsx | 4 +- .../setting/spaceMember/index.module.scss | 2 +- components/AddToHome/index.jsx | 5 +- components/BottomNav/index.js | 88 +- components/OwnIcon/index.jsx | 34 + components/OwnImage/index.jsx | 33 + components/OwnInput/index.js | 8 +- components/Photos/index.js | 30 +- components/PostItem/index.js | 36 +- components/VideoPlayer/index.jsx | 106 +++ utils/tools/handleFuns.js | 57 +- 20 files changed, 797 insertions(+), 687 deletions(-) create mode 100644 components/OwnIcon/index.jsx create mode 100644 components/OwnImage/index.jsx create mode 100644 components/VideoPlayer/index.jsx diff --git a/app/globals.css b/app/globals.css index 1cdcab7..52db484 100644 --- a/app/globals.css +++ b/app/globals.css @@ -96,7 +96,7 @@ textarea { .custom-tabs .adm-tabs-tab-line { background: none; - background-image: url("https://filecdn01.tiefen.fun/web_app_public/icons/tabindicator.png"); + background-image: url("https://filecdntx01.tiefen.fun/web_app_public/icons/tabindicator.png"); height: 34px; background-position: -2px -18px; background-size: cover; @@ -179,6 +179,7 @@ textarea { .adm-list-body, .adm-list-item { + padding: 0 !important; border: none !important; background: none !important; } @@ -194,7 +195,7 @@ textarea { .tabPinkLine::after { content: ""; position: absolute; - background-image: url("https://filecdn01.tiefen.fun/web_app_public/icons/tabindicator.png"); + background-image: url("https://filecdntx01.tiefen.fun/web_app_public/icons/tabindicator.png"); height: 34px; background-position: -2px -18px; background-size: cover; @@ -207,7 +208,7 @@ textarea { .titlePinkLine::after { content: ""; position: absolute; - background-image: url("https://filecdn01.tiefen.fun/web_app_public/icons/pinkline.png"); + background-image: url("https://filecdntx01.tiefen.fun/web_app_public/icons/pinkline.png"); height: 12px; width: inherit; min-width: 42px; @@ -304,6 +305,7 @@ textarea { .adm-list-item-content { padding: 0; + border: none!important; } .customize-body img { max-height: 90vh; @@ -390,3 +392,11 @@ textarea { } } } + +.adm-slider-track{ + background-color: #ff669e40 !important; +} +.adm-slider-thumb{ + background-color: #ff669e !important; + transform: scale(0.5); +} \ No newline at end of file diff --git a/app/index.css b/app/index.css index bdcfdb0..8dd2526 100644 --- a/app/index.css +++ b/app/index.css @@ -16,7 +16,7 @@ .custom-tabs .adm-tabs-tab-line { background: none; - background-image: url("https://filecdn01.tiefen.fun/web_app_public/icons/tabindicator.png"); + background-image: url("https://filecdntx01.tiefen.fun/web_app_public/icons/tabindicator.png"); height: 34px; background-position: -2px -18px; background-size: cover; @@ -30,11 +30,11 @@ .adm-list-body-inner { /* margin-top: 8px; */ } -.adm-image-viewer-indicator{ +.adm-image-viewer-indicator { color: #fff; } -.imagesBtnsControllers{ +.imagesBtnsControllers { position: fixed; top: 50%; width: 100%; @@ -44,19 +44,20 @@ z-index: 10001; pointer-events: none; } -.imagesBtnsControllerLeft,.imagesBtnsControllerRight{ +.imagesBtnsControllerLeft, +.imagesBtnsControllerRight { width: 42px; height: 42px; border-radius: 53px; - background-color: #0000001A; + background-color: #0000001a; background-size: contain; background-repeat: no-repeat; pointer-events: all; } -.imagesBtnsControllerLeft{ +.imagesBtnsControllerLeft { background-image: url("/icons/left.png"); opacity: 0.5; } -.imagesBtnsControllerRight{ +.imagesBtnsControllerRight { background-image: url("/icons/right.png"); -} \ No newline at end of file +} diff --git a/app/login/index.module.scss b/app/login/index.module.scss index 5bc1412..60954a9 100644 --- a/app/login/index.module.scss +++ b/app/login/index.module.scss @@ -15,7 +15,7 @@ } .customTabs>div>div:last-child>div:first-child::after{ content: ""; - background-image: url("https://filecdn01.tiefen.fun/web_app_public/icons/tabindicator.png"); + background-image: url("https://filecdntx01.tiefen.fun/web_app_public/icons/tabindicator.png"); height: 44px; background-size: cover; background-repeat: no-repeat; diff --git a/app/my/page.js b/app/my/page.js index 184aa5e..7e742a3 100644 --- a/app/my/page.js +++ b/app/my/page.js @@ -3,10 +3,12 @@ import React, { useEffect, useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleRight } from "@fortawesome/free-solid-svg-icons"; -import { Avatar, Image, Toast, Space } from "antd-mobile"; +import { Avatar, Toast, Space } from "antd-mobile"; import { useRouter } from "next/navigation"; import { get } from "@/utils/storeInfo"; import requireAPI from "@/utils/requireAPI"; +import OwnIcon from "@/components/OwnIcon"; +import OwnImage from "@/components/OwnImage"; const My = () => { const [userInfo, setUserInfo] = useState({}); const router = useRouter(); @@ -87,35 +89,35 @@ const My = () => { url: !zoneLength ? `my/createProfile` : `space/${account.data.account.mid}`, - iconUrl: `icons/32DP/space.png`, + iconUrl: `/icons/32DP/space.png`, title: !zoneLength ? "开通空间" : "我的空间", subTitle: account.data.account.role == 3 ? "创作者功能" : "完善资料后解锁", }, { url: `streamerPosts/${account.data.account.mid}`, - iconUrl: "icons/32DP/myposts.png", + iconUrl: "/icons/32DP/myposts.png", title: "广场动态", subTitle: account.data.account.role == 3 ? "创作者功能" : "完善资料后解锁", }, { url: `my/wechatWaitingToAdd`, - iconUrl: "icons/32DP/wechat.png", + iconUrl: "/icons/32DP/wechat.png", title: "待添加微信", subTitle: account.data.account.role == 3 ? "创作者功能" : "完善资料后解锁", }, { url: `my/editprofile`, - iconUrl: "icons/32DP/editprofile.png", + iconUrl: "/icons/32DP/editprofile.png", title: "编辑资料", subTitle: account.data.account.role == 3 ? "创作者功能" : "完善资料后解锁", }, { url: `my/refund/refundList`, - iconUrl: "icons/32DP/wallet.png", + iconUrl: "/icons/32DP/wallet.png", title: "退款审核", subTitle: account.data.account.role == 3 ? "创作者功能" : "完善资料后解锁", @@ -126,7 +128,7 @@ const My = () => { currentOld = [ { url: `my/streamerVerification/completeStreamerInformation`, - iconUrl: "icons/32DP/editprofile.png", + iconUrl: "/icons/32DP/editprofile.png", title: "完善资料", subTitle: "完善后解锁全部功能", status: @@ -148,27 +150,27 @@ const My = () => { let currentOld = [ { url: `my/wallet`, - iconUrl: "icons/32DP/wallet.png", + iconUrl: "/icons/32DP/wallet.png", title: "我的钱包", }, { url: `my/unlockedWechat`, - iconUrl: "icons/32DP/wechat.png", + iconUrl: "/icons/32DP/wechat.png", title: "已解锁微信", }, { url: `my/streamerVerification/joinEntrance`, - iconUrl: "icons/32DP/join.png", + iconUrl: "/icons/32DP/join.png", title: "申请入驻", }, { url: `/messageDetail`, - iconUrl: "icons/32DP/contact.png", + iconUrl: "/icons/32DP/contact.png", title: "联系客服", }, { url: `/my/addToHome`, - iconUrl: "icons/32DP/toScreen.png", + iconUrl: "/icons/32DP/toScreen.png", title: "添加到主屏幕", }, ]; @@ -229,12 +231,9 @@ const My = () => { }} >
- +
+ +
{title}
@@ -281,26 +280,20 @@ const My = () => { router.push("my/editUserProfile/selectUserProfileItem") } > -
router.push("my/setting")} > -
@@ -310,12 +303,15 @@ const My = () => { onClick={() => router.push("profile/" + userInfo.mid)} >
- +
+ +

{ {userInfo.name}

{userInfo?.is_a_member === 1 && ( - + )}
- {userInfo.user_id}
@@ -363,12 +347,15 @@ const My = () => { ) : (
- +
+ +

{ {userInfo.name}

{userInfo?.is_a_member === 1 && ( - + )}
- {userInfo.user_id}
diff --git a/app/my/refund/refundList/index.module.scss b/app/my/refund/refundList/index.module.scss index 58e081a..b12519c 100644 --- a/app/my/refund/refundList/index.module.scss +++ b/app/my/refund/refundList/index.module.scss @@ -15,7 +15,7 @@ } .customTabs>div>div:last-child>div:first-child::after{ content: ""; - background-image: url("https://filecdn01.tiefen.fun/web_app_public/icons/tabindicator.png"); + background-image: url("https://filecdntx01.tiefen.fun/web_app_public/icons/tabindicator.png"); height: 44px; background-size: cover; background-repeat: no-repeat; diff --git a/app/my/streamerVerification/completeStreamerInformation/page.jsx b/app/my/streamerVerification/completeStreamerInformation/page.jsx index e3c0a2c..3a00ad3 100644 --- a/app/my/streamerVerification/completeStreamerInformation/page.jsx +++ b/app/my/streamerVerification/completeStreamerInformation/page.jsx @@ -21,6 +21,8 @@ import { Image, Mask, SpinLoading, + Form, + Input, } from "antd-mobile"; import { useRouter } from "next/navigation"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -90,27 +92,17 @@ const provinces = [ export default function CompleteStreamerInformation() { const router = useRouter(); const ref = useRef(null); + const [form] = Form.useForm(); const [hadSubmited, setHadSubmited] = useState(false); const [frameImageUrl, setFrameImageUrl] = useState(null); const [isWaitingReview, setIsWaitingReview] = useState(false); + const [showWechatInput, setShowWechatInput] = useState(false); const [formData, setFormData] = useState({ - wechatPrice: 0, - gender: [""], - age: [""], - height: [""], - weight: [""], - constellation: [""], - province: [""], - tags: [], - info: "", - autoResponse: "", - wechat: "", - wechatAddWay: 1, - fans: 0, imageAssets: [], displayImage: [], displayVideo: [], }); + const [spacePriceAble, setSpacePriceAble] = useState(false); // const [wechatAddWay, setWechatAddWay] = useState("0"); const [data, setData] = useState({}); @@ -155,8 +147,8 @@ export default function CompleteStreamerInformation() { cover, shorts, } = data?.streamer; - setFormData((old) => ({ - ...old, + + const newFormData = { fans, wechatPrice: wechat_coin_price / 10, gender: [`${gender}`], @@ -185,7 +177,9 @@ export default function CompleteStreamerInformation() { url: shorts?.videos[0]?.cover_urls[0], }, ], - })); + }; + setShowWechatInput(wechat_lock_type); + form.setFieldsValue(newFormData); } }, [data]); useEffect(() => { @@ -308,42 +302,10 @@ export default function CompleteStreamerInformation() { setIsSubmitting(false); } }; - const handSubmit = async (values) => { + const handleSubmit = async (values) => { const account = await get("account"); - const { - fans, - gender, - wechatAddWay, - wechatPrice, - info, - age, - height, - weight, - constellation, - province, - autoResponse, - tags, - wechat, - imageAssets, - displayImage, - displayVideo, - } = values; - if ( - !fans || - !gender || - // !wechatAddWay || - !wechatPrice || - !info || - !age || - !height || - !weight || - !constellation || - !province || - !autoResponse || - tags.length === 0 || - displayImage.length === 0 || - displayVideo.length === 0 - ) { + const { imageAssets, displayImage, displayVideo } = formData; + if (displayImage.length === 0 || displayVideo.length === 0) { Toast.show({ icon: "fail", content: "请完善信息后提交", @@ -351,31 +313,6 @@ export default function CompleteStreamerInformation() { }); return; } - if (isNaN(fans) || fans < 1) { - Toast.show({ - icon: "fail", - content: "请输入有效的全网粉丝量(大于等于1的整数)", - position: "top", - }); - return; - } - const price = parseInt(wechatPrice, 10); - if (isNaN(price) || price < 1) { - Toast.show({ - icon: "fail", - content: "请输入有效的微信价格(大于等于1的整数)", - position: "top", - }); - return; - } - if (wechatAddWay === 0 && wechat.trim() == "") { - Toast.show({ - icon: "fail", - content: "请填写微信号", - position: "top", - }); - return; - } //相册不得低于2张 if (imageAssets.length < 2) { Toast.show({ @@ -424,6 +361,21 @@ export default function CompleteStreamerInformation() { setIsSubmitting(false); return; } + const { + gender, + wechat, + info, + age, + tags, + height, + weight, + constellation, + province, + wechatAddWay, + fans, + wechatPrice, + autoResponse, + } = values; //上传表单 const body = { mid: account?.mid, @@ -583,6 +535,7 @@ export default function CompleteStreamerInformation() {
); } + const messageEle = (message) =>

{message}

; return (
{/* 头部标题 */} @@ -633,13 +586,38 @@ export default function CompleteStreamerInformation() { {data?.name}
- -
-
-

- 性别 - * -

+
console.log(error)} + initialValues={formData} + // hasFeedback={false} + validateMessages={{ + required: (name) => { + return

{`请输入${name}`}

; + }, + }} + > + 性别} + layout="horizontal" + trigger="onConfirm" + rules={[ + { + required: true, + message: messageEle("请选择性别"), + // validator: (rule, value) => { + // if (value.length === 0) { + // return Promise.reject(messageEle("请选择性别")); + // } + // }, + }, + ]} + > { - setFormData((old) => ({ ...old, gender: v })); - }} > {(items, { open }) => { return ( @@ -660,9 +634,11 @@ export default function CompleteStreamerInformation() { justify="center" onClick={open} > - {items.every((item) => item === null) - ? "未选择" - : items.map((item) => item?.label ?? "未选择").join("")} + + {items.every((item) => item === null) + ? "未选择" + : items.map((item) => item?.label ?? "未选择").join("")} + -
-
-
-
-

- 年龄(岁) - * -

- { - setFormData((old) => ({ ...old, age: v })); - }} - > + + 年龄(岁)} + layout="horizontal" + rules={[ + { + required: true, + message: messageEle("请选择年龄"), + }, + ]} + > + {(items, { open }) => { return ( - {items.every((item) => item === null) - ? "未选择" - : items.map((item) => item?.label ?? "未选择").join("")} + + {items.every((item) => item === null) + ? "未选择" + : items.map((item) => item?.label ?? "未选择").join("")} + -
-
-
-
-

- 身高(cm) - * -

- { - setFormData((old) => ({ ...old, height: v })); - }} - > + + 身高(cm)} + layout="horizontal" + rules={[ + { + required: true, + message: messageEle("请选择身高"), + }, + ]} + > + {(items, { open }) => { return ( - {items.every((item) => item === null) - ? "未选择" - : items.map((item) => item?.label ?? "未选择").join("")} + + {items.every((item) => item === null) + ? "未选择" + : items.map((item) => item?.label ?? "未选择").join("")} + -
-
-
-
-

- 体重(kg) - * -

- { - setFormData((old) => ({ ...old, weight: v })); - }} - > + + 体重(kg)} + layout="horizontal" + rules={[ + { + required: true, + message: messageEle("请选择体重"), + }, + ]} + > + {(items, { open }) => { return ( - {items.every((item) => item === null) - ? "未选择" - : items.map((item) => item?.label ?? "未选择").join("")} + + {items.every((item) => item === null) + ? "未选择" + : items.map((item) => item?.label ?? "未选择").join("")} + -
-
-
-
-

- 星座 - * -

- { - setFormData((old) => ({ ...old, constellation: v })); - }} - > + + 星座} + layout="horizontal" + rules={[ + { + required: true, + message: messageEle("请选择星座"), + }, + ]} + > + {(items, { open }) => { return ( - {items.every((item) => item === null) - ? "未选择" - : items.map((item) => item?.label ?? "未选择").join("")} + + {items.every((item) => item === null) + ? "未选择" + : items.map((item) => item?.label ?? "未选择").join("")} + -
-
-
-
-

- 所在地 - * -

- { - setFormData((old) => ({ ...old, province: v })); - }} - > + + 所在地} + layout="horizontal" + rules={[ + { + required: true, + message: messageEle("请选择所在地"), + }, + ]} + > + {(items, { open }) => { return ( - {items.every((item) => item === null) - ? "未选择" - : items.map((item) => item?.label ?? "未选择").join("")} + + {items.every((item) => item === null) + ? "未选择" + : items.map((item) => item?.label ?? "未选择").join("")} + -
-
-
-
-

- 添加标签 - * -

-
-
-
+ + 添加标签} + layout="vertical" + rules={[ + { + required: true, + message: messageEle("请添加标签"), + }, + ]} + > { - if (arr.length >= 4) { - Toast.show({ - content: "最多只能选择3个标签", - position: "top", - }); - return; - } - setFormData((old) => ({ ...old, tags: arr })); - }} + // onChange={(arr, extend) => { + // if (arr.length >= 4) { + // Toast.show({ + // content: "最多只能选择3个标签", + // position: "top", + // }); + // return; + // } + // setFormData((old) => ({ ...old, tags: arr })); + // }} showCheckMark={false} - value={formData.tags} style={{ "--border-radius": "100px", "--border": "solid #ffffff80 1px", @@ -889,23 +881,21 @@ export default function CompleteStreamerInformation() { "--checked-color": "none", }} /> -
-
-
-
-

- 添加微信方式 - * -

-
-
- - - setFormData((old) => ({ ...old, wechatAddWay: value })) - } - > + + 添加微信方式} + layout="vertical" + // trigger="onConfirm" + rules={[ + { + required: true, + message: messageEle("请添加微信方式"), + }, + ]} + > +
    {superSingles.map((item) => ( @@ -914,245 +904,255 @@ export default function CompleteStreamerInformation() { ))}
- {formData.wechatAddWay == 0 && ( -
-
- - setFormData((old) => ({ ...old, wechat: value })) - } - /> -
-
- )} -
-
-
-
-

- 全网粉丝量(万) - * -

-
-
+ + + 微信帐号} + layout="vertical" + name="wechat" + rules={[ + { + required: true, + message: messageEle("请填写正确的微信"), + pattern: /^[a-zA-Z0-9_-]+$/, + }, + ]} + > + + + 全网粉丝量(万)} + rules={[ + { + required: true, + message: messageEle( + "请输入有效的全网粉丝量(大于等于1的整数)" + ), + // pattern: /^[1-9]+(\.[0-9]{1,2})?$/, + pattern: /^[1-9]\d*$/, + }, + ]} + > { - setFormData((old) => ({ ...old, fans: value })); - }} + inputClassName="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center" /> -
-
-
-
-

- 加微信价格(元) - * -

-

-
-
-
- ¥ - - setFormData((old) => ({ ...old, wechatPrice: value })) - } - /> + + 加微信价格(元)} + rules={[ + { + required: true, + message: messageEle("请输入有效的微信价格(大于等于1的整数)"), + pattern: /^[1-9]\d*$/, + }, + ]} + > +
+
+ ¥ + + + +
+
- -
-
+ -
-
-

- 个性签名 - * -

-

-
-
+