diff --git a/app/my/streamerVerification/completeStreamerInformation/page.jsx b/app/my/streamerVerification/completeStreamerInformation/page.jsx index e9bbc91..16b0261 100644 --- a/app/my/streamerVerification/completeStreamerInformation/page.jsx +++ b/app/my/streamerVerification/completeStreamerInformation/page.jsx @@ -498,6 +498,7 @@ export default function CompleteStreamerInformation() { const url = URL.createObjectURL(file); videoD.src = url; videoD.addEventListener("loadeddata", function () { + videoD.pause(); videoD.currentTime = 1; }); videoD.addEventListener("seeked", function () { diff --git a/app/space/createImagePost/page.jsx b/app/space/createImagePost/page.jsx index a4b0c49..3d58d67 100644 --- a/app/space/createImagePost/page.jsx +++ b/app/space/createImagePost/page.jsx @@ -56,6 +56,44 @@ export default function CreateImagePost() { console.error(error); } }; + //保存付费设置 + const handleSavePaymentSetting = ({ price, imageVisibleRange }) => { + const intPrice = parseFloat(price); + if (intPrice < 0) { + Toast.show({ + icon: "fail", + content: "请输入正确区间的价格", + position: "top", + }); + return; + } + if (intPrice > 0 && intPrice * 100 < 100) { + Toast.show({ + icon: "fail", + content: "请输入正确区间的价格", + position: "top", + }); + return; + } + if (intPrice * 100 > 300000) { + Toast.show({ + icon: "fail", + content: "请输入正确区间的价格", + position: "top", + }); + return; + } + if (imageVisibleRange < 0 || imageVisibleRange > 3) { + Toast.show({ + icon: "fail", + content: "请输入正确区间的可预览图片张数", + position: "top", + }); + return; + } + setPriceEdit(false); + setFormData((old) => ({ ...old, ...priceEditData })); + }; //发布内容 const handleSubmit = async () => { if (formData.content == "") { @@ -387,8 +425,7 @@ export default function CreateImagePost() {

{ - setPriceEdit(false); - setFormData((old) => ({ ...old, ...priceEditData })); + handleSavePaymentSetting(priceEditData); }} > 保存 diff --git a/app/space/createVideoPost/page.jsx b/app/space/createVideoPost/page.jsx index 9f19b27..04c96ef 100644 --- a/app/space/createVideoPost/page.jsx +++ b/app/space/createVideoPost/page.jsx @@ -55,6 +55,36 @@ export default function CreateVideoPost() { console.error(error); } }; + //保存付费设置 + const handleSavePaymentSetting = ({ price }) => { + const intPrice = parseFloat(price); + if (intPrice < 0) { + Toast.show({ + icon: "fail", + content: "请输入正确区间的价格", + position: "top", + }); + return; + } + if (intPrice > 0 && intPrice * 100 < 100) { + Toast.show({ + icon: "fail", + content: "请输入正确区间的价格", + position: "top", + }); + return; + } + if (intPrice * 100 > 300000) { + Toast.show({ + icon: "fail", + content: "请输入正确区间的价格", + position: "top", + }); + return; + } + setPriceEdit(false); + setFormData((old) => ({ ...old, ...priceEditData })); + }; //发布内容 const handleSubmit = async () => { if (formData.content == "") { @@ -350,8 +380,7 @@ export default function CreateVideoPost() {

{ - setPriceEdit(false); - setFormData((old) => ({ ...old, ...priceEditData })); + handleSavePaymentSetting(priceEditData); }} > 保存 diff --git a/app/space/setting/spaceIntroSetting/editStreamerMedia/page.jsx b/app/space/setting/spaceIntroSetting/editStreamerMedia/page.jsx index 357bacb..f62bf80 100644 --- a/app/space/setting/spaceIntroSetting/editStreamerMedia/page.jsx +++ b/app/space/setting/spaceIntroSetting/editStreamerMedia/page.jsx @@ -195,6 +195,7 @@ export default function EditStreamerMedia() { const url = URL.createObjectURL(file); videoD.src = url; videoD.addEventListener("loadeddata", function () { + videoD.pause(); videoD.currentTime = 1; }); videoD.addEventListener("seeked", function () { diff --git a/components/UploadImgs/index.js b/components/UploadImgs/index.js index dd6319b..17db08c 100644 --- a/components/UploadImgs/index.js +++ b/components/UploadImgs/index.js @@ -104,6 +104,7 @@ export default function UploadImgs({ const url = URL.createObjectURL(file); videoD.src = url; videoD.addEventListener("loadeddata", function () { + videoD.pause(); videoD.currentTime = 1; }); videoD.addEventListener("seeked", function () {