From 75967e4fb19bf5be72fc56ca65e046f506e1997f Mon Sep 17 00:00:00 2001 From: eleliauk <2831336720@qq.com> Date: Tue, 10 Dec 2024 22:55:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(bug):=20=E4=BF=AE=E5=A4=8Dbugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/guide/components/Selector.tsx | 3 ++- src/modules/notification/components/Items.tsx | 2 +- .../notification/components/Notification.tsx | 2 -- src/pages/classInfo/index.tsx | 6 ++++++ src/pages/editUser/index.tsx | 1 - src/pages/evaluate/evaluate.tsx | 13 +++++++++---- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/modules/guide/components/Selector.tsx b/src/modules/guide/components/Selector.tsx index 69ecc57..48c5fcf 100644 --- a/src/modules/guide/components/Selector.tsx +++ b/src/modules/guide/components/Selector.tsx @@ -74,12 +74,13 @@ const Selector: React.FC = memo( {children} - { setSelection({ year: value[0], term: value[1] }); diff --git a/src/modules/notification/components/Items.tsx b/src/modules/notification/components/Items.tsx index 5a49486..5a83f98 100644 --- a/src/modules/notification/components/Items.tsx +++ b/src/modules/notification/components/Items.tsx @@ -50,7 +50,7 @@ export const OfficialItem = memo( return ( <> - + {/* 07:25 diff --git a/src/modules/notification/components/Notification.tsx b/src/modules/notification/components/Notification.tsx index ba122e0..a0a96e4 100644 --- a/src/modules/notification/components/Notification.tsx +++ b/src/modules/notification/components/Notification.tsx @@ -96,10 +96,8 @@ const Notification: React.FC = memo(() => { } else { console.log('官方'); } - Taro.hideLoading(); setLoading(false); - // console.log('最终 ' + JSON.stringify(message)); } catch (error) { // eslint-disable-next-line no-console console.error('Error fetching data:', error); diff --git a/src/pages/classInfo/index.tsx b/src/pages/classInfo/index.tsx index d1021bd..cd42cd8 100644 --- a/src/pages/classInfo/index.tsx +++ b/src/pages/classInfo/index.tsx @@ -154,6 +154,7 @@ export default function Index() { 综合评分: (共{course.rater_count}人评价) + {/* 收藏该课程 */} 课程分类: @@ -164,6 +165,11 @@ export default function Index() { ))} + {/* + + */} { const [avatarUrl, setAvatarUrl] = useState(''); - // const [editing, setEditing] = useState(false); const [nickName, setNickName] = useState('请修改昵称'); const [isEditingNickname, setIsEditingNickname] = useState(false); const [editableNickName, setEditableNickName] = useState(nickName); diff --git a/src/pages/evaluate/evaluate.tsx b/src/pages/evaluate/evaluate.tsx index 9ff01cf..53deb0a 100644 --- a/src/pages/evaluate/evaluate.tsx +++ b/src/pages/evaluate/evaluate.tsx @@ -103,6 +103,13 @@ export default function evaluate() { }, []); // 这个 effect 仅在组件挂载时运行一次 const postEvaluation = () => { + if (selectedStarIndex === -1) { + void Taro.showToast({ + title: '请为课程选择星级', + icon: 'none', + }); + return; + } const evaluationobj = { star_rating: selectedStarIndex, content: comment, @@ -153,9 +160,7 @@ export default function evaluate() { } }; - return accoutInfo.miniProgram.envVersion === 'develop' ? ( - <>因为政策原因,暂时无法评价课程 - ) : ( + return (
选择课程 : @@ -172,7 +177,7 @@ export default function evaluate() { handleRadioChange(item.value)}